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
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <oh...@ma...> - 2008-12-28 22:40:47
|
Author: oharboe Date: 2008-12-28 22:40:39 +0100 (Sun, 28 Dec 2008) New Revision: 1293 Modified: trunk/src/flash/nand.c trunk/src/helper/jim.c trunk/src/jtag/usbprog.c trunk/src/target/target.c Log: Uwe Hermann <uw...@he...> One of them is fixing a few compiler warnings (see attached patch) and likely also one (non-cosmetic) bug (the 'id_buff' change, which seems to be a buffer overflow). Modified: trunk/src/flash/nand.c =================================================================== --- trunk/src/flash/nand.c 2008-12-28 10:58:34 UTC (rev 1292) +++ trunk/src/flash/nand.c 2008-12-28 21:40:39 UTC (rev 1293) @@ -375,7 +375,7 @@ int nand_probe(struct nand_device_s *device) { u8 manufacturer_id, device_id; - u8 id_buff[5]; + u8 id_buff[6]; int retval; int i; Modified: trunk/src/helper/jim.c =================================================================== --- trunk/src/helper/jim.c 2008-12-28 10:58:34 UTC (rev 1292) +++ trunk/src/helper/jim.c 2008-12-28 21:40:39 UTC (rev 1293) @@ -49,6 +49,7 @@ #define JIM_DYNLIB /* Dynamic library support for UNIX and WIN32 */ #endif /* JIM_ANSIC */ +#define _GNU_SOURCE /* for vasprintf() */ #include <stdio.h> #include <stdlib.h> #include <string.h> Modified: trunk/src/jtag/usbprog.c =================================================================== --- trunk/src/jtag/usbprog.c 2008-12-28 10:58:34 UTC (rev 1292) +++ trunk/src/jtag/usbprog.c 2008-12-28 21:40:39 UTC (rev 1293) @@ -93,7 +93,7 @@ struct usbprog_jtag * usbprog_jtag_handle; -struct usbprog_jtag* usbprog_jtag_open(); +struct usbprog_jtag* usbprog_jtag_open(void); void usbprog_jtag_close(struct usbprog_jtag *usbprog_jtag); void usbprog_jtag_init(struct usbprog_jtag *usbprog_jtag); unsigned char usbprog_jtag_message(struct usbprog_jtag *usbprog_jtag, char *msg, int msglen); @@ -405,7 +405,7 @@ struct usb_bus *busses; -struct usbprog_jtag* usbprog_jtag_open() +struct usbprog_jtag* usbprog_jtag_open(void) { struct usb_bus *bus; struct usb_device *dev; Modified: trunk/src/target/target.c =================================================================== --- trunk/src/target/target.c 2008-12-28 10:58:34 UTC (rev 1292) +++ trunk/src/target/target.c 2008-12-28 21:40:39 UTC (rev 1293) @@ -4014,7 +4014,7 @@ static int fastload_num; static struct FastLoad *fastload; -static void free_fastload() +static void free_fastload(void) { if (fastload!=NULL) { |
From: ntfreak at B. <nt...@ma...> - 2008-12-28 11:58:35
|
Author: ntfreak Date: 2008-12-28 11:58:34 +0100 (Sun, 28 Dec 2008) New Revision: 1292 Modified: trunk/src/jtag/vsllink.c trunk/testing/build.test1/Makefile trunk/testing/build.test1/Makefile.confuse trunk/testing/build.test1/Makefile.ftd2xx trunk/testing/build.test1/Makefile.libftdi trunk/testing/build.test1/Makefile.libusb trunk/testing/build.test1/Makefile.openocd trunk/testing/build.test1/README.TXT trunk/testing/build.test1/local.uses trunk/testing/build.test1/mingw32_help/include/elf.h trunk/testing/build.test1/mingw32_help/include/sys/cdefs.h trunk/testing/build.test1/mingw32_help/include/sys/elf32.h trunk/testing/build.test1/mingw32_help/include/sys/elf64.h trunk/testing/build.test1/mingw32_help/include/sys/elf_common.h trunk/testing/build.test1/mingw32_help/include/sys/elf_generic.h trunk/testing/build.test2/Makefile trunk/testing/build.test2/README.txt trunk/testing/build.test2/local.uses Log: - fix missing/incorrect svn file props Property changes on: trunk/src/jtag/vsllink.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/testing/build.test1/Makefile ___________________________________________________________________ Name: svn:executable - * Name: svn:eol-style + native Property changes on: trunk/testing/build.test1/Makefile.confuse ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/testing/build.test1/Makefile.ftd2xx ___________________________________________________________________ Name: svn:executable - * Name: svn:eol-style + native Property changes on: trunk/testing/build.test1/Makefile.libftdi ___________________________________________________________________ Name: svn:executable - * Name: svn:eol-style + native Property changes on: trunk/testing/build.test1/Makefile.libusb ___________________________________________________________________ Name: svn:executable - * Name: svn:eol-style + native Property changes on: trunk/testing/build.test1/Makefile.openocd ___________________________________________________________________ Name: svn:executable - * Name: svn:eol-style + native Modified: trunk/testing/build.test1/README.TXT =================================================================== --- trunk/testing/build.test1/README.TXT 2008-12-28 01:08:56 UTC (rev 1291) +++ trunk/testing/build.test1/README.TXT 2008-12-28 10:58:34 UTC (rev 1292) @@ -1,39 +1,39 @@ --- Duane Ellis'es test case for building numerous openocd configurations... -Dec 26,2008 ---------------------------------------------------------------------------- - -1) Make a directory some where.. - - mkdir ~/test - -2) Change to that directory - - cd ~/test - -3) Checkout OpenOCD in that directory. - - cd ~/test - svn co https://svn.berlios.de/svnroot/repos/openocd/trunk openocd - -4) Copy the "build.test1" directory to the "~/work" directory. - - - cd ~/test - cp ~/openocd/testing/build.test1/. ~/test/. - -5) If needed, download various components. - - cd ~/work - make all.download - - -6) For Linux - type: - - cd ~/work - make linux.buildtest - -7) For Cygwin - type: - - cd ~/work - make cygwin.buildtest - +-- Duane Ellis'es test case for building numerous openocd configurations... +Dec 26,2008 +--------------------------------------------------------------------------- + +1) Make a directory some where.. + + mkdir ~/test + +2) Change to that directory + + cd ~/test + +3) Checkout OpenOCD in that directory. + + cd ~/test + svn co https://svn.berlios.de/svnroot/repos/openocd/trunk openocd + +4) Copy the "build.test1" directory to the "~/work" directory. + + + cd ~/test + cp ~/openocd/testing/build.test1/. ~/test/. + +5) If needed, download various components. + + cd ~/work + make all.download + + +6) For Linux - type: + + cd ~/work + make linux.buildtest + +7) For Cygwin - type: + + cd ~/work + make cygwin.buildtest + Property changes on: trunk/testing/build.test1/README.TXT ___________________________________________________________________ Name: svn:executable - * Name: svn:eol-style + native Property changes on: trunk/testing/build.test1/local.uses ___________________________________________________________________ Name: svn:executable - * Name: svn:eol-style + native Property changes on: trunk/testing/build.test1/mingw32_help/include/elf.h ___________________________________________________________________ Name: svn:executable - * Name: svn:eol-style + native Property changes on: trunk/testing/build.test1/mingw32_help/include/sys/cdefs.h ___________________________________________________________________ Name: svn:executable - * Name: svn:eol-style + native Property changes on: trunk/testing/build.test1/mingw32_help/include/sys/elf32.h ___________________________________________________________________ Name: svn:executable - * Name: svn:eol-style + native Property changes on: trunk/testing/build.test1/mingw32_help/include/sys/elf64.h ___________________________________________________________________ Name: svn:executable - * Name: svn:eol-style + native Property changes on: trunk/testing/build.test1/mingw32_help/include/sys/elf_common.h ___________________________________________________________________ Name: svn:executable - * Name: svn:eol-style + native Property changes on: trunk/testing/build.test1/mingw32_help/include/sys/elf_generic.h ___________________________________________________________________ Name: svn:executable - * Name: svn:eol-style + native Property changes on: trunk/testing/build.test2/Makefile ___________________________________________________________________ Name: svn:executable - * Name: svn:eol-style + native Modified: trunk/testing/build.test2/README.txt =================================================================== --- trunk/testing/build.test2/README.txt 2008-12-28 01:08:56 UTC (rev 1291) +++ trunk/testing/build.test2/README.txt 2008-12-28 10:58:34 UTC (rev 1292) @@ -1,59 +1,59 @@ - -This makefile is how I Duane Ellis (op...@du...) builds -openocd test purposes on Cygwin. I have included it here so others -might also make use of the same configuration that I use to develop -Openocd. - ---Duane Ellis - -To make use of it do the following: - -(1) Check out openocd in the standard way. - -For example - in cygwin, type this: - - bash$ mkdir -p /home/duane/test - bash$ cd /home/duane/test - bash$ svn co https://svn.berlios.de/svnroot/repos/openocd/trunk openocd - -(2) COPY this folder "right above" where you have OpenOCD. - - bash$ cd /home/duane/test - bash$ cp ./openocd/testing/build.test2/* /home/duane/test/. - -(3) OPTIONALLY - - You might want to review the file "local.uses" - Change options and so forth at the top of the file. - -(4) Initially, you need to download some additional files. - These include "libftdi", "libconfuse", and the ftd2xx drivers. - -(5) You also need to build the supporting libraries and install them - (They are installed "locally" only) - - Type this command: - - bash$ cd /home/duane/test - - bash$ make initial.build - - which: (1) downloads files - (2) builds the libs - (3) builds OpenOCD - -(6) As you hack upon OpenOCD... to rebuild OpenOCD... - - bash$ cd /home/duane/test - - bash$ make remake - - which: (1) re-bootstraps - (2) re-configures - (3) re-builds - (4) re-installs. - -======= -**END** -======= - + +This makefile is how I Duane Ellis (op...@du...) builds +openocd test purposes on Cygwin. I have included it here so others +might also make use of the same configuration that I use to develop +Openocd. + +--Duane Ellis + +To make use of it do the following: + +(1) Check out openocd in the standard way. + +For example - in cygwin, type this: + + bash$ mkdir -p /home/duane/test + bash$ cd /home/duane/test + bash$ svn co https://svn.berlios.de/svnroot/repos/openocd/trunk openocd + +(2) COPY this folder "right above" where you have OpenOCD. + + bash$ cd /home/duane/test + bash$ cp ./openocd/testing/build.test2/* /home/duane/test/. + +(3) OPTIONALLY + + You might want to review the file "local.uses" + Change options and so forth at the top of the file. + +(4) Initially, you need to download some additional files. + These include "libftdi", "libconfuse", and the ftd2xx drivers. + +(5) You also need to build the supporting libraries and install them + (They are installed "locally" only) + + Type this command: + + bash$ cd /home/duane/test + + bash$ make initial.build + + which: (1) downloads files + (2) builds the libs + (3) builds OpenOCD + +(6) As you hack upon OpenOCD... to rebuild OpenOCD... + + bash$ cd /home/duane/test + + bash$ make remake + + which: (1) re-bootstraps + (2) re-configures + (3) re-builds + (4) re-installs. + +======= +**END** +======= + Property changes on: trunk/testing/build.test2/README.txt ___________________________________________________________________ Name: svn:executable - * Name: svn:eol-style + native Property changes on: trunk/testing/build.test2/local.uses ___________________________________________________________________ Name: svn:executable - * Name: svn:eol-style + native |
From: <du...@ma...> - 2008-12-28 02:08:59
|
Author: duane Date: 2008-12-28 02:08:56 +0100 (Sun, 28 Dec 2008) New Revision: 1291 Modified: trunk/src/jtag/vsllink.c Log: Updates from SimonQian Modified: trunk/src/jtag/vsllink.c =================================================================== --- trunk/src/jtag/vsllink.c 2008-12-27 23:23:06 UTC (rev 1290) +++ trunk/src/jtag/vsllink.c 2008-12-28 01:08:56 UTC (rev 1291) @@ -694,8 +694,8 @@ void vsllink_runtest(int num_cycles) { - int i, j; - int tms_len, first_tms = 0, tms_cmd_pos; + int i = 0, j; + int tms_len, first_tms = 0, tms_cmd_pos = 0; enum tap_state saved_end_state = end_state; if (cur_state != TAP_IDLE) @@ -971,7 +971,7 @@ result = vsllink_usb_write(vsllink_jtag_handle, 3); if (result != 3) { - LOG_ERROR("VSLLink command VSLLINK_CMD_SET_PORT failed (%d)", result); + LOG_ERROR("VSLLink command VSLLINK_CMD_SET_PORT failed (%d)", result); } } @@ -1054,8 +1054,7 @@ static int pending_scan_results_length; static pending_scan_result_t pending_scan_results_buffer[MAX_PENDING_SCAN_RESULTS]; - -void vsllink_tap_init() +void vsllink_tap_init(void) { vsllink_usb_out_buffer_idx = 0; vsllink_usb_in_want_length = 0; @@ -1103,7 +1102,7 @@ /* Pad and send a tap sequence to the device, and receive the answer. * For the purpose of padding we assume that we are in idle or pause state. */ -int vsllink_tap_execute() +int vsllink_tap_execute(void) { int i; int result; @@ -1185,7 +1184,7 @@ /*****************************************************************************/ /* VSLLink USB low-level functions */ -vsllink_jtag_t* vsllink_usb_open() +vsllink_jtag_t* vsllink_usb_open(void) { struct usb_bus *busses; struct usb_bus *bus; |
From: <du...@ma...> - 2008-12-28 00:23:09
|
Author: duane Date: 2008-12-28 00:23:06 +0100 (Sun, 28 Dec 2008) New Revision: 1290 Added: trunk/testing/build.test2/ trunk/testing/build.test2/Makefile trunk/testing/build.test2/README.txt trunk/testing/build.test2/local.uses Log: Added another test build configuration Added: trunk/testing/build.test2/Makefile =================================================================== --- trunk/testing/build.test2/Makefile 2008-12-27 22:43:56 UTC (rev 1289) +++ trunk/testing/build.test2/Makefile 2008-12-27 23:23:06 UTC (rev 1290) @@ -0,0 +1,193 @@ +# -*- mode: makefile -*- +#======================================== +# DO NOT DELETE THE LINE BELOW +_default: default +# DO NOT DELETE THE LINE_ABOVE +#======================================== + +#======================================== +# +# There are no user configurable options here. +# +# All user configurable options are in local.uses +# +include ./local.uses +# +#======================================== + +#======================================== +# This is the USB driver for the FTDI2XX chips. +# It is a "closed" solution from FTDICHIP.COM +# Some claim it is faster then the open/free +# solution: win32-libusb+libftdi. +# +ftd2xx.download: + mkdir -p ${VIRGINS} + wget -O ${FTD2XX_ZIPFILE_LOCAL} \ + ${FTD2XX_ZIPFILE_URL} + +ftd2xx.unpack: + rm -rf ${FTD2XX_WIN32_DIR} + mkdir -p ${FTD2XX_WIN32_DIR} + cd ${FTD2XX_WIN32_DIR} && unzip \ + ${FTD2XX_ZIPFILE_LOCAL} + +ftd2xx.build: + @echo "Nothing to do for: $@" + +ftd2xx.configure: + @echo "Nothing to do for: $@" + +ftd2xx.install: + @echo "Nothing to do for: $@" + +clean:: + rm -rf ${FTD2XX_WIN32_DIR} + +ftd2xx.all: ftd2xx.unpack ftd2xx.configure \ + ftd2xx.build ftd2xx.install + + +#========================================- +# LIBFTDI - requires LIBCONFUSE.. +# So we handle it here :-( + +libconfuse.download: + mkdir -p virgins + wget -O ${LIBCONFUSE_TARFILE_LOCAL} \ + ${LIBCONFUSE_TARFILE_URL} + +libconfuse.unpack: + tar xfz ${LIBCONFUSE_TARFILE_LOCAL} + +clean:: + rm -rf ${LIBCONFUSE_SRC_DIR} + +libconfuse.configure: + rm -rf ${LIBCONFUSE_BUILD_DIR} + mkdir -p ${LIBCONFUSE_BUILD_DIR} + cd ${LIBCONFUSE_BUILD_DIR} && \ + ${LIBCONFUSE_SRC_DIR}/configure \ + --prefix=${PREFIX} + +clean:: + rm -rf ${LIBCONFUSE_BUILD_DIR} + +libconfuse.build: + cd ${LIBCONFUSE_BUILD_DIR} && ${MAKE} + +libconfuse.install: + cd ${LIBCONFUSE_BUILD_DIR} && ${MAKE} install + +libconfuse.all: libconfuse.unpack libconfuse.configure \ + libconfuse.build libconfuse.install + +#======================================== +# LIBFTDI - the open source (and free) +# alternative to (closed) FTD2XX drivers. + +libftdi.download: + mkdir -p virgins + wget -O ${LIBFTDI_TARFILE_LOCAL} \ + ${LIBFTDI_TARFILE_URL} + +libftdi.unpack: + tar xfz ${LIBFTDI_TARFILE_LOCAL} + +clean:: + rm -rf ${LIBFTDI_SRC_DIR} + +libftdi.configure: + rm -rf ${LIBFTDI_BUILD_DIR} + mkdir -p ${LIBFTDI_BUILD_DIR} + cd ${LIBFTDI_BUILD_DIR} && \ + ${LIBFTDI_SRC_DIR}/configure \ + --prefix=${PREFIX} + +clean:: + rm -rf ${LIBFTDI_BUILD_DIR} + +libftdi.build: + cd ${LIBFTDI_BUILD_DIR} && ${MAKE} + +libftdi.install: + cd ${LIBFTDI_BUILD_DIR} && ${MAKE} install + +libftdi.all: libftdi.unpack libftdi.configure \ + libftdi.build libftdi.install + +#======================================== +# Openocd... + +openocd.bootstrap: + cd ${OPENOCD_SRC_DIR} && bash ./bootstrap + +openocd.configure: + rm -rf ${OPENOCD_BUILD_DIR} + mkdir -p ${OPENOCD_BUILD_DIR} + cd ${OPENOCD_BUILD_DIR} && ${OPENOCD_SRC_DIR}/configure \ + --prefix=${INSTALL_DIR} \ + ${OPENOCD_CONFIG_OPTIONS} + +openocd.build: + cd ${OPENOCD_BUILD_DIR} && ${MAKE} + +openocd.docs: + cd ${OPENOCD_BUILD_DIR}/docs && ${MAKE} + +openocd.docs.pdf: + cd ${OPENOCD_BUILD_DIR}/docs && ${MAKE} pdf + +openocd.docs.html: + cd ${OPENOCD_BUILD_DIR}/docs && ${MAKE} html + +# fixme: +# need to add a "make one huge html file target" + +openocd.install: + cd ${OPENOCD_BUILD_DIR} && ${MAKE} install + +#======================================== +# The world... + +# Manual step. +download.all: \ + ftd2xx.download \ + libconfuse.download \ + libftdi.download + +ifeq (x"${FT2232_DRIVER}",x"ftd2xx") +prebuild: ftd2xx.all +endif + +ifeq (x"${FT2232_DRIVER}",x"libftdi") +prebuild: libconfuse.all libftdi.all +endif + +remake: \ + openocd.bootstrap \ + openocd.configure \ + openocd.build \ + openocd.install + +initial.build : download.all prebuild remake + +all: + @echo "" + @echo " This makefile does not support an 'all' target" + @echo "" + @echo " If this is your *FIRST* time building... " + @echo " Then use this command: \"make initial.build\"" + @echo "" + @echo " The \"default\" target is for openocd developers" + @echo " and rebuilds openocd completely.." + @echo "" + +default: + test -d ${OPENOCD_SRC_DIR} || (echo "Where is: The OPENOCD source?"; exit 1) + ${MAKE} remake + +whatis_%: + @echo "" + @echo "Makevariable: $* => ${${*}}" + @echo "" Property changes on: trunk/testing/build.test2/Makefile ___________________________________________________________________ Name: svn:executable + * Added: trunk/testing/build.test2/README.txt =================================================================== --- trunk/testing/build.test2/README.txt 2008-12-27 22:43:56 UTC (rev 1289) +++ trunk/testing/build.test2/README.txt 2008-12-27 23:23:06 UTC (rev 1290) @@ -0,0 +1,59 @@ + +This makefile is how I Duane Ellis (op...@du...) builds +openocd test purposes on Cygwin. I have included it here so others +might also make use of the same configuration that I use to develop +Openocd. + +--Duane Ellis + +To make use of it do the following: + +(1) Check out openocd in the standard way. + +For example - in cygwin, type this: + + bash$ mkdir -p /home/duane/test + bash$ cd /home/duane/test + bash$ svn co https://svn.berlios.de/svnroot/repos/openocd/trunk openocd + +(2) COPY this folder "right above" where you have OpenOCD. + + bash$ cd /home/duane/test + bash$ cp ./openocd/testing/build.test2/* /home/duane/test/. + +(3) OPTIONALLY + + You might want to review the file "local.uses" + Change options and so forth at the top of the file. + +(4) Initially, you need to download some additional files. + These include "libftdi", "libconfuse", and the ftd2xx drivers. + +(5) You also need to build the supporting libraries and install them + (They are installed "locally" only) + + Type this command: + + bash$ cd /home/duane/test + + bash$ make initial.build + + which: (1) downloads files + (2) builds the libs + (3) builds OpenOCD + +(6) As you hack upon OpenOCD... to rebuild OpenOCD... + + bash$ cd /home/duane/test + + bash$ make remake + + which: (1) re-bootstraps + (2) re-configures + (3) re-builds + (4) re-installs. + +======= +**END** +======= + Property changes on: trunk/testing/build.test2/README.txt ___________________________________________________________________ Name: svn:executable + * Added: trunk/testing/build.test2/local.uses =================================================================== --- trunk/testing/build.test2/local.uses 2008-12-27 22:43:56 UTC (rev 1289) +++ trunk/testing/build.test2/local.uses 2008-12-27 23:23:06 UTC (rev 1290) @@ -0,0 +1,161 @@ +# -*- mode: makefile -*- +#======================================== +# DO NOT REMOVE THE LINE BELOW +HERE := $(shell pwd) +# DO NOT REMOVE THE LINE ABOVE +#======================================== + +# These are common CYGWIN build settings. +# Comment out things you do not want. +# Or unComment things you want. + +# PCs always have printer ports... +X86_PRINTER_PORT ?= y + +# Chose *ONE* of these three solutions. +#FTD2232_DRIVER = none +FT2232_DRIVER = ftd2xx +#FT2232_DRIVER = libftdi + +# Do you have "libusb" installed? +ifeq (x"${FT2232_DRIVER}",x"libftdi") +# With LIBFTDI... LIBUSB is manditory. +USE_LIBUSB = y +endif + +# By default... we assume libusb not present. +USE_LIBUSB ?= n + +#======================================== +# DO NOT EDIT SETTINGS BELOW THIS LINE +#======================================== + + + +#======================================== +# House keeping... + +# Solve problems on systems with DASH.. Grrr... +SHELL=/bin/bash +export SHELL + +VIRGINS ?= ${HERE}/virgins +INSTALL_DIR ?= $(HERE)/install +PREFIX ?= ${INSTALL_DIR} + +# Determine the build platform. +BUILD_SYSNAME_Linux =linux +BUILD_SYSNAME_linux =linux +BUILD_SYSNAME_CYGWIN_NT =cygwin +BUILD_SYSNAME_MINGW32_NT =mingw32 +BUILD_SYSNAME_Darwin =darwin +BUILD_SYSNAME_darwin =darwin +BUILD_SYSNAME :=$(BUILD_SYSNAME_$(shell uname --sysname | cut -d'-' -f1)) + +# And machine (ie: i686, x86_64, or what ever) +BUILD_MACHINE :=$(BUILD_SYSNAME).$(shell uname -m) + + +#======================================== +# + +FTD2XX_LINUX_VERSION=0.4.16 +FTD2XX_LINUX_DIR = ${HERE}/libftd2xx${FTD2XX_LINUX_VERSION} +FTD2XX_LINUX_64_DIR = ${HERE}/libftd2xx${FTD2XX_LINUX_VERSION}_x86_64 + + +# Wiggler type interfaces are here. +OPENOCD_CONFIG_OPTIONS_printer_y += --enable-parport +OPENOCD_CONFIG_OPTIONS_printer_y += --enable-parport-giveio +OPENOCD_CONFIG_OPTIONS_printer_y += --enable-gw16012 +OPENOCD_CONFIG_OPTIONS_printer_y += --enable-parport-giveio +OPENOCD_CONFIG_OPTIONS_printer_y += --enable-amtjtagaccel + + +# FTD2XX only supports these +OPENOCD_CONFIG_OPTIONS_ft2232_none = +OPENOCD_CONFIG_OPTIONS_ft2232_ftd2xx = --enable-ft2232_ftd2xx --enable-presto_ftd2xx --with-ftd2xx-win32-zipdir=${FTD2XX_WIN32_DIR} +OPENOCD_CONFIG_OPTIONS_ft2232_libftdi = --enable-ft2232_libftdi --enable-presto_libftdi + +# LIBUSB - adds support for these. +OPENOCD_CONFIG_OPTIONS_libusb_y += --enable-jlink +OPENOCD_CONFIG_OPTIONS_libusb_y += --enable-usbprog +OPENOCD_CONFIG_OPTIONS_libusb_y += --enable-rlink +OPENOCD_CONFIG_OPTIONS_libusb_y += --enable-vsllink +OPENOCD_CONFIG_OPTIONS_libusb_y += --enable-usbprog + +#======================================== +# EXPLICITY NOT SUPPORTED INTERFACES +# +# zy1000.c +# This is a standalone hardware box +# it is *NOT* a cygwin thing. +# +# at91rm9200.c +# This is a uC/Linux (or linux) that +# runs uC/Linux and uses the gpio pins +# to bit-bang JTAG stuff. +# +# ep93xx.c +# Just like at91rm9200 - different chip. + +#======================================== +# Build OPENOCD config options... +# Always enable "dummy" +OPENOCD_CONFIG_OPTIONS += --enable-dummy +# +# Today: Cannot enable 'oocd_trace' on cygwin. +# it assumes/uses termios functions like +# cfmakeraw() which do not exist on cygwin. +# +#OPENOCD_CONFIG_OPTIONS += --enable-oocd-trace +# +# Add printer options.. +OPENOCD_CONFIG_OPTIONS += ${OPENOCD_CONFIG_OPTIONS_printer_${X86_PRINTER_PORT}} + +# Add the FTD2232 based options. +OPENOCD_CONFIG_OPTIONS += ${OPENOCD_CONFIG_OPTIONS_ft2232_${FT2232_DRIVER}} + +# Add LIBUSB based options. +OPENOCD_CONFIG_OPTIONS += ${OPENOCD_CONFIG_OPTIONS_libusb_${USE_LIBUSB}} + + +#======================================== +# WARNING... the file on the ftdi chip site has a SPACE in the filename GRRR!!! +# We fix that with the "-O" option to wget. +FTD2XX_WIN32_VERSION=2.04.14 +FTD2XX_WIN32_DIR = ${HERE}/ftd2xx.win32 + +FTD2XX_ZIPFILE_LOCAL=${VIRGINS}/cdm.${FTD2XX_WIN32_VERSION}.zip +# Damn thing has a space in the F-ing filename! +FTD2XX_ZIPFILE_URL ="http://www.ftdichip.com/Drivers/CDM/CDM ${FTD2XX_WIN32_VERSION}.zip" + + +#======================================== +# LIBCONFUSE - used by LIBFTDI.. +LIBCONFUSE_VERSION=2.5 +LIBCONFUSE_TARFILE_LOCAL=${VIRGINS}/confuse-${LIBCONFUSE_VERSION}.tar.gz +LIBCONFUSE_TARFILE_URL =http://www.intra2net.com/de/produkte/opensource/ftdi/TGZ/confuse-${LIBCONFUSE_VERSION}.tar.gz + +LIBCONFUSE_SRC_DIR =${HERE}/confuse-${LIBCONFUSE_VERSION} +LIBCONFUSE_BUILD_DIR =${HERE}/confuse-build + + +#======================================== +# LIBFTDI... (which uses libusb, and libconfuse) +LIBFTDI_VERSION=0.14 +LIBFTDI_TARFILE_LOCAL = ${VIRGINS}/libftdi-${LIBFTDI_VERSION}.tar.gz +LIBFTDI_TARFILE_URL = http://www.intra2net.com/de/produkte/opensource/ftdi/TGZ/libftdi-${LIBFTDI_VERSION}.tar.gz + +LIBFTDI_SRC_DIR = ${HERE}/libftdi-${LIBFTDI_VERSION} +LIBFTDI_BUILD_DIR= ${HERE}/libftdi-build + +#======================================== +# Finally - OpenOCD... +# +OPENOCD_BUILD_DIR =${HERE}/openocd-build +OPENOCD_SRC_DIR =${HERE}/openocd + +#======================================== +# END .. +#======================================== Property changes on: trunk/testing/build.test2/local.uses ___________________________________________________________________ Name: svn:executable + * |
From: <du...@ma...> - 2008-12-27 23:43:58
|
Author: duane Date: 2008-12-27 23:43:56 +0100 (Sat, 27 Dec 2008) New Revision: 1289 Modified: trunk/src/jtag/vsllink.c Log: Warnings cleanup ... finish up earlier commit Modified: trunk/src/jtag/vsllink.c =================================================================== --- trunk/src/jtag/vsllink.c 2008-12-27 22:40:51 UTC (rev 1288) +++ trunk/src/jtag/vsllink.c 2008-12-27 22:43:56 UTC (rev 1289) @@ -200,8 +200,8 @@ void vsllink_simple_command(u8 command); /* VSLLink tap buffer functions */ -void vsllink_tap_init(); -int vsllink_tap_execute(); +void vsllink_tap_init(void); +int vsllink_tap_execute(void); void vsllink_tap_ensure_space(int scans, int bytes); void vsllink_tap_append_scan(int length, u8 *buffer, scan_command_t *command, int offset); @@ -971,7 +971,7 @@ result = vsllink_usb_write(vsllink_jtag_handle, 3); if (result != 3) { - LOG_ERROR("VSLLink command VSLLINK_CMD_SET_PORT failed (%d)"); + LOG_ERROR("VSLLink command VSLLINK_CMD_SET_PORT failed (%d)", result); } } @@ -1054,7 +1054,6 @@ static int pending_scan_results_length; static pending_scan_result_t pending_scan_results_buffer[MAX_PENDING_SCAN_RESULTS]; -static int last_tms; void vsllink_tap_init() { @@ -1106,7 +1105,7 @@ * For the purpose of padding we assume that we are in idle or pause state. */ int vsllink_tap_execute() { - int i, j; + int i; int result; int first = 0; @@ -1242,7 +1241,6 @@ int vsllink_usb_message(vsllink_jtag_t *vsllink_jtag, int out_length, int in_length) { int result; - int result2; result = vsllink_usb_write(vsllink_jtag, out_length); if (result == out_length) |
From: <du...@ma...> - 2008-12-27 23:40:53
|
Author: duane Date: 2008-12-27 23:40:51 +0100 (Sat, 27 Dec 2008) New Revision: 1288 Added: trunk/src/jtag/vsllink.c Log: Missed the svn add on earlier commit, duh Added: trunk/src/jtag/vsllink.c =================================================================== --- trunk/src/jtag/vsllink.c 2008-12-27 22:35:35 UTC (rev 1287) +++ trunk/src/jtag/vsllink.c 2008-12-27 22:40:51 UTC (rev 1288) @@ -0,0 +1,1334 @@ +/*************************************************************************** + * Copyright (C) 2007 by Simon Qian <Sim...@Si...> * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +/* Versaloon is a programming tool for multiple MCUs. + * OpenOCD and MSP430 supports are distributed under GPLv2. + * You can find it at http://www.SimonQian.com/en/Versaloon. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "replacements.h" + +#include "jtag.h" + +#include <usb.h> +#include <string.h> + +#include "log.h" + +//#define _VSLLINK_IN_DEBUG_MODE_ + +/* enable this to view USB communication + */ +#if 0 +#define _DEBUG_USB_COMMS_ +#endif + +#ifdef _DEBUG_JTAG_IO_ +#define DEBUG_JTAG_IO(expr ...) LOG_DEBUG(expr) +#else +#define DEBUG_JTAG_IO(expr ...) +#endif + +#define VID 0x03EB +#define PID 0x2103 +#define VSLLINK_WRITE_ENDPOINT 0x02 +#define VSLLINK_READ_ENDPOINT 0x82 + +u16 vsllink_vid = VID; +u16 vsllink_pid = PID; +u8 vsllink_bulkout = VSLLINK_WRITE_ENDPOINT; +u8 vsllink_bulkin = VSLLINK_READ_ENDPOINT; + +#define VSLLINK_USB_TIMEOUT 1000 + +static int VSLLINK_BufferSize = 1024; + +/* Global USB buffers */ +static int vsllink_usb_out_buffer_idx; +static int vsllink_usb_in_want_length; +static u8* vsllink_usb_in_buffer = NULL; +static u8* vsllink_usb_out_buffer = NULL; + +/* Constants for VSLLink command */ +#define VSLLINK_CMD_CONN 0x80 +#define VSLLINK_CMD_DISCONN 0x81 +#define VSLLINK_CMD_SET_SPEED 0x82 +#define VSLLINK_CMD_SET_PORT 0x90 +#define VSLLINK_CMD_GET_PORT 0x91 +#define VSLLINK_CMD_SET_PORTDIR 0x92 +#define VSLLINK_CMD_HW_JTAGSEQCMD 0xA0 + +#define VSLLINK_CMDJTAGSEQ_TMSBYTE 0x00 +#define VSLLINK_CMDJTAGSEQ_SCAN 0x80 + +#define VSLLINK_CMDJTAGSEQ_CMDMSK 0xC0 +#define VSLLINK_CMDJTAGSEQ_LENMSK 0x3F + +#define JTAG_PINMSK_SRST (1 << 0) +#define JTAG_PINMSK_TRST (1 << 1) +#define JTAG_PINMSK_USR1 (1 << 2) +#define JTAG_PINMSK_USR2 (1 << 3) +#define JTAG_PINMSK_TCK (1 << 4) +#define JTAG_PINMSK_TMS (1 << 5) +#define JTAG_PINMSK_TDI (1 << 6) +#define JTAG_PINMSK_TDO (1 << 7) + + +#define VSLLINK_TAP_MOVE(from, to) VSLLINK_tap_move[tap_move_map[from]][tap_move_map[to]] + +/* VSLLINK_tap_move[i][j]: tap movement command to go from state i to state j + * 0: Test-Logic-Reset + * 1: Run-Test/Idle + * 2: Shift-DR + * 3: Pause-DR + * 4: Shift-IR + * 5: Pause-IR + * + * SD->SD and SI->SI have to be caught in interface specific code + */ +u8 VSLLINK_tap_move[6][6] = +{ +/* TLR RTI SD PD SI PI */ + {0xff, 0x00, 0x2f, 0x0a, 0x37, 0x16}, /* TLR */ + {0xff, 0x00, 0x45, 0x05, 0x4b, 0x0b}, /* RTI */ + {0xff, 0x61, 0x00, 0x01, 0x0f, 0x2f}, /* SD */ + {0xff, 0x60, 0x40, 0x17, 0x3c, 0x2f}, /* PD */ + {0xff, 0x61, 0x07, 0x17, 0x00, 0x01}, /* SI */ + {0xff, 0x60, 0x38, 0x17, 0x40, 0x2f} /* PI */ +}; + +u8 VSLLINK_TAP_MOVE_FROM_E1[6] = +{ +// TLR RTI SD PD SI PI + 0xff, 0x60, 0x38, 0x5c, 0x3c, 0x5E +}; + +u8 VSLLINK_TAP_MOVE_INSERT_INSIGNIFICANT[7][6][2] = +{ +/* stuff offset */ + {/* TLR */ + {1, 0,}, /* TLR */ + {1, 0,}, /* RTI */ + {1, 0,}, /* SD */ + {1, 0,}, /* PD */ + {1, 0,}, /* SI */ + {1, 0,}}, /* PI */ + {/* RTI */ + {1, 0,}, /* TLR */ + {0, 0,}, /* RTI */ + {0, 4,}, /* SD */ + {0, 7,}, /* PD */ + {0, 5,}, /* SI */ + {0, 7,}}, /* PI */ + {/* SD */ + {0, 0,}, /* TLR */ + {0, 0,}, /* RTI */ + {0, 0,}, /* SD */ + {0, 0,}, /* PD */ + {0, 0,}, /* SI */ + {0, 0,}}, /* PI */ + {/* PD */ + {0, 0,}, /* TLR */ + {0, 0,}, /* RTI */ + {0, 0,}, /* SD */ + {0, 0,}, /* PD */ + {0, 0,}, /* SI */ + {0, 0,}}, /* PI */ + {/* SI */ + {0, 0,}, /* TLR */ + {0, 0,}, /* RTI */ + {0, 0,}, /* SD */ + {0, 0,}, /* PD */ + {0, 0,}, /* SI */ + {0, 0,}}, /* PI */ + {/* PI */ + {0, 0,}, /* TLR */ + {0, 0,}, /* RTI */ + {0, 0,}, /* SD */ + {0, 0,}, /* PD */ + {0, 0,}, /* SI */ + {0, 0,}}, /* PI */ +}; + +u8 VSLLINK_BIT_MSK[8] = +{ + 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f +}; + +/* External interface functions */ +int vsllink_execute_queue(void); +int vsllink_speed(int speed); +int vsllink_khz(int khz, int *jtag_speed); +int vsllink_speed_div(int jtag_speed, int *khz); +int vsllink_register_commands(struct command_context_s *cmd_ctx); +int vsllink_init(void); +int vsllink_quit(void); + +/* CLI command handler functions */ +int vsllink_handle_usb_vid_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +int vsllink_handle_usb_pid_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +int vsllink_handle_usb_bulkin_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +int vsllink_handle_usb_bulkout_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); + +/* Queue command functions */ +void vsllink_end_state(enum tap_state state); +void vsllink_state_move(void); +void vsllink_path_move(int num_states, enum tap_state *path); +void vsllink_runtest(int num_cycles); +void vsllink_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size, scan_command_t *command); +void vsllink_reset(int trst, int srst); +void vsllink_simple_command(u8 command); + +/* VSLLink tap buffer functions */ +void vsllink_tap_init(); +int vsllink_tap_execute(); +void vsllink_tap_ensure_space(int scans, int bytes); +void vsllink_tap_append_scan(int length, u8 *buffer, scan_command_t *command, int offset); + +/* VSLLink lowlevel functions */ +typedef struct vsllink_jtag +{ + struct usb_dev_handle* usb_handle; +} vsllink_jtag_t; + +vsllink_jtag_t *vsllink_usb_open(void); +void vsllink_usb_close(vsllink_jtag_t *vsllink_jtag); +int vsllink_usb_message(vsllink_jtag_t *vsllink_jtag, int out_length, int in_length); +int vsllink_usb_write(vsllink_jtag_t *vsllink_jtag, int out_length); +int vsllink_usb_read(vsllink_jtag_t *vsllink_jtag); + +void vsllink_debug_buffer(u8 *buffer, int length); + +int vsllink_tms_data_len = 0; +u8* vsllink_tms_cmd_pos; + +vsllink_jtag_t* vsllink_jtag_handle; + +/***************************************************************************/ +/* External interface implementation */ + +jtag_interface_t vsllink_interface = +{ + .name = "vsllink", + .execute_queue = vsllink_execute_queue, + .speed = vsllink_speed, + .khz = vsllink_khz, + .speed_div = vsllink_speed_div, + .register_commands = vsllink_register_commands, + .init = vsllink_init, + .quit = vsllink_quit +}; + +int vsllink_execute_queue(void) +{ + jtag_command_t *cmd = jtag_command_queue; + int scan_size; + enum scan_type type; + u8 *buffer; + + DEBUG_JTAG_IO("--------------------------------------------------------------------------------"); + + vsllink_usb_out_buffer[0] = VSLLINK_CMD_HW_JTAGSEQCMD; + vsllink_usb_out_buffer_idx = 3; + while (cmd != NULL) + { + switch (cmd->type) + { + case JTAG_END_STATE: + DEBUG_JTAG_IO("end_state: %i", cmd->cmd.end_state->end_state); + + if (cmd->cmd.end_state->end_state != -1) + { + vsllink_end_state(cmd->cmd.end_state->end_state); + } + break; + + case JTAG_RUNTEST: + DEBUG_JTAG_IO( "runtest %i cycles, end in %i", cmd->cmd.runtest->num_cycles, \ + cmd->cmd.runtest->end_state); + + if (cmd->cmd.runtest->end_state != -1) + { + vsllink_end_state(cmd->cmd.runtest->end_state); + } + vsllink_runtest(cmd->cmd.runtest->num_cycles); + break; + + case JTAG_STATEMOVE: + DEBUG_JTAG_IO("statemove end in %i", cmd->cmd.statemove->end_state); + + if (cmd->cmd.statemove->end_state != -1) + { + vsllink_end_state(cmd->cmd.statemove->end_state); + } + vsllink_state_move(); + break; + + case JTAG_PATHMOVE: + DEBUG_JTAG_IO("pathmove: %i states, end in %i", \ + cmd->cmd.pathmove->num_states, \ + cmd->cmd.pathmove->path[cmd->cmd.pathmove->num_states - 1]); + + vsllink_path_move(cmd->cmd.pathmove->num_states, cmd->cmd.pathmove->path); + break; + + case JTAG_SCAN: + if (cmd->cmd.scan->end_state != -1) + { + vsllink_end_state(cmd->cmd.scan->end_state); + } + + scan_size = jtag_build_buffer(cmd->cmd.scan, &buffer); + if (cmd->cmd.scan->ir_scan) + { + DEBUG_JTAG_IO("JTAG Scan write IR(%d bits), end in %d:", scan_size, cmd->cmd.scan->end_state); + } + else + { + DEBUG_JTAG_IO("JTAG Scan write DR(%d bits), end in %d:", scan_size, cmd->cmd.scan->end_state); + } + +#ifdef _DEBUG_JTAG_IO_ + vsllink_debug_buffer(buffer, (scan_size + 7) >> 3); +#endif + + type = jtag_scan_type(cmd->cmd.scan); + + vsllink_scan(cmd->cmd.scan->ir_scan, type, buffer, scan_size, cmd->cmd.scan); + break; + + case JTAG_RESET: + DEBUG_JTAG_IO("reset trst: %i srst %i", cmd->cmd.reset->trst, cmd->cmd.reset->srst); + + vsllink_tap_execute(); + + if (cmd->cmd.reset->trst == 1) + { + cur_state = TAP_RESET; + } + vsllink_reset(cmd->cmd.reset->trst, cmd->cmd.reset->srst); + + vsllink_usb_out_buffer[0] = VSLLINK_CMD_HW_JTAGSEQCMD; + vsllink_usb_out_buffer_idx = 3; + break; + + case JTAG_SLEEP: + DEBUG_JTAG_IO("sleep %i", cmd->cmd.sleep->us); + vsllink_tap_execute(); + jtag_sleep(cmd->cmd.sleep->us); + break; + + default: + LOG_ERROR("BUG: unknown JTAG command type encountered"); + exit(-1); + } + cmd = cmd->next; + } + + return vsllink_tap_execute(); +} + +int vsllink_speed(int speed) +{ + int result; + + vsllink_usb_out_buffer[0] = VSLLINK_CMD_SET_SPEED; + vsllink_usb_out_buffer[1] = (speed >> 0) & 0xff; + vsllink_usb_out_buffer[2] = (speed >> 8) & 0xFF; + + result = vsllink_usb_write(vsllink_jtag_handle, 3); + + if (result == 3) + { + return ERROR_OK; + } + else + { + LOG_ERROR("VSLLink setting speed failed (%d)", result); + return ERROR_JTAG_DEVICE_ERROR; + } + + return ERROR_OK; +} + +int vsllink_khz(int khz, int *jtag_speed) +{ + *jtag_speed = khz; + + return ERROR_OK; +} + +int vsllink_speed_div(int jtag_speed, int *khz) +{ + *khz = jtag_speed; + + return ERROR_OK; +} + +int vsllink_register_commands(struct command_context_s *cmd_ctx) +{ + register_command(cmd_ctx, NULL, "vsllink_usb_vid", vsllink_handle_usb_vid_command, + COMMAND_CONFIG, NULL); + register_command(cmd_ctx, NULL, "vsllink_usb_pid", vsllink_handle_usb_pid_command, + COMMAND_CONFIG, NULL); + register_command(cmd_ctx, NULL, "vsllink_usb_bulkin", vsllink_handle_usb_bulkin_command, + COMMAND_CONFIG, NULL); + register_command(cmd_ctx, NULL, "vsllink_usb_bulkout", vsllink_handle_usb_bulkout_command, + COMMAND_CONFIG, NULL); + + return ERROR_OK; +} + +int vsllink_init(void) +{ + int check_cnt; + int result; + char version_str[100]; + + vsllink_usb_in_buffer = malloc(VSLLINK_BufferSize); + vsllink_usb_out_buffer = malloc(VSLLINK_BufferSize); + if ((vsllink_usb_in_buffer == NULL) || (vsllink_usb_out_buffer == NULL)) + { + LOG_ERROR("Not enough memory"); + exit(-1); + } + + vsllink_jtag_handle = vsllink_usb_open(); + + if (vsllink_jtag_handle == 0) + { + LOG_ERROR("Can't find USB JTAG Interface! Please check connection and permissions."); + return ERROR_JTAG_INIT_FAILED; + } + + check_cnt = 0; + while (check_cnt < 3) + { + vsllink_simple_command(VSLLINK_CMD_CONN); + result = vsllink_usb_read(vsllink_jtag_handle); + + if (result > 2) + { + vsllink_usb_in_buffer[result] = 0; + VSLLINK_BufferSize = vsllink_usb_in_buffer[0] + (vsllink_usb_in_buffer[1] << 8); + strncpy(version_str, (char *)vsllink_usb_in_buffer + 2, sizeof(version_str)); + LOG_INFO(version_str); + + // free the pre-alloc memroy + free(vsllink_usb_in_buffer); + free(vsllink_usb_out_buffer); + vsllink_usb_in_buffer = NULL; + vsllink_usb_out_buffer = NULL; + + // alloc new memory + vsllink_usb_in_buffer = malloc(VSLLINK_BufferSize); + vsllink_usb_out_buffer = malloc(VSLLINK_BufferSize); + if ((vsllink_usb_in_buffer == NULL) || (vsllink_usb_out_buffer == NULL)) + { + LOG_ERROR("Not enough memory"); + exit(-1); + } + else + { + LOG_INFO("buffer size for USB is %d bytes", VSLLINK_BufferSize); + } + break; + } + vsllink_simple_command(VSLLINK_CMD_DISCONN); + + check_cnt++; + } + + if (check_cnt == 3) + { + // It's dangerout to proced + LOG_ERROR("VSLLink initial failed"); + exit(-1); + } + + // Set SRST and TRST to output, Set USR1 and USR2 to input + vsllink_usb_out_buffer[0] = VSLLINK_CMD_SET_PORTDIR; + vsllink_usb_out_buffer[1] = JTAG_PINMSK_SRST | JTAG_PINMSK_TRST | JTAG_PINMSK_USR1 | JTAG_PINMSK_USR2; + vsllink_usb_out_buffer[2] = JTAG_PINMSK_SRST | JTAG_PINMSK_TRST; + result = vsllink_usb_write(vsllink_jtag_handle, 3); + if (result != 3) + { + LOG_ERROR("VSLLink USB send data error"); + exit(-1); + } + + vsllink_reset(0, 0); + + LOG_INFO("VSLLink JTAG Interface ready"); + + vsllink_tap_init(); + + return ERROR_OK; +} + +int vsllink_quit(void) +{ + if ((vsllink_usb_in_buffer != NULL) && (vsllink_usb_out_buffer != NULL)) + { + vsllink_simple_command(VSLLINK_CMD_DISCONN); + vsllink_usb_close(vsllink_jtag_handle); + } + + if (vsllink_usb_in_buffer != NULL) + { + free(vsllink_usb_in_buffer); + } + if (vsllink_usb_out_buffer != NULL) + { + free(vsllink_usb_out_buffer); + } + return ERROR_OK; +} + +// when vsllink_tms_data_len > 0, vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx] is the byte that need to be appended. +// length of VSLLINK_CMDJTAGSEQ_TMSBYTE has been set. +void VSLLINK_add_tms_from_RTI(enum tap_state state) +{ + u8 tms_scan = VSLLINK_TAP_MOVE(TAP_IDLE, state); + u16 tms2; + + if ((cur_state != TAP_IDLE) || (state == TAP_IDLE) || (vsllink_tms_data_len <= 0) || (vsllink_tms_data_len >= 8) || (vsllink_tms_cmd_pos == NULL)) + { + LOG_ERROR("There MUST be some bugs in the driver"); + exit(-1); + } + + tms2 = (tms_scan & VSLLINK_BIT_MSK[VSLLINK_TAP_MOVE_INSERT_INSIGNIFICANT[1][tap_move_map[state]][1]]) << vsllink_tms_data_len; + if (VSLLINK_TAP_MOVE_INSERT_INSIGNIFICANT[1][tap_move_map[state]][0] == 1) + { + tms2 |= VSLLINK_BIT_MSK[8 - vsllink_tms_data_len] << (vsllink_tms_data_len + VSLLINK_TAP_MOVE_INSERT_INSIGNIFICANT[1][tap_move_map[state]][1]); + } + tms2 |= (tms_scan >> VSLLINK_TAP_MOVE_INSERT_INSIGNIFICANT[1][tap_move_map[state]][1]) << (8 + VSLLINK_TAP_MOVE_INSERT_INSIGNIFICANT[1][tap_move_map[state]][1]); + + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] |= (tms2 >> 0) & 0xff; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = (tms2 >> 8) & 0xff; + + vsllink_tms_data_len = 0; + vsllink_tms_cmd_pos = NULL; +} + +/***************************************************************************/ +/* Queue command implementations */ + +void vsllink_end_state(enum tap_state state) +{ + if (tap_move_map[state] != -1) + { + end_state = state; + } + else + { + LOG_ERROR("BUG: %i is not a valid end state", state); + exit(-1); + } +} + +/* Goes to the end state. */ +void vsllink_state_move(void) +{ + if (vsllink_tms_data_len > 0) + { + VSLLINK_add_tms_from_RTI(end_state); + } + else + { + vsllink_tap_ensure_space(0, 2); + + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_CMDJTAGSEQ_TMSBYTE; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_TAP_MOVE(cur_state, end_state); + } + + cur_state = end_state; +} + +// write tms from current vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx] +void vsllink_add_path(int start, int num, enum tap_state *path) +{ + int i; + + for (i = start; i < (start + num); i++) + { + if ((i & 7) == 0) + { + if (i > 0) + { + vsllink_usb_out_buffer[++vsllink_usb_out_buffer_idx] = 0; + } + else + { + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx] = 0; + } + } + + if (path[i - start] == tap_transitions[cur_state].high) + { + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx] |= 1 << (i & 7); + } + else + { + LOG_ERROR("BUG: %d -> %d isn't a valid TAP transition", cur_state, path[i]); + exit(-1); + } + + cur_state = path[i]; + } + end_state = cur_state; +} + +void vsllink_path_move(int num_states, enum tap_state *path) +{ + int i, tms_len, tms_cmd_pos, path_idx = 0; + + if (vsllink_tms_data_len > 0) + { + if ((vsllink_tms_data_len + num_states) < 8) + { + vsllink_add_path(vsllink_tms_data_len, num_states, path); + num_states = 0; + } + else if ((vsllink_tms_data_len + num_states) < 16) + { + if ((*vsllink_tms_cmd_pos & VSLLINK_CMDJTAGSEQ_LENMSK) \ + < VSLLINK_CMDJTAGSEQ_LENMSK) + { + *vsllink_tms_cmd_pos++; + vsllink_add_path(vsllink_tms_data_len, num_states, path); + } + else + { + // need a new VSLLINK_CMDJTAGSEQ_TMSBYTE command + // if vsllink_tms_data_len > 0, length of VSLLINK_CMDJTAGSEQ_TMSBYTE MUST be > 1(tms_len > 2) + *vsllink_tms_cmd_pos--; + vsllink_add_path(vsllink_tms_data_len, 8 - vsllink_tms_data_len, path); + vsllink_usb_out_buffer_idx++; + vsllink_tap_ensure_space(0, 3); + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_CMDJTAGSEQ_TMSBYTE | 1; + vsllink_tms_cmd_pos = vsllink_usb_out_buffer + vsllink_usb_out_buffer_idx; + vsllink_add_path(vsllink_tms_data_len, num_states + vsllink_tms_data_len - 8, path + 8 - vsllink_tms_data_len); + } + vsllink_tms_data_len = (vsllink_tms_data_len + num_states) & 7; + num_states = 0; + } + else + { + vsllink_add_path(vsllink_tms_data_len, 16 - vsllink_tms_data_len, path); + path_idx = 16 - vsllink_tms_data_len; + vsllink_usb_out_buffer_idx++; + + num_states -= 16 - vsllink_tms_data_len; + path += 16 - vsllink_tms_data_len; + vsllink_tms_data_len = 0; + vsllink_tms_cmd_pos = NULL; + } + } + + if (num_states > 0) + { + // Normal operation, don't need to append tms data + vsllink_tms_data_len = num_states & 7; + + while (num_states > 0) + { + if (num_states > ((VSLLINK_CMDJTAGSEQ_LENMSK + 1) * 8)) + { + i = (VSLLINK_CMDJTAGSEQ_LENMSK + 1) * 8; + } + else + { + i = num_states; + } + tms_len = (i + 7) >> 3; + vsllink_tap_ensure_space(0, tms_len + 2); + tms_cmd_pos = vsllink_usb_out_buffer_idx; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_CMDJTAGSEQ_TMSBYTE | (tms_len - 1); + + vsllink_add_path(0, i, path + path_idx); + + path_idx += i; + num_states -= i; + } + + if (vsllink_tms_data_len > 0) + { + if (tms_len < (VSLLINK_CMDJTAGSEQ_LENMSK + 1)) + { + vsllink_usb_out_buffer[tms_cmd_pos]++; + vsllink_usb_out_buffer = vsllink_usb_out_buffer + tms_cmd_pos; + } + else + { + vsllink_usb_out_buffer[tms_cmd_pos]--; + tms_len = vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx]; + vsllink_tap_ensure_space(0, 3); + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_CMDJTAGSEQ_TMSBYTE | 1; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx] = tms_len; + } + } + } +} + +void vsllink_runtest(int num_cycles) +{ + int i, j; + int tms_len, first_tms = 0, tms_cmd_pos; + enum tap_state saved_end_state = end_state; + + if (cur_state != TAP_IDLE) + { + vsllink_end_state(TAP_IDLE); + + if (vsllink_tms_data_len > 0) + { + VSLLINK_add_tms_from_RTI(end_state); + } + else + { + first_tms = 1; + } + } + + if (vsllink_tms_data_len > 0) + { + // cur_state == TAP_IDLE + if ((vsllink_tms_data_len + num_cycles) < 8) + { + vsllink_tms_data_len += num_cycles; + num_cycles = 0; + } + else if ((vsllink_tms_data_len + num_cycles) < 16) + { + if ((*vsllink_tms_cmd_pos & VSLLINK_CMDJTAGSEQ_LENMSK) \ + < VSLLINK_CMDJTAGSEQ_LENMSK) + { + *vsllink_tms_cmd_pos++; + vsllink_usb_out_buffer[++vsllink_usb_out_buffer_idx] = 0; + } + else + { + // need a new VSLLINK_CMDJTAGSEQ_TMSBYTE command + // if vsllink_tms_data_len > 0, length of VSLLINK_CMDJTAGSEQ_TMSBYTE MUST be > 1(tms_len > 2) + *vsllink_tms_cmd_pos--; + vsllink_tap_ensure_space(0, 3); + vsllink_usb_out_buffer[++vsllink_usb_out_buffer_idx] = VSLLINK_CMDJTAGSEQ_TMSBYTE | 1; + vsllink_tms_cmd_pos = vsllink_usb_out_buffer + vsllink_usb_out_buffer_idx; + vsllink_usb_out_buffer[++vsllink_usb_out_buffer_idx] = 0; + } + vsllink_tms_data_len = (vsllink_tms_data_len + num_cycles) & 7; + num_cycles = 0; + } + else + { + vsllink_usb_out_buffer[++vsllink_usb_out_buffer_idx] = 0; + vsllink_usb_out_buffer_idx++; + + num_cycles -= 16 - vsllink_tms_data_len; + vsllink_tms_data_len = 0; + vsllink_tms_cmd_pos = NULL; + } + } + + tms_len = ((num_cycles + 7) >> 3) + first_tms; + if (tms_len > 0) + { + // Normal operation, don't need to append tms data + vsllink_tms_data_len = num_cycles & 7; + + if (vsllink_tms_data_len > 0) + { + tms_len += 1; + } + // tms_len includes the length of tms byte to append + + // Make sure there is enough space + // 1 more byte maybe needed for the last tms move + vsllink_tap_ensure_space(0, (tms_len / VSLLINK_CMDJTAGSEQ_LENMSK) + tms_len + 1); + + while(tms_len > 0) + { + if (tms_len > (VSLLINK_CMDJTAGSEQ_LENMSK + 1)) + { + i = VSLLINK_CMDJTAGSEQ_LENMSK + 1; + } + else + { + i = tms_len; + } + + tms_cmd_pos = vsllink_usb_out_buffer_idx; + + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_CMDJTAGSEQ_TMSBYTE | (i - 1); + + if (first_tms) + { + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_TAP_MOVE(cur_state, end_state); + first_tms = 0; + j = i - 1; + } + else + { + j = i; + } + + while (j-- > 0) + { + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = 0; + } + + tms_len -= i; + } + + // post process vsllink_usb_out_buffer_idx + if (vsllink_tms_data_len > 0) + { + vsllink_usb_out_buffer_idx -= 2; + } + + // Set end_state + vsllink_end_state(saved_end_state); + cur_state = TAP_IDLE; + if (saved_end_state != TAP_IDLE) + { + if (vsllink_tms_data_len > 0) + { + VSLLINK_add_tms_from_RTI(end_state); + } + else + { + if (i < (VSLLINK_CMDJTAGSEQ_LENMSK + 1)) + { + vsllink_usb_out_buffer[tms_cmd_pos]++; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_TAP_MOVE(TAP_IDLE, end_state); + } + else + { + vsllink_tap_ensure_space(0, 2); + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_CMDJTAGSEQ_TMSBYTE; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_TAP_MOVE(TAP_IDLE, end_state); + } + } + cur_state = saved_end_state; + } + + if (vsllink_tms_data_len > 0) + { + vsllink_tms_cmd_pos = vsllink_usb_out_buffer + tms_cmd_pos; + } + } + else + { + // Set end_state if no RTI shifts + vsllink_end_state(saved_end_state); + cur_state = TAP_IDLE; + if (saved_end_state != TAP_IDLE) + { + vsllink_tap_ensure_space(0, 2); + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_CMDJTAGSEQ_TMSBYTE; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_TAP_MOVE(TAP_IDLE, end_state); + + cur_state = saved_end_state; + } + } +} + +void vsllink_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size, scan_command_t *command) +{ + enum tap_state saved_end_state; + u8 bits_left, tms_tmp, tdi_len; + int i; + + tdi_len = ((scan_size + 7) >> 3); + if ((tdi_len + 7) > VSLLINK_BufferSize) + { + LOG_ERROR("Your implementation of VSLLink has not enough buffer"); + exit(-1); + } + + saved_end_state = end_state; + + /* Move to appropriate scan state */ + vsllink_end_state(ir_scan ? TAP_IRSHIFT : TAP_DRSHIFT); + + if (vsllink_tms_data_len > 0) + { + if (cur_state == end_state) + { + *vsllink_tms_cmd_pos--; + tms_tmp = vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx]; + vsllink_tap_ensure_space(1, tdi_len + 7); + + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_CMDJTAGSEQ_SCAN | 1; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = ((tdi_len + 1) >> 0) & 0xff; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = ((tdi_len + 1)>> 8) & 0xff; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = tms_tmp; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = buffer[0] << (8 - vsllink_tms_data_len); + + for (i = 0; i < tdi_len; i++) + { + buffer[i] >>= 8 - vsllink_tms_data_len; + if (i != tdi_len) + { + buffer[i] += buffer[i + 1] << vsllink_tms_data_len; + } + } + + vsllink_tap_append_scan(scan_size - vsllink_tms_data_len, buffer, command, vsllink_tms_data_len); + scan_size -= 8 - vsllink_tms_data_len; + } + else + { + VSLLINK_add_tms_from_RTI(end_state); + vsllink_tap_ensure_space(1, tdi_len + 5); + + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_CMDJTAGSEQ_SCAN; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = (tdi_len >> 0) & 0xff; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = (tdi_len >> 8) & 0xff; + + vsllink_tap_append_scan(scan_size, buffer, command, 0); + } + } + else + { + vsllink_tap_ensure_space(1, tdi_len + 7); + + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_CMDJTAGSEQ_SCAN | 1; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = ((tdi_len + 1) >> 0) & 0xff; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = ((tdi_len + 1)>> 8) & 0xff; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_TAP_MOVE(cur_state, end_state); + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = 0; + + vsllink_tap_append_scan(scan_size, buffer, command, 8); + } + vsllink_end_state(saved_end_state); + + bits_left = scan_size & 0x07; + cur_state = ir_scan ? TAP_IRPAUSE : TAP_DRPAUSE; + + if (bits_left > 0) + { + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = 1 << (bits_left - 1); + } + else + { + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = 1 << 7; + } + + if (cur_state != end_state) + { + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = VSLLINK_TAP_MOVE_FROM_E1[tap_move_map[end_state]]; + } + else + { + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = 0; + } + + cur_state = end_state; +} + +void vsllink_reset(int trst, int srst) +{ + int result; + + LOG_DEBUG("trst: %i, srst: %i", trst, srst); + + /* Signals are active low */ + vsllink_usb_out_buffer[0] = VSLLINK_CMD_SET_PORT; + vsllink_usb_out_buffer[1] = JTAG_PINMSK_SRST | JTAG_PINMSK_TRST; + vsllink_usb_out_buffer[2] = 0; + if (srst == 0) + { + vsllink_usb_out_buffer[2] |= JTAG_PINMSK_SRST; + } + if (trst == 0) + { + vsllink_usb_out_buffer[2] |= JTAG_PINMSK_TRST; + } + + result = vsllink_usb_write(vsllink_jtag_handle, 3); + if (result != 3) + { + LOG_ERROR("VSLLink command VSLLINK_CMD_SET_PORT failed (%d)"); + } +} + +void vsllink_simple_command(u8 command) +{ + int result; + + DEBUG_JTAG_IO("0x%02x", command); + + vsllink_usb_out_buffer[0] = command; + result = vsllink_usb_write(vsllink_jtag_handle, 1); + + if (result != 1) + { + LOG_ERROR("VSLLink command 0x%02x failed (%d)", command, result); + } +} + +int vsllink_handle_usb_vid_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +{ + if (argc != 1) { + LOG_ERROR("parameter error, should be one parameter for VID"); + return ERROR_OK; + } + + vsllink_vid = strtol(args[0], NULL, 0); + + return ERROR_OK; +} + +int vsllink_handle_usb_pid_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +{ + if (argc != 1) { + LOG_ERROR("parameter error, should be one parameter for PID"); + return ERROR_OK; + } + + vsllink_pid = strtol(args[0], NULL, 0); + + return ERROR_OK; +} + +int vsllink_handle_usb_bulkin_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +{ + if (argc != 1) { + LOG_ERROR("parameter error, should be one parameter for BULKIN endpoint"); + return ERROR_OK; + } + + vsllink_bulkin = strtol(args[0], NULL, 0) | 0x80; + + return ERROR_OK; +} + +int vsllink_handle_usb_bulkout_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +{ + if (argc != 1) { + LOG_ERROR("parameter error, should be one parameter for BULKOUT endpoint"); + return ERROR_OK; + } + + vsllink_bulkout = strtol(args[0], NULL, 0); + + return ERROR_OK; +} + +/***************************************************************************/ +/* VSLLink tap functions */ + +typedef struct +{ + int length; /* Number of bits to read */ + int offset; + scan_command_t *command; /* Corresponding scan command */ + u8 *buffer; +} pending_scan_result_t; + +#define MAX_PENDING_SCAN_RESULTS 256 + +static int pending_scan_results_length; +static pending_scan_result_t pending_scan_results_buffer[MAX_PENDING_SCAN_RESULTS]; + +static int last_tms; + +void vsllink_tap_init() +{ + vsllink_usb_out_buffer_idx = 0; + vsllink_usb_in_want_length = 0; + pending_scan_results_length = 0; +} + +void vsllink_tap_ensure_space(int scans, int bytes) +{ + int available_scans = MAX_PENDING_SCAN_RESULTS - pending_scan_results_length; + int available_bytes = VSLLINK_BufferSize - vsllink_usb_out_buffer_idx; + + if (scans > available_scans || bytes > available_bytes) + { + vsllink_tap_execute(); + vsllink_usb_out_buffer[0] = VSLLINK_CMD_HW_JTAGSEQCMD; + vsllink_usb_out_buffer_idx = 3; + } +} + +void vsllink_tap_append_scan(int length, u8 *buffer, scan_command_t *command, int offset) +{ + pending_scan_result_t *pending_scan_result = &pending_scan_results_buffer[pending_scan_results_length]; + int i; + + if (offset > 0) + { + vsllink_usb_in_want_length += ((length + 7) >> 3) + 1; + } + else + { + vsllink_usb_in_want_length += (length + 7) >> 3; + } + pending_scan_result->length = length; + pending_scan_result->offset = offset; + pending_scan_result->command = command; + pending_scan_result->buffer = buffer; + + for (i = 0; i < ((length + 7) >> 3); i++) + { + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = buffer[i]; + } + + pending_scan_results_length++; +} + +/* Pad and send a tap sequence to the device, and receive the answer. + * For the purpose of padding we assume that we are in idle or pause state. */ +int vsllink_tap_execute() +{ + int i, j; + int result; + int first = 0; + + if (vsllink_tms_data_len > 0) + { + if (vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx] & (1 << (vsllink_tms_data_len - 1))) + { + // last tms bit is '1' + // the only possible state is TLR, no need to control the number of shifts in RLT + // There MUST be some errors in the code + LOG_ERROR("last tms bit is '1'"); + exit(-1); + } + else + { + // last tms bit is '0' + vsllink_usb_out_buffer_idx++; + vsllink_usb_out_buffer[vsllink_usb_out_buffer_idx++] = 0; + vsllink_tms_data_len = 0; + } + } + + if (vsllink_usb_out_buffer_idx > 3) + { + if (vsllink_usb_out_buffer[0] == VSLLINK_CMD_HW_JTAGSEQCMD) + { + vsllink_usb_out_buffer[1] = (vsllink_usb_out_buffer_idx >> 0) & 0xff; + vsllink_usb_out_buffer[2] = (vsllink_usb_out_buffer_idx >> 8) & 0xff; + } + + result = vsllink_usb_message(vsllink_jtag_handle, vsllink_usb_out_buffer_idx, vsllink_usb_in_want_length); + + if (result == vsllink_usb_in_want_length) + { + for (i = 0; i < pending_scan_results_length; i++) + { + pending_scan_result_t *pending_scan_result = &pending_scan_results_buffer[i]; + u8 *buffer = pending_scan_result->buffer; + int length = pending_scan_result->length; + int offset = pending_scan_result->offset; + scan_command_t *command = pending_scan_result->command; + + /* Copy to buffer */ + buf_set_buf(vsllink_usb_in_buffer, first * 8 + offset, buffer, 0, length); + first += (length + offset + 7) >> 3; + + DEBUG_JTAG_IO("JTAG scan read(%d bits):", length); +#ifdef _DEBUG_JTAG_IO_ + vsllink_debug_buffer(buffer, (length + 7) >> 3); +#endif + + if (jtag_read_buffer(buffer, command) != ERROR_OK) + { + vsllink_tap_init(); + return ERROR_JTAG_QUEUE_FAILED; + } + + if (pending_scan_result->buffer != NULL) + { + free(pending_scan_result->buffer); + pending_scan_result->buffer = NULL; + } + } + } + else + { + LOG_ERROR("vsllink_tap_execute, wrong result %d, expected %d", result, vsllink_usb_in_want_length); + return ERROR_JTAG_QUEUE_FAILED; + } + + vsllink_tap_init(); + } + + return ERROR_OK; +} + +/*****************************************************************************/ +/* VSLLink USB low-level functions */ + +vsllink_jtag_t* vsllink_usb_open() +{ + struct usb_bus *busses; + struct usb_bus *bus; + struct usb_device *dev; + + vsllink_jtag_t *result; + + result = (vsllink_jtag_t*) malloc(sizeof(vsllink_jtag_t)); + + usb_init(); + usb_find_busses(); + usb_find_devices(); + + busses = usb_get_busses(); + + /* find vsllink_jtag device in usb bus */ + + for (bus = busses; bus; bus = bus->next) + { + for (dev = bus->devices; dev; dev = dev->next) + { + if ((dev->descriptor.idVendor == vsllink_vid) && (dev->descriptor.idProduct == vsllink_pid)) + { + result->usb_handle = usb_open(dev); + + /* usb_set_configuration required under win32 */ + usb_set_configuration(result->usb_handle, dev->config[0].bConfigurationValue); + usb_claim_interface(result->usb_handle, 0); + +#if 0 + /* + * This makes problems under Mac OS X. And is not needed + * under Windows. Hopefully this will not break a linux build + */ + usb_set_altinterface(result->usb_handle, 0); +#endif + return result; + } + } + } + + free(result); + return NULL; +} + +void vsllink_usb_close(vsllink_jtag_t *vsllink_jtag) +{ + usb_close(vsllink_jtag->usb_handle); + free(vsllink_jtag); +} + +/* Send a message and receive the reply. */ +int vsllink_usb_message(vsllink_jtag_t *vsllink_jtag, int out_length, int in_length) +{ + int result; + int result2; + + result = vsllink_usb_write(vsllink_jtag, out_length); + if (result == out_length) + { + if (in_length > 0) + { + result = vsllink_usb_read(vsllink_jtag); + if (result == in_length ) + { + return result; + } + else + { + LOG_ERROR("usb_bulk_read failed (requested=%d, result=%d)", in_length, result); + return -1; + } + } + return 0; + } + else + { + LOG_ERROR("usb_bulk_write failed (requested=%d, result=%d)", out_length, result); + return -1; + } +} + +/* Write data from out_buffer to USB. */ +int vsllink_usb_write(vsllink_jtag_t *vsllink_jtag, int out_length) +{ + int result; + + if (out_length > VSLLINK_BufferSize) + { + LOG_ERROR("vsllink_jtag_write illegal out_length=%d (max=%d)", out_length, VSLLINK_BufferSize); + return -1; + } + + result = usb_bulk_write(vsllink_jtag->usb_handle, vsllink_bulkout, \ + (char *)vsllink_usb_out_buffer, out_length, VSLLINK_USB_TIMEOUT); + + DEBUG_JTAG_IO("vsllink_usb_write, out_length = %d, result = %d", out_length, result); + +#ifdef _DEBUG_USB_COMMS_ + LOG_DEBUG("USB out:"); + vsllink_debug_buffer(vsllink_usb_out_buffer, out_length); +#endif + +#ifdef _VSLLINK_IN_DEBUG_MODE_ + usleep(100000); +#endif + + return result; +} + +/* Read data from USB into in_buffer. */ +int vsllink_usb_read(vsllink_jtag_t *vsllink_jtag) +{ + int result = usb_bulk_read(vsllink_jtag->usb_handle, vsllink_bulkin, \ + (char *)vsllink_usb_in_buffer, VSLLINK_BufferSize, VSLLINK_USB_TIMEOUT); + + DEBUG_JTAG_IO("vsllink_usb_read, result = %d", result); + +#ifdef _DEBUG_USB_COMMS_ + LOG_DEBUG("USB in:"); + vsllink_debug_buffer(vsllink_usb_in_buffer, result); +#endif + return result; +} + +#define BYTES_PER_LINE 16 + +void vsllink_debug_buffer(u8 *buffer, int length) +{ + char line[81]; + char s[4]; + int i; + int j; + + for (i = 0; i < length; i += BYTES_PER_LINE) + { + snprintf(line, 5, "%04x", i); + for (j = i; j < i + BYTES_PER_LINE && j < length; j++) + { + snprintf(s, 4, " %02x", buffer[j]); + strcat(line, s); + } + LOG_DEBUG(line); + } +} |
From: <du...@ma...> - 2008-12-27 23:35:38
|
Author: duane Date: 2008-12-27 23:35:35 +0100 (Sat, 27 Dec 2008) New Revision: 1287 Modified: trunk/src/jtag/bitq.c trunk/src/jtag/rlink/rlink.c Log: Tweaks - old crusty code with some warnings & errors - minor stuff Modified: trunk/src/jtag/bitq.c =================================================================== --- trunk/src/jtag/bitq.c 2008-12-27 21:00:16 UTC (rev 1286) +++ trunk/src/jtag/bitq.c 2008-12-27 22:35:35 UTC (rev 1287) @@ -169,10 +169,12 @@ int i; for (i=0; i<=cmd->num_states; i++) { - if (tap_transitions[cur_state].low == cmd->path[i]) bitq_io(0, 0, 0); - else if (tap_transitions[cur_state].high == cmd->path[i]) bitq_io(1, 0, 0); + if (tap_transitions[cur_state].low == cmd->path[i]) + bitq_io(0, 0, 0); + else if (tap_transitions[cur_state].high == cmd->path[i]) + bitq_io(1, 0, 0); else { - LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition", jtag_state_name(cur_state), jtag_state_name(cmd->path[i)]); + LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition", jtag_state_name(cur_state), jtag_state_name(cmd->path[i])); exit(-1); } Modified: trunk/src/jtag/rlink/rlink.c =================================================================== --- trunk/src/jtag/rlink/rlink.c 2008-12-27 21:00:16 UTC (rev 1286) +++ trunk/src/jtag/rlink/rlink.c 2008-12-27 22:35:35 UTC (rev 1287) @@ -427,8 +427,7 @@ */ static int -dtc_start_download( -) { +dtc_start_download(void) { int usb_err; u8 ep2txr; @@ -611,8 +610,7 @@ static int -dtc_queue_init( -) { +dtc_queue_init(void) { dtc_queue.rq_head = NULL; dtc_queue.rq_tail = NULL; dtc_queue.cmd_index = 0; @@ -663,8 +661,7 @@ static int -dtc_queue_run( -) { +dtc_queue_run(void) { dtc_reply_queue_entry_t *rq_p, *rq_next; int retval; int usb_err; @@ -808,8 +805,7 @@ static int -tap_state_queue_init( -) { +tap_state_queue_init(void) { tap_state_queue.length = 0; tap_state_queue.buffer = 0; return(0); @@ -818,8 +814,7 @@ static int -tap_state_queue_run( -) { +tap_state_queue_run(void) { int i; int bits; u8 byte; |
From: <du...@ma...> - 2008-12-27 22:00:19
|
Author: duane Date: 2008-12-27 22:00:16 +0100 (Sat, 27 Dec 2008) New Revision: 1286 Modified: trunk/doc/openocd.texi Log: Added note to user manual for packagers of OpenOCD Modified: trunk/doc/openocd.texi =================================================================== --- trunk/doc/openocd.texi 2008-12-27 16:31:28 UTC (rev 1285) +++ trunk/doc/openocd.texi 2008-12-27 21:00:16 UTC (rev 1286) @@ -133,6 +133,46 @@ you. Chances are that that binary is from some SVN version that is more stable than SVN trunk where bleeding edge development takes place. +@section Packagers Please Read! + +If you are a @b{PACKAGER} of OpenOCD if you + +@enumerate +@item @b{Sell dongles} and include pre-built binaries +@item @b{Supply tools} ie: A complete development solution +@item @b{Supply IDEs} like Eclipse, or RHIDE, etc. +@item @b{Build packages} ie: RPM files, or DEB files for a Linux Distro +@end enumerate + +As a @b{PACKAGER} - you are at the top of the food chain. You solve +problems for downstream users. What you fix or solve - solves hundreds +if not thousands of user questions. If something does not work for you +please let us know. That said, would also like you to follow a few +suggestions: + +@enumerate +@item @b{Always build with Printer Ports Enabled} +@item @b{Try where possible to use LIBFTDI + LIBUSB} You cover more bases +@end enumerate + +It is your decision.. + +@itemize @bullet +@item @b{Why YES to LIBFTDI + LIBUSB} +@itemize @bullet +@item @b{LESS} work - libusb perhaps already there +@item @b{LESS} work - identical code multiple platforms +@item @b{MORE} dongles are supported +@item @b{MORE} platforms are supported +@item @b{MORE} complete solution +@end itemize +@item @b{Why not LIBFTDI + LIBUSB} (ie: ftd2xx instead) +@itemize @bullet +@item @b{LESS} Some say it is slower. +@item @b{LESS} complex to distribute (external dependencies) +@end itemize +@end itemize + @section Building From Source You can download the current SVN version with SVN client of your choice from the |
From: <du...@ma...> - 2008-12-27 17:31:31
|
Author: duane Date: 2008-12-27 17:31:28 +0100 (Sat, 27 Dec 2008) New Revision: 1285 Modified: trunk/configure.in Log: From Dirk Behme - another set of typos Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2008-12-27 15:00:36 UTC (rev 1284) +++ trunk/configure.in 2008-12-27 16:31:28 UTC (rev 1285) @@ -55,8 +55,7 @@ LDFLAGS="$LDFLAGS -L$OCDxprefix/lib" # RPATH becomes an issue on Linux only - if test $host_os = linux-gnu || $host_os = linux - then + if test $host_os = linux-gnu || test $host_os = linux ; then LDFLAGS="$LDFLAGS -Wl,-rpath,$OCDxprefix/lib" fi # The "INCDIR" is also usable @@ -500,7 +499,7 @@ AC_MSG_CHECKING([for libftd2xx.a (linux)]) # Must be linux - # Cause FTDICHIP does not supply a MAC-OS version - if test $host_os != linux-gnu && $host_os != linux ; then + if test $host_os != linux-gnu && test $host_os != linux ; then AC_MSG_ERROR([The (linux) ftd2xx library from FTDICHIP.com is linux only. Try --enable-ft2232-libftdi instead]) fi # Are we given a TAR directory? |
From: <du...@ma...> - 2008-12-27 16:00:46
|
Author: duane Date: 2008-12-27 16:00:36 +0100 (Sat, 27 Dec 2008) New Revision: 1284 Modified: trunk/configure.in Log: Some systems report linux as host, others linux-gnu... grrr Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2008-12-27 13:47:36 UTC (rev 1283) +++ trunk/configure.in 2008-12-27 15:00:36 UTC (rev 1284) @@ -55,7 +55,7 @@ LDFLAGS="$LDFLAGS -L$OCDxprefix/lib" # RPATH becomes an issue on Linux only - if test $host_os = linux-gnu + if test $host_os = linux-gnu || $host_os = linux then LDFLAGS="$LDFLAGS -Wl,-rpath,$OCDxprefix/lib" fi @@ -500,7 +500,7 @@ AC_MSG_CHECKING([for libftd2xx.a (linux)]) # Must be linux - # Cause FTDICHIP does not supply a MAC-OS version - if test $host_os != linux-gnu; then + if test $host_os != linux-gnu && $host_os != linux ; then AC_MSG_ERROR([The (linux) ftd2xx library from FTDICHIP.com is linux only. Try --enable-ft2232-libftdi instead]) fi # Are we given a TAR directory? |
From: <du...@ma...> - 2008-12-27 14:47:49
|
Author: duane Date: 2008-12-27 14:47:36 +0100 (Sat, 27 Dec 2008) New Revision: 1283 Modified: trunk/configure.in Log: Missed support for without --exec-prefix and ftd2xx stuff Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2008-12-27 03:13:50 UTC (rev 1282) +++ trunk/configure.in 2008-12-27 13:47:36 UTC (rev 1283) @@ -36,15 +36,28 @@ # And - if we are being installed there - the odds are # The libraries unique to what we are are there too. # + +# Expand nd deal with NONE - just like configure will do later +OCDprefix=$prefix +OCDxprefix=$exec_prefix +test x"$OCDprefix" = xNONE && OCDprefix=$ac_default_prefix +# Let make expand exec_prefix. +test x"$OCDxprefix" = xNONE && OCDxprefix="$OCDprefix" + + # what matters is the "exec-prefix" -if test $exec_prefix != $ac_default_prefix +if test "$OCDxprefix" != "$ac_default_prefix" then + # We are installing in a non-standard place + # Nonstandard --prefix and/or --exec-prefix + # We have an override of some sort. # use build specific install library dir - LDFLAGS="$LDFLAGS -L$libdir" + + LDFLAGS="$LDFLAGS -L$OCDxprefix/lib" # RPATH becomes an issue on Linux only if test $host_os = linux-gnu then - LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir" + LDFLAGS="$LDFLAGS -Wl,-rpath,$OCDxprefix/lib" fi # The "INCDIR" is also usable CFLAGS="$CFLAGS -I$includedir" |
From: <du...@ma...> - 2008-12-27 04:13:54
|
Author: duane Date: 2008-12-27 04:13:50 +0100 (Sat, 27 Dec 2008) New Revision: 1282 Modified: trunk/src/jtag/rlink/rlink.c Log: From Lou...@fi... Modified: trunk/src/jtag/rlink/rlink.c =================================================================== --- trunk/src/jtag/rlink/rlink.c 2008-12-27 03:07:32 UTC (rev 1281) +++ trunk/src/jtag/rlink/rlink.c 2008-12-27 03:13:50 UTC (rev 1282) @@ -1001,18 +1001,29 @@ } usb_err = ep1_generic_commandl( - pHDev, 5, + pHDev, 6, EP1_CMD_MEMORY_WRITE, ST7_PADR >> 8, ST7_PADR, 1, - bitmap + bitmap, + EP1_CMD_DTC_GET_CACHED_STATUS ); if(usb_err < 0) { LOG_ERROR("%s: %s\n", __func__, usb_strerror()); exit(1); } + + usb_err = usb_bulk_read( + pHDev, USB_EP1IN_ADDR, + &bitmap, 1, + USB_TIMEOUT_MS + ); + if(usb_err < 1) { + LOG_ERROR("%s: %s\n", __func__, usb_strerror()); + exit(1); + } } |
From: <du...@ma...> - 2008-12-27 04:07:36
|
Author: duane Date: 2008-12-27 04:07:32 +0100 (Sat, 27 Dec 2008) New Revision: 1281 Modified: trunk/src/jtag/ft2232.c trunk/src/jtag/jtag.c Log: Quoteify the FT2232 description list, and a missed fix from Dirk Behme about jtag tapisenabled Modified: trunk/src/jtag/ft2232.c =================================================================== --- trunk/src/jtag/ft2232.c 2008-12-27 02:56:55 UTC (rev 1280) +++ trunk/src/jtag/ft2232.c 2008-12-27 03:07:32 UTC (rev 1281) @@ -1469,7 +1469,7 @@ { LOG_ERROR("ListDevices: %lu\n", num_devices); for (i = 0; i < num_devices; i++) - LOG_ERROR("%i: %s", i, desc_array[i]); + LOG_ERROR("%i: \"%s\"", i, desc_array[i]); } for (i = 0; i < num_devices; i++) Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2008-12-27 02:56:55 UTC (rev 1280) +++ trunk/src/jtag/jtag.c 2008-12-27 03:07:32 UTC (rev 1281) @@ -2071,7 +2071,7 @@ } switch( n->value ){ case JTAG_CMD_TAPISENABLED: - // below + e = t->enabled; break; case JTAG_CMD_TAPENABLE: jtag_tap_handle_event( t, JTAG_TAP_EVENT_ENABLE); |
From: <du...@ma...> - 2008-12-27 03:57:01
|
Author: duane Date: 2008-12-27 03:56:55 +0100 (Sat, 27 Dec 2008) New Revision: 1280 Modified: trunk/configure.in trunk/doc/openocd.texi trunk/src/Makefile.am trunk/src/jtag/Makefile.am trunk/src/jtag/jtag.c trunk/testing/build.test1/Makefile.openocd Log: Added dongle VSLLINK - from Simon Qian Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2008-12-27 02:21:38 UTC (rev 1279) +++ trunk/configure.in 2008-12-27 02:56:55 UTC (rev 1280) @@ -156,8 +156,8 @@ ) AC_ARG_ENABLE(gccwarnings, - AS_HELP_STRING([--enable-gccwarnings], [Enable compiler warnings, default no]), - [gcc_warnings=$enableval], [gcc_warnings=no]) + AS_HELP_STRING([--enable-gccwarnings], [Enable compiler warnings, default yes]), + [gcc_warnings=$enableval], [gcc_warnings=yes]) AC_ARG_ENABLE(parport, AS_HELP_STRING([--enable-parport], [Enable building the pc parallel port driver]), @@ -243,6 +243,10 @@ AS_HELP_STRING([--enable-jlink], [Enable building support for the Segger J-Link JTAG Programmer]), [build_jlink=$enableval], [build_jlink=no]) +AC_ARG_ENABLE(vsllink, + AS_HELP_STRING([--enable-vsllink], [Enable building support for the Versaloon-Link JTAG Programmer]), + [build_vsllink=$enableval], [build_vsllink=no]) + AC_ARG_ENABLE(rlink, AS_HELP_STRING([--enable-rlink], [Enable building support for the Raisonance RLink JTAG Programmer]), [build_rlink=$enableval], [build_rlink=no]) @@ -412,6 +416,12 @@ AC_DEFINE(BUILD_JLINK, 0, [0 if you don't want the J-Link JTAG driver.]) fi +if test $build_vsllink = yes; then + AC_DEFINE(BUILD_VSLLINK, 1, [1 if you want the Versaloon-Link JTAG driver.]) +else + AC_DEFINE(BUILD_VSLLINK, 0, [0 if you don't want the Versaloon-Link JTAG driver.]) +fi + if test $build_rlink = yes; then AC_DEFINE(BUILD_RLINK, 1, [1 if you want the RLink JTAG driver.]) else @@ -631,6 +641,7 @@ AM_CONDITIONAL(USBPROG, test $build_usbprog = yes) AM_CONDITIONAL(OOCD_TRACE, test $build_oocd_trace = yes) AM_CONDITIONAL(JLINK, test $build_jlink = yes) +AM_CONDITIONAL(VSLLINK, test $build_vsllink = yes) AM_CONDITIONAL(RLINK, test $build_rlink = yes) AM_CONDITIONAL(IS_CYGWIN, test $is_cygwin = yes) AM_CONDITIONAL(IS_MINGW, test $is_mingw = yes) Modified: trunk/doc/openocd.texi =================================================================== --- trunk/doc/openocd.texi 2008-12-27 02:21:38 UTC (rev 1279) +++ trunk/doc/openocd.texi 2008-12-27 02:56:55 UTC (rev 1280) @@ -222,6 +222,8 @@ @item @option{--enable-jlink} - From SEGGER @item +@option{--enable-vsllink} +@item @option{--enable-rlink} - Raisonance.com dongle. @end itemize @@ -395,6 +397,9 @@ @item @b{USB - Presto} @* Link: @url{http://tools.asix.net/prg_presto.htm} + +@item @b{Versaloon-Link} +@* Link: @url{http://www.simonqian.com/en/Versaloon} @end itemize @section IBM PC Parallel Printer Port Based @@ -1140,6 +1145,9 @@ @item @b{rlink} @* Raisonance RLink usb adapter + +@item @b{vsllink} +@* vsllink is part of Versaloon which is a versatile USB programmer. @comment - End parameters @end itemize @comment - End Interface Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2008-12-27 02:21:38 UTC (rev 1279) +++ trunk/src/Makefile.am 2008-12-27 02:56:55 UTC (rev 1280) @@ -50,10 +50,14 @@ if RLINK LIBUSB = -lusb else +if VSLLINK +LIBUSB = -lusb +else LIBUSB = endif endif endif +endif Modified: trunk/src/jtag/Makefile.am =================================================================== --- trunk/src/jtag/Makefile.am 2008-12-27 02:21:38 UTC (rev 1279) +++ trunk/src/jtag/Makefile.am 2008-12-27 02:56:55 UTC (rev 1280) @@ -96,7 +96,13 @@ RLINKFILES = endif +if VSLLINK +VSLLINKFILES = vsllink.c +else +VSLLINKFILES = +endif + libjtag_a_SOURCES = jtag.c $(BITBANGFILES) $(PARPORTFILES) $(DUMMYFILES) $(FT2232FILES) $(AMTJTAGACCELFILES) $(EP93XXFILES) \ - $(AT91RM9200FILES) $(GW16012FILES) $(BITQFILES) $(PRESTOFILES) $(USBPROGFILES) $(ECOSBOARDFILES) $(JLINKFILES) $(RLINKFILES) + $(AT91RM9200FILES) $(GW16012FILES) $(BITQFILES) $(PRESTOFILES) $(USBPROGFILES) $(ECOSBOARDFILES) $(JLINKFILES) $(RLINKFILES) $(VSLLINKFILES) noinst_HEADERS = bitbang.h jtag.h Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2008-12-27 02:21:38 UTC (rev 1279) +++ trunk/src/jtag/jtag.c 2008-12-27 02:56:55 UTC (rev 1280) @@ -196,6 +196,10 @@ extern jtag_interface_t jlink_interface; #endif +#if BUILD_VSLLINK == 1 + extern jtag_interface_t vsllink_interface; +#endif + #if BUILD_RLINK == 1 extern jtag_interface_t rlink_interface; #endif @@ -237,6 +241,9 @@ #if BUILD_JLINK == 1 &jlink_interface, #endif +#if BUILD_VSLLINK == 1 + &vsllink_interface, +#endif #if BUILD_RLINK == 1 &rlink_interface, #endif Modified: trunk/testing/build.test1/Makefile.openocd =================================================================== --- trunk/testing/build.test1/Makefile.openocd 2008-12-27 02:21:38 UTC (rev 1279) +++ trunk/testing/build.test1/Makefile.openocd 2008-12-27 02:56:55 UTC (rev 1280) @@ -40,7 +40,7 @@ CONFIG_OPTIONS_win32_libftdi = --enable-parport --enable-ft2232_libftdi # Default build for win32... is the ftd2xx type build. -PERMUTE_win32 ?= $(BUILD_SYSNAME)_ftd2xx +PERMUTE_win32 ?= ftd2xx CONFIG_OPTIONS_win32 ?= $(CONFIG_OPTIONS_win32_$(PERMUTE_win32)) CONFIG_OPTIONS_cygwin = $(CONFIG_OPTIONS_win32) CONFIG_OPTIONS_mingw32 = $(CONFIG_OPTIONS_win32) |
From: <du...@ma...> - 2008-12-27 03:21:43
|
Author: duane Date: 2008-12-27 03:21:38 +0100 (Sat, 27 Dec 2008) New Revision: 1279 Modified: trunk/src/jtag/rlink/rlink.c Log: Warning removal from lou...@fi... Modified: trunk/src/jtag/rlink/rlink.c =================================================================== --- trunk/src/jtag/rlink/rlink.c 2008-12-27 02:18:06 UTC (rev 1278) +++ trunk/src/jtag/rlink/rlink.c 2008-12-27 02:21:38 UTC (rev 1279) @@ -132,7 +132,7 @@ usb_ret = usb_bulk_write( pHDev, USB_EP1OUT_ADDR, - usb_buffer, sizeof(usb_buffer), + (char *)usb_buffer, sizeof(usb_buffer), USB_TIMEOUT_MS ); @@ -249,7 +249,7 @@ usb_ret = usb_bulk_write( pHDev, USB_EP1OUT_ADDR, - usb_buffer, sizeof(usb_buffer), + (char *)usb_buffer, sizeof(usb_buffer), USB_TIMEOUT_MS ); @@ -359,7 +359,7 @@ case DTCLOAD_ENTRY: /* store entry addresses somewhere */ - if(!strncmp("download", buffer + 1, 8)) { + if(!strncmp("download", (char *)buffer + 1, 8)) { dtc_entry_download = buffer[0]; } break; @@ -449,7 +449,7 @@ /* read back ep2txr */ usb_err = usb_bulk_read( pHDev, USB_EP1IN_ADDR, - &ep2txr, 1, + (char *)&ep2txr, 1, USB_TIMEOUT_MS ); if(usb_err < 0) return(usb_err); @@ -476,7 +476,7 @@ /* wait for completion */ usb_err = usb_bulk_read( pHDev, USB_EP1IN_ADDR, - &ep2txr, 1, + (char *)&ep2txr, 1, USB_TIMEOUT_MS ); @@ -502,7 +502,7 @@ usb_err = usb_bulk_write( pHDev, USB_EP2OUT_ADDR, - command_buffer, USB_EP2BANK_SIZE, + (char *)command_buffer, USB_EP2BANK_SIZE, USB_TIMEOUT_MS ); if(usb_err < 0) return(usb_err); @@ -523,7 +523,7 @@ usb_err = usb_bulk_read( pHDev, USB_EP1IN_ADDR, - ep2_buffer, 1, + (char *)ep2_buffer, 1, USB_TIMEOUT_MS ); if(usb_err < 0) return(usb_err); @@ -544,7 +544,7 @@ usb_err = usb_bulk_read( pHDev, USB_EP2IN_ADDR, - ep2_buffer, sizeof(ep2_buffer), + (char *)ep2_buffer, sizeof(ep2_buffer), USB_TIMEOUT_MS ); @@ -1662,7 +1662,7 @@ } j = usb_bulk_read( pHDev, USB_EP1IN_ADDR, - reply_buffer, sizeof(reply_buffer), + (char *)reply_buffer, sizeof(reply_buffer), 200 ); if(j != -ETIMEDOUT) break; @@ -1701,7 +1701,7 @@ usb_bulk_read( pHDev, USB_EP1IN_ADDR, - reply_buffer, 1, + (char *)reply_buffer, 1, USB_TIMEOUT_MS ); @@ -1726,7 +1726,7 @@ usb_bulk_read( pHDev, USB_EP1IN_ADDR, - reply_buffer, 1, + (char *)reply_buffer, 1, USB_TIMEOUT_MS ); |
From: <du...@ma...> - 2008-12-27 03:18:09
|
Author: duane Date: 2008-12-27 03:18:06 +0100 (Sat, 27 Dec 2008) New Revision: 1278 Modified: trunk/doc/openocd.texi Log: From Dirk Behme - Further docu fixes Modified: trunk/doc/openocd.texi =================================================================== --- trunk/doc/openocd.texi 2008-12-27 01:44:29 UTC (rev 1277) +++ trunk/doc/openocd.texi 2008-12-27 02:18:06 UTC (rev 1278) @@ -1459,7 +1459,7 @@ @itemize @bullet @item @b{-irlen NUMBER} - the length in bits of the instruction register @item @b{-ircapture NUMBER} - the ID code capture command. -@item @b{-irmask NUMBER} - the corrisponding mask for the ir register. +@item @b{-irmask NUMBER} - the corresponding mask for the ir register. @comment END REQUIRED @end itemize An example of a FOOBAR Tap @@ -2399,14 +2399,12 @@ @section Daemon Commands -@subsection sleep -@b{sleep} <@var{msec}> +@subsection sleep [@var{msec}] @cindex sleep @*Wait for n milliseconds before resuming. Useful in connection with script files (@var{script} command and @var{target_script} configuration). -@subsection sleep -@b{shutdown} +@subsection shutdown @cindex shutdown @*Close the OpenOCD daemon, disconnecting all clients (GDB, Telnet, Other). @@ -2803,7 +2801,8 @@ example if you need to control a JTAG Route Controller (ie: the OMAP3530 on the Beagle Board has one) you might use these commands in a script or an event procedure. - +@section Commands +@cindex Commands @itemize @bullet @item @b{scan_chain} @cindex scan_chain @@ -2837,7 +2836,45 @@ Display/modify variable field <@var{var}> <@var{field}> [@var{value}|@var{flip}]. @end itemize +@section Tap states +@cindex Tap states +Available tap_states are: +@itemize @bullet +@item @b{RESET} +@cindex RESET +@item @b{IDLE} +@cindex IDLE +@item @b{DRSELECT} +@cindex DRSELECT +@item @b{DRCAPTURE} +@cindex DRCAPTURE +@item @b{DRSHIFT} +@cindex DRSHIFT +@item @b{DREXIT1} +@cindex DREXIT1 +@item @b{DRPAUSE} +@cindex DRPAUSE +@item @b{DREXIT2} +@cindex DREXIT2 +@item @b{DRUPDATE} +@cindex DRUPDATE +@item @b{IRSELECT} +@cindex IRSELECT +@item @b{IRCAPTURE} +@cindex IRCAPTURE +@item @b{IRSHIFT} +@cindex IRSHIFT +@item @b{IREXIT1} +@cindex IREXIT1 +@item @b{IRPAUSE} +@cindex IRPAUSE +@item @b{IREXIT2} +@cindex IREXIT2 +@item @b{IRUPDATE} +@cindex IRUPDATE +@end itemize + @node TFTP @chapter TFTP @cindex TFTP |
From: <du...@ma...> - 2008-12-27 02:44:36
|
Author: duane Date: 2008-12-27 02:44:29 +0100 (Sat, 27 Dec 2008) New Revision: 1277 Added: trunk/testing/build.test1/README.TXT Modified: trunk/testing/build.test1/Makefile trunk/testing/build.test1/Makefile.libusb Log: Added documentation for build test case1 Modified: trunk/testing/build.test1/Makefile =================================================================== --- trunk/testing/build.test1/Makefile 2008-12-27 01:30:06 UTC (rev 1276) +++ trunk/testing/build.test1/Makefile 2008-12-27 01:44:29 UTC (rev 1277) @@ -81,6 +81,13 @@ cd $(EXEC_PREFIX)/lib && ln -s libftd2xx.so.$(FTD2XX_LINUX_VERSION) libftd2xx.so +all.download: + mkdir -p ${VIRGINS} + ${MAKE} -f Makefile.confuse download + ${MAKE} -f Makefile.libftdi download + ${MAKE} -f Makefile.ftd2xx download + ${MAKE} -f Makefile.libusb download + .PHONY: linux.buildtest \ linux.easy.buildtest \ linux.ftd2xx_installed \ @@ -88,3 +95,4 @@ linux.ftd2xx_installed.setup + Modified: trunk/testing/build.test1/Makefile.libusb =================================================================== --- trunk/testing/build.test1/Makefile.libusb 2008-12-27 01:30:06 UTC (rev 1276) +++ trunk/testing/build.test1/Makefile.libusb 2008-12-27 01:44:29 UTC (rev 1277) @@ -10,8 +10,8 @@ $(error Please use the win32 specific port of LibUSB not the Unix version) endif -TARFILE_LOCAL = ${VIRGINS}/libusb-${LIBUSB_VERSION}.tar.bz2 -TARFILE_URL = http://downloads.sourceforge.net/libusb/libusb-${LIBUSB_VERSION}.tar.gz +TARFILE_LOCAL = ${VIRGINS}/libusb-${LIBUSB_VERSION_linux}.tar.bz2 +TARFILE_URL = http://downloads.sourceforge.net/libusb/libusb-${LIBUSB_VERSION_linux}.tar.gz LIBUSB_SRC_DIR = ${HERE}/libusb-${LIBUSB_VERSION} LIBUSB_BUILD_DIR = ${HERE}/libusb-build Added: trunk/testing/build.test1/README.TXT =================================================================== --- trunk/testing/build.test1/README.TXT 2008-12-27 01:30:06 UTC (rev 1276) +++ trunk/testing/build.test1/README.TXT 2008-12-27 01:44:29 UTC (rev 1277) @@ -0,0 +1,39 @@ +-- Duane Ellis'es test case for building numerous openocd configurations... +Dec 26,2008 +--------------------------------------------------------------------------- + +1) Make a directory some where.. + + mkdir ~/test + +2) Change to that directory + + cd ~/test + +3) Checkout OpenOCD in that directory. + + cd ~/test + svn co https://svn.berlios.de/svnroot/repos/openocd/trunk openocd + +4) Copy the "build.test1" directory to the "~/work" directory. + + + cd ~/test + cp ~/openocd/testing/build.test1/. ~/test/. + +5) If needed, download various components. + + cd ~/work + make all.download + + +6) For Linux - type: + + cd ~/work + make linux.buildtest + +7) For Cygwin - type: + + cd ~/work + make cygwin.buildtest + Property changes on: trunk/testing/build.test1/README.TXT ___________________________________________________________________ Name: svn:executable + * |
From: <du...@ma...> - 2008-12-27 02:30:12
|
Author: duane Date: 2008-12-27 02:30:06 +0100 (Sat, 27 Dec 2008) New Revision: 1276 Added: trunk/testing/build.test1/ Removed: trunk/testing/build.tests/ Log: Renamed build.tests to build.test1 Copied: trunk/testing/build.test1 (from rev 1275, trunk/testing/build.tests) Property changes on: trunk/testing/build.test1 ___________________________________________________________________ Name: svn:mergeinfo + |
Author: duane Date: 2008-12-27 02:15:50 +0100 (Sat, 27 Dec 2008) New Revision: 1275 Added: trunk/testing/build.tests/ trunk/testing/build.tests/Makefile trunk/testing/build.tests/Makefile.confuse trunk/testing/build.tests/Makefile.ftd2xx trunk/testing/build.tests/Makefile.libftdi trunk/testing/build.tests/Makefile.libusb trunk/testing/build.tests/Makefile.openocd trunk/testing/build.tests/local.uses trunk/testing/build.tests/mingw32_help/ trunk/testing/build.tests/mingw32_help/include/ trunk/testing/build.tests/mingw32_help/include/elf.h trunk/testing/build.tests/mingw32_help/include/sys/ trunk/testing/build.tests/mingw32_help/include/sys/cdefs.h trunk/testing/build.tests/mingw32_help/include/sys/elf32.h trunk/testing/build.tests/mingw32_help/include/sys/elf64.h trunk/testing/build.tests/mingw32_help/include/sys/elf_common.h trunk/testing/build.tests/mingw32_help/include/sys/elf_generic.h Modified: trunk/configure.in trunk/doc/openocd.texi trunk/src/Makefile.am trunk/src/helper/options.c trunk/src/jtag/Makefile.am Log: Build Permutations with ftd2xx and libftdi addressed. Also added a new se of regression makefiles to build openocd in multiple ways Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/configure.in 2008-12-27 01:15:50 UTC (rev 1275) @@ -28,6 +28,133 @@ is_mingw=no is_win32=no +# We are not *ALWAYS* being installed in the standard place. +# We may be installed in a "tool-build" specific location. +# Normally with other packages - as part of a tool distro. +# Thus - we should search that 'libdir' also. +# +# And - if we are being installed there - the odds are +# The libraries unique to what we are are there too. +# +# what matters is the "exec-prefix" +if test $exec_prefix != $ac_default_prefix +then + # use build specific install library dir + LDFLAGS="$LDFLAGS -L$libdir" + # RPATH becomes an issue on Linux only + if test $host_os = linux-gnu + then + LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir" + fi + # The "INCDIR" is also usable + CFLAGS="$CFLAGS -I$includedir" +fi + +AC_ARG_WITH(ftd2xx, + AS_HELP_STRING([--with-ftd2xx=<PATH>],[This option has been removed.]), +[ +# Option Given. +cat << __EOF__ + +The option: --with-ftd2xx=<PATH> has been removed replaced. +On Linux, the new option is: + + --with-ftd2xx-linux-tardir=/path/to/files + +Where <path> is the path the the directory where the "tar.gz" file +from FTDICHIP.COM was unpacked, for example: + + --with-ftd2xx-linux-tardir=/home/duane/libftd2xx-linux-tardir=/home/duane/libftd2xx0.4.16 + +On Cygwin/MingW32, the new option is: + + --with-ftd2xx-win32-zipdir=/path/to/files + +Where <path> is the path to the directory where the "zip" file from +FTDICHIP.COM was unpacked, for example: + + --with-ftd2xx-win32-zipdir=/home/duane/ftd2xx.cdm.files + +__EOF__ + + AC_MSG_ERROR([Sorry Cannot continue]) +], +[ +# Option not given +true +] +) + +#======================================== +# FTD2XXX support comes in 3 forms. +# (1) win32 - via a zip file +# (2) linux - via a tar file +# (3) linux/cygwin/mingw - via libftdi +# +# In case (1) and (2) we need to know where the package was unpacked. + +AC_ARG_WITH(ftd2xx-win32-zipdir, + AS_HELP_STRING([--with-ftd2xx-win32-zipdir],[Where (CYGWIN/MINGW) the zip file from ftdichip.com was unpacked <default=search>]), + [ + # option present + if test -d $with_ftd2xx_win32_zipdir + then + with_ftd2xx_win32_zipdir=`cd $with_ftd2xx_win32_zipdir && pwd` + AC_MSG_NOTICE([Using: ftdichip.com library: $with_ftd2xx_win32_zipdir]) + else + AC_MSG_ERROR([Parameter to --with-ftd2xx-win32-zipdir is not a dir: $with_ftd2xx_win32_zipdir]) + fi + ], + [ + # not given + true + ] +) + + +AC_ARG_WITH(ftd2xx-linux-tardir, + AS_HELP_STRING([--with-ftd2xx-linux-tardir], [Where (Linux/Unix) the tar file from ftdichip.com was unpacked <default=search>]), + [ + # Option present + if test $is_win32 = yes ; then + AC_MSG_ERROR([The option: --with-ftd2xx-linux-tardir is only usable on linux]) + fi + if test -d $with_ftd2xx_linux_tardir + then + with_ftd2xx_linux_tardir=`cd $with_ftd2xx_linux_tardir && pwd` + AC_MSG_NOTICE([Using: ftdichip.com library: $with_ftd2xx_linux_tardir]) + else + AC_MSG_ERROR([Parameter to --with-ftd2xx-linux-tardir is not a dir: $with_ftd2xx_linux_tardir]) + fi + ], + [ + # Not given + true + ] +) + + +AC_ARG_WITH(ftd2xx-lib, + AS_HELP_STRING([--with-ftd2xx-lib], [Use static or shared ftd2xx libs on default static]), +[ +case "$withval" in +static) + with_ftd2xx_lib=$withval + ;; +shared) + with_ftd2xx_lib=$withval + ;; +*) + AC_MSG_ERROR([Option: --with-ftd2xx-lib=static or --with-ftd2xx-lib=shared not, $withval]) + ;; +esac +], +[ + # Default is static - it is simpler :-( + with_ftd2xx_lib=static +] +) + AC_ARG_ENABLE(gccwarnings, AS_HELP_STRING([--enable-gccwarnings], [Enable compiler warnings, default no]), [gcc_warnings=$enableval], [gcc_warnings=no]) @@ -52,11 +179,11 @@ esac AC_ARG_ENABLE(ft2232_libftdi, - AS_HELP_STRING([--enable-ft2232_libftdi], [Enable building support for FT2232 based devices using the libftdi driver]), + AS_HELP_STRING([--enable-ft2232_libftdi], [Enable building support for FT2232 based devices using the libftdi driver, opensource alternate of FTD2XX]), [build_ft2232_libftdi=$enableval], [build_ft2232_libftdi=no]) AC_ARG_ENABLE(ft2232_ftd2xx, - AS_HELP_STRING([--enable-ft2232_ftd2xx], [Enable building support for FT2232 based devices using the FTD2XX driver]), + AS_HELP_STRING([--enable-ft2232_ftd2xx], [Enable building support for FT2232 based devices using the FTD2XX driver from ftdichip.com]), [build_ft2232_ftd2xx=$enableval], [build_ft2232_ftd2xx=no]) AC_ARG_ENABLE(amtjtagaccel, @@ -120,11 +247,6 @@ AS_HELP_STRING([--enable-rlink], [Enable building support for the Raisonance RLink JTAG Programmer]), [build_rlink=$enableval], [build_rlink=no]) -AC_ARG_WITH(ftd2xx, - [AS_HELP_STRING(--with-ftd2xx, - [Where libftd2xx can be found <default=search>])], - [], - with_ftd2xx=search) case $host in *-cygwin*) @@ -296,6 +418,198 @@ AC_DEFINE(BUILD_RLINK, 0, [0 if you don't want the RLink JTAG driver.]) fi +#-- Deal with MingW/Cygwin FTD2XX issues + +if test $is_win32 = yes; then +if test "${with_ftd2xx_linux_tardir+set}" = set +then + AC_MSG_ERROR([The option: with_ftd2xx_linux_tardir is for LINUX only.]) +fi + +if test $build_ft2232_ftd2xx = yes ; then +AC_MSG_CHECKING([for ftd2xx.lib exists (win32)]) + + # if we are given a zipdir... + if test "${with_ftd2xx_win32_zipdir+set}" = set + then + # Set the CFLAGS for "ftd2xx.h" + f=$with_ftd2xx_win32_zipdir/ftd2xx.h + if test ! -f $f ; then + AC_MSG_ERROR([File: $f cannot be found]) + fi + CFLAGS="$CFLAGS -I$with_ftd2xx_win32_zipdir" + + # And calculate the LDFLAGS for the machine + case "$host_cpu" in + i?86|x86_*) + LDFLAGS="$LFLAGS -L$with_ftd2xx_win32_zipdir/i386" + LIBS="$LIBS -lftd2xx" + f=$with_ftd2xx_win32_zipdir/i386/ftd2xx.lib + ;; + amd64) + LDFLAGS="$LFLAGS -L$with_ftd2xx_win32_zipdir/amd64" + LIBS="$LIBS -lftd2xx" + f=$with_ftd2xx_win32_zipdir/amd64/ftd2xx.lib + ;; + *) + AC_MSG_ERROR([Unknown Win32 host cpu: $host_cpu]) + ;; + esac + if test ! -f $f ; then + AC_MSG_ERROR([Library: $f not found]) + fi + else + LIBS="$LIBS -lftd2xx" + AC_MSG_WARN([ASSUMPTION: The (win32) FTDICHIP.COM files: ftd2xx.h and ftd2xx.lib are in a proper place]) + fi +fi +fi + + +if test $is_win32 = no; then + +if test "${with_ftd2xx_win32_zipdir+set}" = set +then + AC_MSG_ERROR([The option: --with-ftd2xx-win32-zipdir is for win32 only]) +fi + +if test $build_ft2232_ftd2xx = yes ; then + AC_MSG_CHECKING([for libftd2xx.a (linux)]) + # Must be linux - + # Cause FTDICHIP does not supply a MAC-OS version + if test $host_os != linux-gnu; then + AC_MSG_ERROR([The (linux) ftd2xx library from FTDICHIP.com is linux only. Try --enable-ft2232-libftdi instead]) + fi + # Are we given a TAR directory? + if test "${with_ftd2xx_linux_tardir+set}" = set + then + # The .H file is simple.. + f=$with_ftd2xx_linux_tardir/ftd2xx.h + if test ! -f $f ; then + AC_MSG_ERROR([Option: --with-ftd2xx-linux-tardir appears wrong, cannot find: $f]) + fi + CFLAGS="$CFLAGS -I$with_ftd2xx_linux_tardir" + if test $with_ftd2xx_lib = shared + then + LDFLAGS="$LDFLAGS -L$with_ftd2xx_linux_tardir" + LIBS="$LIBS -lftd2xx" + AC_MSG_RESULT([ Assuming: -L$with_ftd2xx_linux_tardir -lftd2xx]) + else + # Test #1 - Future proof - if/when ftdichip fixes their distro. + # Try it with the simple ".a" suffix. + f=$with_ftd2xx_linux_tardir/static_lib/libftd2xx.a + if test -f $f ; then + # Yea we are done + LDFLAGS="$LDFLAGS -L$with_ftd2xx_linux_tardir/static_lib" + LIBS="$LIBS -lftd2xx" + else + # Test Number2. + # Grr.. perhaps it exists as a version number? + f="$with_ftd2xx_linux_tardir/static_lib/libftd2xx.a.*.*.*" + count=`ls $f | wc -l` + if test $count -gt 1 ; then + AC_MSG_ERROR([Multiple libftd2xx.a files found in: $with_ftd2xx_linux_tardir/static_lib sorry cannot handle this yet]) + fi + if test $count -ne 1 ; then + AC_MSG_ERROR([Not found: $f, option: --with-ftd2xx-linux-tardir appears to be wrong]) + fi + # Because the "-l" rules do not understand version numbers... + # we will just stuff the absolute path onto the LIBS variable + f=`ls $f` + # + LIBS="$LIBS $f -lpthread" + # No need to bother with LDFLAGS... + fi + AC_MSG_RESULT([Found: $f]) + fi + else + LIBS="$LIBS -lftd2xx" + AC_MSG_RESULT([Assumed: installed]) + AC_MSG_WARN([The (linux) FTDICHIP.COM files ftd2xx.h and libftd2xx.so are assumed to be in a proper place]) + fi +fi +fi + +if test $build_ft2232_ftd2xx = yes; then + +# Before we go any further - make sure we can *BUILD* and *RUN* +# a simple app with the "ftd2xx.lib" file - in what ever form we where given +# We should be able to compile, link and run this test program now + AC_MSG_CHECKING([Test: Build & Link with ftd2xx]) + +# +# Save the LDFLAGS for later.. +LDFLAGS_SAVE=$LDFLAGS +CFLAGS_SAVE=$CFLAGS +_LDFLAGS=`eval echo $LDFLAGS` +_CFLAGS=`eval echo $CFLAGS` +LDFLAGS=$_LDFLAGS +CFLAGS=$_CFLAGS + AC_RUN_IFELSE( +[ +#include "confdefs.h" +#if IS_WIN32 +#include "windows.h" +#endif +#include <stdio.h> +#include <ftd2xx.h> + +int +main( int argc, char **argv ) +{ + DWORD x; + FT_GetLibraryVersion( &x ); + return 0; +} +], [ AC_MSG_RESULT([Success!])] , [ AC_MSG_ERROR([Cannot build & run test program using ftd2xx.lib]) ] ) +LDFLAGS=$LDFLAGS_SAVE +CFLAGS=$CFLAGS_SAVE +fi + +if test $build_ft2232_libftdi = yes ; then + # We assume: the package is preinstalled in the proper place + # these present as 2 libraries.. + LIBS="$LIBS -lftdi -lusb" + # + # Try to build a small program. + AC_MSG_CHECKING([Build & Link with libftdi...]) + +LDFLAGS_SAVE=$LDFLAGS +CFLAGS_SAVE=$CFLAGS +_LDFLAGS=`eval echo $LDFLAGS` +_CFLAGS=`eval echo $CFLAGS` +LDFLAGS=$_LDFLAGS +CFLAGS=$_CFLAGS + + AC_RUN_IFELSE( +[ +#include <stdio.h> +#include <ftdi.h> + +int +main( int argc, char **argv ) +{ + struct ftdi_context *p; + p = ftdi_new(); + if( p != NULL ){ + return 0; + } else { + fprintf( stderr, "calling ftdi_new() failed\n"); + return 1; + } +} +] +, +[ AC_MSG_RESULT([Success]) ] +, +[ AC_MSG_ERROR([Cannot build & run test program using libftdi]) ] ) +# Restore the 'unexpanded ldflags' +LDFLAGS=$LDFLAGS_SAVE +CFLAGS=$CFLAGS_SAVE +fi + + + AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(openocd, 1.0) @@ -321,7 +635,6 @@ AM_CONDITIONAL(IS_CYGWIN, test $is_cygwin = yes) AM_CONDITIONAL(IS_MINGW, test $is_mingw = yes) AM_CONDITIONAL(IS_WIN32, test $is_win32 = yes) -AM_CONDITIONAL(FTD2XXDIR, test $with_ftd2xx != search) AM_CONDITIONAL(BITQ, test $build_bitq = yes) AC_LANG_C @@ -377,6 +690,6 @@ AC_MSG_RESULT([$EXEEXT_FOR_BUILD]) AC_SUBST(EXEEXT_FOR_BUILD) -AC_SUBST(WITH_FTD2XX, $with_ftd2xx) +#AC_SUBST(WITH_FTD2XX, $with_ftd2xx) AC_OUTPUT(Makefile src/Makefile src/helper/Makefile src/jtag/Makefile src/xsvf/Makefile src/target/Makefile src/server/Makefile src/flash/Makefile src/pld/Makefile doc/Makefile) Modified: trunk/doc/openocd.texi =================================================================== --- trunk/doc/openocd.texi 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/doc/openocd.texi 2008-12-27 01:15:50 UTC (rev 1275) @@ -127,11 +127,13 @@ @chapter Building @cindex building OpenOCD +@section Pre-Built Tools If you are interested in getting actual work done rather than building OpenOCD, then check if your interface supplier provides binaries for you. Chances are that that binary is from some SVN version that is more stable than SVN trunk where bleeding edge development takes place. +@section Building From Source You can download the current SVN version with SVN client of your choice from the following repositories: @@ -166,8 +168,7 @@ homepage (@uref{www.amontec.com}), as the JTAGkey uses a non-standard VID/PID. @end itemize -libftdi is supported under windows. Versions earlier than 0.13 will require patching. -see contrib/libftdi for more details. +libftdi is supported under windows. Do not use versions earlier then 0.14. In general, the D2XX driver provides superior performance (several times as fast), but has the draw-back of being binary-only - though that isn't that bad, as it isn't @@ -179,36 +180,38 @@ @end example Bootstrap generates the configure script, and prepares building on your system. @example - ./configure + ./configure [options, see below] @end example Configure generates the Makefiles used to build OpenOCD. @example make + make install @end example -Make builds OpenOCD, and places the final executable in ./src/. +Make builds OpenOCD, and places the final executable in ./src/, the last step, ``make install'' is optional. The configure script takes several options, specifying which JTAG interfaces should be included: @itemize @bullet @item -@option{--enable-parport} +@option{--enable-parport} - Bit bang pc printer ports. @item -@option{--enable-parport_ppdev} +@option{--enable-parport_ppdev} - Parallel Port [see below] @item -@option{--enable-parport_giveio} +@option{--enable-parport_giveio} - Parallel Port [see below] @item -@option{--enable-amtjtagaccel} +@option{--enable-amtjtagaccel} - Parallel Port [Amontec, see below] @item -@option{--enable-ft2232_ftd2xx} -@footnote{Using the latest D2XX drivers from FTDI and following their installation -instructions, I had to use @option{--enable-ft2232_libftd2xx} for OpenOCD to -build properly.} +@option{--enable-ft2232_ftd2xx} - Numerous USB Type ARM JTAG dongles use the FT2232C chip from this FTDICHIP.COM chip (closed source). @item -@option{--enable-ft2232_libftdi} +@option{--enable-ft2232_libftdi} - An open source (free) alternate to FTDICHIP.COM ftd2xx solution (Linux, MacOS, Cygwin) @item -@option{--with-ftd2xx=/path/to/d2xx/} +@option{--with-ftd2xx-win32-zipdir=PATH} - If using FTDICHIP.COM ft2232c, point at the directory where the Win32 FTDICHIP.COM 'CDM' driver zip file was unpacked. @item +@option{--with-ftd2xx-linux-tardir=PATH} - Linux only equal of @option{--with-ftd2xx-win32-zipdir}, where you unpacked the TAR.GZ file. +@item +@option{--with-ftd2xx-lib=shared|static} - Linux only. Default: static, specifies how the FTDICHIP.COM libftd2xx driver should be linked. Note 'static' only works in conjunction with @option{--with-ftd2xx-linux-tardir}. Shared is supported (12/26/2008), however you must manually install the required header files and shared libraries in an appropriate place. This uses ``libusb'' internally. +@item @option{--enable-gw16012} @item @option{--enable-usbprog} @@ -217,24 +220,73 @@ @item @option{--enable-presto_ftd2xx} @item -@option{--enable-jlink} +@option{--enable-jlink} - From SEGGER @item -@option{--enable-rlink} +@option{--enable-rlink} - Raisonance.com dongle. @end itemize +@section Parallel Port Dongles + If you want to access the parallel port using the PPDEV interface you have to specify both the @option{--enable-parport} AND the @option{--enable-parport_ppdev} option since the @option{--enable-parport_ppdev} option actually is an option to the parport driver (see @uref{http://forum.sparkfun.com/viewtopic.php?t=3795} for more info). -Cygwin users have to specify the location of the FTDI D2XX package. This should be an -absolute path containing no spaces. +@section FT2232C Based USB Dongles -Linux users should copy the various parts of the D2XX package to the appropriate -locations, i.e. /usr/include, /usr/lib. +There are 2 methods of using the FTD2232, either (1) using the +FTDICHIP.COM closed source driver, or (2) the open (and free) driver +libftdi. Some claim the (closed) FTDICHIP.COM solution is faster. -Miscellaneous configure options +The FTDICHIP drivers come as either a (win32) ZIP file, or a (linux) +TAR.GZ file. You must unpack them ``some where'' convient. As of this +writing (12/26/2008) FTDICHIP does not supply means to install these +files ``in an appropriate place'' As a result, there are two +``./configure'' options that help. +Below is an example build process: + +1) Check out the latest version of ``openocd'' from SVN. + +2) Download & Unpack either the Windows or Linux FTD2xx Drivers + (@uref{http://www.ftdichip.com/Drivers/D2XX.htm}) + +@example + /home/duane/ftd2xx.win32 => the Cygwin/Win32 ZIP file contents. + /home/duane/libftd2xx0.4.16 => the Linux TAR file contents. +@end example + +3) Configure with these options: + +@example +Cygwin FTCICHIP solution + ./configure --prefix=/home/duane/mytools \ + --enable-ft2232_ftd2xx \ + --with-ftd2xx-win32-zipdir=/home/duane/ftd2xx.win32 + +Linux FTDICHIP solution + ./configure --prefix=/home/duane/mytools \ + --enable-ft2232_ftd2xx \ + --with-ft2xx-linux-tardir=/home/duane/libftd2xx0.4.16 + +Cygwin/Linux LIBFTDI solution + Assumes: + 1a) For Windows: The windows port of LIBUSB is in place. + 1b) For Linux: libusb has been built and is inplace. + + 2) And libftdi has been built and installed + Note: libftdi - relies upon libusb. + + ./configure --prefix=/home/duane/mytools \ + --enable-ft2232_libftdi + +@end example + +4) Then just type ``make'', and perhaps ``make install''. + + +@section Miscellaneous configure options + @itemize @bullet @item @option{--enable-gccwarnings} - enable extra gcc warnings during build Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/src/Makefile.am 2008-12-27 01:15:50 UTC (rev 1275) @@ -55,33 +55,15 @@ endif endif -if IS_WIN32 -if FTD2XXDIR -FTD2XXLDADD = @WITH_FTD2XX@/FTD2XX.lib -else -FTD2XXLDADD = -lftd2xx -endif -else -FTD2XXLDADD = -lftd2xx -endif - -if FT2232_FTD2XX -FTD2XXLIB = $(FTD2XXLDADD) -else -if PRESTO_FTD2XX -FTD2XXLIB = $(FTD2XXLDADD) -else -FTD2XXLIB = -endif -endif + openocd_LDADD = $(top_builddir)/src/xsvf/libxsvf.a \ $(top_builddir)/src/target/libtarget.a $(top_builddir)/src/jtag/libjtag.a \ $(top_builddir)/src/helper/libhelper.a \ $(top_builddir)/src/server/libserver.a $(top_builddir)/src/helper/libhelper.a \ $(top_builddir)/src/flash/libflash.a $(top_builddir)/src/target/libtarget.a \ $(top_builddir)/src/pld/libpld.a \ - $(FTDI2232LIB) $(FTD2XXLIB) $(MINGWLDADD) $(LIBUSB) + $(FTDI2232LIB) $(MINGWLDADD) $(LIBUSB) if HTTPD Modified: trunk/src/helper/options.c =================================================================== --- trunk/src/helper/options.c 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/src/helper/options.c 2008-12-27 01:15:50 UTC (rev 1275) @@ -178,7 +178,8 @@ if (version_flag) { /* Nothing to do, version gets printed automatically. */ - exit(-1); + // It is not an error to request the VERSION number. + exit(0); } return ERROR_OK; Modified: trunk/src/jtag/Makefile.am =================================================================== --- trunk/src/jtag/Makefile.am 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/src/jtag/Makefile.am 2008-12-27 01:15:50 UTC (rev 1275) @@ -1,15 +1,6 @@ -if FTD2XXDIR -if IS_MINGW -FTD2XXINC = -I@WITH_FTD2XX@ -else -FTD2XXINC = -I@WITH_FTD2XX@/ -endif -else -FTD2XXINC = -endif -INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/helper $(FTD2XXINC) $(all_includes) -I$(top_srcdir)/src/target +INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/helper $(all_includes) -I$(top_srcdir)/src/target METASOURCES = AUTO noinst_LIBRARIES = libjtag.a Added: trunk/testing/build.tests/Makefile =================================================================== --- trunk/testing/build.tests/Makefile 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/testing/build.tests/Makefile 2008-12-27 01:15:50 UTC (rev 1275) @@ -0,0 +1,90 @@ +# -*- mode: makefile -*- +# +default: _complain_ +include ./local.uses + +%: _complain_ + + +_complain_: + @echo "" + @echo " Try the target: cygwin.buildtest or linux.buildtest " + @echo "" + +remove.install: + rm -rf ${INSTALL_DIR} + +.PHONY: remove.install + +cygwin.buildtest: + ${MAKE} -f Makefile.ftd2xx clean all + ${MAKE} -f Makefile.openocd cygwin.easy.permutations + ${MAKE} -f Makefile.openocd mingw32.easy.permutations + ${MAKE} -f Makefile.libftdi all + ${MAKE} -f Makefile.openocd cygwin.libftdi + +linux.buildtest: + ${MAKE} linux.easy.buildtest + ${MAKE} linux.ftd2xx_installed + ${MAKE} linux.ft2232_libftdi + @echo "" + @echo "" + @echo "========================================" + @echo " Linux Build Tests Complete " + @echo "========================================" + @echo "" + @echo "" + + +linux.easy.buildtest: + @test -d openocd || (echo "Where the source to openocd?" && exit 1) + ${MAKE} -f Makefile.openocd bootstrap + ${MAKE} -f Makefile.ftd2xx all + ${MAKE} -f Makefile.openocd linux.easy.permutations + +linux.ftd2xx_installed: + ${MAKE} remove.install + ${MAKE} linux.ftd2xx_installed.setup + ${MAKE} -f Makefile.openocd $@ + + linux.ft2232_libftdi: + ${MAKE} remove.install + ${MAKE} -f Makefile.libusb all + ${MAKE} -f Makefile.confuse all + ${MAKE} -f Makefile.libftdi all + ${MAKE} -f Makefile.openocd $@ + +# This target is used to "install" files from +# the FTDICHIP.COM tar.gz unpack directory +# into "a proper place" - where they should be found. +linux.ftd2xx_installed.setup: + mkdir -p ${INSTALL_DIR}/include + mkdir -p ${EXEC_PREFIX}/lib + @# + @# Sanity check - make sure the .H file is findable + @# + @f=$(FTD2XX_LINUX_DIR)/ftd2xx.h && \ + test -f $$f || (echo "Error: $$f not found" ; exit 1) + @# + @# Header files are simple... just copy them. + @# + cp $(FTD2XX_LINUX_DIR)/ftd2xx.h $(PREFIX)/include/. + cp $(FTD2XX_LINUX_DIR)/WinTypes.h $(PREFIX)/include/. + @# + @# .SO files are harder. + @# (1) copy them, (2) make links + @# + cp $(FTD2XX_LINUX_DIR)/libftd2xx.so.$(FTD2XX_LINUX_VERSION) $(EXEC_PREFIX)/lib/. + cd $(EXEC_PREFIX)/lib && rm -f libftd2xx.so.0 + cd $(EXEC_PREFIX)/lib && ln -s libftd2xx.so.$(FTD2XX_LINUX_VERSION) libftd2xx.so.0 + cd $(EXEC_PREFIX)/lib && rm -f libftd2xx.so + cd $(EXEC_PREFIX)/lib && ln -s libftd2xx.so.$(FTD2XX_LINUX_VERSION) libftd2xx.so + + +.PHONY: linux.buildtest \ + linux.easy.buildtest \ + linux.ftd2xx_installed \ + linux.ft22232_libftdi \ + linux.ftd2xx_installed.setup + + Property changes on: trunk/testing/build.tests/Makefile ___________________________________________________________________ Name: svn:executable + * Added: trunk/testing/build.tests/Makefile.confuse =================================================================== --- trunk/testing/build.tests/Makefile.confuse 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/testing/build.tests/Makefile.confuse 2008-12-27 01:15:50 UTC (rev 1275) @@ -0,0 +1,46 @@ +# -*- mode: makefile -*- +default: _complain_ +include ./local.uses + +TARFILE_LOCAL=${VIRGINS}/confuse-${LIBCONFUSE_VERSION}.tar.gz +TARFILE_URL =http://www.intra2net.com/de/produkte/opensource/ftdi/TGZ/confuse-${LIBCONFUSE_VERSION}.tar.gz + +CONFUSE_SRC_DIR =${HERE}/confuse-${LIBCONFUSE_VERSION} +CONFUSE_BUILD_DIR =${HERE}/confuse-build + +download: + wget -O ${TARFILE_LOCAL} ${TARFILE_URL} + +unpack: + rm -rf ${CONFUSE_SRC_DIR} + tar xfz ${TARFILE_LOCAL} + +clean:: + rm -rf ${CONFUSE_SRC_DIR} + +configure: + rm -rf ${CONFUSE_BUILD_DIR} + mkdir ${CONFUSE_BUILD_DIR} + cd ${CONFUSE_BUILD_DIR} && ${CONFUSE_SRC_DIR}/configure \ + --prefix=${PREFIX} \ + --exec-prefix=${EXEC_PREFIX} + +clean:: + rm -rf ${CONFUSE_BUILD_DIR} + +build: + cd ${CONFUSE_BUILD_DIR} && ${MAKE} + +install: + cd ${CONFUSE_BUILD_DIR} && ${MAKE} install + +all: unpack configure build install + +_complain_: + @echo "" + @echo "Please try one of these targets: bootstrap, clean, configure, build, install" + @echo " Or read the makefile and learn about the permutation test targets" + @echo "" + @echo "You also might find the download and unpack targets helpful." + @echo "" + @exit 1 Added: trunk/testing/build.tests/Makefile.ftd2xx =================================================================== --- trunk/testing/build.tests/Makefile.ftd2xx 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/testing/build.tests/Makefile.ftd2xx 2008-12-27 01:15:50 UTC (rev 1275) @@ -0,0 +1,88 @@ +# -*- mode: makefile -*- +# +default: _complain_ + +include ./local.uses + +# WARNING... the file on the ftdi chip site has a SPACE in the filename GRRR!!! +# We fix that with the "-O" option to wget. +ZIPFILE_LOCAL=${VIRGINS}/cdm.${FTD2XX_WIN32_VERSION}.zip +ZIPFILE_URL ="http://www.ftdichip.com/Drivers/CDM/CDM ${FTD2XX_WIN32_VERSION}.zip" + +TARFILE_LOCAL=${VIRGINS}/libftd2xx${FTD2XX_LINUX_VERSION}.tar.gz +TARFILE_URL =http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx${FTD2XX_LINUX_VERSION}.tar.gz + +TARFILE_64_LOCAL=${VIRGINS}/libftd2xx${FTD2XX_LINUX_VERSION}_x86_64.tar.gz +TARFILE_64_URL =http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx${FTD2XX_LINUX_VERSION}_x86_64.tar.gz + + +download.win32: + mkdir -p ${VIRGINS} + wget -O ${ZIPFILE_LOCAL} ${ZIPFILE_URL} + +unpack.win32: + rm -rf ${FTD2XX_WIN32_DIR} + mkdir -p ${FTD2XX_WIN32_DIR} + cd ${FTD2XX_WIN32_DIR} && unzip ${ZIPFILE_LOCAL} + +clean:: + rm -rf ${FTD2XX_WIN32_DIR} + +download.linux: + mkdir -p ${VIRGINS} + wget -O ${TARFILE_LOCAL} ${TARFILE_URL} + +clean:: + rm -rf ${FTD2XX_LINUX_DIR} + +unpack.linux: + rm -rf ${FTD2XX_LINUX_DIR} + mkdir -p ${FTD2XX_LINUX_DIR} + tar xfz ${TARFILE_LOCAL} + +download.linux.x86_64: + mkdir -p ${VIRGINS} + wget -O ${TARFILE_LOCAL} ${TARFILE_URL} + +unpack.linux.x86_64: + rm -rf ${FTD2XX_LINUX_64_DIR} + mkdir -p ${FTD2XX_LINUX_64_DIR} + tar xfz ${TARFILE_64_LOCAL} + +clean:: + rm -rf ${FTD2XX_LINUX_64_DIR} + +download: download.win32 download.linux + +unpack.cygwin unpack.mingw32: unpack.win32 + +unpack: unpack.${BUILD_SYSNAME} + +# Nothing to do here +build: + @echo "Done" + +#Nothing to do here +configure: + @echo "Done" + +# Nothing to do here +install: + @echo "Done" + +all: unpack configure build install + +.PHONY: install + +# Nothing to do here +clean:: + @echo "Done" + +_complain_: + @echo "" + @echo "Please try one of these targets: bootstrap, clean, configure, build, install" + @echo " Or read the makefile and learn about the permutation test targets" + @echo "" + @echo "You also might find the download and unpack targets helpful." + @echo "" + @exit 1 Property changes on: trunk/testing/build.tests/Makefile.ftd2xx ___________________________________________________________________ Name: svn:executable + * Added: trunk/testing/build.tests/Makefile.libftdi =================================================================== --- trunk/testing/build.tests/Makefile.libftdi 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/testing/build.tests/Makefile.libftdi 2008-12-27 01:15:50 UTC (rev 1275) @@ -0,0 +1,51 @@ +# -*- mode: makefile -*- +default: _complain_ +include ./local.uses + +TARFILE_LOCAL = ${VIRGINS}/libftdi-${LIBFTDI_VERSION}.tar.gz +TARFILE_URL = http://www.intra2net.com/de/produkte/opensource/ftdi/TGZ/libftdi-${LIBFTDI_VERSION}.tar.gz + +LIBFTDI_SRC_DIR = ${HERE}/libftdi-${LIBFTDI_VERSION} +LIBFTDI_BUILD_DIR= ${HERE}/libftdi-build + +download: + mkdir -p virgins + wget -O ${TARFILE_LOCAL} ${TARFILE_URL} + +clean:: + rm -rf ${LIBFTDI_SRC_DIR} + +unpack: + tar xf ${TARFILE_LOCAL} + +PATH := ${EXEC_PREFIX}/bin:${PATH} +export PATH + +clean:: + rm -rf ${LIBFTDI_BUILD_DIR} + +configure: + rm -rf ${LIBFTDI_BUILD_DIR} + mkdir -p ${LIBFTDI_BUILD_DIR} + cd ${LIBFTDI_BUILD_DIR} && ${LIBFTDI_SRC_DIR}/configure \ + --prefix=${PREFIX} \ + --exec-prefix=${EXEC_PREFIX} + +build: + cd ${LIBFTDI_BUILD_DIR} && ${MAKE} + +install: + cd ${LIBFTDI_BUILD_DIR} && ${MAKE} install + +all: unpack configure build install + +.PHONY: install + +_complain_: + @echo "" + @echo "Please try one of these targets: bootstrap, clean, configure, build, install" + @echo " Or read the makefile and learn about the permutation test targets" + @echo "" + @echo "You also might find the download and unpack targets helpful." + @echo "" + @exit 1 Property changes on: trunk/testing/build.tests/Makefile.libftdi ___________________________________________________________________ Name: svn:executable + * Added: trunk/testing/build.tests/Makefile.libusb =================================================================== --- trunk/testing/build.tests/Makefile.libusb 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/testing/build.tests/Makefile.libusb 2008-12-27 01:15:50 UTC (rev 1275) @@ -0,0 +1,55 @@ +# -*- mode: makefile -*- +default: _complain_ + +include ./local.uses + +ifeq (x"$BUILD_SYSNAME",x"cygwin") +$(error Please use the Win32 specific port of LibUSB not the Unix version) +endif +ifeq (x"$BUILD_SYSNAME",x"mingw32") +$(error Please use the win32 specific port of LibUSB not the Unix version) +endif + +TARFILE_LOCAL = ${VIRGINS}/libusb-${LIBUSB_VERSION}.tar.bz2 +TARFILE_URL = http://downloads.sourceforge.net/libusb/libusb-${LIBUSB_VERSION}.tar.gz + +LIBUSB_SRC_DIR = ${HERE}/libusb-${LIBUSB_VERSION} +LIBUSB_BUILD_DIR = ${HERE}/libusb-build + +download: + wget -O ${TARFILE_LOCAL} ${TARFILE_URL} + +unpack: + rm -rf ${LIBUSB_SRC_DIR} + tar xfz ${TARFILE_LOCAL} + +clean:: + rm -rf ${LIBUSB_SRC_DIR} + +configure: + rm -rf ${LIBUSB_BUILD_DIR} + mkdir -p ${LIBUSB_BUILD_DIR} + cd ${LIBUSB_BUILD_DIR} && ${LIBUSB_SRC_DIR}/configure \ + --prefix=${PREFIX} --exec-prefix=${EXEC_PREFIX} + +clean:: + rm -rf ${LIBUSB_BUILD_DIR} + +build: + cd ${LIBUSB_BUILD_DIR} && ${MAKE} + +install: + cd ${LIBUSB_BUILD_DIR} && ${MAKE} install + +all: unpack configure build install + +.PHONY: install + +_complain_: + @echo "" + @echo "Please try one of these targets: bootstrap, clean, configure, build, install" + @echo " Or read the makefile and learn about the permutation test targets" + @echo "" + @echo "You also might find the download and unpack targets helpful." + @echo "" + @exit 1 Property changes on: trunk/testing/build.tests/Makefile.libusb ___________________________________________________________________ Name: svn:executable + * Added: trunk/testing/build.tests/Makefile.openocd =================================================================== --- trunk/testing/build.tests/Makefile.openocd 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/testing/build.tests/Makefile.openocd 2008-12-27 01:15:50 UTC (rev 1275) @@ -0,0 +1,193 @@ +# -*- mode: makefile -*- +# +default: _complain_ + +include ./local.uses + + +SRC_DIR ?= $(HERE)/openocd +BUILD_SUFFIX ?= $(BUILD_MACHINE) +BUILD_DIR =$(HERE)/openocd.$(BUILD_SUFFIX) + +checkout: + svn co https://svn.berlios.de/svnroot/repos/openocd/trunk openocd + +remove.install: + rm -rf ${INSTALL_DIR} + +#======================================== +# Win32 Build Permutations +# none +# parport +# ftd2xx - (ftdichip) +# libftd +CONFIG_OPTIONS_win32_none = +CONFIG_OPTIONS_win32_parport = --enable-parport +CONFIG_OPTIONS_win32_ftd2xx = --enable-parport --enable-ft2232_ftd2xx --with-ftd2xx-win32-zipdir=$(FTD2XX_WIN32_DIR) + +CYGWIN_EASY_PERMUTATIONS += none +CYGWIN_EASY_PERMUTATIONS += parport +CYGWIN_EASY_PERMUTATIONS += ftd2xx + +MINGW32_EASY_PERMUTATIONS += none +MINGW32_EASY_PERMUTATIONS += parport +MINGW32_EASY_PERMUTATIONS += ftd2xx + + +# This is not a possible permutation, it is manual :-( +# Why? Because "libftdi" installs things into install/include +# which would efect the 'ftd2xx' win32 build +CONFIG_OPTIONS_win32_libftdi = --enable-parport --enable-ft2232_libftdi + +# Default build for win32... is the ftd2xx type build. +PERMUTE_win32 ?= $(BUILD_SYSNAME)_ftd2xx +CONFIG_OPTIONS_win32 ?= $(CONFIG_OPTIONS_win32_$(PERMUTE_win32)) +CONFIG_OPTIONS_cygwin = $(CONFIG_OPTIONS_win32) +CONFIG_OPTIONS_mingw32 = $(CONFIG_OPTIONS_win32) + +#======================================== +# Linux Build Permuatations +# none +# parport +# ft2232_ftd2xx +# ft2232_libftdi +CONFIG_OPTIONS_linux_none = +LINUX_EASY_PERMUTATIONS += none + +CONFIG_OPTIONS_linux_parport = --enable-parport +LINUX_EASY_PERMUTATIONS += parport + +CONFIG_OPTIONS_linux_ft2232_libftdi = --enable-parport --enable-ft2232-libftdi +#this cannot be done as part of the permutations. +#LINUX_EASY_PERMUTATIONS += ft2232_libftdi + +CONFIG_OPTIONS_linux_ft2232_ftd2xx_static = \ + --enable-parport \ + --enable-ft2232-ftd2xx --with-ftd2xx-lib=static --with-ftd2xx-linux-tardir=$(FTD2XX_LINUX_DIR) +LINUX_EASY_PERMUTATIONS += ft2232_ftd2xx_static + +# this is not a possible permutation it is manual :-( +# why? because it interfers with the other permutations +# by "installing files" in the $(INSTALL_DIR) +CONFIG_OPTIONS_linux_ftd2xx_installed = \ + --enable-parport \ + --enable-ft2232-ftd2xx \ + --with-ftd2xx-lib=shared + +# The default build permutation is +PERMUTE_linux ?= ft2232_ftd2xx_static +CONFIG_OPTIONS_linux = $(CONFIG_OPTIONS_linux_$(PERMUTE_linux)) + +CONFIG_OPTIONS_darwin=\ + --enable-ftd2232-libftdi + +# Which build are we doing? +CONFIG_OPTIONS := $(CONFIG_OPTIONS_$(BUILD_SYSNAME)) + +bootstrap: + cd $(SRC_DIR) && bash ./bootstrap + +clean:: + rm -rf $(BUILD_DIR) + +ifndef CFLAGS +_CFLAGS=true +else +_CFLAGS=export CFLAGS="${CFLAGS}" +endif + + +# if this was given... then pass it on +configure: + @echo " Build Sysname: $(BUILD_SYSNAME)" + @echo " Config Options: $(CONFIG_OPTIONS)" + rm -rf $(BUILD_DIR) + mkdir $(BUILD_DIR) + ${_CFLAGS} && \ + cd $(BUILD_DIR) && \ + $(SRC_DIR)/configure \ + --prefix=$(PREFIX) \ + --exec-prefix=$(EXEC_PREFIX) \ + $(CONFIG_OPTIONS) + +build: + cd $(BUILD_DIR) && $(MAKE) + +install: + cd $(BUILD_DIR) && $(MAKE) install + +all: configure build install + +.PHONY: install + +# The "cygwin.libftdi" requires that libftdi be built +# and installed *PRIOR* to running this target. +# it is not part of the permutations because ... +# it interfers with the ftd2xx based builds +cygwin.libftdi: + $(MAKE) -f Makefile.openocd bootstrap + $(MAKE) BUILD_SUFFIX=$@ PERMUTE_win32=libftdi -f Makefile.openocd all + +cygwin.easy.permutations: remove.install ${CYGWIN_EASY_PERMUTATIONS:%=_cygwin.%} + +_cygwin.%: + @echo "" + @echo "" + @echo "========================================" + @echo "Permutation Build... $@" + @echo "========================================" + @echo "" + @echo "" + $(MAKE) PERMUTE_win32=$* BUILD_SUFFIX=cygwin.$* -f Makefile.openocd all + $(EXEC_PREFIX)/bin/openocd -v + +mingw32.easy.permutations: remove.install ${MINGW32_EASY_PERMUTATIONS:%=_mingw32.%} + +# I (duane) build openocd-mingw32 via Cygwin. +# Sadly, the "mingw32" buid for cygwin does not include +# the required "elf.h" header files... so ... +# we have them in our own private helper place. +_mingw32.%: + @echo "" + @echo "" + @echo "========================================" + @echo "Permutation Build... $@" + @echo "========================================" + @echo "" + @echo "" + CFLAGS="-mno-cygwin -I$(HERE)/mingw32_help/include" \ + $(MAKE) -f Makefile.openocd all ;\ + $(EXEC_PREFIX)/bin/openocd -v + +win32.permutations: mingw32.permutations cygwin.permutations + + +# SMOKE TEST - Build every linux permuation... +# If "openocd -v" does exit(0) we are good enough. + +linux.easy.permutations: remove.install ${LINUX_EASY_PERMUTATIONS:%=_linux.%} + + +_linux.%: + @echo "" + @echo "" + @echo "========================================" + @echo "Permutation Build... $@" + @echo "========================================" + @echo "" + @echo "" + $(MAKE) PERMUTE_linux=$* BUILD_SUFFIX=linux.$* -f Makefile.openocd all + $(EXEC_PREFIX)/bin/openocd -v + +linux.ftd2xx_installed: + ${MAKE} -f Makefile.openocd _$@ + +linux.ft2232_libftdi: + ${MAKE} -f Makefile.openocd _$@ + +_complain_: + @echo "" + @echo "Please try one of these targets: bootstrap, clean, configure, build, install" + @echo " Or read the makefile and learn about the permutation test targets" + @echo "" + @exit 1 Property changes on: trunk/testing/build.tests/Makefile.openocd ___________________________________________________________________ Name: svn:executable + * Added: trunk/testing/build.tests/local.uses =================================================================== --- trunk/testing/build.tests/local.uses 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/testing/build.tests/local.uses 2008-12-27 01:15:50 UTC (rev 1275) @@ -0,0 +1,39 @@ +# -*- mode: makefile -*- +HERE := $(shell pwd) + +# Solve problems on systems with DASH.. Grrr... +SHELL=/bin/bash +export SHELL + +VIRGINS=${HERE}/virgins + +# Determine the build platform. +BUILD_SYSNAME_Linux =linux +BUILD_SYSNAME_linux =linux +BUILD_SYSNAME_CYGWIN_NT =cygwin +BUILD_SYSNAME_MINGW32_NT =mingw32 +BUILD_SYSNAME_Darwin =darwin +BUILD_SYSNAME_darwin =darwin +BUILD_SYSNAME :=$(BUILD_SYSNAME_$(shell uname --sysname | cut -d'-' -f1)) + +# And machine (ie: i686, x86_64, or what) +BUILD_MACHINE :=$(BUILD_SYSNAME).$(shell uname -m) + + +INSTALL_DIR := $(HERE)/install +PREFIX := ${INSTALL_DIR} +EXEC_PREFIX := ${INSTALL_DIR}/${BUILD_MACHINE} + +LIBFTDI_VERSION=0.14 +LIBCONFUSE_VERSION=2.5 + +LIBUSB_VERSION_linux=0.1.12 + +LIBUSB_VERSION=${LIBUSB_VERSION_${BUILD_SYSNAME}} + +FTD2XX_WIN32_VERSION=2.04.14 +FTD2XX_WIN32_DIR = ${HERE}/ftd2xx.win32 + +FTD2XX_LINUX_VERSION=0.4.16 +FTD2XX_LINUX_DIR = ${HERE}/libftd2xx${FTD2XX_LINUX_VERSION} +FTD2XX_LINUX_64_DIR = ${HERE}/libftd2xx${FTD2XX_LINUX_VERSION}_x86_64 Property changes on: trunk/testing/build.tests/local.uses ___________________________________________________________________ Name: svn:executable + * Added: trunk/testing/build.tests/mingw32_help/include/elf.h =================================================================== --- trunk/testing/build.tests/mingw32_help/include/elf.h 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/testing/build.tests/mingw32_help/include/elf.h 2008-12-27 01:15:50 UTC (rev 1275) @@ -0,0 +1,38 @@ +/* elf.h + + Copyright 2005 Red Hat, Inc. + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#ifndef _ELF_H_ +#define _ELF_H_ + +#include <stdint.h> + +typedef signed char int8_t; +typedef unsigned char u_int8_t; +typedef short int16_t; +typedef unsigned short u_int16_t; +typedef int int32_t; +typedef unsigned int u_int32_t; +typedef long long int64_t; +typedef unsigned long long u_int64_t; +typedef int32_t register_t; + + +#ifdef __cplusplus +extern "C" { +#endif +#include <sys/types.h> +#include <sys/elf32.h> +#include <sys/elf64.h> +#include <sys/elf_generic.h> +#ifdef __cplusplus +} +#endif + +#endif /*_ELF_H_*/ Property changes on: trunk/testing/build.tests/mingw32_help/include/elf.h ___________________________________________________________________ Name: svn:executable + * Added: trunk/testing/build.tests/mingw32_help/include/sys/cdefs.h =================================================================== --- trunk/testing/build.tests/mingw32_help/include/sys/cdefs.h 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/testing/build.tests/mingw32_help/include/sys/cdefs.h 2008-12-27 01:15:50 UTC (rev 1275) @@ -0,0 +1,23 @@ +/* sys/cdefs.h + + Copyright 1998, 2000, 2001 Red Hat, Inc. + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#ifndef _SYS_CDEFS_H +#define _SYS_CDEFS_H +#ifdef __cplusplus +#define __BEGIN_DECLS extern "C" { +#define __END_DECLS } +#else +#define __BEGIN_DECLS +#define __END_DECLS +#endif +#define __P(protos) protos /* full-blown ANSI C */ +#define __CONCAT(__x,__y) __x##__y +#endif + Property changes on: trunk/testing/build.tests/mingw32_help/include/sys/cdefs.h ___________________________________________________________________ Name: svn:executable + * Added: trunk/testing/build.tests/mingw32_help/include/sys/elf32.h =================================================================== --- trunk/testing/build.tests/mingw32_help/include/sys/elf32.h 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/testing/build.tests/mingw32_help/include/sys/elf32.h 2008-12-27 01:15:50 UTC (rev 1275) @@ -0,0 +1,156 @@ +/*- + * Copyright (c) 1996-1998 John D. Polstra. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/sys/sys/elf32.h,v 1.8 2002/05/30 08:32:18 dfr Exp $ + */ + +#ifndef _SYS_ELF32_H_ +#define _SYS_ELF32_H_ 1 + +#include <sys/elf_common.h> + +/* + * ELF definitions common to all 32-bit architectures. + */ + +typedef u_int32_t Elf32_Addr; +typedef u_int16_t Elf32_Half; +typedef u_int32_t Elf32_Off; +typedef int32_t Elf32_Sword; +typedef u_int32_t Elf32_Word; +typedef u_int32_t Elf32_Size; +typedef Elf32_Off Elf32_Hashelt; + +/* + * ELF header. + */ + +typedef struct { + unsigned char e_ident[EI_NIDENT]; /* File identification. */ + Elf32_Half e_type; /* File type. */ + Elf32_Half e_machine; /* Machine architecture. */ + Elf32_Word e_version; /* ELF format version. */ + Elf32_Addr e_entry; /* Entry point. */ + Elf32_Off e_phoff; /* Program header file offset. */ + Elf32_Off e_shoff; /* Section header file offset. */ + Elf32_Word e_flags; /* Architecture-specific flags. */ + Elf32_Half e_ehsize; /* Size of ELF header in bytes. */ + Elf32_Half e_phentsize; /* Size of program header entry. */ + Elf32_Half e_phnum; /* Number of program header entries. */ + Elf32_Half e_shentsize; /* Size of section header entry. */ + Elf32_Half e_shnum; /* Number of section header entries. */ + Elf32_Half e_shstrndx; /* Section name strings section. */ +} Elf32_Ehdr; + +/* + * Section header. + */ + +typedef struct { + Elf32_Word sh_name; /* Section name (index into the + section header string table). */ + Elf32_Word sh_type; /* Section type. */ + Elf32_Word sh_flags; /* Section flags. */ + Elf32_Addr sh_addr; /* Address in memory image. */ + Elf32_Off sh_offset; /* Offset in file. */ + Elf32_Size sh_size; /* Size in bytes. */ + Elf32_Word sh_link; /* Index of a related section. */ + Elf32_Word sh_info; /* Depends on section type. */ + Elf32_Size sh_addralign; /* Alignment in bytes. */ + Elf32_Size sh_entsize; /* Size of each entry in section. */ +} Elf32_Shdr; + +/* + * Program header. + */ + +typedef struct { + Elf32_Word p_type; /* Entry type. */ + Elf32_Off p_offset; /* File offset of contents. */ + Elf32_Addr p_vaddr; /* Virtual address in memory image. */ + Elf32_Addr p_paddr; /* Physical address (not used). */ + Elf32_Size p_filesz; /* Size of contents in file. */ + Elf32_Size p_memsz; /* Size of contents in memory. */ + Elf32_Word p_flags; /* Access permission flags. */ + Elf32_Size p_align; /* Alignment in memory and file. */ +} Elf32_Phdr; + +/* + * Dynamic structure. The ".dynamic" section contains an array of them. + */ + +typedef struct { + Elf32_Sword d_tag; /* Entry type. */ + union { + Elf32_Size d_val; /* Integer value. */ + Elf32_Addr d_ptr; /* Address value. */ + } d_un; +} Elf32_Dyn; + +/* + * Relocation entries. + */ + +/* Relocations that don't need an addend field. */ +typedef struct { + Elf32_Addr r_offset; /* Location to be relocated. */ + Elf32_Word r_info; /* Relocation type and symbol index. */ +} Elf32_Rel; + +/* Relocations that need an addend field. */ +typedef struct { + Elf32_Addr r_offset; /* Location to be relocated. */ + Elf32_Word r_info; /* Relocation type and symbol index. */ + Elf32_Sword r_addend; /* Addend. */ +} Elf32_Rela; + +/* Macros for accessing the fields of r_info. */ +#define ELF32_R_SYM(info) ((info) >> 8) +#define ELF32_R_TYPE(info) ((unsigned char)(info)) + +/* Macro for constructing r_info from field values. */ +#define ELF32_R_INFO(sym, type) (((sym) << 8) + (unsigned char)(type)) + +/* + * Symbol table entries. + */ + +typedef struct { + Elf32_Word st_name; /* String table index of name. */ + Elf32_Addr st_value; /* Symbol value. */ + Elf32_Size st_size; /* Size of associated object. */ + unsigned char st_info; /* Type and binding information. */ + unsigned char st_other; /* Reserved (not used). */ + Elf32_Half st_shndx; /* Section index of symbol. */ +} Elf32_Sym; + +/* Macros for accessing the fields of st_info. */ +#define ELF32_ST_BIND(info) ((info) >> 4) +#define ELF32_ST_TYPE(info) ((info) & 0xf) + +/* Macro for constructing st_info from field values. */ +#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) + +#endif /* !_SYS_ELF32_H_ */ Property changes on: trunk/testing/build.tests/mingw32_help/include/sys/elf32.h ___________________________________________________________________ Name: svn:executable + * Added: trunk/testing/build.tests/mingw32_help/include/sys/elf64.h =================================================================== --- trunk/testing/build.tests/mingw32_help/include/sys/elf64.h 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/testing/build.tests/mingw32_help/include/sys/elf64.h 2008-12-27 01:15:50 UTC (rev 1275) @@ -0,0 +1,172 @@ +/*- + * Copyright (c) 1996-1998 John D. Polstra. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/sys/sys/elf64.h,v 1.10 2002/05/30 08:32:18 dfr Exp $ + */ + +#ifndef _SYS_ELF64_H_ +#define _SYS_ELF64_H_ 1 + +#include <sys/elf_common.h> + +/* + * ELF definitions common to all 64-bit architectures. + */ + +typedef uint64_t Elf64_Addr; +typedef uint16_t Elf64_Half; +typedef uint32_t Elf64_Word; +typedef int32_t Elf64_Sword; +typedef uint64_t Elf64_Xword; +typedef int64_t Elf64_Sxword; +typedef uint64_t Elf64_Off; +typedef uint16_t Elf64_Section; +typedef Elf64_Half Elf64_Versym; +typedef uint16_t Elf64_Quarter; + +/* + * Types of dynamic symbol hash table bucket and chain elements. + * + * This is inconsistent among 64 bit architectures, so a machine dependent + * typedef is required. + */ + +#ifdef __alpha__ +typedef Elf64_Off Elf64_Hashelt; +#else +typedef Elf64_Half Elf64_Hashelt; +#endif + +/* + * ELF header. + */ + +typedef struct { + unsigned char e_ident[EI_NIDENT]; /* File identification. */ + Elf64_Half e_type; /* File type. */ + Elf64_Half e_machine; /* Machine architecture. */ + Elf64_Word e_version; /* ELF format version. */ + Elf64_Addr e_entry; /* Entry point. */ + Elf64_Off e_phoff; /* Program header file offset. */ + Elf64_Off e_shoff; /* Section header file offset. */ + Elf64_Word e_flags; /* Architecture-specific flags. */ + Elf64_Half e_ehsize; /* Size of ELF header in bytes. */ + Elf64_Half e_phentsize; /* Size of program header entry. */ + Elf64_Half e_phnum; /* Number of program header entries. */ + Elf64_Half e_shentsize; /* Size of section header entry. */ + Elf64_Half e_shnum; /* Number of section header entries. */ + Elf64_Half e_shstrndx; /* Section name strings section. */ +} Elf64_Ehdr; + +/* + * Section header. + */ + +typedef struct { + Elf64_Word sh_name; /* Section name (index into the + section header string table). */ + Elf64_Word sh_type; /* Section type. */ + Elf64_Xword sh_flags; /* Section flags. */ + Elf64_Addr sh_addr; /* Address in memory image. */ + Elf64_Off sh_offset; /* Offset in file. */ + Elf64_Xword sh_size; /* Size in bytes. */ + Elf64_Word sh_link; /* Index of a related section. */ + Elf64_Word sh_info; /* Depends on section type. */ + Elf64_Xword sh_addralign; /* Alignment in bytes. */ + Elf64_Xword sh_entsize; /* Size of each entry in section. */ +} Elf64_Shdr; + +/* + * Program header. + */ + +typedef struct { + Elf64_Word p_type; /* Entry type. */ + Elf64_Word p_flags; /* Access permission flags. */ + Elf64_Off p_offset; /* File offset of contents. */ + Elf64_Addr p_vaddr; /* Virtual address in memory image. */ + Elf64_Addr p_paddr; /* Physical address (not used). */ + Elf64_Xword p_filesz; /* Size of contents in file. */ + Elf64_Xword p_memsz; /* Size of contents in memory. */ + Elf64_Xword p_align; /* Alignment in memory and file. */ +} Elf64_Phdr; + +/* + * Dynamic structure. The ".dynamic" section contains an array of them. + */ + +typedef struct { + Elf64_Sxword d_tag; /* Entry type. */ + union { + Elf64_Xword d_val; /* Integer value. */ + Elf64_Addr d_ptr; /* Address value. */ + } d_un; +} Elf64_Dyn; + +/* + * Relocation entries. + */ + +/* Relocations that don't need an addend field. */ +typedef struct { + Elf64_Addr r_offset; /* Location to be relocated. */ + Elf64_Xword r_info; /* Relocation type and symbol index. */ +} Elf64_Rel; + +/* Relocations that need an addend field. */ +typedef struct { + Elf64_Addr r_offset; /* Location to be relocated. */ + Elf64_Xword r_info; /* Relocation type and symbol index. */ + Elf64_Sxword r_addend; /* Addend. */ +} Elf64_Rela; + +/* Macros for accessing the fields of r_info. */ +#define ELF64_R_SYM(info) ((info) >> 32) +#define ELF64_R_TYPE(info) ((unsigned char)(info)) + +/* Macro for constructing r_info from field values. */ +#define ELF64_R_INFO(sym, type) (((sym) << 32) + (unsigned char)(type)) + +/* + * Symbol table entries. + */ + +typedef struct { + Elf64_Word st_name; /* String table index of name. */ + unsigned char st_info; /* Type and binding information. */ + unsigned char st_other; /* Reserved (not used). */ + Elf64_Section st_shndx; /* Section index of symbol. */ + Elf64_Addr st_value; /* Symbol value. */ + Elf64_Xword st_size; /* Size of associated object. */ +} Elf64_Sym; + +/* Macros for accessing the fields of st_info. */ +#define ELF64_ST_BIND(info) ((info) >> 4) +#define ELF64_ST_TYPE(info) ((info) & 0xf) + +/* Macro for constructing st_info from field values. */ +#define ELF64_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) + +#endif /* !_SYS_ELF64_H_ */ Property changes on: trunk/testing/build.tests/mingw32_help/include/sys/elf64.h ___________________________________________________________________ Name: svn:executable + * Added: trunk/testing/build.tests/mingw32_help/include/sys/elf_common.h =================================================================== --- trunk/testing/build.tests/mingw32_help/include/sys/elf_common.h 2008-12-24 23:22:22 UTC (rev 1274) +++ trunk/testing/build.tests/mingw32_help/include/sys/elf_common.h 2008-12-27 01:15:50 UTC (rev 1275) @@ -0,0 +1,299 @@ +/*- + * Copyright (c) 1998 John D. Polstra. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/sys/sys/elf_common.h,v 1.15 2004/05/05 02:38:54 marcel Exp $ + */ + +#ifndef _SYS_ELF_COMMON_H_ +#define _SYS_ELF_COMMON_H_ 1 + +/* + * ELF definitions that are independent of architecture or word size. + */ + +/* + * Note header. The ".note" section contains an array of notes. Each + * begins with this header, aligned to a word boundary. Immediately + * following the note header is n_namesz bytes of name, padded to the + * next word boundary. Then comes n_descsz bytes of descriptor, again + * padded to a word boundary. The values of n_namesz and n_descsz do + * not include the padding. + */ + +typedef struct { + u_int32_t n_namesz; /* Length of name. */ + u_int32_t n_descsz; /* Length of descriptor. */ + u_int32_t n_type; /* Type of this note. */ +} Elf_Note; + +/* Indexes into the e_ident array. Keep synced with + http://www.sco.com/developer/gabi/ch4.eheader.html */ +#define EI_MAG0 0 /* Magic number, byte 0. */ +#define EI_MAG1 1 /* Magic number, byte 1. */ +#define EI_MAG2 2 /* Magic number, byte 2. */ +#define EI_MAG3 3 /* Magic number, byte 3. */ +#define EI_CLASS 4 /* Class of machine. */ +#define EI_DATA 5 /* Data format. */ +#define EI_VERSION 6 /* ELF format version. */ +#define EI_OSABI 7 /* Operating system / ABI identification */ +#define EI_ABIVERSION 8 /* ABI version */ +#define OLD_EI_BRAND 8 /* Start of architecture identification. */ +#define EI_PAD 9 /* Start of padding (per SVR4 ABI). */ +#define EI_NIDENT 16 /* Size of e_ident array. */ + +/* Values for the magic number bytes. */ +#define ELFMAG0 0x7f +#define ELFMAG1 'E' +#define ELFMAG2 'L' +#define ELFMAG3 'F' +#define ELFMAG "\177ELF" /* magic string */ +#define SELFMAG 4 /* magic string size */ + +/* Values for e_ident[EI_VERSION] and e_version. */ +#define EV_NONE 0 +#define EV_CURRENT 1 + +/* Values for e_ident[EI_CLASS]. */ +#define ELFCLASSNONE 0 /* Unknown class. */ +#define ELFCLASS32 1 /* 32-bit architecture. */ +#define ELFCLASS64 2 /* 64-bit architecture. */ + +/* Values for e_ident[EI_DATA]. */ +#define ELFDATANONE 0 /* Unknown data format. */ +#define ELFDATA2LSB 1 /* 2's complement little-endian. */ +#define ELFDATA2MSB 2 /* 2's complement big-endian. */ + +/* Values for e_ident[EI_OSABI]. */ +#define ELFOSABI_SYSV 0 /* UNIX System V ABI */ +#define ELFOSABI_NONE ELFOSABI_SYSV /* symbol used in old spec */ +#define ELFOSABI_HPUX 1 /* HP-UX operating system */ +#define ELFOSABI_NETBSD 2 /* NetBSD */ +#define ELFOSABI_LINUX 3 /* GNU/Linux */ +#define ELFOSABI_HURD 4 /* GNU/Hurd */ +#define ELFOSABI_86OPEN 5 /* 86Open common IA32 ABI */ +#define ELFOSABI_SOLARIS 6 /* Solaris */ +#define ELFOSABI_MONTEREY 7 /* Monterey */ +#define ELFOSABI_IRIX 8 /* IRIX */ +#define ELFOSABI_FREEBSD 9 /* FreeBSD */ +#define ELFOSABI_TRU64 10 /* TRU64 UNIX */ +#define ELFOSABI_MODESTO 11 /* Novell Modesto */ +#define ELFOSABI_OPENBSD 12 /* OpenBSD */ +#define ELFOSABI_ARM 97 /* ARM */ +#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ + +/* e_ident */ +#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \ + (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \ + (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \ + (ehdr).e_ident[EI_MAG3] == ELFMAG3) + +/* Values for e_type. */ +#define ET_NONE 0 /* Unknown type. */ +#define ET_REL 1 /* Relocatable. */ +#define ET_EXEC 2 /* Executable. */ +#define ET_DYN 3 /* Shared object. */ +#define ET_CORE 4 /* Core file. */ + +/* Values for e_machine. */ +#define EM_NONE 0 /* Unknown machine. */ +#define EM_M32 1 /* AT&T WE32100. */ +#define EM_SPARC 2 /* Sun SPARC. */ +#define EM_386 3 /* Intel i386. */ +#define EM_68K 4 /* Motorola 68000. */ +#define EM_88K 5 /* Motorola 88000. */ +#define EM_486 6 /* Intel i486. */ +#define EM_860 7 /* Intel i860. */ +#define EM_MIPS 8 /* MIPS R3000 Big-Endian only */ + +/* Extensions. This list is not complete. */ +#define EM_S370 9 /* IBM System/370 */ +#define EM_MIPS_RS4_BE 10 /* MIPS R4000 Big-Endian */ /* Depreciated */ +#define EM_PARISC 15 /* HPPA */ +#define EM_SPARC32PLUS 18 /* SPARC v8plus */ +#define EM_PPC 20 /* PowerPC 32-bit */ +#define EM_PPC64 21 /* PowerPC 64-bit */ +#define EM_ARM 40 /* ARM */ +#define EM_SPARCV9 43 /* SPARC v9 64-bit */ +#define EM_IA_64 50 /* Intel IA-64 Processor */ +#define EM_X86_64 62 /* Advanced Micro Devices x86-64 */ +#define EM_ALPHA 0x9026 /* Alpha (written in the absence of an ABI */ + +/* Special section indexes. */ +#define SHN_UNDEF 0 /* Undefined, missing, irrelevant. */ +#define SHN_LORESERVE 0xff00 /* First of reserved range. */ +#define SHN_LOPROC 0xff00 /* First processor-specific. */ +#define SHN_HIPROC 0xff1f /* Last processor-specific. */ +#define SHN_ABS 0xfff1 /* Absolute values. */ +#define SHN_COMMON 0xfff2 /* Common data. */ +#define SHN_HIRESERVE 0xffff /* Last of reserved range. */ + +/* sh_type */ +#define SHT_NULL 0 /* inactive */ +#define SHT_PROGBITS 1 /* program defined information */ +#define SHT_SYMTAB 2 /* symbol table section */ +#define SHT_STRTAB 3 /* string table section */ +#define SHT_RELA 4 /* relocation section with addends */ +#define SHT_H... [truncated message content] |
From: <du...@ma...> - 2008-12-25 00:22:25
|
Author: duane Date: 2008-12-25 00:22:22 +0100 (Thu, 25 Dec 2008) New Revision: 1274 Modified: trunk/src/target/target/str710.cfg trunk/src/target/target/str730.cfg trunk/src/target/target/str750.cfg Log: Typos found by miceal catudal Modified: trunk/src/target/target/str710.cfg =================================================================== --- trunk/src/target/target/str710.cfg 2008-12-23 12:52:14 UTC (rev 1273) +++ trunk/src/target/target/str710.cfg 2008-12-24 23:22:22 UTC (rev 1274) @@ -24,7 +24,7 @@ #jtag scan chain -tag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0x0f -expected-id $_CPUTAPID +jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0x0f -expected-id $_CPUTAPID set _TARGETNAME [format "%s.cpu" $_CHIPNAME] target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi Modified: trunk/src/target/target/str730.cfg =================================================================== --- trunk/src/target/target/str730.cfg 2008-12-23 12:52:14 UTC (rev 1273) +++ trunk/src/target/target/str730.cfg 2008-12-24 23:22:22 UTC (rev 1274) @@ -25,7 +25,7 @@ reset_config trst_and_srst srst_pulls_trst #jtag scan chain -tag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0x0f -expected-id $_CPUTAPID +jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0x0f -expected-id $_CPUTAPID #jtag nTRST and nSRST delay jtag_nsrst_delay 500 Modified: trunk/src/target/target/str750.cfg =================================================================== --- trunk/src/target/target/str750.cfg 2008-12-23 12:52:14 UTC (rev 1273) +++ trunk/src/target/target/str750.cfg 2008-12-24 23:22:22 UTC (rev 1274) @@ -27,7 +27,7 @@ #jtag scan chain -tag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0x0f -expected-id $_CPUTAPID +jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0x0f -expected-id $_CPUTAPID #jtag nTRST and nSRST delay jtag_nsrst_delay 500 |
From: ntfreak at B. <nt...@ma...> - 2008-12-23 13:52:22
|
Author: ntfreak Date: 2008-12-23 13:52:14 +0100 (Tue, 23 Dec 2008) New Revision: 1273 Modified: trunk/src/server/httpd/Stylizer.class trunk/src/server/httpd/Stylizer.java trunk/src/server/httpd/browsemem.tcl trunk/src/server/httpd/build.sh trunk/src/server/httpd/downloadmem.tcl trunk/src/server/httpd/editconfigs.tcl trunk/src/server/httpd/editfile.tcl trunk/src/server/httpd/erase.tcl trunk/src/server/httpd/flash.tcl trunk/src/server/httpd/flashinfo.tcl trunk/src/server/httpd/guiupload.tcl trunk/src/server/httpd/html2tcl.sh trunk/src/server/httpd/httpd.tcl trunk/src/server/httpd/index.tcl trunk/src/server/httpd/log.tcl trunk/src/server/httpd/menu.xml trunk/src/server/httpd/menu.xsl trunk/src/server/httpd/menu_cuts/center_bottom.png trunk/src/server/httpd/menu_cuts/center_top.png trunk/src/server/httpd/menu_cuts/h_tab1.png trunk/src/server/httpd/menu_cuts/h_tab1_selected.png trunk/src/server/httpd/menu_cuts/h_tab2.png trunk/src/server/httpd/menu_cuts/h_tab2_selected.png trunk/src/server/httpd/menu_cuts/h_tab_free.png trunk/src/server/httpd/menu_cuts/logo_bottom.png trunk/src/server/httpd/menu_cuts/logo_top.png trunk/src/server/httpd/menu_cuts/right_bottom.png trunk/src/server/httpd/menu_cuts/right_top.png trunk/src/server/httpd/menu_cuts/right_top_small.png trunk/src/server/httpd/menu_cuts/top_right.png trunk/src/server/httpd/menu_cuts/v_1.png trunk/src/server/httpd/menu_cuts/v_2_tile.png trunk/src/server/httpd/menu_cuts/v_3.png trunk/src/server/httpd/menu_cuts/v_tab.png trunk/src/server/httpd/menu_cuts/v_tab_selected.png trunk/src/server/httpd/menuweb.css trunk/src/server/httpd/openocd.tcl trunk/src/server/httpd/preconfig.tcl trunk/src/server/httpd/production.tcl trunk/src/server/httpd/readme.txt trunk/src/server/httpd/reload.tcl trunk/src/server/httpd/run.tcl trunk/src/server/httpd/support.tcl trunk/src/server/httpd/targets.tcl trunk/src/server/httpd/terminal.tcl trunk/src/server/httpd/upgrade.tcl Log: - add missing svn props from r1270 commit - change mime-type for png files to image/png Property changes on: trunk/src/server/httpd/Stylizer.class ___________________________________________________________________ Name: svn:executable + * Property changes on: trunk/src/server/httpd/Stylizer.java ___________________________________________________________________ Name: svn:executable + * Modified: trunk/src/server/httpd/browsemem.tcl =================================================================== --- trunk/src/server/httpd/browsemem.tcl 2008-12-23 08:52:02 UTC (rev 1272) +++ trunk/src/server/httpd/browsemem.tcl 2008-12-23 12:52:14 UTC (rev 1273) @@ -1,454 +1,454 @@ -# converted to .tcl by html2tcl.tcl -set buffer "" -append buffer { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <html xmlns="http://www.w3.org/TR/REC-html40"> -<head> -<title>OpenOCD debugger</title> -<meta charset="utf-8" content="text/html" http-equiv="Content-Type"/> -<link type="text/css" rel="stylesheet" href="menuweb.css"/> -</head> -} - - set console "" - set upload_filename /ram/upload - -append buffer { -<body style="margin:0px;"> -<div style="width:974px;height:85px;"> -<div style="float:left;position:relative;left:32px;width:478px;"> -<a href="/"> - OpenOCD - </a> -</div> -<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('menu_cuts/top_right.png');"> -<div style="position:relative;left:15px;top:4px;" class="textlight"> -} -append buffer [capture version] -append buffer { -</div> -</div> -</div> -<table style="padding:0px;border-collapse:collapse;"> -<tr> -<td style="width:33px;"> -<div style="width:20px;height:510px;"> - - </div> -</td> -<td style="vertical-align:top;height:100%;width:140px;padding:0px;"> -<table style="padding:0px;border-collapse:collapse;height:100%;width:140px;"> -<tr style="height:59px;"> -<td/> -</tr> -<tr> -<td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab_selected.png');background-repeat: no-repeat;"> -<div style="position:relative;left:10px;top:10px;font-weight:bold;"> -<a href="browsemem.tcl" style="font-weight: bold;">Browse / Edit</a> -</div> -</td> -</tr> -<tr> -<td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;"> -<div style="position:relative;left:10px;top:10px;font-weight:bold;"> -<a href="downloadmem.tcl" style="">Download</a> -</div> -</td> -</tr> -<tr> -<td style="width:140px;height:35px;background-image:url('menu_cuts/v_1.png')"/> -</tr> -<tr> -<td style="width:140px;background-image:url('menu_cuts/v_2_tile.png')"/> -</tr> -<tr> -<td style="width:140px;height:140px;background-image:url('menu_cuts/v_3.png')"/> -</tr> -</table> -</td> -<td style="vertical-align:top;padding:0px;height:100%"> -<table style="padding:0px;border-collapse:collapse;height:100%;"> -<tr> -<td> -<table style="padding:0px;border-collapse:collapse;"> -<tr> -<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;"> -<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> -<a href="index.tcl">Config Target</a> -</div> -</td> -<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;"> -<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> -<a href="flashinfo.tcl">Flash</a> -</div> -</td> -<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1_selected.png');background-repeat: no-repeat;"> -<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> -<a href="browsemem.tcl" style="font-weight: bold;">Memory</a> -</div> -</td> -<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;"> -<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> -<a href="openocd.tcl">OpenOCD</a> -</div> -</td> -</tr> -</table> -</td> -</tr> -<tr> -<td style="height:30px;width:535px;background-image:url('menu_cuts/center_top.png');background-repeat: no-repeat;background-position:top right;" colspan="6"> -<div style="width:500px;background-color:#ffffff;height:100%;"> - - </div> -</td> -</tr> -<tr> -<td style="background-color:#ffffff;text-indent:30px;height:40px;" colspan="6"> -<H1>Browse / Edit Memory</H1> -</td> -</tr> -<tr style="height:100%;"> -<td style="background-color:#ffffff;padding-left:30px;padding-right:30px;width=535px;height:100%;" colspan="6"> - - - - } - - - set form_address [formfetch form_address] - set form_length [formfetch form_length] - set form_type [formfetch form_type] - set form_action [formfetch form_action] - set form_value [formfetch form_value] - - if {[string compare $form_length ""]==0} { - set form_length 0 - } - if {$form_length<=0} { - set form_length 0x80 - } - if {$form_length>0x1000} { - set form_length 0x1000 - } - - if {[string compare $form_type ""]==0} { - set form_type mdw - } - - if {[string compare $form_type "mdw"]==0} { - set wordsize 4 - set modify_cmd mww - } - if {[string compare $form_type "mdh"]==0} { - set wordsize 2 - set modify_cmd mwh - } - if {[string compare $form_type "mdb"]==0} { - set wordsize 1 - set modify_cmd mwb - } - - - - - if {[string compare $form_address ""]!=0} { - if {[string compare $form_action "Previous"]==0} { - # Kludge! Work around problems parsing hex in Jim Tcl expressions - incr form_address ; set form_address [expr $form_address-1] - if {$form_address-$form_length>0} { - set form_address "0x[tohex [expr $form_address-$form_length]]" - } else { - set form_address "0x0" - } - } - if {[string compare $form_action "Next"]==0} { - # Kludge! Work around problems parsing hex in Jim Tcl expressions - incr form_address ; set form_address [expr $form_address-1] - set form_address "0x[tohex [expr $form_address+$form_length]]" - } - if {[string compare $form_action "Modify"]==0} { - append console [capture_catch "$modify_cmd $form_address $form_value"] - } - if {[string compare $form_action "Fill"]==0} { - append console [capture_catch "$modify_cmd $form_address $form_value $form_length"] - } - } - - - -append buffer { - - <form action="browsemem.tcl" method="post"> - <table> - <tr><td class="formtext">Address</td><td><input type="text" name="form_address" value="} -append buffer $form_address -append buffer {"></td></tr> - <tr><td class="formtext">Length</td><td><input type="text" name="form_length" value="} -append buffer "0x[tohex $form_length]" -append buffer {"></td></tr> - <tr><td class="formtext">Value</td><td><input type="text" name="form_value" value="} -append buffer $form_value -append buffer {"></td> - <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Modify"></td> - <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Fill"></td></tr> - <tr><td class="formtext">Type</td><td style="padding-top:1px;"> - <select name="form_type"> - <option - } -if {[string compare $form_type "mdb"]==0} { append buffer {selected="selected"} } -append buffer { value ="mdb">8 bit - </option> - <option - } -if {[string compare $form_type "mdh"]==0} { append buffer {selected="selected"} } -append buffer { value ="mdh">16 bit - </option> - <option - } -if {[string compare $form_type "mdw"]==0} { append buffer {selected="selected"} } -append buffer {value ="mdw">32 bit - </option> - </select> - - </td></tr> - </table> - <table> - <tr><td style="height:15px;width:535px;"> </td></tr> - <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr> - <tr><td style="height:15px;width:535px;"> </td></tr> - </table> - - <table><tr> - <td><input type="submit" name="form_action" value="Refresh"></td> - <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Previous" ></td> - <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Next" ></td> - </tr></table> - <br> - - </form> - <p> - <div class="fontbigger">Memory:</div><p> - <code style="white-space: nowrap; font-size:11px;font:courier new;"> - } - - if {[string compare $form_address ""]!=0} { - append console [encode [capture_catch halt]] - append buffer [encode [capture_catch "$form_type $form_address [expr $form_length]"]] - } - -append buffer { - </code> - - - - - - </td> -</tr> -} - - - set toggle_details [formfetch toggle_details] - if {[string length $toggle_details]==0} { - set toggle_details 0 - } - set show_details [load_var show_details] - if {[string length $show_details]==0} { - set show_details 0 - } - if {$toggle_details==1} { - set show_details [expr 1-$show_details] - save_var show_details $show_details - } - - if {[string length $console]!=0} { - -append buffer { -<tr style="height:100%;"> -<td style="height:100%;background-color:red;" colspan="6"> -<table style="padding:0px;border-collapse:collapse;background-color:#ffffff;width:100%" class="textgray"> -<td style="width:25px;"> </td> -} - - if {$show_details==1} { - append buffer < - append buffer {td style="background-color:#dddddd;padding-left:5px;padding-right:5px;padding-top:3px;padding-bottom:3px;"} - append buffer > - } else { - append buffer < - append buffer {td style="background-image:url('menu_cuts/h_tab_free.png');width:110px;height:29px;background-repeat: no-repeat;background-position:top left;"} - append buffer > - } - -append buffer { -<a class="openocd" href="browsemem.tcl?toggle_details=1"> -} - - if {$show_details==1} { - append buffer "Hide details" - append buffer <br/> - } else { - append buffer {<div style="position:relative;top:7px;text-align:center;">} - append buffer "Show details" - append buffer {</div>} - } - -append buffer { -</a> -} - - if {$show_details==1} { - append buffer $console - } - -append buffer {</td>} - - if {$show_details!=1} { - append buffer {<td> </td>} - } - -append buffer { -<td style="width:25px;"> </td> -</table> -</td> -</tr> -} - - } - -append buffer { -<tr> -<td style="height:30px;background-image:url('menu_cuts/center_bottom.png');background-repeat: no-repeat;background-position:top right;" colspan="6"> -<div style="width:500px;background-color:#ffffff;height:100%;"> - - </div> -</td> -</tr> -</table> -</td> -<td style="width:6px;"/> -<td style="width:245px;height:100%"> -<table style="padding:0px;border-collapse:collapse;height:100%;"> -<tr> -<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab2_selected.png');background-repeat: no-repeat;"> -<div style="position:relative;top:7px;;font-weight:bold;text-align:center;width:100px;" class="textgray"> - Documentation - </div> -</td> -<td width="40px"> - - </td> -<td/> -</tr> -<tr> -<td style="height:10px;width:245px;background-image:url('menu_cuts/right_top_small.png');" colspan="3"/> -</tr> -<tr> -<td style="background-color:#d8d7d7;width:245px;padding-left:10px;padding-buttom:10px;line-height:17px;" colspan="3"> -<a target="_blank" href="http://openocd.berlios.de/doc/openocd.pdf">OpenOCD Manual</a> -<br/> -</td> -</tr> -<tr> -<td style="background-color:#d8d7d7;height:15px;" colspan="3"/> -</tr> -<tr> -<td colspan="3"> -<table style="padding:0px;border-collapse:collapse;"> -<td style="background-color:#d8d7d7;width:10px;height:1px"/> -<td style="background-color:#999999;width:225px; height:1px;"/> -<td style="background-color:#d8d7d7;width:10px;height:1px"/> -</table> -</td> -</tr> -<tr> -<td style="background-color:#d8d7d7;height:15px;" colspan="3"/> -</tr> -<tr style="height:100%;"> -<td style="height:100%;background-color:#d8d7d7;padding-left:10px;padding-right:10px;" colspan="3" class="textgray"> - - <p>Browse and edit target memory.<br> - Length is in bytes, maximum 4096 bytes.</p> - <p>An error message is shown when trying to browse or edit memory which cases a CPU fault.</p> - <p>CPU will be halted if required.</p> - <p><b>Modify</b> - Will modify only one byte, half-word or word starting at Address.</p> - <p><b>Fill</b> - Will fill the specified region with the specified value.</p> - <p><b>Refresh</b> - Display the content of the specified memory area.</p> - - </td> -</tr> -<tr> -<td style="height:30px;background-image:url('menu_cuts/right_bottom.png');" colspan="3"> - - </td> -</tr> -</table> -</td> -</tr> -</table> -</body> -</html> - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -start_chunked "html" -write_chunked $buffer -end_chunked - +# converted to .tcl by html2tcl.tcl +set buffer "" +append buffer { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <html xmlns="http://www.w3.org/TR/REC-html40"> +<head> +<title>OpenOCD debugger</title> +<meta charset="utf-8" content="text/html" http-equiv="Content-Type"/> +<link type="text/css" rel="stylesheet" href="menuweb.css"/> +</head> +} + + set console "" + set upload_filename /ram/upload + +append buffer { +<body style="margin:0px;"> +<div style="width:974px;height:85px;"> +<div style="float:left;position:relative;left:32px;width:478px;"> +<a href="/"> + OpenOCD + </a> +</div> +<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('menu_cuts/top_right.png');"> +<div style="position:relative;left:15px;top:4px;" class="textlight"> +} +append buffer [capture version] +append buffer { +</div> +</div> +</div> +<table style="padding:0px;border-collapse:collapse;"> +<tr> +<td style="width:33px;"> +<div style="width:20px;height:510px;"> + + </div> +</td> +<td style="vertical-align:top;height:100%;width:140px;padding:0px;"> +<table style="padding:0px;border-collapse:collapse;height:100%;width:140px;"> +<tr style="height:59px;"> +<td/> +</tr> +<tr> +<td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab_selected.png');background-repeat: no-repeat;"> +<div style="position:relative;left:10px;top:10px;font-weight:bold;"> +<a href="browsemem.tcl" style="font-weight: bold;">Browse / Edit</a> +</div> +</td> +</tr> +<tr> +<td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;"> +<div style="position:relative;left:10px;top:10px;font-weight:bold;"> +<a href="downloadmem.tcl" style="">Download</a> +</div> +</td> +</tr> +<tr> +<td style="width:140px;height:35px;background-image:url('menu_cuts/v_1.png')"/> +</tr> +<tr> +<td style="width:140px;background-image:url('menu_cuts/v_2_tile.png')"/> +</tr> +<tr> +<td style="width:140px;height:140px;background-image:url('menu_cuts/v_3.png')"/> +</tr> +</table> +</td> +<td style="vertical-align:top;padding:0px;height:100%"> +<table style="padding:0px;border-collapse:collapse;height:100%;"> +<tr> +<td> +<table style="padding:0px;border-collapse:collapse;"> +<tr> +<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;"> +<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> +<a href="index.tcl">Config Target</a> +</div> +</td> +<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;"> +<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> +<a href="flashinfo.tcl">Flash</a> +</div> +</td> +<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1_selected.png');background-repeat: no-repeat;"> +<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> +<a href="browsemem.tcl" style="font-weight: bold;">Memory</a> +</div> +</td> +<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;"> +<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> +<a href="openocd.tcl">OpenOCD</a> +</div> +</td> +</tr> +</table> +</td> +</tr> +<tr> +<td style="height:30px;width:535px;background-image:url('menu_cuts/center_top.png');background-repeat: no-repeat;background-position:top right;" colspan="6"> +<div style="width:500px;background-color:#ffffff;height:100%;"> + + </div> +</td> +</tr> +<tr> +<td style="background-color:#ffffff;text-indent:30px;height:40px;" colspan="6"> +<H1>Browse / Edit Memory</H1> +</td> +</tr> +<tr style="height:100%;"> +<td style="background-color:#ffffff;padding-left:30px;padding-right:30px;width=535px;height:100%;" colspan="6"> + + + + } + + + set form_address [formfetch form_address] + set form_length [formfetch form_length] + set form_type [formfetch form_type] + set form_action [formfetch form_action] + set form_value [formfetch form_value] + + if {[string compare $form_length ""]==0} { + set form_length 0 + } + if {$form_length<=0} { + set form_length 0x80 + } + if {$form_length>0x1000} { + set form_length 0x1000 + } + + if {[string compare $form_type ""]==0} { + set form_type mdw + } + + if {[string compare $form_type "mdw"]==0} { + set wordsize 4 + set modify_cmd mww + } + if {[string compare $form_type "mdh"]==0} { + set wordsize 2 + set modify_cmd mwh + } + if {[string compare $form_type "mdb"]==0} { + set wordsize 1 + set modify_cmd mwb + } + + + + + if {[string compare $form_address ""]!=0} { + if {[string compare $form_action "Previous"]==0} { + # Kludge! Work around problems parsing hex in Jim Tcl expressions + incr form_address ; set form_address [expr $form_address-1] + if {$form_address-$form_length>0} { + set form_address "0x[tohex [expr $form_address-$form_length]]" + } else { + set form_address "0x0" + } + } + if {[string compare $form_action "Next"]==0} { + # Kludge! Work around problems parsing hex in Jim Tcl expressions + incr form_address ; set form_address [expr $form_address-1] + set form_address "0x[tohex [expr $form_address+$form_length]]" + } + if {[string compare $form_action "Modify"]==0} { + append console [capture_catch "$modify_cmd $form_address $form_value"] + } + if {[string compare $form_action "Fill"]==0} { + append console [capture_catch "$modify_cmd $form_address $form_value $form_length"] + } + } + + + +append buffer { + + <form action="browsemem.tcl" method="post"> + <table> + <tr><td class="formtext">Address</td><td><input type="text" name="form_address" value="} +append buffer $form_address +append buffer {"></td></tr> + <tr><td class="formtext">Length</td><td><input type="text" name="form_length" value="} +append buffer "0x[tohex $form_length]" +append buffer {"></td></tr> + <tr><td class="formtext">Value</td><td><input type="text" name="form_value" value="} +append buffer $form_value +append buffer {"></td> + <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Modify"></td> + <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Fill"></td></tr> + <tr><td class="formtext">Type</td><td style="padding-top:1px;"> + <select name="form_type"> + <option + } +if {[string compare $form_type "mdb"]==0} { append buffer {selected="selected"} } +append buffer { value ="mdb">8 bit + </option> + <option + } +if {[string compare $form_type "mdh"]==0} { append buffer {selected="selected"} } +append buffer { value ="mdh">16 bit + </option> + <option + } +if {[string compare $form_type "mdw"]==0} { append buffer {selected="selected"} } +append buffer {value ="mdw">32 bit + </option> + </select> + + </td></tr> + </table> + <table> + <tr><td style="height:15px;width:535px;"> </td></tr> + <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr> + <tr><td style="height:15px;width:535px;"> </td></tr> + </table> + + <table><tr> + <td><input type="submit" name="form_action" value="Refresh"></td> + <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Previous" ></td> + <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Next" ></td> + </tr></table> + <br> + + </form> + <p> + <div class="fontbigger">Memory:</div><p> + <code style="white-space: nowrap; font-size:11px;font:courier new;"> + } + + if {[string compare $form_address ""]!=0} { + append console [encode [capture_catch halt]] + append buffer [encode [capture_catch "$form_type $form_address [expr $form_length]"]] + } + +append buffer { + </code> + + + + + + </td> +</tr> +} + + + set toggle_details [formfetch toggle_details] + if {[string length $toggle_details]==0} { + set toggle_details 0 + } + set show_details [load_var show_details] + if {[string length $show_details]==0} { + set show_details 0 + } + if {$toggle_details==1} { + set show_details [expr 1-$show_details] + save_var show_details $show_details + } + + if {[string length $console]!=0} { + +append buffer { +<tr style="height:100%;"> +<td style="height:100%;background-color:red;" colspan="6"> +<table style="padding:0px;border-collapse:collapse;background-color:#ffffff;width:100%" class="textgray"> +<td style="width:25px;"> </td> +} + + if {$show_details==1} { + append buffer < + append buffer {td style="background-color:#dddddd;padding-left:5px;padding-right:5px;padding-top:3px;padding-bottom:3px;"} + append buffer > + } else { + append buffer < + append buffer {td style="background-image:url('menu_cuts/h_tab_free.png');width:110px;height:29px;background-repeat: no-repeat;background-position:top left;"} + append buffer > + } + +append buffer { +<a class="openocd" href="browsemem.tcl?toggle_details=1"> +} + + if {$show_details==1} { + append buffer "Hide details" + append buffer <br/> + } else { + append buffer {<div style="position:relative;top:7px;text-align:center;">} + append buffer "Show details" + append buffer {</div>} + } + +append buffer { +</a> +} + + if {$show_details==1} { + append buffer $console + } + +append buffer {</td>} + + if {$show_details!=1} { + append buffer {<td> </td>} + } + +append buffer { +<td style="width:25px;"> </td> +</table> +</td> +</tr> +} + + } + +append buffer { +<tr> +<td style="height:30px;background-image:url('menu_cuts/center_bottom.png');background-repeat: no-repeat;background-position:top right;" colspan="6"> +<div style="width:500px;background-color:#ffffff;height:100%;"> + + </div> +</td> +</tr> +</table> +</td> +<td style="width:6px;"/> +<td style="width:245px;height:100%"> +<table style="padding:0px;border-collapse:collapse;height:100%;"> +<tr> +<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab2_selected.png');background-repeat: no-repeat;"> +<div style="position:relative;top:7px;;font-weight:bold;text-align:center;width:100px;" class="textgray"> + Documentation + </div> +</td> +<td width="40px"> + + </td> +<td/> +</tr> +<tr> +<td style="height:10px;width:245px;background-image:url('menu_cuts/right_top_small.png');" colspan="3"/> +</tr> +<tr> +<td style="background-color:#d8d7d7;width:245px;padding-left:10px;padding-buttom:10px;line-height:17px;" colspan="3"> +<a target="_blank" href="http://openocd.berlios.de/doc/openocd.pdf">OpenOCD Manual</a> +<br/> +</td> +</tr> +<tr> +<td style="background-color:#d8d7d7;height:15px;" colspan="3"/> +</tr> +<tr> +<td colspan="3"> +<table style="padding:0px;border-collapse:collapse;"> +<td style="background-color:#d8d7d7;width:10px;height:1px"/> +<td style="background-color:#999999;width:225px; height:1px;"/> +<td style="background-color:#d8d7d7;width:10px;height:1px"/> +</table> +</td> +</tr> +<tr> +<td style="background-color:#d8d7d7;height:15px;" colspan="3"/> +</tr> +<tr style="height:100%;"> +<td style="height:100%;background-color:#d8d7d7;padding-left:10px;padding-right:10px;" colspan="3" class="textgray"> + + <p>Browse and edit target memory.<br> + Length is in bytes, maximum 4096 bytes.</p> + <p>An error message is shown when trying to browse or edit memory which cases a CPU fault.</p> + <p>CPU will be halted if required.</p> + <p><b>Modify</b> - Will modify only one byte, half-word or word starting at Address.</p> + <p><b>Fill</b> - Will fill the specified region with the specified value.</p> + <p><b>Refresh</b> - Display the content of the specified memory area.</p> + + </td> +</tr> +<tr> +<td style="height:30px;background-image:url('menu_cuts/right_bottom.png');" colspan="3"> + + </td> +</tr> +</table> +</td> +</tr> +</table> +</body> +</html> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} + +start_chunked "html" +write_chunked $buffer +end_chunked + Property changes on: trunk/src/server/httpd/browsemem.tcl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/server/httpd/build.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + LF Modified: trunk/src/server/httpd/downloadmem.tcl =================================================================== --- trunk/src/server/httpd/downloadmem.tcl 2008-12-23 08:52:02 UTC (rev 1272) +++ trunk/src/server/httpd/downloadmem.tcl 2008-12-23 12:52:14 UTC (rev 1273) @@ -1,366 +1,366 @@ -# converted to .tcl by html2tcl.tcl -set buffer "" -append buffer { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <html xmlns="http://www.w3.org/TR/REC-html40"> -<head> -<title>OpenOCD debugger</title> -<meta charset="utf-8" content="text/html" http-equiv="Content-Type"/> -<link type="text/css" rel="stylesheet" href="menuweb.css"/> -</head> -} - - set console "" - set upload_filename /ram/upload - -append buffer { -<body style="margin:0px;"> -<div style="width:974px;height:85px;"> -<div style="float:left;position:relative;left:32px;width:478px;"> -<a href="/"> - OpenOCD - </a> -</div> -<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('menu_cuts/top_right.png');"> -<div style="position:relative;left:15px;top:4px;" class="textlight"> -} -append buffer [capture version] -append buffer { -</div> -</div> -</div> -<table style="padding:0px;border-collapse:collapse;"> -<tr> -<td style="width:33px;"> -<div style="width:20px;height:510px;"> - - </div> -</td> -<td style="vertical-align:top;height:100%;width:140px;padding:0px;"> -<table style="padding:0px;border-collapse:collapse;height:100%;width:140px;"> -<tr style="height:59px;"> -<td/> -</tr> -<tr> -<td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;"> -<div style="position:relative;left:10px;top:10px;font-weight:bold;"> -<a href="browsemem.tcl" style="">Browse / Edit</a> -</div> -</td> -</tr> -<tr> -<td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab_selected.png');background-repeat: no-repeat;"> -<div style="position:relative;left:10px;top:10px;font-weight:bold;"> -<a href="downloadmem.tcl" style="font-weight: bold;">Download</a> -</div> -</td> -</tr> -<tr> -<td style="width:140px;height:35px;background-image:url('menu_cuts/v_1.png')"/> -</tr> -<tr> -<td style="width:140px;background-image:url('menu_cuts/v_2_tile.png')"/> -</tr> -<tr> -<td style="width:140px;height:140px;background-image:url('menu_cuts/v_3.png')"/> -</tr> -</table> -</td> -<td style="vertical-align:top;padding:0px;height:100%"> -<table style="padding:0px;border-collapse:collapse;height:100%;"> -<tr> -<td> -<table style="padding:0px;border-collapse:collapse;"> -<tr> -<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;"> -<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> -<a href="index.tcl">Config Target</a> -</div> -</td> -<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;"> -<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> -<a href="flashinfo.tcl">Flash</a> -</div> -</td> -<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1_selected.png');background-repeat: no-repeat;"> -<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> -<a href="browsemem.tcl" style="font-weight: bold;">Memory</a> -</div> -</td> -<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;"> -<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> -<a href="openocd.tcl">OpenOCD</a> -</div> -</td> -</tr> -</table> -</td> -</tr> -<tr> -<td style="height:30px;width:535px;background-image:url('menu_cuts/center_top.png');background-repeat: no-repeat;background-position:top right;" colspan="6"> -<div style="width:500px;background-color:#ffffff;height:100%;"> - - </div> -</td> -</tr> -<tr> -<td style="background-color:#ffffff;text-indent:30px;height:40px;" colspan="6"> -<H1>Download Memory Range</H1> -</td> -</tr> -<tr style="height:100%;"> -<td style="background-color:#ffffff;padding-left:30px;padding-right:30px;width=535px;height:100%;" colspan="6"> - } - - set form_address [formfetch form_address] - set form_length [formfetch form_length] - set form_action [formfetch form_action] - -append buffer { - <form action="downloadmem.tcl" method="post"> - <table> - <tr><td class="formtext">Address</td><td><input type="text" name="form_address" value="} -append buffer $form_address -append buffer {"></td></tr> - <tr><td class="formtext">Length</td><td><input type="text" name="form_length" value="} -append buffer $form_length -append buffer {"></td></tr> - </td></tr> - </table> - - <table> - <tr><td style="height:15px;width:535px;"> </td></tr> - <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr> - <tr><td style="height:15px;width:535px;"> </td></tr> - </table> - - <input type="submit" value="Download" name="form_action"> - - - </form> - } - - if {[string compare $form_action "Download"]==0} { - append console [encode [capture_catch "reset init"]] - append console [encode [capture_catch "dump_image /tmp/dump.bin $form_address $form_length"]] - -append buffer { - <form action="../dump.bin" target="_blank"> - <input type="submit" name="form_action" value="Save downloaded memory"> - </form> - } - - } - - -append buffer { - - - - </td> -</tr> -} - - - set toggle_details [formfetch toggle_details] - if {[string length $toggle_details]==0} { - set toggle_details 0 - } - set show_details [load_var show_details] - if {[string length $show_details]==0} { - set show_details 0 - } - if {$toggle_details==1} { - set show_details [expr 1-$show_details] - save_var show_details $show_details - } - - if {[string length $console]!=0} { - -append buffer { -<tr style="height:100%;"> -<td style="height:100%;background-color:red;" colspan="6"> -<table style="padding:0px;border-collapse:collapse;background-color:#ffffff;width:100%" class="textgray"> -<td style="width:25px;"> </td> -} - - if {$show_details==1} { - append buffer < - append buffer {td style="background-color:#dddddd;padding-left:5px;padding-right:5px;padding-top:3px;padding-bottom:3px;"} - append buffer > - } else { - append buffer < - append buffer {td style="background-image:url('menu_cuts/h_tab_free.png');width:110px;height:29px;background-repeat: no-repeat;background-position:top left;"} - append buffer > - } - -append buffer { -<a class="openocd" href="downloadmem.tcl?toggle_details=1"> -} - - if {$show_details==1} { - append buffer "Hide details" - append buffer <br/> - } else { - append buffer {<div style="position:relative;top:7px;text-align:center;">} - append buffer "Show details" - append buffer {</div>} - } - -append buffer { -</a> -} - - if {$show_details==1} { - append buffer $console - } - -append buffer {</td>} - - if {$show_details!=1} { - append buffer {<td> </td>} - } - -append buffer { -<td style="width:25px;"> </td> -</table> -</td> -</tr> -} - - } - -append buffer { -<tr> -<td style="height:30px;background-image:url('menu_cuts/center_bottom.png');background-repeat: no-repeat;background-position:top right;" colspan="6"> -<div style="width:500px;background-color:#ffffff;height:100%;"> - - </div> -</td> -</tr> -</table> -</td> -<td style="width:6px;"/> -<td style="width:245px;height:100%"> -<table style="padding:0px;border-collapse:collapse;height:100%;"> -<tr> -<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab2_selected.png');background-repeat: no-repeat;"> -<div style="position:relative;top:7px;;font-weight:bold;text-align:center;width:100px;" class="textgray"> - Documentation - </div> -</td> -<td width="40px"> - - </td> -<td/> -</tr> -<tr> -<td style="height:10px;width:245px;background-image:url('menu_cuts/right_top_small.png');" colspan="3"/> -</tr> -<tr> -<td style="background-color:#d8d7d7;width:245px;padding-left:10px;padding-buttom:10px;line-height:17px;" colspan="3"> -<a target="_blank" href="http://openocd.berlios.de/doc/openocd.pdf">OpenOCD Manual</a> -<br/> -</td> -</tr> -<tr> -<td style="background-color:#d8d7d7;height:15px;" colspan="3"/> -</tr> -<tr> -<td colspan="3"> -<table style="padding:0px;border-collapse:collapse;"> -<td style="background-color:#d8d7d7;width:10px;height:1px"/> -<td style="background-color:#999999;width:225px; height:1px;"/> -<td style="background-color:#d8d7d7;width:10px;height:1px"/> -</table> -</td> -</tr> -<tr> -<td style="background-color:#d8d7d7;height:15px;" colspan="3"/> -</tr> -<tr style="height:100%;"> -<td style="height:100%;background-color:#d8d7d7;padding-left:10px;padding-right:10px;" colspan="3" class="textgray"> - - Download memory from target. <br> - <b>Note</b> that download memory can take - a long time(potentially minutes for megabytes at low JTAG clk speeds). - <p/> - Once the memory is downloaded a link is available on the page to download - the file to your PC. - - </td> -</tr> -<tr> -<td style="height:30px;background-image:url('menu_cuts/right_bottom.png');" colspan="3"> - - </td> -</tr> -</table> -</td> -</tr> -</table> -</body> -</html> - - - - - - - - - - - - - - - - - - - - - - - -} - -start_chunked "html" -write_chunked $buffer -end_chunked - +# converted to .tcl by html2tcl.tcl +set buffer "" +append buffer { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <html xmlns="http://www.w3.org/TR/REC-html40"> +<head> +<title>OpenOCD debugger</title> +<meta charset="utf-8" content="text/html" http-equiv="Content-Type"/> +<link type="text/css" rel="stylesheet" href="menuweb.css"/> +</head> +} + + set console "" + set upload_filename /ram/upload + +append buffer { +<body style="margin:0px;"> +<div style="width:974px;height:85px;"> +<div style="float:left;position:relative;left:32px;width:478px;"> +<a href="/"> + OpenOCD + </a> +</div> +<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('menu_cuts/top_right.png');"> +<div style="position:relative;left:15px;top:4px;" class="textlight"> +} +append buffer [capture version] +append buffer { +</div> +</div> +</div> +<table style="padding:0px;border-collapse:collapse;"> +<tr> +<td style="width:33px;"> +<div style="width:20px;height:510px;"> + + </div> +</td> +<td style="vertical-align:top;height:100%;width:140px;padding:0px;"> +<table style="padding:0px;border-collapse:collapse;height:100%;width:140px;"> +<tr style="height:59px;"> +<td/> +</tr> +<tr> +<td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;"> +<div style="position:relative;left:10px;top:10px;font-weight:bold;"> +<a href="browsemem.tcl" style="">Browse / Edit</a> +</div> +</td> +</tr> +<tr> +<td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab_selected.png');background-repeat: no-repeat;"> +<div style="position:relative;left:10px;top:10px;font-weight:bold;"> +<a href="downloadmem.tcl" style="font-weight: bold;">Download</a> +</div> +</td> +</tr> +<tr> +<td style="width:140px;height:35px;background-image:url('menu_cuts/v_1.png')"/> +</tr> +<tr> +<td style="width:140px;background-image:url('menu_cuts/v_2_tile.png')"/> +</tr> +<tr> +<td style="width:140px;height:140px;background-image:url('menu_cuts/v_3.png')"/> +</tr> +</table> +</td> +<td style="vertical-align:top;padding:0px;height:100%"> +<table style="padding:0px;border-collapse:collapse;height:100%;"> +<tr> +<td> +<table style="padding:0px;border-collapse:collapse;"> +<tr> +<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;"> +<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> +<a href="index.tcl">Config Target</a> +</div> +</td> +<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;"> +<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> +<a href="flashinfo.tcl">Flash</a> +</div> +</td> +<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1_selected.png');background-repeat: no-repeat;"> +<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> +<a href="browsemem.tcl" style="font-weight: bold;">Memory</a> +</div> +</td> +<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;"> +<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> +<a href="openocd.tcl">OpenOCD</a> +</div> +</td> +</tr> +</table> +</td> +</tr> +<tr> +<td style="height:30px;width:535px;background-image:url('menu_cuts/center_top.png');background-repeat: no-repeat;background-position:top right;" colspan="6"> +<div style="width:500px;background-color:#ffffff;height:100%;"> + + </div> +</td> +</tr> +<tr> +<td style="background-color:#ffffff;text-indent:30px;height:40px;" colspan="6"> +<H1>Download Memory Range</H1> +</td> +</tr> +<tr style="height:100%;"> +<td style="background-color:#ffffff;padding-left:30px;padding-right:30px;width=535px;height:100%;" colspan="6"> + } + + set form_address [formfetch form_address] + set form_length [formfetch form_length] + set form_action [formfetch form_action] + +append buffer { + <form action="downloadmem.tcl" method="post"> + <table> + <tr><td class="formtext">Address</td><td><input type="text" name="form_address" value="} +append buffer $form_address +append buffer {"></td></tr> + <tr><td class="formtext">Length</td><td><input type="text" name="form_length" value="} +append buffer $form_length +append buffer {"></td></tr> + </td></tr> + </table> + + <table> + <tr><td style="height:15px;width:535px;"> </td></tr> + <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr> + <tr><td style="height:15px;width:535px;"> </td></tr> + </table> + + <input type="submit" value="Download" name="form_action"> + + + </form> + } + + if {[string compare $form_action "Download"]==0} { + append console [encode [capture_catch "reset init"]] + append console [encode [capture_catch "dump_image /tmp/dump.bin $form_address $form_length"]] + +append buffer { + <form action="../dump.bin" target="_blank"> + <input type="submit" name="form_action" value="Save downloaded memory"> + </form> + } + + } + + +append buffer { + + + + </td> +</tr> +} + + + set toggle_details [formfetch toggle_details] + if {[string length $toggle_details]==0} { + set toggle_details 0 + } + set show_details [load_var show_details] + if {[string length $show_details]==0} { + set show_details 0 + } + if {$toggle_details==1} { + set show_details [expr 1-$show_details] + save_var show_details $show_details + } + + if {[string length $console]!=0} { + +append buffer { +<tr style="height:100%;"> +<td style="height:100%;background-color:red;" colspan="6"> +<table style="padding:0px;border-collapse:collapse;background-color:#ffffff;width:100%" class="textgray"> +<td style="width:25px;"> </td> +} + + if {$show_details==1} { + append buffer < + append buffer {td style="background-color:#dddddd;padding-left:5px;padding-right:5px;padding-top:3px;padding-bottom:3px;"} + append buffer > + } else { + append buffer < + append buffer {td style="background-image:url('menu_cuts/h_tab_free.png');width:110px;height:29px;background-repeat: no-repeat;background-position:top left;"} + append buffer > + } + +append buffer { +<a class="openocd" href="downloadmem.tcl?toggle_details=1"> +} + + if {$show_details==1} { + append buffer "Hide details" + append buffer <br/> + } else { + append buffer {<div style="position:relative;top:7px;text-align:center;">} + append buffer "Show details" + append buffer {</div>} + } + +append buffer { +</a> +} + + if {$show_details==1} { + append buffer $console + } + +append buffer {</td>} + + if {$show_details!=1} { + append buffer {<td> </td>} + } + +append buffer { +<td style="width:25px;"> </td> +</table> +</td> +</tr> +} + + } + +append buffer { +<tr> +<td style="height:30px;background-image:url('menu_cuts/center_bottom.png');background-repeat: no-repeat;background-position:top right;" colspan="6"> +<div style="width:500px;background-color:#ffffff;height:100%;"> + + </div> +</td> +</tr> +</table> +</td> +<td style="width:6px;"/> +<td style="width:245px;height:100%"> +<table style="padding:0px;border-collapse:collapse;height:100%;"> +<tr> +<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab2_selected.png');background-repeat: no-repeat;"> +<div style="position:relative;top:7px;;font-weight:bold;text-align:center;width:100px;" class="textgray"> + Documentation + </div> +</td> +<td width="40px"> + + </td> +<td/> +</tr> +<tr> +<td style="height:10px;width:245px;background-image:url('menu_cuts/right_top_small.png');" colspan="3"/> +</tr> +<tr> +<td style="background-color:#d8d7d7;width:245px;padding-left:10px;padding-buttom:10px;line-height:17px;" colspan="3"> +<a target="_blank" href="http://openocd.berlios.de/doc/openocd.pdf">OpenOCD Manual</a> +<br/> +</td> +</tr> +<tr> +<td style="background-color:#d8d7d7;height:15px;" colspan="3"/> +</tr> +<tr> +<td colspan="3"> +<table style="padding:0px;border-collapse:collapse;"> +<td style="background-color:#d8d7d7;width:10px;height:1px"/> +<td style="background-color:#999999;width:225px; height:1px;"/> +<td style="background-color:#d8d7d7;width:10px;height:1px"/> +</table> +</td> +</tr> +<tr> +<td style="background-color:#d8d7d7;height:15px;" colspan="3"/> +</tr> +<tr style="height:100%;"> +<td style="height:100%;background-color:#d8d7d7;padding-left:10px;padding-right:10px;" colspan="3" class="textgray"> + + Download memory from target. <br> + <b>Note</b> that download memory can take + a long time(potentially minutes for megabytes at low JTAG clk speeds). + <p/> + Once the memory is downloaded a link is available on the page to download + the file to your PC. + + </td> +</tr> +<tr> +<td style="height:30px;background-image:url('menu_cuts/right_bottom.png');" colspan="3"> + + </td> +</tr> +</table> +</td> +</tr> +</table> +</body> +</html> + + + + + + + + + + + + + + + + + + + + + + + +} + +start_chunked "html" +write_chunked $buffer +end_chunked + Property changes on: trunk/src/server/httpd/downloadmem.tcl ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/src/server/httpd/editconfigs.tcl =================================================================== --- trunk/src/server/httpd/editconfigs.tcl 2008-12-23 08:52:02 UTC (rev 1272) +++ trunk/src/server/httpd/editconfigs.tcl 2008-12-23 12:52:14 UTC (rev 1273) @@ -1,462 +1,462 @@ -# converted to .tcl by html2tcl.tcl -set buffer "" -append buffer { - - - - - - - - - - <html xmlns="http://www.w3.org/TR/REC-html40"> -<head> -<title>Zylin ZY1000 JTAG debugger</title> -<meta charset="utf-8" content="text/html" http-equiv="Content-Type"/> -<link type="text/css" rel="stylesheet" href="menuweb.css"/> -</head> -} - - set console "" - set upload_filename /ram/upload - -append buffer { -<body style="margin:0px;"> -<div style="width:974px;height:85px;"> -<div style="float:left;position:relative;left:32px;width:478px;"> -<a href="/"> -<img src="menu_cuts/logo_top.png" style="border:0px;"/> -</a> -</div> -<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('menu_cuts/top_right.png');"> -<div style="position:relative;left:15px;top:4px;" class="textlight"> -} -append buffer [capture version] -append buffer { -</div> -</div> -</div> -<table style="padding:0px;border-collapse:collapse;"> -<tr> -<td style="width:33px;"> -<div style="width:20px;height:510px;"> - - </div> -</td> -<td style="vertical-align:top;height:100%;width:140px;padding:0px;"> -<table style="padding:0px;border-collapse:collapse;height:100%;width:140px;"> -<tr style="height:59px;"> -<td/> -</tr> -<tr> -<td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;"> -<div style="position:relative;left:10px;top:10px;font-weight:bold;"> -<a href="index.tcl" style="">Target Status</a> -</div> -</td> -</tr> -<tr> -<td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;"> -<div style="position:relative;left:10px;top:10px;font-weight:bold;"> -<a href="preconfig.tcl" style="">Select Target Config</a> -</div> -</td> -</tr> -<tr> -<td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab_selected.png');background-repeat: no-repeat;"> -<div style="position:relative;left:10px;top:10px;font-weight:bold;"> -<a href="editconfigs.tcl" style="font-weight: bold;">Edit Configurations</a> -</div> -</td> -</tr> -<tr> -<td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;"> -<div style="position:relative;left:10px;top:10px;font-weight:bold;"> -<a href="reload.tcl" style="">Reload Config Scripts</a> -</div> -</td> -</tr> -<tr> -<td style="width:140px;height:35px;background-image:url('menu_cuts/v_1.png')"/> -</tr> -<tr> -<td style="width:140px;background-image:url('menu_cuts/v_2_tile.png')"/> -</tr> -<tr> -<td style="width:140px;height:140px;background-image:url('menu_cuts/v_3.png')"/> -</tr> -</table> -</td> -<td style="vertical-align:top;padding:0px;height:100%"> -<table style="padding:0px;border-collapse:collapse;height:100%;"> -<tr> -<td> -<table style="padding:0px;border-collapse:collapse;"> -<tr> -<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1_selected.png');background-repeat: no-repeat;"> -<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> -<a href="index.tcl" style="font-weight: bold;">Config Target</a> -</div> -</td> -<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;"> -<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> -<a href="flashinfo.tcl">Flash</a> -</div> -</td> -<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;"> -<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> -<a href="browsemem.tcl">Memory</a> -</div> -</td> -<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;"> -<div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;"> -<a href="openocd.tcl">OpenOCD</a> -</div> -</td> -</tr> -</table> -</td> -</tr> -<tr> -<td style="height:30px;width:535px;background-image:url('menu_cuts/center_top.png');background-repeat: no-repeat;background-position:top right;" colspan="6"> -<div style="width:500px;background-color:#ffffff;height:100%;"> - - </div> -</td> -</tr> -<tr> -<td style="background-color:#ffffff;text-indent:30px;height:40px;" colspan="6"> -<H1>Edit Target Configurations</H1> -</td> -</tr> -<tr style="height:100%;"> -<td style="background-color:#ffffff;padding-left:30px;padding-right:30px;width=535px;height:100%;" colspan="6"> - <form action="editconfigs.tcl" method="post"> - } - - set form_edittext [formfetch form_edittext] - set form_action [formfetch form_action] - set form_filename [formfetch form_filename] - set form_selected [formfetch form_selected] - - if {[string compare $form_action "Load"]==0} { - set form_filename $form_selected - } - - if {[string compare $form_action "Delete"]==0} { - capture_catch "rm /config/settings/$form_selected" - } - - if {[string compare $form_action "Save"]==0} { - save_var $form_filename [from_textarea $form_edittext] - append buffer "Wrote file $form_filename<br>" - } - - set form_edittext "" - - # load original or script saved on disk. - if {[string compare $form_action "Show default"]==0} { - set form_edittext [load_file "/rom/$form_selected"] - set form_filename $form_selected - } else { - set form_edittext [load_config $form_filename] - } - - set form_edittext_subst [to_textarea $form_edittext] - - - proc prepend { val list } { - set res "" - foreach value $list { - set t $val - append t $value - lappend res $t - } - return $res - } - - set files [prepend target/ [ls /rom/target]] - set files [lunion $files [prepend event/ [ls /config/settings/event]]] - set files [lunion $files [prepend target/ [ls /config/settings/target]]] - set files [lsort $files] - - -append buffer { - <table style="padding:0px;border-collapse:collapse;"><tr> - <td style="padding-top:1px;"><select name="form_selected"> - } - - set foundTarget 0 - foreach i $files { - -append buffer { - <option - } - - if {[string compare $form_filename $i]==0} { - set foundTarget 1 - append buffer {selected="selected"} - } - -append buffer { - value="} -append buffer $i -append buffer {">} -append buffer $i -append buffer {</option> - } - - } - if {$foundTarget==0} { - -append buffer { - <option selected="selected" value="">Select target config</option> - } - - } - -append buffer { - </select></td> - <td class="buttonspacesmall"> </td> - <td><input type="submit" value="Load" name="form_action"></td> - <td class="buttonspacesmall"> </td> - <td><input type="submit" value="Show default" name="form_action"></td> - <td class="buttonspacesmall"> </td> - <td><input type="submit" value="Delete" name="form_action"></td> - </tr></table> - <textarea style="overflow:auto;" rows="21" cols="65" name="form_edittext" wrap="off">} -append buffer $form_edittext_subst -append buffer {</textarea> - <table style="padding:0px;border-collapse:collapse;"><tr> - } - - append buffer {<td class="formtext">File</td><td><input type="text" name="form_filename" } "\n" - append buffer "value=\"$form_filename\" ></td>\n" - append buffer {<td class="buttonspacesmall"> </td><td><input type="submit" value="Save" name="form_action"></td><br>} "\n" - append buffer {</tr></table>} "\n" - -append buffer { - </form> - </td> -</tr> -} - - - set toggle_details [formfetch toggle_details] - if {[string length $toggle_details]==0} { - set toggle_details 0 - } - set show_details [load_var show_details] - if {[string length $show_details]==0} { - set show_details 0 - } - if {$toggle_details==1} { - set show_details [expr 1-$show_details] - save_var show_details $show_details - } - - if {[string length $console]!=0} { - -append buffer { -<tr style="height:100%;"> -<td style="height:100%;background-color:red;" colspan="6"> -<table style="padding:0px;border-collapse:collapse;background-color:#ffffff;width:100%" class="textgray"> -<td style="width:25px;"> </td> -} - - if {$show_details==1} { - append buffer < - append buffer {td style="background-color:#dddddd;padding-left:5px;padding-right:5px;padding-top:3px;padding-bottom:3px;"} - append buffer > - } else { - append buffer < - append buffer {td style="background-image:url('menu_cuts/h_tab_free.png');width:110px;height:29px;background-repeat: no-repeat;background-position:top left;"} - append buffer > - } - -append buffer { -<a class="openocd" href="editconfigs.tcl?toggle_details=1"> -} - - if {$show_details==1} { - append buffer "Hide details" - append buffer <br/> - } else { - append buffer {<div style="position:relative;top:7px;text-align:center;">} - append buffer "Show details" - append buffer {</div>} - } - -append buffer { -</a> -} - - if {$show_details==1} { - append buffer $console - } - -append buffer {</td>} - - if {$show_details!=1} { - append buffer {<td> </td>} - } - -append buffer { -<td style="width:25px;"> </td> -</table> -</td> -</tr> -} - - } - -append buffer { -<tr> -<td style="height:30px;background-image:url('menu_cuts/center_bottom.png');background-repeat: no-repeat;background-position:top right;" colspan="6"> -<div style="width:500px;background-color:#ffffff;height:100%;"> - - </div> -</td> -</tr> -</table> -</td> -<td style="width:6px;"/> -<td style="width:245px;height:100%"> -<table style="padding:0px;border-collapse:collapse;height:100%;"> -<tr> -<td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab2_selected.png');background-repeat: no-repeat;"> -<div style="position:relative;top:7px;;font-weight:bold;text-align:center;width:100px;" class="textgray"> - Documentation - </div> -</td> -<td width="40px"> - - </td> -<td/> -</tr> -<tr> -<td style="height:10px;width:245px;background-image:url('menu_cuts/right_top_small.png');" colspan="3"/> -</tr> -<tr> -<td style="background-color:#d8d7d7;width:245px;padding-left:10px;padding-buttom:10px;line-height:17px;" colspan="3"> -<a target="_blank" href="http://www.zylin.com/zy1000/ZY1000_Quick_S... [truncated message content] |
From: <oh...@ma...> - 2008-12-23 09:52:06
|
Author: oharboe Date: 2008-12-23 09:52:02 +0100 (Tue, 23 Dec 2008) New Revision: 1272 Added: trunk/src/server/httpd/httpd.tcl Removed: trunk/src/server/httpd/httpd.tcl Modified: trunk/src/server/httpd.c trunk/src/server/httpd/build.sh trunk/src/server/httpd/erase.tcl trunk/src/server/httpd/menu.xml trunk/src/server/httpd/openocd.tcl Log: httpd wip Modified: trunk/src/server/httpd/build.sh =================================================================== --- trunk/src/server/httpd/build.sh 2008-12-22 15:24:35 UTC (rev 1271) +++ trunk/src/server/httpd/build.sh 2008-12-23 08:52:02 UTC (rev 1272) @@ -1,3 +1,5 @@ set e java -classpath ../../../../zy1000/build/xalan.jar\;. Stylizer menu.xsl menu.xml . find . -regex ".*\.tcl" -type f -exec sh html2tcl.sh {} {} \; +echo "Copy .tcl files to /usr/local/lib/openocd/httpd/" +cp *.tcl /usr/local/lib/openocd/httpd/ \ No newline at end of file Modified: trunk/src/server/httpd/erase.tcl =================================================================== --- trunk/src/server/httpd/erase.tcl 2008-12-22 15:24:35 UTC (rev 1271) +++ trunk/src/server/httpd/erase.tcl 2008-12-23 08:52:02 UTC (rev 1272) @@ -161,7 +161,7 @@ set form_length 0x10000 } if {[string compare $form_address ""]==0} { - if {[catch {[zy1000_flash]} result]==0} { + if {[catch {[first_flash_base]} result]==0} { set form_address "0x[tohex $result]" } } Deleted: trunk/src/server/httpd/httpd.tcl =================================================================== --- trunk/src/server/httpd/httpd.tcl 2008-12-22 15:24:35 UTC (rev 1271) +++ trunk/src/server/httpd/httpd.tcl 2008-12-23 08:52:02 UTC (rev 1272) @@ -1,113 +0,0 @@ -# some dummy proc's to get things going for test purposes - - - -proc ip {} { -return 10.0.0.55 -} - -proc start_chunked {a} { - global httpdata - global httpmime - set httpmime $a - set httpdata "" -} - -proc write_chunked {a} { - global httpdata - append httpdata $a -} - -proc end_chunked {} { -} - - - -#proc formfetch {a} { -# global httppostdata - #catch { -# echo "$a=$httppostdata($a)" - #return $httppostdata($a) - #} -# - #return "" -#} - - - - -proc tohex {a} { - set r "" - while 1 { - - set rem [expr $a%16] - set a [expr $a/16] - set r [string index "0123456789abcdef" $rem]$r - if ($a==0) then break - } - return $r -} - -# encode text -proc encode {a} { - return [string map {\n <br/> { } { } \t { } > > < < / /} $a] -} - -#stubs that can be overriden to save between sessions -proc load_var {a} { - global glob_var - catch { - return $glob_var($a) - } - return "" -} -#stubs that can be overriden to save between sessions -proc save_var {a b} { - catch { - set glob_var($a) $b - return "" - } err - set glob_var($a) "" - return "" -} - - - -proc to_textarea {a} { - return [string map {& & > > < < / /} $a] -} - -proc from_textarea {a} { - return [string map {> > < < & & / /} $a] -} - -proc lunion {a b} { - foreach e $a { - set x($e) {} - } - foreach e $b { - if {![info exists x($e)]} { - lappend a $e - } - } - return $a -} - - -# encode text -proc encode {a} { - return [string map {\n <br/> { } { } \t { } > > < < / /} $a] -} - -# catch any exceptions, capture output and return it -proc capture_catch {a} { - catch { - return [eval {capture $a}] - } result - return $result -} - -proc zy1000_flash {} { - set t [lindex 0 [ocd_flash_banks]] - return $t(base) -} Copied: trunk/src/server/httpd/httpd.tcl (from rev 1271, trunk/src/server/httpd/httpd.tcl) =================================================================== --- trunk/src/server/httpd/httpd.tcl 2008-12-22 15:24:35 UTC (rev 1271) +++ trunk/src/server/httpd/httpd.tcl 2008-12-23 08:52:02 UTC (rev 1272) @@ -0,0 +1,113 @@ +# some dummy proc's to get things going for test purposes + + + +proc ip {} { +return 10.0.0.55 +} + +proc start_chunked {a} { + global httpdata + global httpmime + set httpmime $a + set httpdata "" +} + +proc write_chunked {a} { + global httpdata + append httpdata $a +} + +proc end_chunked {} { +} + + + +#proc formfetch {a} { +# global httppostdata + #catch { +# echo "$a=$httppostdata($a)" + #return $httppostdata($a) + #} +# + #return "" +#} + + + + +proc tohex {a} { + set r "" + while 1 { + + set rem [expr $a%16] + set a [expr $a/16] + set r [string index "0123456789abcdef" $rem]$r + if ($a==0) then break + } + return $r +} + +# encode text +proc encode {a} { + return [string map {\n <br/> { } { } \t { } > > < < / /} $a] +} + +#stubs that can be overriden to save between sessions +proc load_var {a} { + global glob_var + catch { + return $glob_var($a) + } + return "" +} +#stubs that can be overriden to save between sessions +proc save_var {a b} { + catch { + set glob_var($a) $b + return "" + } err + set glob_var($a) "" + return "" +} + + + +proc to_textarea {a} { + return [string map {& & > > < < / /} $a] +} + +proc from_textarea {a} { + return [string map {> > < < & & / /} $a] +} + +proc lunion {a b} { + foreach e $a { + set x($e) {} + } + foreach e $b { + if {![info exists x($e)]} { + lappend a $e + } + } + return $a +} + + +# encode text +proc encode {a} { + return [string map {\n <br/> { } { } \t { } > > < < / /} $a] +} + +# catch any exceptions, capture output and return it +proc capture_catch {a} { + catch { + capture {uplevel $a} + } result + return $result +} + +proc first_flash_base {} { + set t [lindex 0 [ocd_flash_banks]] + return $t(base) +} Property changes on: trunk/src/server/httpd/httpd.tcl ___________________________________________________________________ Name: svn:mergeinfo + Modified: trunk/src/server/httpd/menu.xml =================================================================== --- trunk/src/server/httpd/menu.xml 2008-12-22 15:24:35 UTC (rev 1271) +++ trunk/src/server/httpd/menu.xml 2008-12-23 08:52:02 UTC (rev 1272) @@ -438,7 +438,7 @@ set form_length 0x10000 } if {[string compare $form_address ""]==0} { - if {[catch {[zy1000_flash]} result]==0} { + if {[catch {[first_flash_base]} result]==0} { set form_address "0x[tohex $result]" } } @@ -794,8 +794,8 @@ set form_command [formfetch form_command] set form_edittext "" - if {[string length $form_command]>0} { - catch {capture_catch {eval "$form_command"}} form_edittext + if {[string length $form_command]>0} { + set form_edittext [capture_catch {eval $form_command}] } append buffer {<form action="openocd.tcl" method="post">} "\n" Modified: trunk/src/server/httpd/openocd.tcl =================================================================== --- trunk/src/server/httpd/openocd.tcl 2008-12-22 15:24:35 UTC (rev 1271) +++ trunk/src/server/httpd/openocd.tcl 2008-12-23 08:52:02 UTC (rev 1272) @@ -154,8 +154,8 @@ set form_command [formfetch form_command] set form_edittext "" - if {[string length $form_command]>0} { - catch {capture_catch {eval "$form_command"}} form_edittext + if {[string length $form_command]>0} { + set form_edittext [capture_catch {eval $form_command}] } append buffer {<form action="openocd.tcl" method="post">} "\n" Modified: trunk/src/server/httpd.c =================================================================== --- trunk/src/server/httpd.c 2008-12-22 15:24:35 UTC (rev 1271) +++ trunk/src/server/httpd.c 2008-12-23 08:52:02 UTC (rev 1272) @@ -429,9 +429,14 @@ } static struct MHD_Daemon * d; +static pthread_mutex_t mutex; + int httpd_start(void) { + pthread_mutexattr_t attr; + pthread_mutexattr_init( &attr ); + pthread_mutex_init( &mutex, &attr ); int port = 8888; LOG_USER("Launching httpd server on port %d", port); @@ -461,15 +466,16 @@ void httpd_stop(void) { MHD_stop_daemon(d); + pthread_mutex_destroy( &mutex ); } void openocd_sleep_prelude(void) { - /* FIX!!!! add locking here!!!! */ + pthread_mutex_unlock( &mutex ); } void openocd_sleep_postlude(void) { - /* FIX!!!! add locking here!!!! */ + pthread_mutex_lock( &mutex ); } |
From: <oh...@ma...> - 2008-12-22 16:24:40
|
Author: oharboe Date: 2008-12-22 16:24:35 +0100 (Mon, 22 Dec 2008) New Revision: 1271 Modified: trunk/src/server/httpd/browsemem.tcl trunk/src/server/httpd/downloadmem.tcl trunk/src/server/httpd/erase.tcl trunk/src/server/httpd/flash.tcl trunk/src/server/httpd/flashinfo.tcl trunk/src/server/httpd/guiupload.tcl trunk/src/server/httpd/httpd.tcl trunk/src/server/httpd/index.tcl trunk/src/server/httpd/menu.xml trunk/src/server/httpd/openocd.tcl trunk/src/server/httpd/production.tcl trunk/src/server/httpd/run.tcl trunk/src/server/httpd/targets.tcl trunk/src/server/httpd/terminal.tcl Log: httpd wip Modified: trunk/src/server/httpd/browsemem.tcl =================================================================== --- trunk/src/server/httpd/browsemem.tcl 2008-12-22 15:14:10 UTC (rev 1270) +++ trunk/src/server/httpd/browsemem.tcl 2008-12-22 15:24:35 UTC (rev 1271) @@ -14,9 +14,7 @@ - - Modified: trunk/src/server/httpd/downloadmem.tcl =================================================================== --- trunk/src/server/httpd/downloadmem.tcl 2008-12-22 15:14:10 UTC (rev 1270) +++ trunk/src/server/httpd/downloadmem.tcl 2008-12-22 15:24:35 UTC (rev 1271) @@ -14,9 +14,7 @@ - - @@ -317,12 +315,12 @@ <tr style="height:100%;"> <td style="height:100%;background-color:#d8d7d7;padding-left:10px;padding-right:10px;" colspan="3" class="textgray"> - Download memory to ZY1000 from target. <br> + Download memory from target. <br> <b>Note</b> that download memory can take a long time(potentially minutes for megabytes at low JTAG clk speeds). <p/> Once the memory is downloaded a link is available on the page to download - the file from ZY1000 to your PC. + the file to your PC. </td> </tr> Modified: trunk/src/server/httpd/erase.tcl =================================================================== --- trunk/src/server/httpd/erase.tcl 2008-12-22 15:14:10 UTC (rev 1270) +++ trunk/src/server/httpd/erase.tcl 2008-12-22 15:24:35 UTC (rev 1271) @@ -14,9 +14,7 @@ - - Modified: trunk/src/server/httpd/flash.tcl =================================================================== --- trunk/src/server/httpd/flash.tcl 2008-12-22 15:14:10 UTC (rev 1270) +++ trunk/src/server/httpd/flash.tcl 2008-12-22 15:24:35 UTC (rev 1271) @@ -14,9 +14,7 @@ - - <html xmlns="http://www.w3.org/TR/REC-html40"> <head> Modified: trunk/src/server/httpd/flashinfo.tcl =================================================================== --- trunk/src/server/httpd/flashinfo.tcl 2008-12-22 15:14:10 UTC (rev 1270) +++ trunk/src/server/httpd/flashinfo.tcl 2008-12-22 15:24:35 UTC (rev 1271) @@ -14,8 +14,6 @@ - - <html xmlns="http://www.w3.org/TR/REC-html40"> <head> <title>OpenOCD debugger</title> Modified: trunk/src/server/httpd/guiupload.tcl =================================================================== --- trunk/src/server/httpd/guiupload.tcl 2008-12-22 15:14:10 UTC (rev 1270) +++ trunk/src/server/httpd/guiupload.tcl 2008-12-22 15:24:35 UTC (rev 1271) @@ -14,9 +14,7 @@ - - @@ -95,7 +93,7 @@ <tr> <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab_selected.png');background-repeat: no-repeat;"> <div style="position:relative;left:10px;top:10px;font-weight:bold;"> -<a href="guiupload.tcl" style="font-weight: bold;">Upload File to ZY1000</a> +<a href="guiupload.tcl" style="font-weight: bold;">Upload File</a> </div> </td> </tr> @@ -149,7 +147,7 @@ </tr> <tr> <td style="background-color:#ffffff;text-indent:30px;height:40px;" colspan="6"> -<H1>Upload File to ZY1000</H1> +<H1>Upload File</H1> </td> </tr> <tr style="height:100%;"> @@ -171,7 +169,7 @@ } } - append buffer {<table style="padding:0px;border-collapse:collapse;"><tr><td class="formtext">Filename on ZY1000</td><td><input type="text" name="form_filename"></td></tr>} + append buffer {<table style="padding:0px;border-collapse:collapse;"><tr><td class="formtext">Filename on OpenOCD machine</td><td><input type="text" name="form_filename"></td></tr>} append buffer {<td class="formtext">File to upload</td><td><input type="file" name="form_filecontent"></td></tr></table>} append buffer {<table><tr><td style="height:15px;width:535px;"> </td></tr><tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr><tr><td style="height:15px;width:535px;"> </td></tr></table>} append buffer {<input type="submit" name="form_action" value="Upload" ><br> } @@ -302,43 +300,7 @@ <td style="background-color:#d8d7d7;height:15px;" colspan="3"/> </tr> <tr style="height:100%;"> -<td style="height:100%;background-color:#d8d7d7;padding-left:10px;padding-right:10px;" colspan="3" class="textgray"> - - <p>The ZY1000 has three filing systems "/rom", "/ram" and "/config". "/rom" is a read only filing - embedded into the firmware.</p> - - <p>Use "/ram" to store temporary files.<p/> - - <p> - You can browse filing systems and download files by pointing your web browser to: - <ul> - <li><a href="/ram" target="_blank">/ram</a> - <li><a href="/rom" target="_blank">/rom</a> - <li><a href="/config" target="_blank">/config</a> - </ul> - </p> - - <p> - You can also upload files using e.g. curl from the command line. Example: - </p> - <code> - curl --form form_filecontent=@/tmp/myfile.elf --form form_filename=/ram/myfile.elf } -append buffer [ip] -append buffer {upload.tcl - </code> - <p> - If you have a tftp server installed on your development PC, you can access - files on your developer PC using a /tftp/ip/ prefix to the file to be accessed - on your developer PC. Note that if you do not increase the default packet - size for your tftp server, then the performance will be very poor. Normal - performance is about 500-600kBytes/s. - </p> - <code> - cp /tftp/10.0.0.106/build/src/openocd /ram/test - </code> - - - </td> +<td style="height:100%;background-color:#d8d7d7;padding-left:10px;padding-right:10px;" colspan="3" class="textgray"/> </tr> <tr> <td style="height:30px;background-image:url('menu_cuts/right_bottom.png');" colspan="3"> Modified: trunk/src/server/httpd/httpd.tcl =================================================================== --- trunk/src/server/httpd/httpd.tcl 2008-12-22 15:14:10 UTC (rev 1270) +++ trunk/src/server/httpd/httpd.tcl 2008-12-22 15:24:35 UTC (rev 1271) @@ -106,3 +106,8 @@ } result return $result } + +proc zy1000_flash {} { + set t [lindex 0 [ocd_flash_banks]] + return $t(base) +} Modified: trunk/src/server/httpd/index.tcl =================================================================== --- trunk/src/server/httpd/index.tcl 2008-12-22 15:14:10 UTC (rev 1270) +++ trunk/src/server/httpd/index.tcl 2008-12-22 15:24:35 UTC (rev 1271) @@ -298,10 +298,7 @@ See log for details. <br> <p><b>Target power</b> - Detects power on target. <br> If the JTAG cable is not connected, or the target has no power, then no target power will be detected.</p> - <p><b>Power on</b> - Turn on ZY1000 target power relay.</p> - <p><b>Power off</b> - Turn off ZY1000 target power relay.</p> <p>Type "help power" in telnet for command to control power relay.</p> - <p><b>Reboot ZY1000</b> - Reboots ZY1000 unit. Type "help reboot" in telnet.</p> </td> </tr> @@ -325,9 +322,7 @@ - - Modified: trunk/src/server/httpd/menu.xml =================================================================== --- trunk/src/server/httpd/menu.xml 2008-12-22 15:14:10 UTC (rev 1270) +++ trunk/src/server/httpd/menu.xml 2008-12-22 15:24:35 UTC (rev 1271) @@ -87,10 +87,7 @@ See log for details. <br> <p><b>Target power</b> - Detects power on target. <br> If the JTAG cable is not connected, or the target has no power, then no target power will be detected.</p> - <p><b>Power on</b> - Turn on ZY1000 target power relay.</p> - <p><b>Power off</b> - Turn off ZY1000 target power relay.</p> <p>Type "help power" in telnet for command to control power relay.</p> - <p><b>Reboot ZY1000</b> - Reboots ZY1000 unit. Type "help reboot" in telnet.</p> ]]></markup_code> </right_column> @@ -108,13 +105,13 @@ <markup_code><![CDATA[ A target needs an openocd.cfg file. This config file sets up - the CPU, flash and reset init script. Either ZY1000 ships with an + the CPU, flash and reset init script. Either OpenOCD ships with an openocd.cfg file for your target or you need to take an existing config file and modify it for your needs. <p> The reset init script is crucial. It will set up e.g. MMU, chip select registers, etc. after a reset. The init.cfg (reset init script) - is embedded into the openocd.cfg file in the sampls Zylin provides. + is embedded into the openocd.cfg file in the sampls OpenOCD provides. <p> Writing an openocd.cfg from scratch is a non-trivial exercise, but fortunally it only has to be done once for a target and afterwards it @@ -133,33 +130,6 @@ - <page lang="eng"> - <outfile>reload.tcl</outfile> - <level2parent>index.tcl</level2parent> - <pageheading>Reload Config Scripts</pageheading> - <pagetext> - <markup_code><![CDATA[ - - <tcl> - set form_action [formfetch form_action] - - if {[string compare $form_action "Reload"]==0} { - append buffer "Reloading Config Scripts...<p>" - reboot - } - </tcl> - <form enctype="multipart/form-data" action="reload.tcl" method="post"> - <input type="submit" name="form_action" value="Reload"> - </form> - - ]]></markup_code> - <right_column> - Restart ZY1000 to reload selected target config script. - </right_column> - </pagetext> - - </page> - <page lang="eng"> <outfile>flashinfo.tcl</outfile> @@ -789,12 +759,12 @@ ]]></markup_code> <right_column> <![CDATA[ - Download memory to ZY1000 from target. <br> + Download memory from target. <br> <b>Note</b> that download memory can take a long time(potentially minutes for megabytes at low JTAG clk speeds). <p/> Once the memory is downloaded a link is available on the page to download - the file from ZY1000 to your PC. + the file to your PC. ]]> </right_column> </pagetext> @@ -811,9 +781,9 @@ <level2parent>openocd.tcl</level2parent> <level2menu href="openocd.tcl" title="Run Command" titlestyle="color:#4e6627;"> </level2menu> - <level2menu href="guiupload.tcl" title="Upload File to ZY1000" titlestyle="color:#4e6627;"> + <level2menu href="guiupload.tcl" title="Upload File" titlestyle="color:#4e6627;"> <![CDATA[ - Upload file to ZY1000 + Upload file ]]> </level2menu> @@ -869,7 +839,7 @@ <page lang="eng"> <outfile>guiupload.tcl</outfile> <level2parent>openocd.tcl</level2parent> - <pageheading>Upload File to ZY1000</pageheading> + <pageheading>Upload File</pageheading> <pagetext> <markup_code><![CDATA[ @@ -888,7 +858,7 @@ } } - append buffer {<table style="padding:0px;border-collapse:collapse;"><tr><td class="formtext">Filename on ZY1000</td><td><input type="text" name="form_filename"></td></tr>} + append buffer {<table style="padding:0px;border-collapse:collapse;"><tr><td class="formtext">Filename on OpenOCD machine</td><td><input type="text" name="form_filename"></td></tr>} append buffer {<td class="formtext">File to upload</td><td><input type="file" name="form_filecontent"></td></tr></table>} append buffer {<table><tr><td style="height:15px;width:535px;"> </td></tr><tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr><tr><td style="height:15px;width:535px;"> </td></tr></table>} append buffer {<input type="submit" name="form_action" value="Upload" ><br> } @@ -897,41 +867,6 @@ </tcl> ]]></markup_code> - <right_column> - <![CDATA[ - <p>The ZY1000 has three filing systems "/rom", "/ram" and "/config". "/rom" is a read only filing - embedded into the firmware.</p> - - <p>Use "/ram" to store temporary files.<p/> - - <p> - You can browse filing systems and download files by pointing your web browser to: - <ul> - <li><a href="/ram" target="_blank">/ram</a> - <li><a href="/rom" target="_blank">/rom</a> - <li><a href="/config" target="_blank">/config</a> - </ul> - </p> - - <p> - You can also upload files using e.g. curl from the command line. Example: - </p> - <code> - curl --form form_filecontent=@/tmp/myfile.elf --form form_filename=/ram/myfile.elf <tcl>append buffer [ip]</tcl>upload.tcl - </code> - <p> - If you have a tftp server installed on your development PC, you can access - files on your developer PC using a /tftp/ip/ prefix to the file to be accessed - on your developer PC. Note that if you do not increase the default packet - size for your tftp server, then the performance will be very poor. Normal - performance is about 500-600kBytes/s. - </p> - <code> - cp /tftp/10.0.0.106/build/src/openocd /ram/test - </code> - - ]]> - </right_column> </pagetext> </page> @@ -946,13 +881,13 @@ <markup_code><![CDATA[ A target needs an openocd.cfg file. This config file sets up - the CPU, flash and reset init script. Either ZY1000 ships with an + the CPU, flash and reset init script. Either OpenOCD ships with an openocd.cfg file for your target or you need to take an existing config file and modify it for your needs. <p> The reset init script is crucial. It will set up e.g. MMU, chip select registers, etc. after a reset. The init.cfg (reset init script) - is embedded into the openocd.cfg file in the sampls Zylin provides. + is embedded into the openocd.cfg file in the sampls OpenOCD provides. <p> Writing an openocd.cfg from scratch is a non-trivial exercise, but fortunally it only has to be done once for a target and afterwards it Modified: trunk/src/server/httpd/openocd.tcl =================================================================== --- trunk/src/server/httpd/openocd.tcl 2008-12-22 15:14:10 UTC (rev 1270) +++ trunk/src/server/httpd/openocd.tcl 2008-12-22 15:24:35 UTC (rev 1271) @@ -14,9 +14,7 @@ - - @@ -91,7 +89,7 @@ <tr> <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;"> <div style="position:relative;left:10px;top:10px;font-weight:bold;"> -<a href="guiupload.tcl" style="">Upload File to ZY1000</a> +<a href="guiupload.tcl" style="">Upload File</a> </div> </td> </tr> Modified: trunk/src/server/httpd/production.tcl =================================================================== --- trunk/src/server/httpd/production.tcl 2008-12-22 15:14:10 UTC (rev 1270) +++ trunk/src/server/httpd/production.tcl 2008-12-22 15:24:35 UTC (rev 1271) @@ -14,9 +14,7 @@ - - Modified: trunk/src/server/httpd/run.tcl =================================================================== --- trunk/src/server/httpd/run.tcl 2008-12-22 15:14:10 UTC (rev 1270) +++ trunk/src/server/httpd/run.tcl 2008-12-22 15:24:35 UTC (rev 1271) @@ -14,9 +14,7 @@ - - Modified: trunk/src/server/httpd/targets.tcl =================================================================== --- trunk/src/server/httpd/targets.tcl 2008-12-22 15:14:10 UTC (rev 1270) +++ trunk/src/server/httpd/targets.tcl 2008-12-22 15:24:35 UTC (rev 1271) @@ -105,13 +105,13 @@ <td style="background-color:#ffffff;padding-left:30px;padding-right:30px;width=535px;height:100%;" colspan="6"> A target needs an openocd.cfg file. This config file sets up - the CPU, flash and reset init script. Either ZY1000 ships with an + the CPU, flash and reset init script. Either OpenOCD ships with an openocd.cfg file for your target or you need to take an existing config file and modify it for your needs. <p> The reset init script is crucial. It will set up e.g. MMU, chip select registers, etc. after a reset. The init.cfg (reset init script) - is embedded into the openocd.cfg file in the sampls Zylin provides. + is embedded into the openocd.cfg file in the sampls OpenOCD provides. <p> Writing an openocd.cfg from scratch is a non-trivial exercise, but fortunally it only has to be done once for a target and afterwards it @@ -260,9 +260,7 @@ - - @@ -392,13 +390,13 @@ <td style="background-color:#ffffff;padding-left:30px;padding-right:30px;width=535px;height:100%;" colspan="6"> A target needs an openocd.cfg file. This config file sets up - the CPU, flash and reset init script. Either ZY1000 ships with an + the CPU, flash and reset init script. Either OpenOCD ships with an openocd.cfg file for your target or you need to take an existing config file and modify it for your needs. <p> The reset init script is crucial. It will set up e.g. MMU, chip select registers, etc. after a reset. The init.cfg (reset init script) - is embedded into the openocd.cfg file in the sampls Zylin provides. + is embedded into the openocd.cfg file in the sampls OpenOCD provides. <p> Writing an openocd.cfg from scratch is a non-trivial exercise, but fortunally it only has to be done once for a target and afterwards it Modified: trunk/src/server/httpd/terminal.tcl =================================================================== --- trunk/src/server/httpd/terminal.tcl 2008-12-22 15:14:10 UTC (rev 1270) +++ trunk/src/server/httpd/terminal.tcl 2008-12-22 15:24:35 UTC (rev 1271) @@ -14,9 +14,7 @@ - - |
From: <oh...@ma...> - 2008-12-22 16:14:11
|
Author: oharboe Date: 2008-12-22 16:14:10 +0100 (Mon, 22 Dec 2008) New Revision: 1270 Added: zy1000/trunk/build/tcl/menu_cuts/zylin_logo_bottom_left.PNG Log: httpd wip Added: zy1000/trunk/build/tcl/menu_cuts/zylin_logo_bottom_left.PNG =================================================================== (Binary files differ) Property changes on: zy1000/trunk/build/tcl/menu_cuts/zylin_logo_bottom_left.PNG ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
From: <oh...@ma...> - 2008-12-22 16:10:27
|
Author: oharboe Date: 2008-12-22 16:10:18 +0100 (Mon, 22 Dec 2008) New Revision: 1269 Added: trunk/src/server/httpd/menu_cuts/ trunk/src/server/httpd/menu_cuts/center_bottom.png trunk/src/server/httpd/menu_cuts/center_top.png trunk/src/server/httpd/menu_cuts/h_tab1.png trunk/src/server/httpd/menu_cuts/h_tab1_selected.png trunk/src/server/httpd/menu_cuts/h_tab2.png trunk/src/server/httpd/menu_cuts/h_tab2_selected.png trunk/src/server/httpd/menu_cuts/h_tab_free.png trunk/src/server/httpd/menu_cuts/logo_bottom.png trunk/src/server/httpd/menu_cuts/logo_top.png trunk/src/server/httpd/menu_cuts/right_bottom.png trunk/src/server/httpd/menu_cuts/right_top.png trunk/src/server/httpd/menu_cuts/right_top_small.png trunk/src/server/httpd/menu_cuts/top_right.png trunk/src/server/httpd/menu_cuts/v_1.png trunk/src/server/httpd/menu_cuts/v_2_tile.png trunk/src/server/httpd/menu_cuts/v_3.png trunk/src/server/httpd/menu_cuts/v_tab.png trunk/src/server/httpd/menu_cuts/v_tab_selected.png Modified: trunk/src/server/httpd.c trunk/src/server/httpd/readme.txt Log: httpd wip Added: trunk/src/server/httpd/menu_cuts/center_bottom.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/center_bottom.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/center_top.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/center_top.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/h_tab1.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/h_tab1.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/h_tab1_selected.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/h_tab1_selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/h_tab2.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/h_tab2.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/h_tab2_selected.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/h_tab2_selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/h_tab_free.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/h_tab_free.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/logo_bottom.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/logo_bottom.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/logo_top.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/logo_top.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/right_bottom.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/right_bottom.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/right_top.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/right_top.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/right_top_small.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/right_top_small.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/top_right.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/top_right.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/v_1.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/v_1.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/v_2_tile.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/v_2_tile.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/v_3.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/v_3.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/v_tab.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/v_tab.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/server/httpd/menu_cuts/v_tab_selected.png =================================================================== (Binary files differ) Property changes on: trunk/src/server/httpd/menu_cuts/v_tab_selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/src/server/httpd/readme.txt =================================================================== --- trunk/src/server/httpd/readme.txt 2008-12-22 15:02:09 UTC (rev 1268) +++ trunk/src/server/httpd/readme.txt 2008-12-22 15:10:18 UTC (rev 1269) @@ -19,6 +19,6 @@ ../openocd/configure --enable-httpd --enable-dummy --enable-ioutil make make install -openocd -c "interface dummy" -f target/at91eb40a.cfg +openocd -f httpd/httpd.tcl -c "interface dummy" -f target/at91eb40a.cfg 4. Point browser to: http://localhost:8888 Modified: trunk/src/server/httpd.c =================================================================== --- trunk/src/server/httpd.c 2008-12-22 15:02:09 UTC (rev 1268) +++ trunk/src/server/httpd.c 2008-12-22 15:10:18 UTC (rev 1269) @@ -296,7 +296,7 @@ } else { - printf("Tcl OK\n"); + LOG_DEBUG("Tcl OK"); /* FIX!!! how to handle mime types??? */ const char *result; int reslen; |