From a224cab4b0a3c15876b645f907795f8089a2dbfb Mon Sep 17 00:00:00 2001 From: Kolja Waschk Date: Sun, 16 Dec 2007 10:38:53 +0000 Subject: [PATCH] Removed code for "setdevice" command (introduced in #741) git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@853 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/doc/UrJTAG.txt | 20 ++++--- jtag/include/Makefile.am | 1 - jtag/include/setdevice.h | 10 ---- jtag/libbrux/Makefile.am | 3 +- jtag/libbrux/flash/amd_flash.c | 10 +++- jtag/libbrux/setdevice.h | 10 ---- jtag/src/cmd/Makefile.am | 1 - jtag/src/cmd/cmd.c | 2 - jtag/src/cmd/setdevice.c | 104 --------------------------------- jtag/src/detect.c | 26 --------- jtag/src/jtag.c | 16 ----- 11 files changed, 19 insertions(+), 184 deletions(-) delete mode 100644 jtag/include/setdevice.h delete mode 100644 jtag/libbrux/setdevice.h delete mode 100644 jtag/src/cmd/setdevice.c diff --git a/jtag/doc/UrJTAG.txt b/jtag/doc/UrJTAG.txt index a3a25660..0894655c 100644 --- a/jtag/doc/UrJTAG.txt +++ b/jtag/doc/UrJTAG.txt @@ -429,6 +429,10 @@ example usage. *signal*:: define new signal for a part *svf*:: execute svf commands from file +Some tools derived from the same openwince JTAG Tools code base as UrJTAG +know additional commands, which are not supported in UrJTAG. See the section +about "Unsupported commands", below, about workarounds. + ==== Basic commands ==== ===== quit ===== @@ -516,18 +520,16 @@ Detects devices on the bus. Example: Stepping: C0 Filename: /usr/local/share/jtag/intel/pxa250/pxa250c0 -===== setdevice ===== -//From README_21065L +==== Unsupported commands ==== -This command is currently only there to support the SHARC 21065L processor, -which has no IDCODE. +===== setdevice ===== -In jtag prompt type command "setdevice sharc21065L", now the mode changes to -SHARC 21065L specific. Note that this mode works only with SHARC 21065L -processor. If you want to try another device, please restart the JTAG tool. +This command was only there to support the SHARC 21065L processor, +which has no IDCODE and therefore can't be initialized correctly by +just running "detect". However, the proper initialization can be done +after "detect" by loading the proper declarations and bus driver manually: - jtag> setdevice sharc21065L - Device is set to SHARC 21065L + jtag> include analog/sharc21065l/sharc21065l //======================================================================== diff --git a/jtag/include/Makefile.am b/jtag/include/Makefile.am index b2e4a458..2794356d 100644 --- a/jtag/include/Makefile.am +++ b/jtag/include/Makefile.am @@ -41,6 +41,5 @@ noinst_HEADERS = \ jtag.h \ tap.h \ fclock.h \ - setdevice.h \ svf.h \ xpcu.h diff --git a/jtag/include/setdevice.h b/jtag/include/setdevice.h deleted file mode 100644 index 79ce8866..00000000 --- a/jtag/include/setdevice.h +++ /dev/null @@ -1,10 +0,0 @@ -#define AUTO_DETECT 0 -#define SHARC_21065L 0x327A70CB //should be the dummy device id - -typedef struct -{ - unsigned long deviceID; - unsigned long flash; - unsigned short algorithm; - unsigned short unlock_bypass; -}forced_detection_t; diff --git a/jtag/libbrux/Makefile.am b/jtag/libbrux/Makefile.am index c5ffda0a..1fb4ceda 100644 --- a/jtag/libbrux/Makefile.am +++ b/jtag/libbrux/Makefile.am @@ -27,8 +27,7 @@ SUBDIRS = po noinst_HEADERS = \ sysdep.h \ - gettext.h \ - setdevice.h + gettext.h EXTRA_DIST = \ Makefile.rules diff --git a/jtag/libbrux/flash/amd_flash.c b/jtag/libbrux/flash/amd_flash.c index 96e68b1b..2062d0e2 100644 --- a/jtag/libbrux/flash/amd_flash.c +++ b/jtag/libbrux/flash/amd_flash.c @@ -40,7 +40,6 @@ #include #include -#include "setdevice.h" //write specific #define AMD_SECTOR_PROTECTED @@ -67,8 +66,13 @@ #define AMD_BYPASS_UNLOCK_MODE 1 #define AMD_STANDARD_MODE 0 - -forced_detection_t var_forced_detection; +struct +{ + unsigned long flash; + unsigned short algorithm; + unsigned short unlock_bypass; +} +var_forced_detection; int amd_detect(bus_t *bus, uint32_t adr, cfi_array_t **cfi_array ); static int amd_29xx040_autodetect( cfi_array_t *cfi_array ); diff --git a/jtag/libbrux/setdevice.h b/jtag/libbrux/setdevice.h deleted file mode 100644 index 79ce8866..00000000 --- a/jtag/libbrux/setdevice.h +++ /dev/null @@ -1,10 +0,0 @@ -#define AUTO_DETECT 0 -#define SHARC_21065L 0x327A70CB //should be the dummy device id - -typedef struct -{ - unsigned long deviceID; - unsigned long flash; - unsigned short algorithm; - unsigned short unlock_bypass; -}forced_detection_t; diff --git a/jtag/src/cmd/Makefile.am b/jtag/src/cmd/Makefile.am index 5150d5e9..cc9996d7 100644 --- a/jtag/src/cmd/Makefile.am +++ b/jtag/src/cmd/Makefile.am @@ -56,7 +56,6 @@ libcmd_a_SOURCES = \ script.c \ include.c \ cmd.c \ - setdevice.c \ svf.c INCLUDES = -DJTAG_DATA_DIR=\"$(pkgdatadir)\" diff --git a/jtag/src/cmd/cmd.c b/jtag/src/cmd/cmd.c index 83105a5a..83b6a907 100644 --- a/jtag/src/cmd/cmd.c +++ b/jtag/src/cmd/cmd.c @@ -65,7 +65,6 @@ extern cmd_t cmd_script; extern cmd_t cmd_include; extern cmd_t cmd_svf; extern cmd_t cmd_debug; -extern cmd_t cmd_setdevice; const cmd_t *cmds[] = { &cmd_quit, @@ -102,7 +101,6 @@ const cmd_t *cmds[] = { &cmd_include, &cmd_svf, &cmd_debug, - &cmd_setdevice, NULL /* last must be NULL */ }; diff --git a/jtag/src/cmd/setdevice.c b/jtag/src/cmd/setdevice.c deleted file mode 100644 index 43281be4..00000000 --- a/jtag/src/cmd/setdevice.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * $Id: setdevice.c,v 1.0 20/09/2006 12:38:01 $ - * - * Copyright (C) 2006 Kila Medical Systems. - * - * 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. - * - * Written by Ajith Kumar P.C - * -*/ - - -#include "sysdep.h" -#include -#include -#include "jtag.h" -#include "cmd.h" -#include "bus.h" -#include "setdevice.h" - -extern chain_t *chain; -extern forced_detection_t var_forced_detection; - -static int cmd_setdevice_run( char *params[] ) -{ - if(cmd_params(params) != 2) - return -1; - if (strcasecmp( params[1], "sharc21065L" ) == 0) - { -#if 0 - buses_free(); - parts_free( chain->parts ); - chain->parts = NULL; -#endif - var_forced_detection.deviceID = SHARC_21065L; - printf( _("Device is set to SHARC 21065L\n") ); - } -#if 0 - else - { - buses_free(); - parts_free( chain->parts ); - chain->parts = NULL; - var_forced_detection.deviceID = AUTO_DETECT; - printf( _("Automatic Device selection\n") ); - } -#endif - -#if 1 - else - { - - if(var_forced_detection.deviceID == SHARC_21065L) - { - printf( _("Support is only for SHARC 21065L\n") ); - printf( _("If you want to try another device:\n") ); - printf( _("\tPlease restart the JTAG tool\n\n") ); - } - else - { - var_forced_detection.deviceID = AUTO_DETECT; - //printf( _("Supports devices which posses device ID\n") ); - printf( _("If you want to try SHARC 21065L, type command:\n") ); - printf( _("\tsetdevice sharc21065L \n\n") ); - } - } -#endif - return 1; -} - -static void cmd_setdevice_help( void ) -{ - printf( _("Provision for supporting devices which do not have device ID\n" - "Usage: %s sharc21065L\n" - "\t For setting to SHARC Processor\n" -#if 0 - "Or %s auto\n" - "\t For auto selection of the device\n" - "Default is Auto Selection\n" -#endif - ),"setdevice" ); -} - -cmd_t cmd_setdevice = { - "setdevice", - N_("Provision for supporting devices which do not have device ID\n"), - cmd_setdevice_help, - cmd_setdevice_run -}; - - diff --git a/jtag/src/detect.c b/jtag/src/detect.c index 8bd66dd1..e24dc749 100644 --- a/jtag/src/detect.c +++ b/jtag/src/detect.c @@ -19,7 +19,6 @@ * 02111-1307, USA. * * Written by Marcel Telka , 2002. - * Modified by Ajith Kumar P.C , 20/09/2006. * */ @@ -40,9 +39,6 @@ #include "jtag.h" -#include "setdevice.h" -extern forced_detection_t var_forced_detection; - struct id_record { char name[20]; char fullname[100]; @@ -266,28 +262,6 @@ detect_parts( chain_t *chain, char *db_path ) printf( _("Device Id: %s (0x%016lX)\n"), register_get_string( did ), bits_to_uint64(did) ); - if (var_forced_detection.deviceID != AUTO_DETECT) - { - const char *tmp_id_data; - did = id; - - switch(var_forced_detection.deviceID) - { - case SHARC_21065L: - printf("\n\n\tAttention !!!!: This mode supports only SHARC 21065L\n\n"); - break; - default: - break; - } - tmp_id_data = register_get_string( did ); - for( i=0; i<32; i++) - { - did->data[i] = ((var_forced_detection.deviceID >> i) & 1) ? 1 : 0; - } - tmp_id_data = register_get_string( did ); - printf(" Dummy device ID : %s\n ",tmp_id_data); - } - part = part_alloc( did ); if (part == NULL) { printf( _("Out of memory\n") ); diff --git a/jtag/src/jtag.c b/jtag/src/jtag.c index 6c997e4e..7c0a91fc 100644 --- a/jtag/src/jtag.c +++ b/jtag/src/jtag.c @@ -496,22 +496,6 @@ main( int argc, const char **argv ) if(!norc) go = jtag_parse_rc(); if (go) { - /* ajk: always run "setdevice auto" command */ - char **s; - s = malloc(25*sizeof(char)); - if (!s) - { - free( s ); - printf( _("Out of memory\n") ); - } - else - { - s[0] = "setdevice"; - s[1] = "auto"; - s[2] = NULL; - cmd_run(s); - free(s); - } #ifdef HAVE_READLINE_HISTORY /* Load history */