diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index c44c8e04..3dd67da9 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -36,6 +36,9 @@ * src/bus/buses.h, src/bus/buses_list.h, src/bus/buses.c: Unify the list of buses in one place. + * src/tap/cable.h, src/tap/cable_list.h, src/tap/cable.c: Unify the list of + cable drivers in one place. + 2010-01-22 Mike Frysinger * src/cmd/cmd_bit.c (cmd_bit_print_params): Fix strncat length handling. diff --git a/urjtag/src/tap/cable.c b/urjtag/src/tap/cable.c index 4e2e7e6c..edb99660 100644 --- a/urjtag/src/tap/cable.c +++ b/urjtag/src/tap/cable.c @@ -43,116 +43,11 @@ #include #include -/* @@@@ RFHH stick these into a (or many) .h files */ -extern urj_cable_driver_t urj_tap_cable_arcom_driver; -extern urj_cable_driver_t urj_tap_cable_byteblaster_driver; -extern urj_cable_driver_t urj_tap_cable_usbblaster_driver; -extern urj_cable_driver_t urj_tap_cable_ft2232_driver; -extern urj_cable_driver_t urj_tap_cable_ft2232_jtagkey_driver; -extern urj_cable_driver_t urj_tap_cable_ft2232_armusbocd_driver; -extern urj_cable_driver_t urj_tap_cable_ft2232_armusbtiny_h_driver; -extern urj_cable_driver_t urj_tap_cable_ft2232_gnice_driver; -extern urj_cable_driver_t urj_tap_cable_ft2232_gniceplus_driver; -extern urj_cable_driver_t urj_tap_cable_ft2232_oocdlinks_driver; -extern urj_cable_driver_t urj_tap_cable_ft2232_signalyzer_driver; -extern urj_cable_driver_t urj_tap_cable_ft2232_turtelizer2_driver; -extern urj_cable_driver_t urj_tap_cable_ft2232_usbtojtagif_driver; -extern urj_cable_driver_t urj_tap_cable_ft2232_flyswatter_driver; -extern urj_cable_driver_t urj_tap_cable_ft2232_usbscarab2_driver; -extern urj_cable_driver_t urj_tap_cable_dlc5_driver; -extern urj_cable_driver_t urj_tap_cable_ea253_driver; -extern urj_cable_driver_t urj_tap_cable_ei012_driver; -extern urj_cable_driver_t urj_tap_cable_igloo_driver; -extern urj_cable_driver_t urj_tap_cable_keithkoep_driver; -extern urj_cable_driver_t urj_tap_cable_lattice_driver; -extern urj_cable_driver_t urj_tap_cable_mpcbdm_driver; -extern urj_cable_driver_t urj_tap_cable_triton_driver; -extern urj_cable_driver_t urj_tap_cable_jim_driver; -extern urj_cable_driver_t urj_tap_cable_minimal_driver; -extern urj_cable_driver_t urj_tap_cable_wiggler_driver; -extern urj_cable_driver_t urj_tap_cable_wiggler2_driver; -extern urj_cable_driver_t urj_tap_cable_xpc_int_driver; -extern urj_cable_driver_t urj_tap_cable_xpc_ext_driver; -extern urj_cable_driver_t urj_tap_cable_jlink_driver; -extern urj_cable_driver_t urj_tap_cable_ep9307_driver; -extern urj_cable_driver_t urj_tap_cable_ts7800_driver; +#include "cable.h" urj_cable_driver_t *urj_tap_cable_drivers[] = { -#ifdef ENABLE_CABLE_ARCOM - &urj_tap_cable_arcom_driver, -#endif -#ifdef ENABLE_CABLE_BYTEBLASTER - &urj_tap_cable_byteblaster_driver, -#endif - -#ifdef ENABLE_CABLE_USBBLASTER - &urj_tap_cable_usbblaster_driver, -#endif - -#ifdef ENABLE_CABLE_FT2232 - &urj_tap_cable_ft2232_driver, - &urj_tap_cable_ft2232_jtagkey_driver, - &urj_tap_cable_ft2232_armusbocd_driver, - &urj_tap_cable_ft2232_armusbtiny_h_driver, - &urj_tap_cable_ft2232_gnice_driver, - &urj_tap_cable_ft2232_gniceplus_driver, - &urj_tap_cable_ft2232_oocdlinks_driver, - &urj_tap_cable_ft2232_signalyzer_driver, - &urj_tap_cable_ft2232_turtelizer2_driver, - &urj_tap_cable_ft2232_usbtojtagif_driver, - &urj_tap_cable_ft2232_flyswatter_driver, - &urj_tap_cable_ft2232_usbscarab2_driver, -#endif - -#ifdef ENABLE_CABLE_DLC5 - &urj_tap_cable_dlc5_driver, -#endif -#ifdef ENABLE_CABLE_EA253 - &urj_tap_cable_ea253_driver, -#endif -#ifdef ENABLE_CABLE_EI012 - &urj_tap_cable_ei012_driver, -#endif -#ifdef ENABLE_CABLE_IGLOO - &urj_tap_cable_igloo_driver, -#endif -#ifdef ENABLE_CABLE_KEITHKOEP - &urj_tap_cable_keithkoep_driver, -#endif -#ifdef ENABLE_CABLE_LATTICE - &urj_tap_cable_lattice_driver, -#endif -#ifdef ENABLE_CABLE_MPCBDM - &urj_tap_cable_mpcbdm_driver, -#endif -#ifdef ENABLE_CABLE_TRITON - &urj_tap_cable_triton_driver, -#endif -#ifdef ENABLE_JIM - &urj_tap_cable_jim_driver, -#endif -#ifdef ENABLE_CABLE_WIGGLER - &urj_tap_cable_minimal_driver, - &urj_tap_cable_wiggler_driver, - &urj_tap_cable_wiggler2_driver, -#endif - -#ifdef ENABLE_CABLE_XPC - &urj_tap_cable_xpc_int_driver, - &urj_tap_cable_xpc_ext_driver, -#endif - -#ifdef ENABLE_CABLE_JLINK - &urj_tap_cable_jlink_driver, -#endif - -#ifdef ENABLE_CABLE_EP9307 - &urj_tap_cable_ep9307_driver, -#endif - -#ifdef ENABLE_CABLE_TS7800 - &urj_tap_cable_ts7800_driver, -#endif +#define _URJ_CABLE(cable) &urj_tap_cable_##cable##_driver, +#include "cable_list.h" NULL /* last must be NULL */ }; diff --git a/urjtag/src/tap/cable.h b/urjtag/src/tap/cable.h new file mode 100644 index 00000000..6d98166f --- /dev/null +++ b/urjtag/src/tap/cable.h @@ -0,0 +1,31 @@ +/* + * $Id: buses.h 1711 2010-01-23 19:12:01Z vapier $ + * + * Copyright (C) 2003 ETC s.r.o. + * + * 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 Marcel Telka , 2003. + * + */ + +#ifndef URJ_CABLE_CABLE_H +#define URJ_CABLE_CABLE_H + +#define _URJ_CABLE(cable) extern urj_cable_driver_t urj_tap_cable_##cable##_driver; +#include "cable_list.h" + +#endif /* URJ_CABLE_CABLE_H */ diff --git a/urjtag/src/tap/cable_list.h b/urjtag/src/tap/cable_list.h new file mode 100644 index 00000000..0d7b01b5 --- /dev/null +++ b/urjtag/src/tap/cable_list.h @@ -0,0 +1,94 @@ +/* + * $Id: buses.h 1687 2009-12-29 23:53:09Z arniml $ + * + * Copyright (C) 2003 ETC s.r.o. + * + * 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 Marcel Telka , 2003. + * + */ + +#ifdef ENABLE_CABLE_ARCOM +_URJ_CABLE(arcom) +#endif +#ifdef ENABLE_CABLE_BYTEBLASTER +_URJ_CABLE(byteblaster) +#endif +#ifdef ENABLE_CABLE_USBBLASTER +_URJ_CABLE(usbblaster) +#endif +#ifdef ENABLE_CABLE_FT2232 +_URJ_CABLE(ft2232) +_URJ_CABLE(ft2232_jtagkey) +_URJ_CABLE(ft2232_armusbocd) +_URJ_CABLE(ft2232_armusbtiny_h) +_URJ_CABLE(ft2232_gnice) +_URJ_CABLE(ft2232_gniceplus) +_URJ_CABLE(ft2232_oocdlinks) +_URJ_CABLE(ft2232_signalyzer) +_URJ_CABLE(ft2232_turtelizer2) +_URJ_CABLE(ft2232_usbtojtagif) +_URJ_CABLE(ft2232_flyswatter) +_URJ_CABLE(ft2232_usbscarab2) +#endif +#ifdef ENABLE_CABLE_DLC5 +_URJ_CABLE(dlc5) +#endif +#ifdef ENABLE_CABLE_EA253 +_URJ_CABLE(ea253) +#endif +#ifdef ENABLE_CABLE_EI012 +_URJ_CABLE(ei012) +#endif +#ifdef ENABLE_CABLE_IGLOO +_URJ_CABLE(igloo) +#endif +#ifdef ENABLE_CABLE_KEITHKOEP +_URJ_CABLE(keithkoep) +#endif +#ifdef ENABLE_CABLE_LATTICE +_URJ_CABLE(lattice) +#endif +#ifdef ENABLE_CABLE_MPCBDM +_URJ_CABLE(mpcbdm) +#endif +#ifdef ENABLE_CABLE_TRITON +_URJ_CABLE(triton) +#endif +#ifdef ENABLE_JIM +_URJ_CABLE(jim) +#endif +#ifdef ENABLE_CABLE_WIGGLER +_URJ_CABLE(minimal) +_URJ_CABLE(wiggler) +_URJ_CABLE(wiggler2) +#endif +#ifdef ENABLE_CABLE_XPC +_URJ_CABLE(xpc_int) +_URJ_CABLE(xpc_ext) +#endif +#ifdef ENABLE_CABLE_JLINK +_URJ_CABLE(jlink) +#endif +#ifdef ENABLE_CABLE_EP9307 +_URJ_CABLE(ep9307) +#endif +#ifdef ENABLE_CABLE_TS7800 +_URJ_CABLE(ts7800) +#endif + +#undef _URJ_CABLE