From 40aab582ecf6637b77c28dfbaf50cf5715cf09fe Mon Sep 17 00:00:00 2001 From: Rutger Hofman Date: Thu, 23 Apr 2009 15:56:49 +0000 Subject: [PATCH] Renamed global variables to carry urj_ prefix. Redid indent. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1525 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/include/bus.h | 2 +- urjtag/include/cable.h | 2 +- urjtag/include/flash.h | 20 ++- urjtag/include/jim.h | 32 ++-- urjtag/include/parport.h | 2 +- urjtag/include/usbconn.h | 2 +- urjtag/src/bus/au1500.c | 2 +- urjtag/src/bus/avr32.c | 2 +- urjtag/src/bus/bcm1250.c | 2 +- urjtag/src/bus/bf533_ezkit.c | 2 +- urjtag/src/bus/bf533_stamp.c | 2 +- urjtag/src/bus/bf537_stamp.c | 10 +- urjtag/src/bus/bf548_ezkit.c | 2 +- urjtag/src/bus/bf561_ezkit.c | 2 +- urjtag/src/bus/bscoach.c | 2 +- urjtag/src/bus/buses.c | 74 ++++---- urjtag/src/bus/buses.h | 72 ++++---- urjtag/src/bus/ejtag.c | 2 +- urjtag/src/bus/ejtag_dma.c | 2 +- urjtag/src/bus/fjmem.c | 2 +- urjtag/src/bus/h7202.c | 2 +- urjtag/src/bus/ixp425.c | 2 +- urjtag/src/bus/jopcyc.c | 2 +- urjtag/src/bus/lh7a400.c | 2 +- urjtag/src/bus/mpc5200.c | 2 +- urjtag/src/bus/mpc824x.c | 2 +- urjtag/src/bus/ppc405ep.c | 2 +- urjtag/src/bus/ppc440gx_ebc8.c | 2 +- urjtag/src/bus/prototype.c | 2 +- urjtag/src/bus/pxa2x0.c | 4 +- urjtag/src/bus/s3c4510x.c | 40 ++--- urjtag/src/bus/sa1110.c | 2 +- urjtag/src/bus/sh7727.c | 2 +- urjtag/src/bus/sh7750r.c | 2 +- urjtag/src/bus/sh7751r.c | 2 +- urjtag/src/bus/sharc21065l.c | 2 +- urjtag/src/bus/slsup3.c | 2 +- urjtag/src/bus/tx4925.c | 2 +- urjtag/src/bus/zefant-xs3.c | 2 +- urjtag/src/cmd/cmd_addpart.c | 2 +- urjtag/src/cmd/cmd_bit.c | 2 +- urjtag/src/cmd/cmd_bsdl.c | 2 +- urjtag/src/cmd/cmd_bus.c | 2 +- urjtag/src/cmd/cmd_cable.c | 24 +-- urjtag/src/cmd/cmd_cmd.c | 160 ++++++++--------- urjtag/src/cmd/cmd_debug.c | 2 +- urjtag/src/cmd/cmd_detect.c | 2 +- urjtag/src/cmd/cmd_detectflash.c | 2 +- urjtag/src/cmd/cmd_discovery.c | 2 +- urjtag/src/cmd/cmd_dr.c | 2 +- urjtag/src/cmd/cmd_endian.c | 2 +- urjtag/src/cmd/cmd_eraseflash.c | 8 +- urjtag/src/cmd/cmd_flashmem.c | 8 +- urjtag/src/cmd/cmd_frequency.c | 2 +- urjtag/src/cmd/cmd_get.c | 2 +- urjtag/src/cmd/cmd_help.c | 2 +- urjtag/src/cmd/cmd_idcode.c | 2 +- urjtag/src/cmd/cmd_include.c | 4 +- urjtag/src/cmd/cmd_initbus.c | 17 +- urjtag/src/cmd/cmd_instruction.c | 2 +- urjtag/src/cmd/cmd_part.c | 2 +- urjtag/src/cmd/cmd_peekpoke.c | 4 +- urjtag/src/cmd/cmd_pod.c | 2 +- urjtag/src/cmd/cmd_print.c | 2 +- urjtag/src/cmd/cmd_quit.c | 2 +- urjtag/src/cmd/cmd_readmem.c | 2 +- urjtag/src/cmd/cmd_register.c | 2 +- urjtag/src/cmd/cmd_reset.c | 2 +- urjtag/src/cmd/cmd_salias.c | 2 +- urjtag/src/cmd/cmd_scan.c | 2 +- urjtag/src/cmd/cmd_set.c | 2 +- urjtag/src/cmd/cmd_shell.c | 2 +- urjtag/src/cmd/cmd_shift.c | 2 +- urjtag/src/cmd/cmd_signal.c | 2 +- urjtag/src/cmd/cmd_svf.c | 2 +- urjtag/src/cmd/cmd_test.c | 2 +- urjtag/src/cmd/cmd_usleep.c | 2 +- urjtag/src/cmd/cmd_writemem.c | 2 +- urjtag/src/flash/amd.c | 232 +++++++++++++----------- urjtag/src/flash/amd_flash.c | 148 ++++++++-------- urjtag/src/flash/cfi.c | 59 ++++--- urjtag/src/flash/detectflash.c | 35 ++-- urjtag/src/flash/flash.c | 92 +++++----- urjtag/src/flash/intel.c | 235 +++++++++++++------------ urjtag/src/flash/jedec.c | 35 ++-- urjtag/src/flash/jedec.h | 6 +- urjtag/src/flash/jedec_exp.c | 22 +-- urjtag/src/jim/intel_28f800b3.c | 2 +- urjtag/src/jim/some_cpu.c | 4 +- urjtag/src/jtag.c | 6 +- urjtag/src/tap/cable.c | 122 ++++++------- urjtag/src/tap/cable/arcom.c | 2 +- urjtag/src/tap/cable/byteblaster.c | 2 +- urjtag/src/tap/cable/dlc5.c | 2 +- urjtag/src/tap/cable/ea253.c | 2 +- urjtag/src/tap/cable/ei012.c | 2 +- urjtag/src/tap/cable/ft2232.c | 104 +++++------ urjtag/src/tap/cable/generic_parport.c | 12 +- urjtag/src/tap/cable/generic_usbconn.c | 159 +++++++++-------- urjtag/src/tap/cable/jim.c | 2 +- urjtag/src/tap/cable/jlink.c | 4 +- urjtag/src/tap/cable/keithkoep.c | 2 +- urjtag/src/tap/cable/lattice.c | 2 +- urjtag/src/tap/cable/mpcbdm.c | 2 +- urjtag/src/tap/cable/triton.c | 2 +- urjtag/src/tap/cable/ts7800.c | 2 +- urjtag/src/tap/cable/usbblaster.c | 18 +- urjtag/src/tap/cable/vision_ep9307.c | 2 +- urjtag/src/tap/cable/wiggler.c | 4 +- urjtag/src/tap/cable/wiggler2.c | 2 +- urjtag/src/tap/cable/xpc.c | 8 +- urjtag/src/tap/parport.c | 14 +- urjtag/src/tap/parport/direct.c | 6 +- urjtag/src/tap/parport/ppdev.c | 6 +- urjtag/src/tap/parport/ppi.c | 6 +- urjtag/src/tap/usbconn.c | 22 +-- urjtag/src/tap/usbconn/libftd2xx.c | 12 +- urjtag/src/tap/usbconn/libftdi.c | 12 +- urjtag/src/tap/usbconn/libusb.c | 6 +- 119 files changed, 1045 insertions(+), 977 deletions(-) diff --git a/urjtag/include/bus.h b/urjtag/include/bus.h index 4fad6a13..61bd6448 100644 --- a/urjtag/include/bus.h +++ b/urjtag/include/bus.h @@ -37,7 +37,7 @@ typedef struct } urj_buses_t; extern urj_buses_t urj_buses; -extern const urj_bus_driver_t *bus_drivers[]; +extern const urj_bus_driver_t *urj_bus_drivers[]; void urj_bus_buses_free (void); void urj_bus_buses_add (urj_bus_t *abus); diff --git a/urjtag/include/cable.h b/urjtag/include/cable.h index 3e43b01f..d1327799 100644 --- a/urjtag/include/cable.h +++ b/urjtag/include/cable.h @@ -160,6 +160,6 @@ int urj_tap_cable_add_queue_item (urj_cable_t *cable, int urj_tap_cable_get_queue_item (urj_cable_t *cable, urj_cable_queue_info_t *q); -extern urj_cable_driver_t *cable_drivers[]; +extern urj_cable_driver_t *urj_tap_cable_drivers[]; #endif /* URJ_CABLE_H */ diff --git a/urjtag/include/flash.h b/urjtag/include/flash.h index 554e4e8b..da0bdd15 100644 --- a/urjtag/include/flash.h +++ b/urjtag/include/flash.h @@ -57,9 +57,9 @@ typedef struct urj_flash_cfi_chip_t **cfi_chips; } urj_flash_cfi_array_t; -void urj_flash_cfi_array_free (urj_flash_cfi_array_t *cfi_array); +void urj_flash_cfi_array_free (urj_flash_cfi_array_t *urj_flash_cfi_array); int urj_flash_cfi_detect (urj_bus_t *bus, uint32_t adr, - urj_flash_cfi_array_t **cfi_array); + urj_flash_cfi_array_t **urj_flash_cfi_array); /* End of brux/cfi.h */ @@ -68,13 +68,15 @@ typedef struct unsigned int bus_width; /* 1 for 8 bits, 2 for 16 bits, 4 for 32 bits, etc. */ const char *name; const char *description; - int (*autodetect) (urj_flash_cfi_array_t *cfi_array); - void (*print_info) (urj_flash_cfi_array_t *cfi_array); - int (*erase_block) (urj_flash_cfi_array_t *cfi_array, uint32_t adr); - int (*unlock_block) (urj_flash_cfi_array_t *cfi_array, uint32_t adr); - int (*program) (urj_flash_cfi_array_t *cfi_array, uint32_t adr, + int (*autodetect) (urj_flash_cfi_array_t *urj_flash_cfi_array); + void (*print_info) (urj_flash_cfi_array_t *urj_flash_cfi_array); + int (*erase_block) (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr); + int (*unlock_block) (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr); + int (*program) (urj_flash_cfi_array_t *urj_flash_cfi_array, uint32_t adr, uint32_t *buffer, int count); - void (*readarray) (urj_flash_cfi_array_t *cfi_array); + void (*readarray) (urj_flash_cfi_array_t *urj_flash_cfi_array); } urj_flash_driver_t; #define URJ_FLASH_ERROR_NOERROR 0 @@ -90,6 +92,6 @@ void urj_flashmsbin (urj_bus_t *bus, FILE * f, int); /* end of original brux/flash.h */ -extern urj_flash_driver_t *flash_drivers[]; +extern urj_flash_driver_t *urj_flash_flash_drivers[]; #endif /* URJ_FLASH_H */ diff --git a/urjtag/include/jim.h b/urjtag/include/jim.h index 42e7b562..638a772e 100644 --- a/urjtag/include/jim.h +++ b/urjtag/include/jim.h @@ -39,22 +39,22 @@ typedef enum jim_tap_state { - URJ_JIM_RESET = 0, - URJ_JIM_SELECT_DR = 0 + 1, - URJ_JIM_CAPTURE_DR = 0 + 2, - URJ_JIM_SHIFT_DR = 0 + 3, - URJ_JIM_EXIT1_DR = 0 + 4, - URJ_JIM_PAUSE_DR = 0 + 5, - URJ_JIM_EXIT2_DR = 0 + 6, - URJ_JIM_UPDATE_DR = 0 + 7, - URJ_JIM_IDLE = 8, - URJ_JIM_SELECT_IR = 8 + 1, - URJ_JIM_CAPTURE_IR = 8 + 2, - URJ_JIM_SHIFT_IR = 8 + 3, - URJ_JIM_EXIT1_IR = 8 + 4, - URJ_JIM_PAUSE_IR = 8 + 5, - URJ_JIM_EXIT2_IR = 8 + 6, - URJ_JIM_UPDATE_IR = 8 + 7, + URJ_JIM_RESET = 0, + URJ_JIM_SELECT_DR = 0 + 1, + URJ_JIM_CAPTURE_DR = 0 + 2, + URJ_JIM_SHIFT_DR = 0 + 3, + URJ_JIM_EXIT1_DR = 0 + 4, + URJ_JIM_PAUSE_DR = 0 + 5, + URJ_JIM_EXIT2_DR = 0 + 6, + URJ_JIM_UPDATE_DR = 0 + 7, + URJ_JIM_IDLE = 8, + URJ_JIM_SELECT_IR = 8 + 1, + URJ_JIM_CAPTURE_IR = 8 + 2, + URJ_JIM_SHIFT_IR = 8 + 3, + URJ_JIM_EXIT1_IR = 8 + 4, + URJ_JIM_PAUSE_IR = 8 + 5, + URJ_JIM_EXIT2_IR = 8 + 6, + URJ_JIM_UPDATE_IR = 8 + 7, } urj_jim_tap_state_t; diff --git a/urjtag/include/parport.h b/urjtag/include/parport.h index 058303fe..b485080d 100644 --- a/urjtag/include/parport.h +++ b/urjtag/include/parport.h @@ -59,6 +59,6 @@ int urj_tap_parport_get_data (urj_parport_t *port); int urj_tap_parport_get_status (urj_parport_t *port); int urj_tap_parport_set_control (urj_parport_t *port, uint8_t data); -extern urj_parport_driver_t *parport_drivers[]; +extern urj_parport_driver_t *urj_tap_parport_drivers[]; #endif /* URJ_PARPORT_H */ diff --git a/urjtag/include/usbconn.h b/urjtag/include/usbconn.h index 1218e773..e1351991 100644 --- a/urjtag/include/usbconn.h +++ b/urjtag/include/usbconn.h @@ -67,6 +67,6 @@ int urj_tap_usbconn_close (urj_usbconn_t *conn); int urj_tap_usbconn_read (urj_usbconn_t *conn, uint8_t *buf, int len); int urj_tap_usbconn_write (urj_usbconn_t *conn, uint8_t *buf, int len, int recv); -extern urj_usbconn_driver_t *usbconn_drivers[]; +extern urj_usbconn_driver_t *urj_tap_usbconn_drivers[]; #endif /* URJ_USBCONN_H */ diff --git a/urjtag/src/bus/au1500.c b/urjtag/src/bus/au1500.c index 50bc9ce8..d66aff20 100644 --- a/urjtag/src/bus/au1500.c +++ b/urjtag/src/bus/au1500.c @@ -304,7 +304,7 @@ au1500_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t au1500_bus = { +const urj_bus_driver_t urj_bus_au1500_bus = { "au1500", N_("AU1500 BUS Driver via BSR"), au1500_bus_new, diff --git a/urjtag/src/bus/avr32.c b/urjtag/src/bus/avr32.c index 4779e10d..7dd367bf 100644 --- a/urjtag/src/bus/avr32.c +++ b/urjtag/src/bus/avr32.c @@ -763,7 +763,7 @@ avr32_bus_write (urj_bus_t *bus, uint32_t addr, uint32_t data) } } -const urj_bus_driver_t avr32_bus_driver = { +const urj_bus_driver_t urj_bus_avr32_bus_driver = { "avr32", N_("Atmel AVR32 multi-mode bus driver, requires parameter\n" " valid parameters:\n" diff --git a/urjtag/src/bus/bcm1250.c b/urjtag/src/bus/bcm1250.c index 5eb53c24..f4be376f 100644 --- a/urjtag/src/bus/bcm1250.c +++ b/urjtag/src/bus/bcm1250.c @@ -536,7 +536,7 @@ bcm1250_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) #endif /* #else #ifndef USE_BCM_EJTAG */ -const urj_bus_driver_t bcm1250_bus = { +const urj_bus_driver_t urj_bus_bcm1250_bus = { "bcm1250", N_("Broadcom BCM1250 compatible bus driver via BSR"), bcm1250_bus_new, diff --git a/urjtag/src/bus/bf533_ezkit.c b/urjtag/src/bus/bf533_ezkit.c index 2fa6ae12..84a2bd5f 100644 --- a/urjtag/src/bus/bf533_ezkit.c +++ b/urjtag/src/bus/bf533_ezkit.c @@ -328,7 +328,7 @@ bf533_ezkit_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t bf533_ezkit_bus = { +const urj_bus_driver_t urj_bus_bf533_ezkit_bus = { "bf533_ezkit", N_("Blackfin BF533 EZKit board bus driver"), bf533_ezkit_bus_new, diff --git a/urjtag/src/bus/bf533_stamp.c b/urjtag/src/bus/bf533_stamp.c index ade8963d..27c41584 100644 --- a/urjtag/src/bus/bf533_stamp.c +++ b/urjtag/src/bus/bf533_stamp.c @@ -330,7 +330,7 @@ bf533_stamp_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t bf533_stamp_bus = { +const urj_bus_driver_t urj_bus_bf533_stamp_bus = { "bf533_stamp", N_("Blackfin BF533 Stamp board bus driver"), bf533_stamp_bus_new, diff --git a/urjtag/src/bus/bf537_stamp.c b/urjtag/src/bus/bf537_stamp.c index fa9e7bed..ffa4cbce 100644 --- a/urjtag/src/bus/bf537_stamp.c +++ b/urjtag/src/bus/bf537_stamp.c @@ -339,7 +339,7 @@ bf537_stamp_bus_printinfo (urj_bus_t *bus) #ifdef ENABLE_BUS_BF537_STAMP -const urj_bus_driver_t bf537_stamp_bus = { +const urj_bus_driver_t urj_bus_bf537_stamp_bus = { "bf537_stamp", N_("Blackfin BF537 Stamp board bus driver via BSR"), BF537_STAMP_BUS_FUNCTIONS @@ -349,7 +349,7 @@ const urj_bus_driver_t bf537_stamp_bus = { #ifdef ENABLE_BUS_BF537_EZKIT -const urj_bus_driver_t bf537_ezkit_bus = { +const urj_bus_driver_t urj_bus_bf537_ezkit_bus = { "bf537_ezkit", N_("Blackfin BF537 EZ-KIT board bus driver via BSR"), BF537_STAMP_BUS_FUNCTIONS @@ -359,7 +359,7 @@ const urj_bus_driver_t bf537_ezkit_bus = { #ifdef ENABLE_BUS_BF527_EZKIT -const urj_bus_driver_t bf527_ezkit_bus = { +const urj_bus_driver_t urj_bus_bf527_ezkit_bus = { "bf527_ezkit", N_("Blackfin BF527 EZ-KIT board bus driver via BSR"), BF537_STAMP_BUS_FUNCTIONS @@ -369,7 +369,7 @@ const urj_bus_driver_t bf527_ezkit_bus = { #ifdef ENABLE_BUS_BF538F_EZKIT -const urj_bus_driver_t bf538f_ezkit_bus = { +const urj_bus_driver_t urj_bus_bf538f_ezkit_bus = { "bf538f_ezkit", N_("Blackfin BF538F EZ-KIT board bus driver"), BF537_STAMP_BUS_FUNCTIONS @@ -379,7 +379,7 @@ const urj_bus_driver_t bf538f_ezkit_bus = { #ifdef ENABLE_BUS_BF526_EZKIT -const urj_bus_driver_t bf526_ezkit_bus = { +const urj_bus_driver_t urj_bus_bf526_ezkit_bus = { "bf526_ezkit", N_("Blackfin BF526 EZ-KIT board bus driver"), BF537_STAMP_BUS_FUNCTIONS diff --git a/urjtag/src/bus/bf548_ezkit.c b/urjtag/src/bus/bf548_ezkit.c index b1ca6831..d8a96bb6 100644 --- a/urjtag/src/bus/bf548_ezkit.c +++ b/urjtag/src/bus/bf548_ezkit.c @@ -319,7 +319,7 @@ bf548_ezkit_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t bf548_ezkit_bus = { +const urj_bus_driver_t urj_bus_bf548_ezkit_bus = { "bf548_ezkit", N_("Blackfin BF548 EZ-KIT board bus driver"), bf548_ezkit_bus_new, diff --git a/urjtag/src/bus/bf561_ezkit.c b/urjtag/src/bus/bf561_ezkit.c index f45eaf83..3241439e 100644 --- a/urjtag/src/bus/bf561_ezkit.c +++ b/urjtag/src/bus/bf561_ezkit.c @@ -342,7 +342,7 @@ bf561_ezkit_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t bf561_ezkit_bus = { +const urj_bus_driver_t urj_bus_bf561_ezkit_bus = { "bf561_ezkit", N_("Blackfin BF561 EZ-KIT board bus driver"), bf561_ezkit_bus_new, diff --git a/urjtag/src/bus/bscoach.c b/urjtag/src/bus/bscoach.c index 39992d42..22745c4d 100644 --- a/urjtag/src/bus/bscoach.c +++ b/urjtag/src/bus/bscoach.c @@ -386,7 +386,7 @@ flashbscoach_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t bscoach_bus = { +const urj_bus_driver_t urj_bus_bscoach_bus = { "flashbscoach", N_("Goepel Boundary Scan Coach compatible bus driver for flash programming via BSR"), flashbscoach_bus_new, diff --git a/urjtag/src/bus/buses.c b/urjtag/src/bus/buses.c index 472ac2db..1274c56a 100644 --- a/urjtag/src/bus/buses.c +++ b/urjtag/src/bus/buses.c @@ -29,112 +29,112 @@ #include "bus.h" #include "buses.h" -const urj_bus_driver_t *bus_drivers[] = { +const urj_bus_driver_t *urj_bus_drivers[] = { #ifdef ENABLE_BUS_AU1500 - &au1500_bus, + &urj_bus_au1500_bus, #endif #ifdef ENABLE_BUS_AVR32 - &avr32_bus_driver, + &urj_bus_avr32_bus_driver, #endif #ifdef ENABLE_BUS_BCM1250 - &bcm1250_bus, + &urj_bus_bcm1250_bus, #endif #ifdef ENABLE_BUS_BF526_EZKIT - &bf526_ezkit_bus, + &urj_bus_bf526_ezkit_bus, #endif #ifdef ENABLE_BUS_BF527_EZKIT - &bf527_ezkit_bus, + &urj_bus_bf527_ezkit_bus, #endif #ifdef ENABLE_BUS_BF533_STAMP - &bf533_stamp_bus, + &urj_bus_bf533_stamp_bus, #endif #ifdef ENABLE_BUS_BF533_EZKIT - &bf533_ezkit_bus, + &urj_bus_bf533_ezkit_bus, #endif #ifdef ENABLE_BUS_BF537_STAMP - &bf537_stamp_bus, + &urj_bus_bf537_stamp_bus, #endif #ifdef ENABLE_BUS_BF537_EZKIT - &bf537_ezkit_bus, + &urj_bus_bf537_ezkit_bus, #endif #ifdef ENABLE_BUS_BF538F_EZKIT - &bf538f_ezkit_bus, + &urj_bus_bf538f_ezkit_bus, #endif #ifdef ENABLE_BUS_BF548_EZKIT - &bf548_ezkit_bus, + &urj_bus_bf548_ezkit_bus, #endif #ifdef ENABLE_BUS_BF561_EZKIT - &bf561_ezkit_bus, + &urj_bus_bf561_ezkit_bus, #endif #ifdef ENABLE_BUS_BSCOACH - &bscoach_bus, + &urj_bus_bscoach_bus, #endif #ifdef ENABLE_BUS_EJTAG - &ejtag_bus, - &ejtag_dma_bus, + &urj_bus_ejtag_bus, + &urj_bus_ejtag_dma_bus, #endif #ifdef ENABLE_BUS_FJMEM - &fjmem_bus, + &urj_bus_fjmem_bus, #endif #ifdef ENABLE_BUS_IXP425 - &ixp425_bus, + &urj_bus_ixp425_bus, #endif #ifdef ENABLE_BUS_JOPCYC - &jopcyc_bus, + &urj_bus_jopcyc_bus, #endif #ifdef ENABLE_BUS_H7202 - &h7202_bus, + &urj_bus_h7202_bus, #endif #ifdef ENABLE_BUS_LH7A400 - &lh7a400_bus, + &urj_bus_lh7a400_bus, #endif #ifdef ENABLE_BUS_MPC5200 - &mpc5200_bus, + &urj_bus_mpc5200_bus, #endif #ifdef ENABLE_BUS_MPC824X - &mpc824x_bus, + &urj_bus_mpc824x_bus, #endif #ifdef ENABLE_BUS_PPC405EP - &ppc405ep_bus, + &urj_bus_ppc405ep_bus, #endif #ifdef ENABLE_BUS_PPC440GX_EBC8 - &ppc440gx_ebc8_bus, + &urj_bus_ppc440gx_ebc8_bus, #endif #ifdef ENABLE_BUS_PROTOTYPE - &prototype_bus, + &urj_bus_prototype_bus, #endif #ifdef ENABLE_BUS_PXA2X0 - &pxa2x0_bus, + &urj_bus_pxa2x0_bus, #endif #ifdef ENABLE_BUS_PXA27X - &pxa27x_bus, + &urj_bus_pxa27x_bus, #endif #ifdef ENABLE_BUS_S3C4510 - &s3c4510_bus, + &urj_bus_s3c4510_bus, #endif #ifdef ENABLE_BUS_SA1110 - &sa1110_bus, + &urj_bus_sa1110_bus, #endif #ifdef ENABLE_BUS_SH7727 - &sh7727_bus, + &urj_bus_sh7727_bus, #endif #ifdef ENABLE_BUS_SH7750R - &sh7750r_bus, + &urj_bus_sh7750r_bus, #endif #ifdef ENABLE_BUS_SH7751R - &sh7751r_bus, + &urj_bus_sh7751r_bus, #endif #ifdef ENABLE_BUS_SHARC_21065L - &sharc_21065L_bus, + &urj_bus_sharc_21065L_bus, #endif #ifdef ENABLE_BUS_SLSUP3 - &slsup3_bus, + &urj_bus_slsup3_bus, #endif #ifdef ENABLE_BUS_TX4925 - &tx4925_bus, + &urj_bus_tx4925_bus, #endif #ifdef ENABLE_BUS_ZEFANT_XS3 - &zefant_xs3_bus, + &urj_bus_zefant_xs3_bus, #endif NULL /* last must be NULL */ }; diff --git a/urjtag/src/bus/buses.h b/urjtag/src/bus/buses.h index 9f2a807a..6a5d7737 100644 --- a/urjtag/src/bus/buses.h +++ b/urjtag/src/bus/buses.h @@ -25,40 +25,40 @@ #ifndef URJ_BUS_BUSES_H #define URJ_BUS_BUSES_H -extern const urj_bus_driver_t au1500_bus; -extern const urj_bus_driver_t avr32_bus_driver; -extern const urj_bus_driver_t bcm1250_bus; -extern const urj_bus_driver_t bf526_ezkit_bus; -extern const urj_bus_driver_t bf527_ezkit_bus; -extern const urj_bus_driver_t bf533_stamp_bus; -extern const urj_bus_driver_t bf533_ezkit_bus; -extern const urj_bus_driver_t bf537_stamp_bus; -extern const urj_bus_driver_t bf537_ezkit_bus; -extern const urj_bus_driver_t bf538f_ezkit_bus; -extern const urj_bus_driver_t bf548_ezkit_bus; -extern const urj_bus_driver_t bf561_ezkit_bus; -extern const urj_bus_driver_t bscoach_bus; -extern const urj_bus_driver_t ejtag_bus; -extern const urj_bus_driver_t fjmem_bus; -extern const urj_bus_driver_t h7202_bus; -extern const urj_bus_driver_t ixp425_bus; -extern const urj_bus_driver_t jopcyc_bus; -extern const urj_bus_driver_t lh7a400_bus; -extern const urj_bus_driver_t mpc5200_bus; -extern const urj_bus_driver_t mpc824x_bus; -extern const urj_bus_driver_t ppc405ep_bus; -extern const urj_bus_driver_t ppc440gx_ebc8_bus; -extern const urj_bus_driver_t prototype_bus; -extern const urj_bus_driver_t pxa2x0_bus; -extern const urj_bus_driver_t pxa27x_bus; -extern const urj_bus_driver_t s3c4510_bus; -extern const urj_bus_driver_t sa1110_bus; -extern const urj_bus_driver_t sh7727_bus; -extern const urj_bus_driver_t sh7750r_bus; -extern const urj_bus_driver_t sh7751r_bus; -extern const urj_bus_driver_t sharc_21065L_bus; -extern const urj_bus_driver_t slsup3_bus; -extern const urj_bus_driver_t tx4925_bus; -extern const urj_bus_driver_t zefant_xs3_bus; -extern const urj_bus_driver_t ejtag_dma_bus; +extern const urj_bus_driver_t urj_bus_au1500_bus; +extern const urj_bus_driver_t urj_bus_avr32_bus_driver; +extern const urj_bus_driver_t urj_bus_bcm1250_bus; +extern const urj_bus_driver_t urj_bus_bf526_ezkit_bus; +extern const urj_bus_driver_t urj_bus_bf527_ezkit_bus; +extern const urj_bus_driver_t urj_bus_bf533_stamp_bus; +extern const urj_bus_driver_t urj_bus_bf533_ezkit_bus; +extern const urj_bus_driver_t urj_bus_bf537_stamp_bus; +extern const urj_bus_driver_t urj_bus_bf537_ezkit_bus; +extern const urj_bus_driver_t urj_bus_bf538f_ezkit_bus; +extern const urj_bus_driver_t urj_bus_bf548_ezkit_bus; +extern const urj_bus_driver_t urj_bus_bf561_ezkit_bus; +extern const urj_bus_driver_t urj_bus_bscoach_bus; +extern const urj_bus_driver_t urj_bus_ejtag_bus; +extern const urj_bus_driver_t urj_bus_fjmem_bus; +extern const urj_bus_driver_t urj_bus_h7202_bus; +extern const urj_bus_driver_t urj_bus_ixp425_bus; +extern const urj_bus_driver_t urj_bus_jopcyc_bus; +extern const urj_bus_driver_t urj_bus_lh7a400_bus; +extern const urj_bus_driver_t urj_bus_mpc5200_bus; +extern const urj_bus_driver_t urj_bus_mpc824x_bus; +extern const urj_bus_driver_t urj_bus_ppc405ep_bus; +extern const urj_bus_driver_t urj_bus_ppc440gx_ebc8_bus; +extern const urj_bus_driver_t urj_bus_prototype_bus; +extern const urj_bus_driver_t urj_bus_pxa2x0_bus; +extern const urj_bus_driver_t urj_bus_pxa27x_bus; +extern const urj_bus_driver_t urj_bus_s3c4510_bus; +extern const urj_bus_driver_t urj_bus_sa1110_bus; +extern const urj_bus_driver_t urj_bus_sh7727_bus; +extern const urj_bus_driver_t urj_bus_sh7750r_bus; +extern const urj_bus_driver_t urj_bus_sh7751r_bus; +extern const urj_bus_driver_t urj_bus_sharc_21065L_bus; +extern const urj_bus_driver_t urj_bus_slsup3_bus; +extern const urj_bus_driver_t urj_bus_tx4925_bus; +extern const urj_bus_driver_t urj_bus_zefant_xs3_bus; +extern const urj_bus_driver_t urj_bus_ejtag_dma_bus; #endif /* URJ_BUS_BUSES_H */ diff --git a/urjtag/src/bus/ejtag.c b/urjtag/src/bus/ejtag.c index 34b1f51b..5c3866a3 100644 --- a/urjtag/src/bus/ejtag.c +++ b/urjtag/src/bus/ejtag.c @@ -726,7 +726,7 @@ ejtag_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) // printf("URJ_BUS_WRITE: adr=0x%08x data=0x%08x\n", adr, data); } -const urj_bus_driver_t ejtag_bus = { +const urj_bus_driver_t urj_bus_ejtag_bus = { "ejtag", N_("EJTAG compatible bus driver via PrAcc"), ejtag_bus_new, diff --git a/urjtag/src/bus/ejtag_dma.c b/urjtag/src/bus/ejtag_dma.c index 0e05df31..2d2600fd 100644 --- a/urjtag/src/bus/ejtag_dma.c +++ b/urjtag/src/bus/ejtag_dma.c @@ -672,7 +672,7 @@ ejtag_dma_bus_read_end (urj_bus_t *bus) return _data_read; } -const urj_bus_driver_t ejtag_dma_bus = { +const urj_bus_driver_t urj_bus_ejtag_dma_bus = { "ejtag_dma", N_("EJTAG compatible bus driver via DMA"), ejtag_dma_bus_new, diff --git a/urjtag/src/bus/fjmem.c b/urjtag/src/bus/fjmem.c index 4280f1a6..bfa1720f 100644 --- a/urjtag/src/bus/fjmem.c +++ b/urjtag/src/bus/fjmem.c @@ -763,7 +763,7 @@ fjmem_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t fjmem_bus = { +const urj_bus_driver_t urj_bus_fjmem_bus = { "fjmem", N_("FPGA JTAG memory bus driver via USER register, requires parameters:\n" " opcode= [len=]"), diff --git a/urjtag/src/bus/h7202.c b/urjtag/src/bus/h7202.c index b400f6f0..fad77fd8 100644 --- a/urjtag/src/bus/h7202.c +++ b/urjtag/src/bus/h7202.c @@ -300,7 +300,7 @@ h7202_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t h7202_bus = { +const urj_bus_driver_t urj_bus_h7202_bus = { "h7202", "H7202 compatible bus driver via BSR", h7202_bus_new, diff --git a/urjtag/src/bus/ixp425.c b/urjtag/src/bus/ixp425.c index cd3948ad..04942f30 100644 --- a/urjtag/src/bus/ixp425.c +++ b/urjtag/src/bus/ixp425.c @@ -295,7 +295,7 @@ ixp425_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t ixp425_bus = { +const urj_bus_driver_t urj_bus_ixp425_bus = { "ixp425", N_("Intel IXP425 compatible bus driver via BSR"), ixp425_bus_new, diff --git a/urjtag/src/bus/jopcyc.c b/urjtag/src/bus/jopcyc.c index 3a8a17a5..bb636848 100644 --- a/urjtag/src/bus/jopcyc.c +++ b/urjtag/src/bus/jopcyc.c @@ -699,7 +699,7 @@ jopcyc_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t jopcyc_bus = { +const urj_bus_driver_t urj_bus_jopcyc_bus = { "jopcyc", N_("JOP.design Cyclone Board compatible bus driver via BSR"), jopcyc_bus_new, diff --git a/urjtag/src/bus/lh7a400.c b/urjtag/src/bus/lh7a400.c index 3450754f..88e4b91d 100644 --- a/urjtag/src/bus/lh7a400.c +++ b/urjtag/src/bus/lh7a400.c @@ -330,7 +330,7 @@ lh7a400_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t lh7a400_bus = { +const urj_bus_driver_t urj_bus_lh7a400_bus = { "lh7a400", N_("Sharp LH7A400 compatible bus driver via BSR (flash access only!)"), lh7a400_bus_new, diff --git a/urjtag/src/bus/mpc5200.c b/urjtag/src/bus/mpc5200.c index 80b36974..11041d75 100644 --- a/urjtag/src/bus/mpc5200.c +++ b/urjtag/src/bus/mpc5200.c @@ -393,7 +393,7 @@ mpc5200_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t mpc5200_bus = { +const urj_bus_driver_t urj_bus_mpc5200_bus = { "mpc5200", N_("Freescale MPC5200 compatible bus driver via BSR, parameter: [mux]"), mpc5200_bus_new, diff --git a/urjtag/src/bus/mpc824x.c b/urjtag/src/bus/mpc824x.c index eb58ede8..91578b87 100644 --- a/urjtag/src/bus/mpc824x.c +++ b/urjtag/src/bus/mpc824x.c @@ -565,7 +565,7 @@ mpc824x_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) } -const urj_bus_driver_t mpc824x_bus = { +const urj_bus_driver_t urj_bus_mpc824x_bus = { "mpc824x", N_("Motorola MPC824x compatible bus driver via BSR"), mpc824x_bus_new, diff --git a/urjtag/src/bus/ppc405ep.c b/urjtag/src/bus/ppc405ep.c index 01b12823..11f4975a 100644 --- a/urjtag/src/bus/ppc405ep.c +++ b/urjtag/src/bus/ppc405ep.c @@ -270,7 +270,7 @@ ppc405ep_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t ppc405ep_bus = { +const urj_bus_driver_t urj_bus_ppc405ep_bus = { "ppc405ep", N_("IBM PowerPC 405EP compatible bus driver via BSR"), ppc405ep_bus_new, diff --git a/urjtag/src/bus/ppc440gx_ebc8.c b/urjtag/src/bus/ppc440gx_ebc8.c index 1b7241da..ca707bba 100644 --- a/urjtag/src/bus/ppc440gx_ebc8.c +++ b/urjtag/src/bus/ppc440gx_ebc8.c @@ -276,7 +276,7 @@ ppc440gx_ebc8_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t ppc440gx_ebc8_bus = { +const urj_bus_driver_t urj_bus_ppc440gx_ebc8_bus = { "ppc440gx_ebc8", N_("IBM PowerPC 440GX 8-bit EBC compatible bus driver via BSR"), ppc440gx_ebc8_bus_new, diff --git a/urjtag/src/bus/prototype.c b/urjtag/src/bus/prototype.c index 1781555f..65a4dd5d 100644 --- a/urjtag/src/bus/prototype.c +++ b/urjtag/src/bus/prototype.c @@ -485,7 +485,7 @@ prototype_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t prototype_bus = { +const urj_bus_driver_t urj_bus_prototype_bus = { "prototype", N_("Configurable prototype bus driver via BSR, requires parameters:\n" " amsb= alsb= dmsb= dlsb=\n" diff --git a/urjtag/src/bus/pxa2x0.c b/urjtag/src/bus/pxa2x0.c index 7c2f41d1..3461ac3a 100644 --- a/urjtag/src/bus/pxa2x0.c +++ b/urjtag/src/bus/pxa2x0.c @@ -748,7 +748,7 @@ pxa2xx_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t pxa2x0_bus = { +const urj_bus_driver_t urj_bus_pxa2x0_bus = { "pxa2x0", N_("Intel PXA2x0 compatible bus driver via BSR"), pxa2xx_bus_new, @@ -764,7 +764,7 @@ const urj_bus_driver_t pxa2x0_bus = { pxa2xx_bus_init }; -const urj_bus_driver_t pxa27x_bus = { +const urj_bus_driver_t urj_bus_pxa27x_bus = { "pxa27x", N_("Intel PXA27x compatible bus driver via BSR"), pxa2xx_bus_new, diff --git a/urjtag/src/bus/s3c4510x.c b/urjtag/src/bus/s3c4510x.c index d63d9dfb..29ac53bb 100644 --- a/urjtag/src/bus/s3c4510x.c +++ b/urjtag/src/bus/s3c4510x.c @@ -433,7 +433,7 @@ s3c4510_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) DEBUG_LVL2 (printf ("URJ_BUS_WRITE %08x @ %08x\n", data, adr);)} -const urj_bus_driver_t s3c4510_bus = { +const urj_bus_driver_t urj_bus_s3c4510_bus = { "s3c4510x", N_("Samsung S3C4510B compatible bus driver via BSR"), s3c4510_bus_new, @@ -458,64 +458,64 @@ const urj_bus_driver_t s3c4510_bus = { ** Revision 1.5 2003/09/10 12:38:01 telka ** 2003-09-10 Marcel Telka ** -** * src/bus/bcm1250.c (bcm1250_bus_printinfo, bcm1250_bus): Fixed typo (compatibile->compatible) in +** * src/bus/bcm1250.c (bcm1250_bus_printinfo, urj_bus_bcm1250_bus): Fixed typo (compatibile->compatible) in ** output message (thanks to Andreas Mohr). -** * src/bus/ixp425.c (ixp425_bus_printinfo, ixp425_bus): Ditto. -** * src/bus/pxa2x0.c (pxa2x0_bus_printinfo, pxa2x0_bus): Ditto. -** * src/bus/s3c4510x.c (s3c4510_bus_printinfo, s3c4510_bus): Ditto. -** * src/bus/sa1110.c (sa1110_bus_printinfo, sa1110_bus): Ditto. -** * src/bus/sh7727.c (sh7727_bus_printinfo, sh7727_bus): Ditto. -** * src/bus/sh7750r.c (sh7750r_bus_printinfo, sh7750r_bus): Ditto. -** * src/bus/sh7751r.c (sh7751r_bus_printinfo, sh7751r_bus): Ditto. +** * src/bus/ixp425.c (ixp425_bus_printinfo, urj_bus_ixp425_bus): Ditto. +** * src/bus/pxa2x0.c (pxa2x0_bus_printinfo, urj_bus_pxa2x0_bus): Ditto. +** * src/bus/s3c4510x.c (s3c4510_bus_printinfo, urj_bus_s3c4510_bus): Ditto. +** * src/bus/sa1110.c (sa1110_bus_printinfo, urj_bus_sa1110_bus): Ditto. +** * src/bus/sh7727.c (sh7727_bus_printinfo, urj_bus_sh7727_bus): Ditto. +** * src/bus/sh7750r.c (sh7750r_bus_printinfo, urj_bus_sh7750r_bus): Ditto. +** * src/bus/sh7751r.c (sh7751r_bus_printinfo, urj_bus_sh7751r_bus): Ditto. ** ** Revision 1.4 2003/09/05 21:09:14 telka ** 2003-09-05 Marcel Telka ** -** * include/bus.h (bus_drivers): Added constant declaration. +** * include/bus.h (urj_bus_drivers): Added constant declaration. ** (new_sa1110_bus, new_pxa250_bus, new_ixp425_bus, new_sh7727_bus, new_sh7750r_bus, new_sh7751r_bus) ** (new_bcm1250_bus): Function declarations removed. -** * src/bus/buses.c (bus_drivers): New constant definition. +** * src/bus/buses.c (urj_bus_drivers): New constant definition. ** * src/bus/buses.h: New file. ** * src/bus/Makefile.am (libbus_a_SOURCES): Added buses.h. ** ** * src/bus/bcm1250.c (bcm1250_bus_printinfo): Added new function parameter 'bus'. -** (bcm1250_bus): Changed structure type to urj_bus_driver_t. Changed members. +** (urj_bus_bcm1250_bus): Changed structure type to urj_bus_driver_t. Changed members. ** (new_bcm1250_bus): Function renamed ... ** (bcm1250_bus_new): ... to this one. Changed parameter list to void (and function body updated). ** * src/bus/ixp425.c (ixp425_bus_printinfo): Added new function parameter 'bus'. -** (ixp425_bus): Changed structure type to urj_bus_driver_t. Changed members. +** (urj_bus_ixp425_bus): Changed structure type to urj_bus_driver_t. Changed members. ** (new_ixp425_bus): Function renamed ... ** (ixp425_bus_new): ... to this one. Changed parameter list to void (and function body updated). ** * src/bus/pxa2x0.c (pxa2x0_bus_printinfo): Added new function parameter 'bus'. ** (pxa250_bus): Structure transformed ... -** (pxa2x0_bus): ... to this constant (changed type to urj_bus_driver_t, changed members). +** (urj_bus_pxa2x0_bus): ... to this constant (changed type to urj_bus_driver_t, changed members). ** (new_pxa250_bus): Function renamed ... ** (pxa2x0_bus_new): ... to this one. Changed parameter list to void (and function body updated). ** * src/bus/s3c4510x.c (s3c4510_bus_printinfo): Added new function parameter 'bus'. -** (s3c4510_bus): Changed structure type to urj_bus_driver_t. Changed members. +** (urj_bus_s3c4510_bus): Changed structure type to urj_bus_driver_t. Changed members. ** (new_s3c4510_bus): Function renamed ... ** (s3c4510_bus_new): ... to this one. Changed parameter list to void (and function body updated). ** * src/bus/sa1110.c (sa1110_bus_printinfo): Added new function parameter 'bus'. -** (sa1110_bus): Changed structure type to urj_bus_driver_t. Changed members. +** (urj_bus_sa1110_bus): Changed structure type to urj_bus_driver_t. Changed members. ** (new_sa1110_bus): Function renamed ... ** (sa1110_bus_new): ... to this one. Changed parameter list to void (and function body updated). ** * src/bus/sh7727.c (sh7727_bus_printinfo): Added new function parameter 'bus'. -** (sh7727_bus): Changed structure type to urj_bus_driver_t. Changed members. +** (urj_bus_sh7727_bus): Changed structure type to urj_bus_driver_t. Changed members. ** (new_sh7727_bus): Function renamed ... ** (sh7727_bus_new): ... to this one. Changed parameter list to void (and function body updated). ** * src/bus/sh7750r.c (sh7750r_bus_printinfo): Added new function parameter 'bus'. -** (sh7750r_bus): Changed structure type to urj_bus_driver_t. Changed members. +** (urj_bus_sh7750r_bus): Changed structure type to urj_bus_driver_t. Changed members. ** (new_sh7750r_bus): Function renamed ... ** (sh7750r_bus_new): ... to this one. Changed parameter list to void (and function body updated). ** * src/bus/sh7751r.c (sh7751r_bus_printinfo): Added new function parameter 'bus'. -** (sh7751r_bus): Changed structure type to urj_bus_driver_t. Changed members. +** (urj_bus_sh7751r_bus): Changed structure type to urj_bus_driver_t. Changed members. ** (new_sh7751r_bus): Function renamed ... ** (sh7751r_bus_new): ... to this one. Changed parameter list to void (and function body updated). ** ** * src/cmd/cable.c (cmd_cable_run): Replaced bus->free() call with URJ_BUS_FREE(). ** * src/jtag.c (main): Ditto. ** -** * src/cmd/cmd.c (cmds): Added cmd_initbus. +** * src/cmd/cmd.c (cmds): Added urj_cmd_initbus. ** * src/cmd/detect.c (cmd_detect_run): Removed explicit bus driver detection. ** * src/cmd/initbus.c: New file. ** * src/cmd/Makefile.am (libcmd_a_SOURCES): Added initbus.c. diff --git a/urjtag/src/bus/sa1110.c b/urjtag/src/bus/sa1110.c index 061e8b3c..35063cc7 100644 --- a/urjtag/src/bus/sa1110.c +++ b/urjtag/src/bus/sa1110.c @@ -312,7 +312,7 @@ sa1110_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t sa1110_bus = { +const urj_bus_driver_t urj_bus_sa1110_bus = { "sa1110", N_("Intel SA-1110 compatible bus driver via BSR"), sa1110_bus_new, diff --git a/urjtag/src/bus/sh7727.c b/urjtag/src/bus/sh7727.c index a803516f..c758a8af 100644 --- a/urjtag/src/bus/sh7727.c +++ b/urjtag/src/bus/sh7727.c @@ -352,7 +352,7 @@ sh7727_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t sh7727_bus = { +const urj_bus_driver_t urj_bus_sh7727_bus = { "sh7727", N_("Hitachi SH7727 compatible bus driver via BSR"), sh7727_bus_new, diff --git a/urjtag/src/bus/sh7750r.c b/urjtag/src/bus/sh7750r.c index de286812..b46aa31a 100644 --- a/urjtag/src/bus/sh7750r.c +++ b/urjtag/src/bus/sh7750r.c @@ -333,7 +333,7 @@ sh7750r_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t sh7750r_bus = { +const urj_bus_driver_t urj_bus_sh7750r_bus = { "sh7750r", N_("Hitachi SH7750R compatible bus driver via BSR"), sh7750r_bus_new, diff --git a/urjtag/src/bus/sh7751r.c b/urjtag/src/bus/sh7751r.c index 1824071d..f8877c10 100644 --- a/urjtag/src/bus/sh7751r.c +++ b/urjtag/src/bus/sh7751r.c @@ -321,7 +321,7 @@ sh7751r_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t sh7751r_bus = { +const urj_bus_driver_t urj_bus_sh7751r_bus = { "sh7751r", N_("Hitachi SH7751R compatible bus driver via BSR"), sh7751r_bus_new, diff --git a/urjtag/src/bus/sharc21065l.c b/urjtag/src/bus/sharc21065l.c index 567384ea..cc1e4c4d 100644 --- a/urjtag/src/bus/sharc21065l.c +++ b/urjtag/src/bus/sharc21065l.c @@ -317,7 +317,7 @@ sharc_21065L_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t sharc_21065L_bus = { +const urj_bus_driver_t urj_bus_sharc_21065L_bus = { "SHARC_21065L", N_("SHARC_21065L compatible bus driver via BSR"), sharc_21065L_bus_new, diff --git a/urjtag/src/bus/slsup3.c b/urjtag/src/bus/slsup3.c index 66313fc0..263cb85e 100644 --- a/urjtag/src/bus/slsup3.c +++ b/urjtag/src/bus/slsup3.c @@ -444,7 +444,7 @@ slsup3_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) } } -const urj_bus_driver_t slsup3_bus = { +const urj_bus_driver_t urj_bus_slsup3_bus = { "slsup3", N_("SLS UP3 compatible bus driver via BSR"), slsup3_bus_new, diff --git a/urjtag/src/bus/tx4925.c b/urjtag/src/bus/tx4925.c index 81cfb49c..bc50aff7 100644 --- a/urjtag/src/bus/tx4925.c +++ b/urjtag/src/bus/tx4925.c @@ -316,7 +316,7 @@ tx4925_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_tap_chain_shift_data_registers (chain, 0); } -const urj_bus_driver_t tx4925_bus = { +const urj_bus_driver_t urj_bus_tx4925_bus = { "tx4925", N_("Toshiba TX4925 compatible bus driver via BSR"), tx4925_bus_new, diff --git a/urjtag/src/bus/zefant-xs3.c b/urjtag/src/bus/zefant-xs3.c index 8e6a67c5..b0890b04 100644 --- a/urjtag/src/bus/zefant-xs3.c +++ b/urjtag/src/bus/zefant-xs3.c @@ -990,7 +990,7 @@ zefant_xs3_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) } } -const urj_bus_driver_t zefant_xs3_bus = { +const urj_bus_driver_t urj_bus_zefant_xs3_bus = { "zefant-xs3", N_("Simple Solutions Zefant-XS3 Board compatible bus driver via BSR"), zefant_xs3_bus_new, diff --git a/urjtag/src/cmd/cmd_addpart.c b/urjtag/src/cmd/cmd_addpart.c index 8f487870..b30b85a3 100644 --- a/urjtag/src/cmd/cmd_addpart.c +++ b/urjtag/src/cmd/cmd_addpart.c @@ -73,7 +73,7 @@ cmd_addpart_help (void) } -urj_cmd_t cmd_addpart = { +urj_cmd_t urj_cmd_addpart = { "addpart", N_("manually adds parts on the JTAG chain"), cmd_addpart_help, diff --git a/urjtag/src/cmd/cmd_bit.c b/urjtag/src/cmd/cmd_bit.c index dfe99a8a..cd77a6b2 100644 --- a/urjtag/src/cmd/cmd_bit.c +++ b/urjtag/src/cmd/cmd_bit.c @@ -226,7 +226,7 @@ cmd_bit_help (void) "CSTATE Control state, valid state is only Z\n"), "bit"); } -urj_cmd_t cmd_bit = { +urj_cmd_t urj_cmd_bit = { "bit", N_("define new BSR bit"), cmd_bit_help, diff --git a/urjtag/src/cmd/cmd_bsdl.c b/urjtag/src/cmd/cmd_bsdl.c index 96e7483e..107d4eb4 100644 --- a/urjtag/src/cmd/cmd_bsdl.c +++ b/urjtag/src/cmd/cmd_bsdl.c @@ -118,7 +118,7 @@ cmd_bsdl_help (void) "bsdl", "bsdl", "bsdl", "bsdl"); } -urj_cmd_t cmd_bsdl = { +urj_cmd_t urj_cmd_bsdl = { "bsdl", N_("manage BSDL files"), cmd_bsdl_help, diff --git a/urjtag/src/cmd/cmd_bus.c b/urjtag/src/cmd/cmd_bus.c index 1addc10c..f2c567db 100644 --- a/urjtag/src/cmd/cmd_bus.c +++ b/urjtag/src/cmd/cmd_bus.c @@ -70,7 +70,7 @@ cmd_bus_help (void) "\n" "BUS bus number\n"), "bus"); } -urj_cmd_t cmd_bus = { +urj_cmd_t urj_cmd_bus = { "bus", N_("change active bus"), cmd_bus_help, diff --git a/urjtag/src/cmd/cmd_cable.c b/urjtag/src/cmd/cmd_cable.c index 294ff05f..af2a0e0f 100644 --- a/urjtag/src/cmd/cmd_cable.c +++ b/urjtag/src/cmd/cmd_cable.c @@ -49,11 +49,11 @@ cmd_cable_run (urj_chain_t *chain, char *params[]) return -1; /* maybe old syntax was used? search connection type driver */ - for (i = 0; parport_drivers[i]; i++) - if (strcasecmp (params[1], parport_drivers[i]->type) == 0) + for (i = 0; urj_tap_parport_drivers[i]; i++) + if (strcasecmp (params[1], urj_tap_parport_drivers[i]->type) == 0) break; - if (parport_drivers[i] != 0) + if (urj_tap_parport_drivers[i] != 0) { /* Old syntax was used. Swap params. */ printf (_ @@ -71,10 +71,10 @@ cmd_cable_run (urj_chain_t *chain, char *params[]) } /* search cable driver list */ - for (i = 0; cable_drivers[i]; i++) - if (strcasecmp (params[1], cable_drivers[i]->name) == 0) + for (i = 0; urj_tap_cable_drivers[i]; i++) + if (strcasecmp (params[1], urj_tap_cable_drivers[i]->name) == 0) break; - if (!cable_drivers[i]) + if (!urj_tap_cable_drivers[i]) { printf (_("Unknown cable type: %s\n"), params[1]); return 1; @@ -84,7 +84,7 @@ cmd_cable_run (urj_chain_t *chain, char *params[]) { if (strcasecmp (params[2], "help") == 0) { - cable_drivers[i]->help (cable_drivers[i]->name); + urj_tap_cable_drivers[i]->help (urj_tap_cable_drivers[i]->name); return 1; } } @@ -104,7 +104,7 @@ cmd_cable_run (urj_chain_t *chain, char *params[]) return 1; } - cable->driver = cable_drivers[i]; + cable->driver = urj_tap_cable_drivers[i]; if (cable->driver->connect (++params, cable)) { @@ -142,12 +142,12 @@ cmd_cable_help (void) "Type \"cable DRIVER help\" for info about options for cable DRIVER.\n" "\n" "List of supported cables:\n"), "cable"); - for (i = 0; cable_drivers[i]; i++) - printf (_("%-13s %s\n"), cable_drivers[i]->name, - _(cable_drivers[i]->description)); + for (i = 0; urj_tap_cable_drivers[i]; i++) + printf (_("%-13s %s\n"), urj_tap_cable_drivers[i]->name, + _(urj_tap_cable_drivers[i]->description)); } -urj_cmd_t cmd_cable = { +urj_cmd_t urj_cmd_cable = { "cable", N_("select JTAG cable"), cmd_cable_help, diff --git a/urjtag/src/cmd/cmd_cmd.c b/urjtag/src/cmd/cmd_cmd.c index cea7a301..76c3bce9 100644 --- a/urjtag/src/cmd/cmd_cmd.c +++ b/urjtag/src/cmd/cmd_cmd.c @@ -34,96 +34,96 @@ #include "cmd.h" -extern urj_cmd_t cmd_quit; -extern urj_cmd_t cmd_help; -extern urj_cmd_t cmd_frequency; -extern urj_cmd_t cmd_cable; -extern urj_cmd_t cmd_reset; -extern urj_cmd_t cmd_discovery; -extern urj_cmd_t cmd_idcode; -extern urj_cmd_t cmd_detect; -extern urj_cmd_t cmd_signal; -extern urj_cmd_t cmd_scan; -extern const urj_cmd_t cmd_salias; -extern urj_cmd_t cmd_bit; -extern urj_cmd_t cmd_register; -extern const urj_cmd_t cmd_initbus; -extern urj_cmd_t cmd_print; -extern urj_cmd_t cmd_part; -extern urj_cmd_t cmd_bus; -extern urj_cmd_t cmd_instruction; -extern urj_cmd_t cmd_shift; -extern urj_cmd_t cmd_dr; -extern urj_cmd_t cmd_get; -extern urj_cmd_t cmd_test; -extern urj_cmd_t cmd_shell; -extern urj_cmd_t cmd_set; -extern urj_cmd_t cmd_endian; -extern urj_cmd_t cmd_peek; -extern urj_cmd_t cmd_poke; -extern urj_cmd_t cmd_pod; -extern urj_cmd_t cmd_readmem; -extern urj_cmd_t cmd_writemem; -extern urj_cmd_t cmd_detectflash; -extern urj_cmd_t cmd_flashmem; -extern urj_cmd_t cmd_eraseflash; -extern urj_cmd_t cmd_script; -extern urj_cmd_t cmd_include; -extern urj_cmd_t cmd_addpart; -extern urj_cmd_t cmd_usleep; +extern urj_cmd_t urj_cmd_quit; +extern urj_cmd_t urj_cmd_help; +extern urj_cmd_t urj_cmd_frequency; +extern urj_cmd_t urj_cmd_cable; +extern urj_cmd_t urj_cmd_reset; +extern urj_cmd_t urj_cmd_discovery; +extern urj_cmd_t urj_cmd_idcode; +extern urj_cmd_t urj_cmd_detect; +extern urj_cmd_t urj_cmd_signal; +extern urj_cmd_t urj_cmd_scan; +extern const urj_cmd_t urj_cmd_salias; +extern urj_cmd_t urj_cmd_bit; +extern urj_cmd_t urj_cmd_register; +extern const urj_cmd_t urj_cmd_initbus; +extern urj_cmd_t urj_cmd_print; +extern urj_cmd_t urj_cmd_part; +extern urj_cmd_t urj_cmd_bus; +extern urj_cmd_t urj_cmd_instruction; +extern urj_cmd_t urj_cmd_shift; +extern urj_cmd_t urj_cmd_dr; +extern urj_cmd_t urj_cmd_get; +extern urj_cmd_t urj_cmd_test; +extern urj_cmd_t urj_cmd_shell; +extern urj_cmd_t urj_cmd_set; +extern urj_cmd_t urj_cmd_endian; +extern urj_cmd_t urj_cmd_peek; +extern urj_cmd_t urj_cmd_poke; +extern urj_cmd_t urj_cmd_pod; +extern urj_cmd_t urj_cmd_readmem; +extern urj_cmd_t urj_cmd_writemem; +extern urj_cmd_t urj_cmd_detectflash; +extern urj_cmd_t urj_cmd_flashmem; +extern urj_cmd_t urj_cmd_eraseflash; +extern urj_cmd_t urj_cmd_script; +extern urj_cmd_t urj_cmd_include; +extern urj_cmd_t urj_cmd_addpart; +extern urj_cmd_t urj_cmd_usleep; #ifdef ENABLE_SVF -extern urj_cmd_t cmd_svf; +extern urj_cmd_t urj_cmd_svf; #endif #ifdef ENABLE_BSDL -extern urj_cmd_t cmd_bsdl; +extern urj_cmd_t urj_cmd_bsdl; #endif -extern urj_cmd_t cmd_debug; +extern urj_cmd_t urj_cmd_debug; const urj_cmd_t *urj_cmds[] = { - &cmd_quit, - &cmd_help, - &cmd_frequency, - &cmd_cable, - &cmd_reset, - &cmd_discovery, - &cmd_idcode, - &cmd_detect, - &cmd_signal, - &cmd_scan, - &cmd_salias, - &cmd_bit, - &cmd_register, - &cmd_initbus, - &cmd_print, - &cmd_part, - &cmd_bus, - &cmd_instruction, - &cmd_shift, - &cmd_dr, - &cmd_get, - &cmd_test, - &cmd_shell, - &cmd_set, - &cmd_endian, - &cmd_peek, - &cmd_poke, - &cmd_pod, - &cmd_readmem, - &cmd_writemem, - &cmd_detectflash, - &cmd_flashmem, - &cmd_eraseflash, - &cmd_script, - &cmd_include, - &cmd_addpart, - &cmd_usleep, + &urj_cmd_quit, + &urj_cmd_help, + &urj_cmd_frequency, + &urj_cmd_cable, + &urj_cmd_reset, + &urj_cmd_discovery, + &urj_cmd_idcode, + &urj_cmd_detect, + &urj_cmd_signal, + &urj_cmd_scan, + &urj_cmd_salias, + &urj_cmd_bit, + &urj_cmd_register, + &urj_cmd_initbus, + &urj_cmd_print, + &urj_cmd_part, + &urj_cmd_bus, + &urj_cmd_instruction, + &urj_cmd_shift, + &urj_cmd_dr, + &urj_cmd_get, + &urj_cmd_test, + &urj_cmd_shell, + &urj_cmd_set, + &urj_cmd_endian, + &urj_cmd_peek, + &urj_cmd_poke, + &urj_cmd_pod, + &urj_cmd_readmem, + &urj_cmd_writemem, + &urj_cmd_detectflash, + &urj_cmd_flashmem, + &urj_cmd_eraseflash, + &urj_cmd_script, + &urj_cmd_include, + &urj_cmd_addpart, + &urj_cmd_usleep, #ifdef ENABLE_SVF - &cmd_svf, + &urj_cmd_svf, #endif #ifdef ENABLE_BSDL - &cmd_bsdl, + &urj_cmd_bsdl, #endif - &cmd_debug, + &urj_cmd_debug, NULL /* last must be NULL */ }; diff --git a/urjtag/src/cmd/cmd_debug.c b/urjtag/src/cmd/cmd_debug.c index 97c2664c..350341c8 100644 --- a/urjtag/src/cmd/cmd_debug.c +++ b/urjtag/src/cmd/cmd_debug.c @@ -57,7 +57,7 @@ cmd_debug_help (void) "\n" "n =1 fileio, 2=tap commands, 4 =?\n"), "debug n"); } -urj_cmd_t cmd_debug = { +urj_cmd_t urj_cmd_debug = { "debug", N_("debug jtag program"), cmd_debug_help, diff --git a/urjtag/src/cmd/cmd_detect.c b/urjtag/src/cmd/cmd_detect.c index 12bf32ee..740101a6 100644 --- a/urjtag/src/cmd/cmd_detect.c +++ b/urjtag/src/cmd/cmd_detect.c @@ -88,7 +88,7 @@ cmd_detect_help (void) "detect"); } -urj_cmd_t cmd_detect = { +urj_cmd_t urj_cmd_detect = { "detect", N_("detect parts on the JTAG chain"), cmd_detect_help, diff --git a/urjtag/src/cmd/cmd_detectflash.c b/urjtag/src/cmd/cmd_detectflash.c index c90808db..b5bea531 100644 --- a/urjtag/src/cmd/cmd_detectflash.c +++ b/urjtag/src/cmd/cmd_detectflash.c @@ -62,7 +62,7 @@ cmd_detectflash_help (void) "urj_flash_detectflash"); } -urj_cmd_t cmd_detectflash = { +urj_cmd_t urj_cmd_detectflash = { "urj_flash_detectflash", N_("detect parameters of flash chips attached to a part"), cmd_detectflash_help, diff --git a/urjtag/src/cmd/cmd_discovery.c b/urjtag/src/cmd/cmd_discovery.c index 73d25058..82bac395 100644 --- a/urjtag/src/cmd/cmd_discovery.c +++ b/urjtag/src/cmd/cmd_discovery.c @@ -60,7 +60,7 @@ cmd_discovery_help (void) "urj_tap_discovery"); } -urj_cmd_t cmd_discovery = { +urj_cmd_t urj_cmd_discovery = { "urj_tap_discovery", N_("urj_tap_discovery of unknown parts in the JTAG chain"), cmd_discovery_help, diff --git a/urjtag/src/cmd/cmd_dr.c b/urjtag/src/cmd/cmd_dr.c index 272383e3..a232480f 100644 --- a/urjtag/src/cmd/cmd_dr.c +++ b/urjtag/src/cmd/cmd_dr.c @@ -122,7 +122,7 @@ cmd_dr_help (void) "dr", "dr"); } -urj_cmd_t cmd_dr = { +urj_cmd_t urj_cmd_dr = { "dr", N_("display active data register for a part"), cmd_dr_help, diff --git a/urjtag/src/cmd/cmd_endian.c b/urjtag/src/cmd/cmd_endian.c index 49caa481..0afc59d8 100644 --- a/urjtag/src/cmd/cmd_endian.c +++ b/urjtag/src/cmd/cmd_endian.c @@ -69,7 +69,7 @@ cmd_endian_help (void) "endian [little|big]"); } -urj_cmd_t cmd_endian = { +urj_cmd_t urj_cmd_endian = { "endian", N_("set/print endianess"), cmd_endian_help, diff --git a/urjtag/src/cmd/cmd_eraseflash.c b/urjtag/src/cmd/cmd_eraseflash.c index df6256c3..175c2346 100644 --- a/urjtag/src/cmd/cmd_eraseflash.c +++ b/urjtag/src/cmd/cmd_eraseflash.c @@ -71,12 +71,12 @@ cmd_eraseflash_help (void) "ADDR and BLOCKS could be in decimal or hexadecimal (prefixed with 0x) form.\n" "\n" "Supported Flash Memories:\n"), "eraseflash"); - for (i = 0; flash_drivers[i]; i++) - printf (_("%s\n %s\n"), _(flash_drivers[i]->name), - _(flash_drivers[i]->description)); + for (i = 0; urj_flash_flash_drivers[i]; i++) + printf (_("%s\n %s\n"), _(urj_flash_flash_drivers[i]->name), + _(urj_flash_flash_drivers[i]->description)); } -urj_cmd_t cmd_eraseflash = { +urj_cmd_t urj_cmd_eraseflash = { "eraseflash", N_("erase flash memory by number of blocks"), cmd_eraseflash_help, diff --git a/urjtag/src/cmd/cmd_flashmem.c b/urjtag/src/cmd/cmd_flashmem.c index 980b624b..9219696f 100644 --- a/urjtag/src/cmd/cmd_flashmem.c +++ b/urjtag/src/cmd/cmd_flashmem.c @@ -94,12 +94,12 @@ cmd_flashmem_help (void) "Supported Flash Memories:\n"), "urj_flashmem", "urj_flashmem msbin", "msbin", "noverify"); - for (i = 0; flash_drivers[i]; i++) - printf (_("%s\n %s\n"), _(flash_drivers[i]->name), - _(flash_drivers[i]->description)); + for (i = 0; urj_flash_flash_drivers[i]; i++) + printf (_("%s\n %s\n"), _(urj_flash_flash_drivers[i]->name), + _(urj_flash_flash_drivers[i]->description)); } -urj_cmd_t cmd_flashmem = { +urj_cmd_t urj_cmd_flashmem = { "urj_flashmem", N_("burn flash memory with data from a file"), cmd_flashmem_help, diff --git a/urjtag/src/cmd/cmd_frequency.c b/urjtag/src/cmd/cmd_frequency.c index cc9a0584..76feaec6 100644 --- a/urjtag/src/cmd/cmd_frequency.c +++ b/urjtag/src/cmd/cmd_frequency.c @@ -73,7 +73,7 @@ cmd_frequency_help (void) "Use 0 for FREQ to disable frequency limit.\n"), "frequency"); } -urj_cmd_t cmd_frequency = { +urj_cmd_t urj_cmd_frequency = { "frequency", N_("setup JTAG frequency"), cmd_frequency_help, diff --git a/urjtag/src/cmd/cmd_get.c b/urjtag/src/cmd/cmd_get.c index 425749ce..51abe5d5 100644 --- a/urjtag/src/cmd/cmd_get.c +++ b/urjtag/src/cmd/cmd_get.c @@ -84,7 +84,7 @@ cmd_get_help (void) "get signal"); } -urj_cmd_t cmd_get = { +urj_cmd_t urj_cmd_get = { "get", N_("get external signal value"), cmd_get_help, diff --git a/urjtag/src/cmd/cmd_help.c b/urjtag/src/cmd/cmd_help.c index eba19bc6..cebcc171 100644 --- a/urjtag/src/cmd/cmd_help.c +++ b/urjtag/src/cmd/cmd_help.c @@ -72,7 +72,7 @@ cmd_help_help (void) "help"); } -urj_cmd_t cmd_help = { +urj_cmd_t urj_cmd_help = { "help", N_("display this help"), cmd_help_help, diff --git a/urjtag/src/cmd/cmd_idcode.c b/urjtag/src/cmd/cmd_idcode.c index 4519091b..2ee45256 100644 --- a/urjtag/src/cmd/cmd_idcode.c +++ b/urjtag/src/cmd/cmd_idcode.c @@ -63,7 +63,7 @@ cmd_idcode_help (void) "idcode"); } -urj_cmd_t cmd_idcode = { +urj_cmd_t urj_cmd_idcode = { "idcode", N_("Read IDCODEs of all parts in a JTAG chain"), cmd_idcode_help, diff --git a/urjtag/src/cmd/cmd_include.c b/urjtag/src/cmd/cmd_include.c index 427cd880..6bcddf95 100644 --- a/urjtag/src/cmd/cmd_include.c +++ b/urjtag/src/cmd/cmd_include.c @@ -132,7 +132,7 @@ cmd_include_help (void) cmd_include_or_script_help ("include"); } -urj_cmd_t cmd_include = { +urj_cmd_t urj_cmd_include = { "include", N_("include command sequence from external repository"), cmd_include_help, @@ -151,7 +151,7 @@ cmd_script_help (void) cmd_include_or_script_help ("script"); } -urj_cmd_t cmd_script = { +urj_cmd_t urj_cmd_script = { "script", N_("run command sequence from external file"), cmd_script_help, diff --git a/urjtag/src/cmd/cmd_initbus.c b/urjtag/src/cmd/cmd_initbus.c index 32d5b601..6d995980 100644 --- a/urjtag/src/cmd/cmd_initbus.c +++ b/urjtag/src/cmd/cmd_initbus.c @@ -54,12 +54,13 @@ cmd_initbus_run (urj_chain_t *chain, char *params[]) return 1; } - for (i = 0; bus_drivers[i] != NULL; i++) + for (i = 0; urj_bus_drivers[i] != NULL; i++) { - if (strcasecmp (bus_drivers[i]->name, params[1]) == 0) + if (strcasecmp (urj_bus_drivers[i]->name, params[1]) == 0) { - urj_bus_t *abus = - bus_drivers[i]->new_bus (chain, bus_drivers[i], params); + urj_bus_t *abus = urj_bus_drivers[i]->new_bus (chain, + urj_bus_drivers[i], + params); if (abus == NULL) { printf (_("bus alloc/attach failed!\n")); @@ -96,12 +97,12 @@ cmd_initbus_help (void) "BUSNAME Name of the bus\n" "\n" "List of available buses:\n"), "initbus"); - for (i = 0; bus_drivers[i] != NULL; i++) - printf (_("%-10s %s\n"), bus_drivers[i]->name, - bus_drivers[i]->description); + for (i = 0; urj_bus_drivers[i] != NULL; i++) + printf (_("%-10s %s\n"), urj_bus_drivers[i]->name, + urj_bus_drivers[i]->description); } -const urj_cmd_t cmd_initbus = { +const urj_cmd_t urj_cmd_initbus = { "initbus", N_("initialize bus driver for active part"), cmd_initbus_help, diff --git a/urjtag/src/cmd/cmd_instruction.c b/urjtag/src/cmd/cmd_instruction.c index b1efcf7b..69d330f2 100644 --- a/urjtag/src/cmd/cmd_instruction.c +++ b/urjtag/src/cmd/cmd_instruction.c @@ -138,7 +138,7 @@ cmd_instruction_help (void) "instruction", "instruction", "instruction"); } -urj_cmd_t cmd_instruction = { +urj_cmd_t urj_cmd_instruction = { "instruction", N_("change active instruction for a part or declare new instruction"), cmd_instruction_help, diff --git a/urjtag/src/cmd/cmd_part.c b/urjtag/src/cmd/cmd_part.c index d41aed13..0a3555a9 100644 --- a/urjtag/src/cmd/cmd_part.c +++ b/urjtag/src/cmd/cmd_part.c @@ -104,7 +104,7 @@ cmd_part_help (void) "\n" "bus->part part number | alias\n"), "part"); } -urj_cmd_t cmd_part = { +urj_cmd_t urj_cmd_part = { "part", N_("change active part for current JTAG chain"), cmd_part_help, diff --git a/urjtag/src/cmd/cmd_peekpoke.c b/urjtag/src/cmd/cmd_peekpoke.c index 00cf19ad..19697d72 100644 --- a/urjtag/src/cmd/cmd_peekpoke.c +++ b/urjtag/src/cmd/cmd_peekpoke.c @@ -88,7 +88,7 @@ cmd_peek_help (void) "\n"), "peek"); } -urj_cmd_t cmd_peek = { +urj_cmd_t urj_cmd_peek = { "peek", N_("read a single word"), cmd_peek_help, @@ -141,7 +141,7 @@ cmd_poke_help (void) "\n"), "poke"); } -urj_cmd_t cmd_poke = { +urj_cmd_t urj_cmd_poke = { "poke", N_("write a single word"), cmd_poke_help, diff --git a/urjtag/src/cmd/cmd_pod.c b/urjtag/src/cmd/cmd_pod.c index 93c54832..e3031f60 100644 --- a/urjtag/src/cmd/cmd_pod.c +++ b/urjtag/src/cmd/cmd_pod.c @@ -87,7 +87,7 @@ cmd_pod_help (void) "# 0 or 1\n"), "pod"); } -urj_cmd_t cmd_pod = { +urj_cmd_t urj_cmd_pod = { "pod", N_("Set state of POD signal(s)"), cmd_pod_help, diff --git a/urjtag/src/cmd/cmd_print.c b/urjtag/src/cmd/cmd_print.c index f307a7aa..a2c0c8c2 100644 --- a/urjtag/src/cmd/cmd_print.c +++ b/urjtag/src/cmd/cmd_print.c @@ -252,7 +252,7 @@ cmd_print_help (void) "print"); } -urj_cmd_t cmd_print = { +urj_cmd_t urj_cmd_print = { "print", N_("display JTAG chain list/status"), cmd_print_help, diff --git a/urjtag/src/cmd/cmd_quit.c b/urjtag/src/cmd/cmd_quit.c index 59de9b27..6e834acf 100644 --- a/urjtag/src/cmd/cmd_quit.c +++ b/urjtag/src/cmd/cmd_quit.c @@ -43,7 +43,7 @@ cmd_quit_help (void) printf (_("Usage: %s\n" "Exit from %s.\n"), "quit", PACKAGE); } -urj_cmd_t cmd_quit = { +urj_cmd_t urj_cmd_quit = { "quit", N_("exit and terminate this session"), cmd_quit_help, diff --git a/urjtag/src/cmd/cmd_readmem.c b/urjtag/src/cmd/cmd_readmem.c index 1a6de512..5a3327dd 100644 --- a/urjtag/src/cmd/cmd_readmem.c +++ b/urjtag/src/cmd/cmd_readmem.c @@ -77,7 +77,7 @@ cmd_readmem_help (void) "urj_bus_readmem"); } -urj_cmd_t cmd_readmem = { +urj_cmd_t urj_cmd_readmem = { "urj_bus_readmem", N_("read content of the memory and write it to file"), cmd_readmem_help, diff --git a/urjtag/src/cmd/cmd_register.c b/urjtag/src/cmd/cmd_register.c index f35eaf5d..19d62422 100644 --- a/urjtag/src/cmd/cmd_register.c +++ b/urjtag/src/cmd/cmd_register.c @@ -113,7 +113,7 @@ cmd_register_help (void) "LENGTH Data register length\n"), "register"); } -urj_cmd_t cmd_register = { +urj_cmd_t urj_cmd_register = { "register", N_("define new data register for a part"), cmd_register_help, diff --git a/urjtag/src/cmd/cmd_reset.c b/urjtag/src/cmd/cmd_reset.c index 19b5ef7d..c6460b4d 100644 --- a/urjtag/src/cmd/cmd_reset.c +++ b/urjtag/src/cmd/cmd_reset.c @@ -52,7 +52,7 @@ cmd_reset_help (void) printf (_("Usage: %s\n" "Reset current JTAG chain.\n"), "reset"); } -urj_cmd_t cmd_reset = { +urj_cmd_t urj_cmd_reset = { "reset", N_("reset JTAG chain"), cmd_reset_help, diff --git a/urjtag/src/cmd/cmd_salias.c b/urjtag/src/cmd/cmd_salias.c index fd63a993..d9d05ef0 100644 --- a/urjtag/src/cmd/cmd_salias.c +++ b/urjtag/src/cmd/cmd_salias.c @@ -94,7 +94,7 @@ cmd_salias_help (void) "SIGNAL Existing signal name\n"), "signal"); } -const urj_cmd_t cmd_salias = { +const urj_cmd_t urj_cmd_salias = { "salias", N_("define an alias for a signal"), cmd_salias_help, diff --git a/urjtag/src/cmd/cmd_scan.c b/urjtag/src/cmd/cmd_scan.c index eafdf240..e9d3baf1 100644 --- a/urjtag/src/cmd/cmd_scan.c +++ b/urjtag/src/cmd/cmd_scan.c @@ -134,7 +134,7 @@ cmd_scan_help (void) "Read BSR and show changes since last scan.\n"), "scan"); } -urj_cmd_t cmd_scan = { +urj_cmd_t urj_cmd_scan = { "scan", N_("read BSR and show changes since last scan"), cmd_scan_help, diff --git a/urjtag/src/cmd/cmd_set.c b/urjtag/src/cmd/cmd_set.c index fe9d1900..52ca584e 100644 --- a/urjtag/src/cmd/cmd_set.c +++ b/urjtag/src/cmd/cmd_set.c @@ -101,7 +101,7 @@ cmd_set_help (void) " is 'out'\n"), "set signal"); } -urj_cmd_t cmd_set = { +urj_cmd_t urj_cmd_set = { "set", N_("set external signal value"), cmd_set_help, diff --git a/urjtag/src/cmd/cmd_shell.c b/urjtag/src/cmd/cmd_shell.c index c5c1e121..09ba7ca0 100644 --- a/urjtag/src/cmd/cmd_shell.c +++ b/urjtag/src/cmd/cmd_shell.c @@ -86,7 +86,7 @@ cmd_shell_help (void) "\n" "CMMD OS Shell Command\n"), "shell cmmd"); } -urj_cmd_t cmd_shell = { +urj_cmd_t urj_cmd_shell = { "shell", N_("shell cmmd"), cmd_shell_help, diff --git a/urjtag/src/cmd/cmd_shift.c b/urjtag/src/cmd/cmd_shift.c index faa6d3f0..0b387c68 100644 --- a/urjtag/src/cmd/cmd_shift.c +++ b/urjtag/src/cmd/cmd_shift.c @@ -64,7 +64,7 @@ cmd_shift_help (void) "shift ir", "shift dr"); } -urj_cmd_t cmd_shift = { +urj_cmd_t urj_cmd_shift = { "shift", N_("shift data/instruction registers through JTAG chain"), cmd_shift_help, diff --git a/urjtag/src/cmd/cmd_signal.c b/urjtag/src/cmd/cmd_signal.c index 177d90ca..1c0bc786 100644 --- a/urjtag/src/cmd/cmd_signal.c +++ b/urjtag/src/cmd/cmd_signal.c @@ -113,7 +113,7 @@ cmd_signal_help (void) "PIN# List of pin # for a signal\n"), "signal"); } -urj_cmd_t cmd_signal = { +urj_cmd_t urj_cmd_signal = { "signal", N_("define new signal for a part"), cmd_signal_help, diff --git a/urjtag/src/cmd/cmd_svf.c b/urjtag/src/cmd/cmd_svf.c index beda6245..599e052f 100644 --- a/urjtag/src/cmd/cmd_svf.c +++ b/urjtag/src/cmd/cmd_svf.c @@ -86,7 +86,7 @@ cmd_svf_help (void) "\n" "FILE file containing SVF commands\n"), "svf"); } -urj_cmd_t cmd_svf = { +urj_cmd_t urj_cmd_svf = { "svf", N_("execute svf commands from file"), cmd_svf_help, diff --git a/urjtag/src/cmd/cmd_test.c b/urjtag/src/cmd/cmd_test.c index 7fbd2913..4008a8c7 100644 --- a/urjtag/src/cmd/cmd_test.c +++ b/urjtag/src/cmd/cmd_test.c @@ -98,7 +98,7 @@ cmd_test_help (void) "get signal"); } -urj_cmd_t cmd_test = { +urj_cmd_t urj_cmd_test = { "test", N_("test external signal value"), cmd_test_help, diff --git a/urjtag/src/cmd/cmd_usleep.c b/urjtag/src/cmd/cmd_usleep.c index bec86a69..819e5d45 100644 --- a/urjtag/src/cmd/cmd_usleep.c +++ b/urjtag/src/cmd/cmd_usleep.c @@ -55,7 +55,7 @@ cmd_usleep_help (void) "Sleep some number of microseconds.\n"), "usleep"); } -urj_cmd_t cmd_usleep = { +urj_cmd_t urj_cmd_usleep = { "usleep", N_("Sleep some number of microseconds"), cmd_usleep_help, diff --git a/urjtag/src/cmd/cmd_writemem.c b/urjtag/src/cmd/cmd_writemem.c index 27ac42bb..0c7203ea 100644 --- a/urjtag/src/cmd/cmd_writemem.c +++ b/urjtag/src/cmd/cmd_writemem.c @@ -76,7 +76,7 @@ cmd_writemem_help (void) "urj_bus_writemem"); } -urj_cmd_t cmd_writemem = { +urj_cmd_t urj_cmd_writemem = { "urj_bus_writemem", N_("write content of file to the memory"), cmd_writemem_help, diff --git a/urjtag/src/flash/amd.c b/urjtag/src/flash/amd.c index 34d0019a..68b6a2a3 100644 --- a/urjtag/src/flash/amd.c +++ b/urjtag/src/flash/amd.c @@ -47,20 +47,21 @@ static int dbg = 0; -static int amd_flash_erase_block (urj_flash_cfi_array_t *cfi_array, +static int amd_flash_erase_block (urj_flash_cfi_array_t *urj_flash_cfi_array, uint32_t adr); -static int amd_flash_unlock_block (urj_flash_cfi_array_t *cfi_array, +static int amd_flash_unlock_block (urj_flash_cfi_array_t *urj_flash_cfi_array, uint32_t adr); -static int amd_flash_program_single (urj_flash_cfi_array_t *cfi_array, - uint32_t adr, uint32_t data); -static int amd_flash_program_buffer (urj_flash_cfi_array_t *cfi_array, - uint32_t adr, uint32_t *buffer, - int count); -static int amd_flash_program (urj_flash_cfi_array_t *cfi_array, uint32_t adr, - uint32_t *buffer, int count); -static int amd_flash_program32 (urj_flash_cfi_array_t *cfi_array, +static int amd_flash_program_single (urj_flash_cfi_array_t + *urj_flash_cfi_array, uint32_t adr, + uint32_t data); +static int amd_flash_program_buffer (urj_flash_cfi_array_t + *urj_flash_cfi_array, uint32_t adr, + uint32_t *buffer, int count); +static int amd_flash_program (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr, uint32_t *buffer, int count); +static int amd_flash_program32 (urj_flash_cfi_array_t *urj_flash_cfi_array, uint32_t adr, uint32_t *buffer, int count); -static void amd_flash_read_array (urj_flash_cfi_array_t *cfi_array); +static void amd_flash_read_array (urj_flash_cfi_array_t *urj_flash_cfi_array); /* The code below assumes a connection of the flash chip address LSB (A0) * to A0, A1 or A2 of the byte-addressed CPU bus dependent on the bus width. @@ -80,14 +81,15 @@ static void amd_flash_read_array (urj_flash_cfi_array_t *cfi_array); * driver has to deal with this. - kawk 2008-01 */ static int -amd_flash_address_shift (urj_flash_cfi_array_t *cfi_array) +amd_flash_address_shift (urj_flash_cfi_array_t *urj_flash_cfi_array) { - if (cfi_array->bus_width == 4) + if (urj_flash_cfi_array->bus_width == 4) return 2; - /* else: cfi_array->bus_width is 2 (16 bit) or 1 (8 bit): */ + /* else: urj_flash_cfi_array->bus_width is 2 (16 bit) or 1 (8 bit): */ - switch (cfi_array->cfi_chips[0]->cfi.device_geometry.device_interface) + switch (urj_flash_cfi_array->cfi_chips[0]->cfi.device_geometry. + device_interface) { case CFI_INTERFACE_X8_X16: /* regardless whether 8 or 16 bit mode */ case CFI_INTERFACE_X16: /* native */ @@ -101,7 +103,7 @@ amd_flash_address_shift (urj_flash_cfi_array_t *cfi_array) break; } - if (cfi_array->bus_width == 2) + if (urj_flash_cfi_array->bus_width == 2) return 1; return 0; @@ -109,30 +111,30 @@ amd_flash_address_shift (urj_flash_cfi_array_t *cfi_array) /* autodetect, we can handle this chip */ static int -amd_flash_autodetect32 (urj_flash_cfi_array_t *cfi_array) +amd_flash_autodetect32 (urj_flash_cfi_array_t *urj_flash_cfi_array) { - if (cfi_array->bus_width != 4) + if (urj_flash_cfi_array->bus_width != 4) return 0; - return (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == - CFI_VENDOR_AMD_SCS); + return (urj_flash_cfi_array->cfi_chips[0]->cfi.identification_string. + pri_id_code == CFI_VENDOR_AMD_SCS); } static int -amd_flash_autodetect16 (urj_flash_cfi_array_t *cfi_array) +amd_flash_autodetect16 (urj_flash_cfi_array_t *urj_flash_cfi_array) { - if (cfi_array->bus_width != 2) + if (urj_flash_cfi_array->bus_width != 2) return 0; - return (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == - CFI_VENDOR_AMD_SCS); + return (urj_flash_cfi_array->cfi_chips[0]->cfi.identification_string. + pri_id_code == CFI_VENDOR_AMD_SCS); } static int -amd_flash_autodetect8 (urj_flash_cfi_array_t *cfi_array) +amd_flash_autodetect8 (urj_flash_cfi_array_t *urj_flash_cfi_array) { - if (cfi_array->bus_width != 1) + if (urj_flash_cfi_array->bus_width != 1) return 0; - return (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == - CFI_VENDOR_AMD_SCS); + return (urj_flash_cfi_array->cfi_chips[0]->cfi.identification_string. + pri_id_code == CFI_VENDOR_AMD_SCS); } /* @@ -145,10 +147,11 @@ amd_flash_autodetect8 (urj_flash_cfi_array_t *cfi_array) */ #if 0 static int -amdstatus29 (urj_flash_cfi_array_t *cfi_array, uint32_t adr, int data) +amdstatus29 (urj_flash_cfi_array_t *urj_flash_cfi_array, uint32_t adr, + int data) { - urj_bus_t *bus = cfi_array->bus; - int o = amd_flash_address_shift (cfi_array); + urj_bus_t *bus = urj_flash_cfi_array->bus; + int o = amd_flash_address_shift (urj_flash_cfi_array); int timeout; uint32_t dq7mask = ((1 << 7) << 16) + (1 << 7); uint32_t dq5mask = ((1 << 5) << 16) + (1 << 5); @@ -184,9 +187,9 @@ amdstatus29 (urj_flash_cfi_array_t *cfi_array, uint32_t adr, int data) * second implementation: see [1], page 30 */ static int -amdstatus (urj_flash_cfi_array_t *cfi_array, uint32_t adr, int data) +amdstatus (urj_flash_cfi_array_t *urj_flash_cfi_array, uint32_t adr, int data) { - urj_bus_t *bus = cfi_array->bus; + urj_bus_t *bus = urj_flash_cfi_array->bus; int timeout; uint32_t togglemask = ((1 << 6) << 16) + (1 << 6); /* DQ 6 */ @@ -221,10 +224,10 @@ amdstatus (urj_flash_cfi_array_t *cfi_array, uint32_t adr, int data) * second implementation: see [1], page 30 */ static int -amdstatus (urj_flash_cfi_array_t *cfi_array, uint32_t adr, int data) +amdstatus (urj_flash_cfi_array_t *urj_flash_cfi_array, uint32_t adr, int data) { - urj_bus_t *bus = cfi_array->bus; - int o = amd_flash_address_shift (cfi_array); + urj_bus_t *bus = urj_flash_cfi_array->bus; + int o = amd_flash_address_shift (urj_flash_cfi_array); int timeout; uint32_t togglemask = ((1 << 6) << 16) + (1 << 6); /* DQ 6 */ /* int dq5mask = ((1 << 5) << 16) + (1 << 5); DQ5 */ @@ -266,14 +269,17 @@ amdstatus (urj_flash_cfi_array_t *cfi_array, uint32_t adr, int data) #if 0 static int -amdisprotected (parts * ps, urj_flash_cfi_array_t *cfi_array, uint32_t adr) +amdisprotected (parts * ps, urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr) { uint32_t data; - int o = amd_flash_address_shift (cfi_array); + int o = amd_flash_address_shift (urj_flash_cfi_array); - URJ_BUS_WRITE (ps, cfi_array->address + (0x0555 << o), 0x00aa00aa); /* autoselect p29, sector erase */ - URJ_BUS_WRITE (ps, cfi_array->address + (0x02aa << o), 0x00550055); - URJ_BUS_WRITE (ps, cfi_array->address + (0x0555 << o), 0x00900090); + URJ_BUS_WRITE (ps, urj_flash_cfi_array->address + (0x0555 << o), 0x00aa00aa); /* autoselect p29, sector erase */ + URJ_BUS_WRITE (ps, urj_flash_cfi_array->address + (0x02aa << o), + 0x00550055); + URJ_BUS_WRITE (ps, urj_flash_cfi_array->address + (0x0555 << o), + 0x00900090); data = URJ_BUS_READ (ps, adr + (0x0002 << 2)); /* Read Array */ @@ -284,19 +290,26 @@ amdisprotected (parts * ps, urj_flash_cfi_array_t *cfi_array, uint32_t adr) #endif /* 0 */ static void -amd_flash_print_info (urj_flash_cfi_array_t *cfi_array) +amd_flash_print_info (urj_flash_cfi_array_t *urj_flash_cfi_array) { int mid, cid, prot; - urj_bus_t *bus = cfi_array->bus; - int o = amd_flash_address_shift (cfi_array); - - URJ_BUS_WRITE (bus, cfi_array->address + (0x0555 << o), 0x00aa00aa); /* autoselect p29 */ - URJ_BUS_WRITE (bus, cfi_array->address + (0x02aa << o), 0x00550055); - URJ_BUS_WRITE (bus, cfi_array->address + (0x0555 << o), 0x00900090); - mid = URJ_BUS_READ (bus, cfi_array->address + (0x00 << o)) & 0xFFFF; - cid = URJ_BUS_READ (bus, cfi_array->address + (0x01 << o)) & 0xFFFF; - prot = URJ_BUS_READ (bus, cfi_array->address + (0x02 << o)) & 0xFF; - amd_flash_read_array (cfi_array); /* AMD reset */ + urj_bus_t *bus = urj_flash_cfi_array->bus; + int o = amd_flash_address_shift (urj_flash_cfi_array); + + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0x0555 << o), 0x00aa00aa); /* autoselect p29 */ + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0x02aa << o), + 0x00550055); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0x0555 << o), + 0x00900090); + mid = + URJ_BUS_READ (bus, + urj_flash_cfi_array->address + (0x00 << o)) & 0xFFFF; + cid = + URJ_BUS_READ (bus, + urj_flash_cfi_array->address + (0x01 << o)) & 0xFFFF; + prot = + URJ_BUS_READ (bus, urj_flash_cfi_array->address + (0x02 << o)) & 0xFF; + amd_flash_read_array (urj_flash_cfi_array); /* AMD reset */ printf (_("Chip: AMD Flash\n\tManufacturer: ")); switch (mid) { @@ -388,76 +401,85 @@ amd_flash_print_info (urj_flash_cfi_array_t *cfi_array) printf (_("\n\tProtected: %04x\n"), prot); /* Read Array */ - URJ_BUS_WRITE (bus, cfi_array->address + (0x0000 << o), 0x00ff00ff); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0x0000 << o), + 0x00ff00ff); } static int -amd_flash_erase_block (urj_flash_cfi_array_t *cfi_array, uint32_t adr) +amd_flash_erase_block (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr) { - urj_bus_t *bus = cfi_array->bus; - int o = amd_flash_address_shift (cfi_array); + urj_bus_t *bus = urj_flash_cfi_array->bus; + int o = amd_flash_address_shift (urj_flash_cfi_array); printf ("flash_erase_block 0x%08X\n", adr); - /* printf("protected: %d\n", amdisprotected(ps, cfi_array, adr)); */ - - URJ_BUS_WRITE (bus, cfi_array->address + (0x0555 << o), 0x00aa00aa); /* autoselect p29, sector erase */ - URJ_BUS_WRITE (bus, cfi_array->address + (0x02aa << o), 0x00550055); - URJ_BUS_WRITE (bus, cfi_array->address + (0x0555 << o), 0x00800080); - URJ_BUS_WRITE (bus, cfi_array->address + (0x0555 << o), 0x00aa00aa); - URJ_BUS_WRITE (bus, cfi_array->address + (0x02aa << o), 0x00550055); + /* printf("protected: %d\n", amdisprotected(ps, urj_flash_cfi_array, adr)); */ + + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0x0555 << o), 0x00aa00aa); /* autoselect p29, sector erase */ + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0x02aa << o), + 0x00550055); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0x0555 << o), + 0x00800080); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0x0555 << o), + 0x00aa00aa); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0x02aa << o), + 0x00550055); URJ_BUS_WRITE (bus, adr, 0x00300030); - if (amdstatus (cfi_array, adr, 0xffff)) + if (amdstatus (urj_flash_cfi_array, adr, 0xffff)) { printf ("flash_erase_block 0x%08X DONE\n", adr); - amd_flash_read_array (cfi_array); /* AMD reset */ + amd_flash_read_array (urj_flash_cfi_array); /* AMD reset */ return 0; } printf ("flash_erase_block 0x%08X FAILED\n", adr); /* Read Array */ - amd_flash_read_array (cfi_array); /* AMD reset */ + amd_flash_read_array (urj_flash_cfi_array); /* AMD reset */ return URJ_FLASH_ERROR_UNKNOWN; } static int -amd_flash_unlock_block (urj_flash_cfi_array_t *cfi_array, uint32_t adr) +amd_flash_unlock_block (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr) { printf ("flash_unlock_block 0x%08X IGNORE\n", adr); return 0; } static int -amd_flash_program_single (urj_flash_cfi_array_t *cfi_array, uint32_t adr, - uint32_t data) +amd_flash_program_single (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr, uint32_t data) { int status; - urj_bus_t *bus = cfi_array->bus; - int o = amd_flash_address_shift (cfi_array); + urj_bus_t *bus = urj_flash_cfi_array->bus; + int o = amd_flash_address_shift (urj_flash_cfi_array); if (dbg) printf ("\nflash_program 0x%08X = 0x%08X\n", adr, data); - URJ_BUS_WRITE (bus, cfi_array->address + (0x0555 << o), 0x00aa00aa); /* autoselect p29, program */ - URJ_BUS_WRITE (bus, cfi_array->address + (0x02aa << o), 0x00550055); - URJ_BUS_WRITE (bus, cfi_array->address + (0x0555 << o), 0x00A000A0); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0x0555 << o), 0x00aa00aa); /* autoselect p29, program */ + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0x02aa << o), + 0x00550055); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0x0555 << o), + 0x00A000A0); URJ_BUS_WRITE (bus, adr, data); - status = amdstatus (cfi_array, adr, data); + status = amdstatus (urj_flash_cfi_array, adr, data); /* amd_flash_read_array(ps); */ return !status; } static int -amd_program_buffer_status (urj_flash_cfi_array_t *cfi_array, uint32_t adr, - uint32_t data) +amd_program_buffer_status (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr, uint32_t data) { /* NOTE: Status polling according to [3], Figure 1. The current method for status polling is not compatible with 32 bit (2x16) configurations since it only checks the DQ7 bit of the lower chip. */ - urj_bus_t *bus = cfi_array->bus; + urj_bus_t *bus = urj_flash_cfi_array->bus; int timeout; const uint32_t dq7mask = (1 << 7); const uint32_t dq5mask = (1 << 5); @@ -486,14 +508,14 @@ amd_program_buffer_status (urj_flash_cfi_array_t *cfi_array, uint32_t adr, } static int -amd_flash_program_buffer (urj_flash_cfi_array_t *cfi_array, uint32_t adr, - uint32_t *buffer, int count) +amd_flash_program_buffer (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr, uint32_t *buffer, int count) { /* NOTE: Write buffer programming operation according to [3], Figure 1. */ int status; - urj_bus_t *bus = cfi_array->bus; - urj_flash_cfi_chip_t *cfi_chip = cfi_array->cfi_chips[0]; - int o = amd_flash_address_shift (cfi_array); + urj_bus_t *bus = urj_flash_cfi_array->bus; + urj_flash_cfi_chip_t *cfi_chip = urj_flash_cfi_array->cfi_chips[0]; + int o = amd_flash_address_shift (urj_flash_cfi_array); int wb_bytes = cfi_chip->cfi.device_geometry.max_bytes_write; int chip_width = cfi_chip->width; int offset = 0; @@ -512,8 +534,10 @@ amd_flash_program_buffer (urj_flash_cfi_array_t *cfi_array, uint32_t adr, if (wcount > count) wcount = count; - URJ_BUS_WRITE (bus, cfi_array->address + (0x0555 << o), 0x00aa00aa); - URJ_BUS_WRITE (bus, cfi_array->address + (0x02aa << o), 0x00550055); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0x0555 << o), + 0x00aa00aa); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0x02aa << o), + 0x00550055); URJ_BUS_WRITE (bus, adr, 0x00250025); URJ_BUS_WRITE (bus, sa, wcount - 1); @@ -521,7 +545,7 @@ amd_flash_program_buffer (urj_flash_cfi_array_t *cfi_array, uint32_t adr, for (idx = 0; idx < wcount; idx++) { URJ_BUS_WRITE (bus, adr, buffer[offset + idx]); - adr += cfi_array->bus_width; + adr += urj_flash_cfi_array->bus_width; } offset += wcount; @@ -529,7 +553,8 @@ amd_flash_program_buffer (urj_flash_cfi_array_t *cfi_array, uint32_t adr, URJ_BUS_WRITE (bus, sa, 0x00290029); status = - amd_program_buffer_status (cfi_array, adr - cfi_array->bus_width, + amd_program_buffer_status (urj_flash_cfi_array, + adr - urj_flash_cfi_array->bus_width, buffer[offset - 1]); /* amd_flash_read_array(ps); */ if (status != 1) @@ -542,10 +567,11 @@ amd_flash_program_buffer (urj_flash_cfi_array_t *cfi_array, uint32_t adr, } static int -amd_flash_program (urj_flash_cfi_array_t *cfi_array, uint32_t adr, +amd_flash_program (urj_flash_cfi_array_t *urj_flash_cfi_array, uint32_t adr, uint32_t *buffer, int count) { - urj_flash_cfi_query_structure_t *cfi = &(cfi_array->cfi_chips[0]->cfi); + urj_flash_cfi_query_structure_t *cfi = + &(urj_flash_cfi_array->cfi_chips[0]->cfi); int max_bytes_write = cfi->device_geometry.max_bytes_write; #ifndef FLASH_MULTI_BYTE @@ -554,7 +580,8 @@ amd_flash_program (urj_flash_cfi_array_t *cfi_array, uint32_t adr, /* multi-byte writes supported? */ if (max_bytes_write > 1) - return amd_flash_program_buffer (cfi_array, adr, buffer, count); + return amd_flash_program_buffer (urj_flash_cfi_array, adr, buffer, + count); else { @@ -563,11 +590,11 @@ amd_flash_program (urj_flash_cfi_array_t *cfi_array, uint32_t adr, for (idx = 0; idx < count; idx++) { - int status = - amd_flash_program_single (cfi_array, adr, buffer[idx]); + int status = amd_flash_program_single (urj_flash_cfi_array, adr, + buffer[idx]); if (status) return status; - adr += cfi_array->bus_width; + adr += urj_flash_cfi_array->bus_width; } } @@ -575,8 +602,8 @@ amd_flash_program (urj_flash_cfi_array_t *cfi_array, uint32_t adr, } static int -amd_flash_program32 (urj_flash_cfi_array_t *cfi_array, uint32_t adr, - uint32_t *buffer, int count) +amd_flash_program32 (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr, uint32_t *buffer, int count) { /* Single byte programming is forced for 32 bit (2x16) flash configuration. a) lack of testing capbilities for 2x16 multi-byte write operation @@ -588,23 +615,24 @@ amd_flash_program32 (urj_flash_cfi_array_t *cfi_array, uint32_t adr, /* unroll buffer to single writes */ for (idx = 0; idx < count; idx++) { - int status = amd_flash_program_single (cfi_array, adr, buffer[idx]); + int status = + amd_flash_program_single (urj_flash_cfi_array, adr, buffer[idx]); if (status) return status; - adr += cfi_array->bus_width; + adr += urj_flash_cfi_array->bus_width; } return 0; } static void -amd_flash_read_array (urj_flash_cfi_array_t *cfi_array) +amd_flash_read_array (urj_flash_cfi_array_t *urj_flash_cfi_array) { /* Read Array */ - URJ_BUS_WRITE (cfi_array->bus, cfi_array->address, 0x00F000F0); /* AMD reset */ + URJ_BUS_WRITE (urj_flash_cfi_array->bus, urj_flash_cfi_array->address, 0x00F000F0); /* AMD reset */ } -urj_flash_driver_t amd_32_flash_driver = { +urj_flash_driver_t urj_flash_amd_32_flash_driver = { 4, /* buswidth */ N_("AMD/Fujitsu Standard Command Set"), N_("supported: AMD 29LV640D, 29LV641D, 29LV642D; 2x16 Bit"), @@ -616,7 +644,7 @@ urj_flash_driver_t amd_32_flash_driver = { amd_flash_read_array, }; -urj_flash_driver_t amd_16_flash_driver = { +urj_flash_driver_t urj_flash_amd_16_flash_driver = { 2, /* buswidth */ N_("AMD/Fujitsu Standard Command Set"), N_("supported: AMD 29LV800B, S92GLxxxN; MX29LV640B; 1x16 Bit"), @@ -628,7 +656,7 @@ urj_flash_driver_t amd_16_flash_driver = { amd_flash_read_array, }; -urj_flash_driver_t amd_8_flash_driver = { +urj_flash_driver_t urj_flash_amd_8_flash_driver = { 1, /* buswidth */ N_("AMD/Fujitsu Standard Command Set"), N_("supported: AMD 29LV160, AMD 29LV065D, AMD 29LV040B, S92GLxxxN; 1x8 Bit"), diff --git a/urjtag/src/flash/amd_flash.c b/urjtag/src/flash/amd_flash.c index 6765609c..7f6022a5 100644 --- a/urjtag/src/flash/amd_flash.c +++ b/urjtag/src/flash/amd_flash.c @@ -75,35 +75,39 @@ static struct var_forced_detection; int urj_flash_amd_detect (urj_bus_t *bus, uint32_t adr, - urj_flash_cfi_array_t **cfi_array); -static int amd_29xx040_autodetect (urj_flash_cfi_array_t *cfi_array); + urj_flash_cfi_array_t **urj_flash_cfi_array); +static int amd_29xx040_autodetect (urj_flash_cfi_array_t + *urj_flash_cfi_array); static int amd_29xx040_status (urj_bus_t *bus, uint32_t adr, unsigned short data); -static void amd_29xx040_print_info (urj_flash_cfi_array_t *cfi_array); -static void amd_29xx040_read_array (urj_flash_cfi_array_t *cfi_array); -static int amd_29xx040_erase_block (urj_flash_cfi_array_t *cfi_array, - uint32_t adr); -static int amd_29xx040_program_single (urj_flash_cfi_array_t *cfi_array, - uint32_t adr, uint32_t data); -static int amd_29xx040_program (urj_flash_cfi_array_t *cfi_array, +static void amd_29xx040_print_info (urj_flash_cfi_array_t + *urj_flash_cfi_array); +static void amd_29xx040_read_array (urj_flash_cfi_array_t + *urj_flash_cfi_array); +static int amd_29xx040_erase_block (urj_flash_cfi_array_t + *urj_flash_cfi_array, uint32_t adr); +static int amd_29xx040_program_single (urj_flash_cfi_array_t + *urj_flash_cfi_array, uint32_t adr, + uint32_t data); +static int amd_29xx040_program (urj_flash_cfi_array_t *urj_flash_cfi_array, uint32_t adr, uint32_t *buffer, int count); -static int amd_29xx040_unlock_block (urj_flash_cfi_array_t *cfi_array, - uint32_t adr); +static int amd_29xx040_unlock_block (urj_flash_cfi_array_t + *urj_flash_cfi_array, uint32_t adr); int urj_flash_amd_detect (urj_bus_t *bus, uint32_t adr, - urj_flash_cfi_array_t **cfi_array) + urj_flash_cfi_array_t **urj_flash_cfi_array) { int mid; int did; urj_bus_area_t area; urj_flash_cfi_query_structure_t *cfi; - if (!cfi_array || !bus) + if (!urj_flash_cfi_array || !bus) return -1; /* invalid parameters */ - *cfi_array = calloc (1, sizeof (urj_flash_cfi_array_t)); - if (!*cfi_array) + *urj_flash_cfi_array = calloc (1, sizeof (urj_flash_cfi_array_t)); + if (!*urj_flash_cfi_array) return -2; /* out of memory */ URJ_BUS_WRITE (bus, adr + 0x0, 0xf0); @@ -131,26 +135,27 @@ urj_flash_amd_detect (urj_bus_t *bus, uint32_t adr, break; } - (*cfi_array)->bus = bus; - (*cfi_array)->address = 0; + (*urj_flash_cfi_array)->bus = bus; + (*urj_flash_cfi_array)->address = 0; if (URJ_BUS_AREA (bus, adr + 0, &area) != URJ_STATUS_OK) return -8; /* bus width detection failed */ unsigned int bw = area.width; int ba, i; if (bw != 8 && bw != 16 && bw != 32) return -3; /* invalid bus width */ - (*cfi_array)->bus_width = ba = bw / 8; - (*cfi_array)->cfi_chips = calloc (ba, sizeof (urj_flash_cfi_chip_t *)); - if (!(*cfi_array)->cfi_chips) + (*urj_flash_cfi_array)->bus_width = ba = bw / 8; + (*urj_flash_cfi_array)->cfi_chips = + calloc (ba, sizeof (urj_flash_cfi_chip_t *)); + if (!(*urj_flash_cfi_array)->cfi_chips) return -2; for (i = 0; i < ba; i++) { - (*cfi_array)->cfi_chips[i] = + (*urj_flash_cfi_array)->cfi_chips[i] = calloc (1, sizeof (urj_flash_cfi_chip_t)); - if (!(*cfi_array)->cfi_chips[i]) + if (!(*urj_flash_cfi_array)->cfi_chips[i]) return -2; /* out of memory */ - (*cfi_array)->cfi_chips[i]->width = 1; //ba; - cfi = &(*cfi_array)->cfi_chips[i]->cfi; + (*urj_flash_cfi_array)->cfi_chips[i]->width = 1; //ba; + cfi = &(*urj_flash_cfi_array)->cfi_chips[i]->cfi; cfi->identification_string.pri_id_code = CFI_VENDOR_NULL; cfi->identification_string.pri_vendor_tbl = NULL; @@ -178,7 +183,7 @@ urj_flash_amd_detect (urj_bus_t *bus, uint32_t adr, static int -amd_29xx040_autodetect (urj_flash_cfi_array_t *cfi_array) +amd_29xx040_autodetect (urj_flash_cfi_array_t *urj_flash_cfi_array) { return (var_forced_detection.flash == AMD_29xx040B); //Non-CFI Am29xx040B flash } @@ -221,23 +226,23 @@ amd_29xx040_status (urj_bus_t *bus, uint32_t adr, unsigned short data) static void -amd_29xx040_print_info (urj_flash_cfi_array_t *cfi_array) +amd_29xx040_print_info (urj_flash_cfi_array_t *urj_flash_cfi_array) { int mid, did, prot; - urj_bus_t *bus = cfi_array->bus; + urj_bus_t *bus = urj_flash_cfi_array->bus; - URJ_BUS_WRITE (bus, cfi_array->address + 0x0, 0xf0); - URJ_BUS_WRITE (bus, cfi_array->address + 0x555, 0xaa); - URJ_BUS_WRITE (bus, cfi_array->address + 0x2AA, 0x55); - URJ_BUS_WRITE (bus, cfi_array->address + 0x555, 0x90); - mid = URJ_BUS_READ (bus, cfi_array->address + 0x0); - did = URJ_BUS_READ (bus, cfi_array->address + 0x1); - prot = URJ_BUS_READ (bus, cfi_array->address + 0x2); - URJ_BUS_WRITE (bus, cfi_array->address + 0x0, 0xf0); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x0, 0xf0); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x555, 0xaa); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x2AA, 0x55); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x555, 0x90); + mid = URJ_BUS_READ (bus, urj_flash_cfi_array->address + 0x0); + did = URJ_BUS_READ (bus, urj_flash_cfi_array->address + 0x1); + prot = URJ_BUS_READ (bus, urj_flash_cfi_array->address + 0x2); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x0, 0xf0); printf ("%s: mid %x, did %x\n", __FUNCTION__, mid, did); -// amd_29xx040_read_array( cfi_array ); /* AMD reset */ +// amd_29xx040_read_array( urj_flash_cfi_array ); /* AMD reset */ switch (mid) { @@ -267,26 +272,29 @@ amd_29xx040_print_info (urj_flash_cfi_array_t *cfi_array) } static void -amd_29xx040_read_array (urj_flash_cfi_array_t *cfi_array) +amd_29xx040_read_array (urj_flash_cfi_array_t *urj_flash_cfi_array) { /* Read Array */ if (var_forced_detection.unlock_bypass == AMD_BYPASS_UNLOCK_MODE) { /* @@@@ RFHH: changed this without understanding */ - URJ_BUS_WRITE (cfi_array->bus, cfi_array->address + 0x555, 0x90); - URJ_BUS_WRITE (cfi_array->bus, cfi_array->address + 0x2AA, 0x00); + URJ_BUS_WRITE (urj_flash_cfi_array->bus, + urj_flash_cfi_array->address + 0x555, 0x90); + URJ_BUS_WRITE (urj_flash_cfi_array->bus, + urj_flash_cfi_array->address + 0x2AA, 0x00); usleep (100); var_forced_detection.unlock_bypass = AMD_STANDARD_MODE; } - URJ_BUS_WRITE (cfi_array->bus, cfi_array->address + 0x0, 0x0F0); /* AMD reset */ + URJ_BUS_WRITE (urj_flash_cfi_array->bus, urj_flash_cfi_array->address + 0x0, 0x0F0); /* AMD reset */ } static int -amd_29xx040_erase_block (urj_flash_cfi_array_t *cfi_array, uint32_t adr) +amd_29xx040_erase_block (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr) { - urj_bus_t *bus = cfi_array->bus; + urj_bus_t *bus = urj_flash_cfi_array->bus; printf ("flash_erase_block 0x%08X\n", adr); @@ -294,41 +302,41 @@ amd_29xx040_erase_block (urj_flash_cfi_array_t *cfi_array, uint32_t adr) if (var_forced_detection.unlock_bypass == AMD_BYPASS_UNLOCK_MODE) { - URJ_BUS_WRITE (bus, cfi_array->address + 0x555, 0x90); - URJ_BUS_WRITE (bus, cfi_array->address + 0x2AA, 0x00); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x555, 0x90); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x2AA, 0x00); usleep (100); var_forced_detection.unlock_bypass = AMD_STANDARD_MODE; } - URJ_BUS_WRITE (bus, cfi_array->address + 0x0, 0xf0); - URJ_BUS_WRITE (bus, cfi_array->address + 0x555, 0xaa); - URJ_BUS_WRITE (bus, cfi_array->address + 0x2AA, 0x55); - URJ_BUS_WRITE (bus, cfi_array->address + 0x555, 0x80); - URJ_BUS_WRITE (bus, cfi_array->address + 0x555, 0xaa); - URJ_BUS_WRITE (bus, cfi_array->address + 0x2AA, 0x55); -// URJ_BUS_WRITE( bus, cfi_array->address + 0x555, 0x10 ); //Chip Erase + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x0, 0xf0); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x555, 0xaa); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x2AA, 0x55); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x555, 0x80); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x555, 0xaa); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x2AA, 0x55); +// URJ_BUS_WRITE( bus, urj_flash_cfi_array->address + 0x555, 0x10 ); //Chip Erase URJ_BUS_WRITE (bus, adr, 0x30); //Sector erase if (amd_29xx040_status (bus, adr, 0xff)) { printf ("flash_erase_block 0x%08X DONE\n", adr); - amd_29xx040_read_array (cfi_array); /* AMD reset */ + amd_29xx040_read_array (urj_flash_cfi_array); /* AMD reset */ return ERASE_FLASH_SUCCESS; } printf ("flash_erase_block 0x%08X FAILED\n", adr); /* Read Array */ - amd_29xx040_read_array (cfi_array); /* AMD reset */ + amd_29xx040_read_array (urj_flash_cfi_array); /* AMD reset */ return FLASH_ERASE_ERROR; } static int -amd_29xx040_program_single (urj_flash_cfi_array_t *cfi_array, uint32_t adr, - uint32_t data) +amd_29xx040_program_single (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr, uint32_t data) { int status; - urj_bus_t *bus = cfi_array->bus; + urj_bus_t *bus = urj_flash_cfi_array->bus; if (0) printf ("\nflash_program 0x%08X = 0x%08X\n", adr, data); @@ -336,54 +344,56 @@ amd_29xx040_program_single (urj_flash_cfi_array_t *cfi_array, uint32_t adr, { if (var_forced_detection.unlock_bypass != AMD_BYPASS_UNLOCK_MODE) { - URJ_BUS_WRITE (bus, cfi_array->address + 0x555, 0xaa); - URJ_BUS_WRITE (bus, cfi_array->address + 0x2AA, 0x55); - URJ_BUS_WRITE (bus, cfi_array->address + 0x555, 0x20); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x555, 0xaa); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x2AA, 0x55); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x555, 0x20); usleep (1000); var_forced_detection.unlock_bypass = AMD_BYPASS_UNLOCK_MODE; } } else { - URJ_BUS_WRITE (bus, cfi_array->address + 0x555, 0xaa); - URJ_BUS_WRITE (bus, cfi_array->address + 0x2AA, 0x55); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x555, 0xaa); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x2AA, 0x55); } - URJ_BUS_WRITE (bus, cfi_array->address + 0x555, 0xA0); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + 0x555, 0xA0); URJ_BUS_WRITE (bus, adr, data); status = amd_29xx040_status (bus, adr, data); - /* amd_29xx040_read_array(cfi_array); */ + /* amd_29xx040_read_array(urj_flash_cfi_array); */ return !status; } static int -amd_29xx040_program (urj_flash_cfi_array_t *cfi_array, uint32_t adr, - uint32_t *buffer, int count) +amd_29xx040_program (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr, uint32_t *buffer, int count) { int idx; /* unroll buffer to single writes */ for (idx = 0; idx < count; idx++) { - int status = amd_29xx040_program_single (cfi_array, adr, buffer[idx]); + int status = amd_29xx040_program_single (urj_flash_cfi_array, adr, + buffer[idx]); if (status) return status; - adr += cfi_array->bus_width; + adr += urj_flash_cfi_array->bus_width; } return 0; } static int -amd_29xx040_unlock_block (urj_flash_cfi_array_t *cfi_array, uint32_t adr) +amd_29xx040_unlock_block (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr) { printf ("flash_unlock_block 0x%08X IGNORE\n", adr); return 0; } -urj_flash_driver_t amd_29xx040_flash_driver = { +urj_flash_driver_t urj_flash_amd_29xx040_flash_driver = { 1, /* buswidth */ N_("AMD Standard Command Set"), N_("supported: AMD 29LV040B, 29C040B, 1x8 Bit"), diff --git a/urjtag/src/flash/cfi.c b/urjtag/src/flash/cfi.c index 481968cc..f8a33b2b 100644 --- a/urjtag/src/flash/cfi.c +++ b/urjtag/src/flash/cfi.c @@ -39,37 +39,37 @@ #include void -urj_flash_cfi_array_free (urj_flash_cfi_array_t *cfi_array) +urj_flash_cfi_array_free (urj_flash_cfi_array_t *urj_flash_cfi_array) { - if (!cfi_array) + if (!urj_flash_cfi_array) return; - if (cfi_array->cfi_chips) + if (urj_flash_cfi_array->cfi_chips) { int i; - for (i = 0; i < cfi_array->bus_width; i++) + for (i = 0; i < urj_flash_cfi_array->bus_width; i++) { - if (!cfi_array->cfi_chips[i]) + if (!urj_flash_cfi_array->cfi_chips[i]) continue; - free (cfi_array->cfi_chips[i]->cfi.device_geometry. + free (urj_flash_cfi_array->cfi_chips[i]->cfi.device_geometry. erase_block_regions); - if (cfi_array->cfi_chips[i]->cfi.identification_string. + if (urj_flash_cfi_array->cfi_chips[i]->cfi.identification_string. pri_vendor_tbl) - free (cfi_array->cfi_chips[i]->cfi.identification_string. - pri_vendor_tbl); - free (cfi_array->cfi_chips[i]); + free (urj_flash_cfi_array->cfi_chips[i]->cfi. + identification_string.pri_vendor_tbl); + free (urj_flash_cfi_array->cfi_chips[i]); } - free (cfi_array->cfi_chips); + free (urj_flash_cfi_array->cfi_chips); } - free (cfi_array); + free (urj_flash_cfi_array); } int urj_flash_cfi_detect (urj_bus_t *bus, uint32_t adr, - urj_flash_cfi_array_t **cfi_array) + urj_flash_cfi_array_t **urj_flash_cfi_array) { unsigned int bw; /* bus width */ unsigned int d; /* data offset */ @@ -77,23 +77,24 @@ urj_flash_cfi_detect (urj_bus_t *bus, uint32_t adr, int ma; /* flash mode address multiplier */ urj_bus_area_t area; - if (!cfi_array || !bus) + if (!urj_flash_cfi_array || !bus) return -1; /* invalid parameters */ - *cfi_array = calloc (1, sizeof (urj_flash_cfi_array_t)); - if (!*cfi_array) + *urj_flash_cfi_array = calloc (1, sizeof (urj_flash_cfi_array_t)); + if (!*urj_flash_cfi_array) return -2; /* out of memory */ - (*cfi_array)->bus = bus; - (*cfi_array)->address = adr; + (*urj_flash_cfi_array)->bus = bus; + (*urj_flash_cfi_array)->address = adr; if (URJ_BUS_AREA (bus, adr, &area) != URJ_STATUS_OK) return -8; /* bus width detection failed */ bw = area.width; if (bw != 8 && bw != 16 && bw != 32) return -3; /* invalid bus width */ - (*cfi_array)->bus_width = ba = bw / 8; - (*cfi_array)->cfi_chips = calloc (ba, sizeof (urj_flash_cfi_chip_t *)); - if (!(*cfi_array)->cfi_chips) + (*urj_flash_cfi_array)->bus_width = ba = bw / 8; + (*urj_flash_cfi_array)->cfi_chips = + calloc (ba, sizeof (urj_flash_cfi_chip_t *)); + if (!(*urj_flash_cfi_array)->cfi_chips) return -2; /* out of memory */ for (d = 0; d < bw; d += 8) @@ -134,14 +135,14 @@ urj_flash_cfi_detect (urj_bus_t *bus, uint32_t adr, return -6; /* CFI not detected (Y) */ } - (*cfi_array)->cfi_chips[d / 8] = + (*urj_flash_cfi_array)->cfi_chips[d / 8] = calloc (1, sizeof (urj_flash_cfi_chip_t)); - if (!(*cfi_array)->cfi_chips[d / 8]) + if (!(*urj_flash_cfi_array)->cfi_chips[d / 8]) { write1 (0, CFI_CMD_READ_ARRAY1); return -2; /* out of memory */ } - cfi = &(*cfi_array)->cfi_chips[d / 8]->cfi; + cfi = &(*urj_flash_cfi_array)->cfi_chips[d / 8]->cfi; /* Identification string - see Table 6 in [1] */ cfi->identification_string.pri_id_code = read2 (PRI_VENDOR_ID_OFFSET); @@ -408,31 +409,31 @@ urj_flash_cfi_detect (urj_bus_t *bus, uint32_t adr, case CFI_INTERFACE_X8: if (ma != 1) return -7; /* error in device detection */ - (*cfi_array)->cfi_chips[d / 8]->width = 1; + (*urj_flash_cfi_array)->cfi_chips[d / 8]->width = 1; break; case CFI_INTERFACE_X16: if (ma != 1) return -7; /* error in device detection */ - (*cfi_array)->cfi_chips[d / 8]->width = 2; + (*urj_flash_cfi_array)->cfi_chips[d / 8]->width = 2; d += 8; break; case CFI_INTERFACE_X8_X16: if (ma != 1 && ma != 2) return -7; /* error in device detection */ - (*cfi_array)->cfi_chips[d / 8]->width = 2 / ma; + (*urj_flash_cfi_array)->cfi_chips[d / 8]->width = 2 / ma; if (ma == 1) d += 8; break; case CFI_INTERFACE_X32: if (ma != 1) return -7; /* error in device detection */ - (*cfi_array)->cfi_chips[d / 8]->width = 4; + (*urj_flash_cfi_array)->cfi_chips[d / 8]->width = 4; d += 24; break; case CFI_INTERFACE_X16_X32: if (ma != 1 && ma != 2) return -7; /* error in device detection */ - (*cfi_array)->cfi_chips[d / 8]->width = 4 / ma; + (*urj_flash_cfi_array)->cfi_chips[d / 8]->width = 4 / ma; if (ma == 1) d += 24; else diff --git a/urjtag/src/flash/detectflash.c b/urjtag/src/flash/detectflash.c index d75f6b6a..8dd7d1c9 100644 --- a/urjtag/src/flash/detectflash.c +++ b/urjtag/src/flash/detectflash.c @@ -41,7 +41,7 @@ #include "jedec.h" -urj_flash_cfi_array_t *cfi_array = NULL; +urj_flash_cfi_array_t *urj_flash_cfi_array = NULL; void urj_flash_detectflash (urj_bus_t *bus, uint32_t adr) @@ -55,41 +55,42 @@ urj_flash_detectflash (urj_bus_t *bus, uint32_t adr) return; } - urj_flash_cfi_array_free (cfi_array); - cfi_array = NULL; + urj_flash_cfi_array_free (urj_flash_cfi_array); + urj_flash_cfi_array = NULL; URJ_BUS_PREPARE (bus); - if (urj_flash_cfi_detect (bus, adr, &cfi_array)) + if (urj_flash_cfi_detect (bus, adr, &urj_flash_cfi_array)) { - urj_flash_cfi_array_free (cfi_array); - cfi_array = NULL; - if (urj_flash_jedec_detect (bus, adr, &cfi_array) != 0) + urj_flash_cfi_array_free (urj_flash_cfi_array); + urj_flash_cfi_array = NULL; + if (urj_flash_jedec_detect (bus, adr, &urj_flash_cfi_array) != 0) { - urj_flash_cfi_array_free (cfi_array); - cfi_array = NULL; - if (urj_flash_amd_detect (bus, adr, &cfi_array) != 0) + urj_flash_cfi_array_free (urj_flash_cfi_array); + urj_flash_cfi_array = NULL; + if (urj_flash_amd_detect (bus, adr, &urj_flash_cfi_array) != 0) { - urj_flash_cfi_array_free (cfi_array); - cfi_array = NULL; + urj_flash_cfi_array_free (urj_flash_cfi_array); + urj_flash_cfi_array = NULL; #ifdef JEDEC_EXP - if (urj_flash_jedec_exp_detect (bus, adr, &cfi_array)) + if (urj_flash_jedec_exp_detect + (bus, adr, &urj_flash_cfi_array)) { - urj_flash_cfi_array_free (cfi_array); - cfi_array = NULL; + urj_flash_cfi_array_free (urj_flash_cfi_array); + urj_flash_cfi_array = NULL; } #endif } } } - if (cfi_array == NULL) + if (urj_flash_cfi_array == NULL) { printf (_("Flash not found!\n")); return; } - cfi = &cfi_array->cfi_chips[0]->cfi; + cfi = &urj_flash_cfi_array->cfi_chips[0]->cfi; /* detect CFI capable devices */ /* TODO: Low chip only */ diff --git a/urjtag/src/flash/flash.c b/urjtag/src/flash/flash.c index 3e2da8d5..f3a005b5 100644 --- a/urjtag/src/flash/flash.c +++ b/urjtag/src/flash/flash.c @@ -46,26 +46,26 @@ #include "flash.h" #include "jtag.h" -extern urj_flash_driver_t amd_32_flash_driver; -extern urj_flash_driver_t amd_16_flash_driver; -extern urj_flash_driver_t amd_8_flash_driver; -extern urj_flash_driver_t intel_32_flash_driver; -extern urj_flash_driver_t intel_16_flash_driver; -extern urj_flash_driver_t intel_8_flash_driver; -extern urj_flash_driver_t amd_29xx040_flash_driver; //20/09/2006 - -urj_flash_driver_t *flash_drivers[] = { - &amd_32_flash_driver, - &amd_16_flash_driver, - &amd_8_flash_driver, - &intel_32_flash_driver, - &intel_16_flash_driver, - &intel_8_flash_driver, - &amd_29xx040_flash_driver, //20/09/2006 +extern urj_flash_driver_t urj_flash_amd_32_flash_driver; +extern urj_flash_driver_t urj_flash_amd_16_flash_driver; +extern urj_flash_driver_t urj_flash_amd_8_flash_driver; +extern urj_flash_driver_t urj_flash_intel_32_flash_driver; +extern urj_flash_driver_t urj_flash_intel_16_flash_driver; +extern urj_flash_driver_t urj_flash_intel_8_flash_driver; +extern urj_flash_driver_t urj_flash_amd_29xx040_flash_driver; //20/09/2006 + +urj_flash_driver_t *urj_flash_flash_drivers[] = { + &urj_flash_amd_32_flash_driver, + &urj_flash_amd_16_flash_driver, + &urj_flash_amd_8_flash_driver, + &urj_flash_intel_32_flash_driver, + &urj_flash_intel_16_flash_driver, + &urj_flash_intel_8_flash_driver, + &urj_flash_amd_29xx040_flash_driver, //20/09/2006 NULL }; -extern urj_flash_cfi_array_t *cfi_array; +extern urj_flash_cfi_array_t *urj_flash_cfi_array; static urj_flash_driver_t *flash_driver = NULL; static void @@ -75,15 +75,15 @@ set_flash_driver (void) urj_flash_cfi_query_structure_t *cfi; flash_driver = NULL; - if (cfi_array == NULL) + if (urj_flash_cfi_array == NULL) return; - cfi = &cfi_array->cfi_chips[0]->cfi; + cfi = &urj_flash_cfi_array->cfi_chips[0]->cfi; - for (i = 0; flash_drivers[i] != NULL; i++) - if (flash_drivers[i]->autodetect (cfi_array)) + for (i = 0; urj_flash_flash_drivers[i] != NULL; i++) + if (urj_flash_flash_drivers[i]->autodetect (urj_flash_cfi_array)) { - flash_driver = flash_drivers[i]; - flash_driver->print_info (cfi_array); + flash_driver = urj_flash_flash_drivers[i]; + flash_driver->print_info (urj_flash_cfi_array); return; } @@ -101,12 +101,12 @@ urj_flashmsbin (urj_bus_t *bus, FILE * f, int noverify) urj_flash_cfi_query_structure_t *cfi; set_flash_driver (); - if (!cfi_array || !flash_driver) + if (!urj_flash_cfi_array || !flash_driver) { printf (_("no flash driver found\n")); return; } - cfi = &cfi_array->cfi_chips[0]->cfi; + cfi = &urj_flash_cfi_array->cfi_chips[0]->cfi; /* test sync bytes */ { @@ -143,10 +143,10 @@ urj_flashmsbin (urj_bus_t *bus, FILE * f, int noverify) first * cfi->device_geometry.erase_block_regions[0].erase_block_size * 2; - flash_driver->unlock_block (cfi_array, adr); + flash_driver->unlock_block (urj_flash_cfi_array, adr); printf (_("block %d unlocked\n"), first); printf (_("erasing block %d: %d\n"), first, - flash_driver->erase_block (cfi_array, adr)); + flash_driver->erase_block (urj_flash_cfi_array, adr)); } } @@ -182,7 +182,7 @@ urj_flashmsbin (urj_bus_t *bus, FILE * f, int noverify) printf ("\r"); fflush (stdout); fread (&data, sizeof data, 1, f); - if (flash_driver->program (cfi_array, a, &data, 1)) + if (flash_driver->program (urj_flash_cfi_array, a, &data, 1)) { printf (_("\nflash error\n")); return; @@ -193,7 +193,7 @@ urj_flashmsbin (urj_bus_t *bus, FILE * f, int noverify) } printf ("\n"); - flash_driver->readarray (cfi_array); + flash_driver->readarray (urj_flash_cfi_array); if (noverify) { @@ -298,15 +298,15 @@ urj_flashmem (urj_bus_t *bus, FILE * f, uint32_t addr, int noverify) uint32_t write_buffer_adr; set_flash_driver (); - if (!cfi_array || !flash_driver) + if (!urj_flash_cfi_array || !flash_driver) { printf (_("no flash driver found\n")); return; } - cfi = &cfi_array->cfi_chips[0]->cfi; + cfi = &urj_flash_cfi_array->cfi_chips[0]->cfi; - bus_width = cfi_array->bus_width; - chip_width = cfi_array->cfi_chips[0]->width; + bus_width = urj_flash_cfi_array->bus_width; + chip_width = urj_flash_cfi_array->cfi_chips[0]->width; for (i = 0, neb = 0; i < cfi->device_geometry.number_of_erase_regions; i++) @@ -331,7 +331,8 @@ urj_flashmem (urj_bus_t *bus, FILE * f, uint32_t addr, int noverify) uint8_t b[BSIZE]; int bc = 0, bn = 0, btr = BSIZE; int block_no = - find_block (cfi, adr - cfi_array->address, bus_width, chip_width, + find_block (cfi, adr - urj_flash_cfi_array->address, bus_width, + chip_width, &btr); write_buffer_count = 0; @@ -343,10 +344,10 @@ urj_flashmem (urj_bus_t *bus, FILE * f, uint32_t addr, int noverify) if (bn > 0 && !erased[block_no]) { - flash_driver->unlock_block (cfi_array, adr); + flash_driver->unlock_block (urj_flash_cfi_array, adr); printf (_("\nblock %d unlocked\n"), block_no); printf (_("erasing block %d: %d\n"), block_no, - flash_driver->erase_block (cfi_array, adr)); + flash_driver->erase_block (urj_flash_cfi_array, adr)); erased[block_no] = 1; } @@ -375,7 +376,7 @@ urj_flashmem (urj_bus_t *bus, FILE * f, uint32_t addr, int noverify) if (write_buffer_count > 0) if (flash_driver-> - program (cfi_array, write_buffer_adr, write_buffer, + program (urj_flash_cfi_array, write_buffer_adr, write_buffer, write_buffer_count)) { printf (_("\nflash error\n")); @@ -387,7 +388,7 @@ urj_flashmem (urj_bus_t *bus, FILE * f, uint32_t addr, int noverify) printf (_("addr: 0x%08X\n"), adr - flash_driver->bus_width); - flash_driver->readarray (cfi_array); + flash_driver->readarray (urj_flash_cfi_array); if (noverify) { @@ -448,15 +449,15 @@ urj_flasherase (urj_bus_t *bus, uint32_t addr, int number) int chip_width; set_flash_driver (); - if (!cfi_array || !flash_driver) + if (!urj_flash_cfi_array || !flash_driver) { printf (_("no flash driver found\n")); return; } - cfi = &cfi_array->cfi_chips[0]->cfi; + cfi = &urj_flash_cfi_array->cfi_chips[0]->cfi; - bus_width = cfi_array->bus_width; - chip_width = cfi_array->cfi_chips[0]->width; + bus_width = urj_flash_cfi_array->bus_width; + chip_width = urj_flash_cfi_array->cfi_chips[0]->width; printf (_("\nErasing %d Flash block%s from address 0x%x\n"), number, number > 1 ? "s" : "", addr); @@ -465,7 +466,8 @@ urj_flasherase (urj_bus_t *bus, uint32_t addr, int number) { int btr = 0; int block_no = - find_block (cfi, addr - cfi_array->address, bus_width, chip_width, + find_block (cfi, addr - urj_flash_cfi_array->address, bus_width, + chip_width, &btr); if (block_no < 0) @@ -477,10 +479,10 @@ urj_flasherase (urj_bus_t *bus, uint32_t addr, int number) printf (_("(%d%% Completed) FLASH Block %d : Unlocking ... "), i * 100 / number, block_no); fflush (stdout); - flash_driver->unlock_block (cfi_array, addr); + flash_driver->unlock_block (urj_flash_cfi_array, addr); printf (_("Erasing ... ")); fflush (stdout); - status = flash_driver->erase_block (cfi_array, addr); + status = flash_driver->erase_block (urj_flash_cfi_array, addr); if (status == 0) { if (i == number) diff --git a/urjtag/src/flash/intel.c b/urjtag/src/flash/intel.c index a235839d..942d4d3d 100644 --- a/urjtag/src/flash/intel.c +++ b/urjtag/src/flash/intel.c @@ -48,91 +48,98 @@ #include #include -static int intel_flash_erase_block (urj_flash_cfi_array_t *cfi_array, - uint32_t adr); -static int intel_flash_unlock_block (urj_flash_cfi_array_t *cfi_array, - uint32_t adr); -static int intel_flash_program_single (urj_flash_cfi_array_t *cfi_array, - uint32_t adr, uint32_t data); -static int intel_flash_program_buffer (urj_flash_cfi_array_t *cfi_array, - uint32_t adr, uint32_t *buffer, - int count); -static int intel_flash_program (urj_flash_cfi_array_t *cfi_array, +static int intel_flash_erase_block (urj_flash_cfi_array_t + *urj_flash_cfi_array, uint32_t adr); +static int intel_flash_unlock_block (urj_flash_cfi_array_t + *urj_flash_cfi_array, uint32_t adr); +static int intel_flash_program_single (urj_flash_cfi_array_t + *urj_flash_cfi_array, uint32_t adr, + uint32_t data); +static int intel_flash_program_buffer (urj_flash_cfi_array_t + *urj_flash_cfi_array, uint32_t adr, + uint32_t *buffer, int count); +static int intel_flash_program (urj_flash_cfi_array_t *urj_flash_cfi_array, uint32_t adr, uint32_t *buffer, int count); -static int intel_flash_erase_block32 (urj_flash_cfi_array_t *cfi_array, - uint32_t adr); -static int intel_flash_unlock_block32 (urj_flash_cfi_array_t *cfi_array, - uint32_t adr); -static int intel_flash_program32_single (urj_flash_cfi_array_t *cfi_array, - uint32_t adr, uint32_t data); -static int intel_flash_program32 (urj_flash_cfi_array_t *cfi_array, +static int intel_flash_erase_block32 (urj_flash_cfi_array_t + *urj_flash_cfi_array, uint32_t adr); +static int intel_flash_unlock_block32 (urj_flash_cfi_array_t + *urj_flash_cfi_array, uint32_t adr); +static int intel_flash_program32_single (urj_flash_cfi_array_t + *urj_flash_cfi_array, uint32_t adr, + uint32_t data); +static int intel_flash_program32 (urj_flash_cfi_array_t *urj_flash_cfi_array, uint32_t adr, uint32_t *buffer, int count); /* autodetect, we can handle this chip */ static int -intel_flash_autodetect32 (urj_flash_cfi_array_t *cfi_array) +intel_flash_autodetect32 (urj_flash_cfi_array_t *urj_flash_cfi_array) { urj_bus_area_t area; - if (URJ_BUS_AREA (cfi_array->bus, cfi_array->address, &area) != - URJ_STATUS_OK) + if (URJ_BUS_AREA + (urj_flash_cfi_array->bus, urj_flash_cfi_array->address, + &area) != URJ_STATUS_OK) return 0; - return ((cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == - CFI_VENDOR_MITSUBISHI_SCS) - || (cfi_array->cfi_chips[0]->cfi.identification_string. + return ((urj_flash_cfi_array->cfi_chips[0]->cfi.identification_string. + pri_id_code == CFI_VENDOR_MITSUBISHI_SCS) + || (urj_flash_cfi_array->cfi_chips[0]->cfi.identification_string. pri_id_code == CFI_VENDOR_MITSUBISHI_ECS) - || (cfi_array->cfi_chips[0]->cfi.identification_string. + || (urj_flash_cfi_array->cfi_chips[0]->cfi.identification_string. pri_id_code == CFI_VENDOR_INTEL_ECS) - || (cfi_array->cfi_chips[0]->cfi.identification_string. + || (urj_flash_cfi_array->cfi_chips[0]->cfi.identification_string. pri_id_code == CFI_VENDOR_INTEL_SCS)) && (area.width == 32); } static int -intel_flash_autodetect (urj_flash_cfi_array_t *cfi_array) +intel_flash_autodetect (urj_flash_cfi_array_t *urj_flash_cfi_array) { urj_bus_area_t area; - if (URJ_BUS_AREA (cfi_array->bus, cfi_array->address, &area) != - URJ_STATUS_OK) + if (URJ_BUS_AREA + (urj_flash_cfi_array->bus, urj_flash_cfi_array->address, + &area) != URJ_STATUS_OK) return 0; - return ((cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == - CFI_VENDOR_MITSUBISHI_SCS) - || (cfi_array->cfi_chips[0]->cfi.identification_string. + return ((urj_flash_cfi_array->cfi_chips[0]->cfi.identification_string. + pri_id_code == CFI_VENDOR_MITSUBISHI_SCS) + || (urj_flash_cfi_array->cfi_chips[0]->cfi.identification_string. pri_id_code == CFI_VENDOR_MITSUBISHI_ECS) - || (cfi_array->cfi_chips[0]->cfi.identification_string. + || (urj_flash_cfi_array->cfi_chips[0]->cfi.identification_string. pri_id_code == CFI_VENDOR_INTEL_ECS) - || (cfi_array->cfi_chips[0]->cfi.identification_string. + || (urj_flash_cfi_array->cfi_chips[0]->cfi.identification_string. pri_id_code == CFI_VENDOR_INTEL_SCS)) && (area.width == 16); } static int -intel_flash_autodetect8 (urj_flash_cfi_array_t *cfi_array) +intel_flash_autodetect8 (urj_flash_cfi_array_t *urj_flash_cfi_array) { urj_bus_area_t area; - if (URJ_BUS_AREA (cfi_array->bus, cfi_array->address, &area) != - URJ_STATUS_OK) + if (URJ_BUS_AREA + (urj_flash_cfi_array->bus, urj_flash_cfi_array->address, + &area) != URJ_STATUS_OK) return 0; - return ((cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == - CFI_VENDOR_MITSUBISHI_SCS) - || (cfi_array->cfi_chips[0]->cfi.identification_string. + return ((urj_flash_cfi_array->cfi_chips[0]->cfi.identification_string. + pri_id_code == CFI_VENDOR_MITSUBISHI_SCS) + || (urj_flash_cfi_array->cfi_chips[0]->cfi.identification_string. pri_id_code == CFI_VENDOR_MITSUBISHI_ECS) - || (cfi_array->cfi_chips[0]->cfi.identification_string. + || (urj_flash_cfi_array->cfi_chips[0]->cfi.identification_string. pri_id_code == CFI_VENDOR_INTEL_ECS) - || (cfi_array->cfi_chips[0]->cfi.identification_string. + || (urj_flash_cfi_array->cfi_chips[0]->cfi.identification_string. pri_id_code == CFI_VENDOR_INTEL_SCS)) && (area.width == 8); } static void -_intel_flash_print_info (urj_flash_cfi_array_t *cfi_array, int o) +_intel_flash_print_info (urj_flash_cfi_array_t *urj_flash_cfi_array, int o) { uint32_t mid, cid; - urj_bus_t *bus = cfi_array->bus; + urj_bus_t *bus = urj_flash_cfi_array->bus; - mid = (URJ_BUS_READ (bus, cfi_array->address + (0x00 << o)) & 0xFF); + mid = + (URJ_BUS_READ (bus, urj_flash_cfi_array->address + (0x00 << o)) & + 0xFF); switch (mid) { case STD_MIC_INTEL: @@ -150,7 +157,9 @@ _intel_flash_print_info (urj_flash_cfi_array_t *cfi_array, int o) } printf (_("Chip: ")); - cid = (URJ_BUS_READ (bus, cfi_array->address + (0x01 << o)) & 0xFFFF); + cid = + (URJ_BUS_READ (bus, urj_flash_cfi_array->address + (0x01 << o)) & + 0xFFFF); switch (cid) { case 0x0016: @@ -207,56 +216,57 @@ _intel_flash_print_info (urj_flash_cfi_array_t *cfi_array, int o) } /* Read Array */ - URJ_BUS_WRITE (bus, cfi_array->address + (0 << o), 0x00FF00FF); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0 << o), 0x00FF00FF); } static void -intel_flash_print_info (urj_flash_cfi_array_t *cfi_array) +intel_flash_print_info (urj_flash_cfi_array_t *urj_flash_cfi_array) { int o = 1; - urj_bus_t *bus = cfi_array->bus; + urj_bus_t *bus = urj_flash_cfi_array->bus; /* Intel Primary Algorithm Extended Query Table - see Table 5. in [3] */ /* TODO */ /* Clear Status Register */ - URJ_BUS_WRITE (bus, cfi_array->address + (0 << o), 0x0050); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0 << o), 0x0050); /* Read Identifier Command */ - URJ_BUS_WRITE (bus, cfi_array->address + (0 << 0), 0x0090); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0 << 0), 0x0090); - _intel_flash_print_info (cfi_array, o); + _intel_flash_print_info (urj_flash_cfi_array, o); } static void -intel_flash_print_info32 (urj_flash_cfi_array_t *cfi_array) +intel_flash_print_info32 (urj_flash_cfi_array_t *urj_flash_cfi_array) { int o = 2; - urj_bus_t *bus = cfi_array->bus; + urj_bus_t *bus = urj_flash_cfi_array->bus; /* Intel Primary Algorithm Extended Query Table - see Table 5. in [3] */ /* TODO */ /* Clear Status Register */ - URJ_BUS_WRITE (bus, cfi_array->address + (0 << o), 0x00500050); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0 << o), 0x00500050); /* Read Identifier Command */ - URJ_BUS_WRITE (bus, cfi_array->address + (0 << 0), 0x00900090); + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address + (0 << 0), 0x00900090); - _intel_flash_print_info (cfi_array, o); + _intel_flash_print_info (urj_flash_cfi_array, o); } static int -intel_flash_erase_block (urj_flash_cfi_array_t *cfi_array, uint32_t adr) +intel_flash_erase_block (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr) { uint16_t sr; - urj_bus_t *bus = cfi_array->bus; + urj_bus_t *bus = urj_flash_cfi_array->bus; - URJ_BUS_WRITE (bus, cfi_array->address, + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address, CFI_INTEL_CMD_CLEAR_STATUS_REGISTER); URJ_BUS_WRITE (bus, adr, CFI_INTEL_CMD_BLOCK_ERASE); URJ_BUS_WRITE (bus, adr, CFI_INTEL_CMD_CONFIRM); - while (!((sr = URJ_BUS_READ (bus, cfi_array->address) & 0xFE) & CFI_INTEL_SR_READY)); /* TODO: add timeout */ + while (!((sr = URJ_BUS_READ (bus, urj_flash_cfi_array->address) & 0xFE) & CFI_INTEL_SR_READY)); /* TODO: add timeout */ switch (sr & ~CFI_INTEL_SR_READY) { @@ -279,17 +289,18 @@ intel_flash_erase_block (urj_flash_cfi_array_t *cfi_array, uint32_t adr) } static int -intel_flash_unlock_block (urj_flash_cfi_array_t *cfi_array, uint32_t adr) +intel_flash_unlock_block (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr) { uint16_t sr; - urj_bus_t *bus = cfi_array->bus; + urj_bus_t *bus = urj_flash_cfi_array->bus; - URJ_BUS_WRITE (bus, cfi_array->address, + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address, CFI_INTEL_CMD_CLEAR_STATUS_REGISTER); URJ_BUS_WRITE (bus, adr, CFI_INTEL_CMD_LOCK_SETUP); URJ_BUS_WRITE (bus, adr, CFI_INTEL_CMD_UNLOCK_BLOCK); - while (!((sr = URJ_BUS_READ (bus, cfi_array->address) & 0xFE) & CFI_INTEL_SR_READY)); /* TODO: add timeout */ + while (!((sr = URJ_BUS_READ (bus, urj_flash_cfi_array->address) & 0xFE) & CFI_INTEL_SR_READY)); /* TODO: add timeout */ if (sr != CFI_INTEL_SR_READY) { @@ -301,18 +312,18 @@ intel_flash_unlock_block (urj_flash_cfi_array_t *cfi_array, uint32_t adr) } static int -intel_flash_program_single (urj_flash_cfi_array_t *cfi_array, uint32_t adr, - uint32_t data) +intel_flash_program_single (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr, uint32_t data) { uint16_t sr; - urj_bus_t *bus = cfi_array->bus; + urj_bus_t *bus = urj_flash_cfi_array->bus; - URJ_BUS_WRITE (bus, cfi_array->address, + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address, CFI_INTEL_CMD_CLEAR_STATUS_REGISTER); URJ_BUS_WRITE (bus, adr, CFI_INTEL_CMD_PROGRAM1); URJ_BUS_WRITE (bus, adr, data); - while (!((sr = URJ_BUS_READ (bus, cfi_array->address) & 0xFE) & CFI_INTEL_SR_READY)); /* TODO: add timeout */ + while (!((sr = URJ_BUS_READ (bus, urj_flash_cfi_array->address) & 0xFE) & CFI_INTEL_SR_READY)); /* TODO: add timeout */ if (sr != CFI_INTEL_SR_READY) { @@ -324,13 +335,13 @@ intel_flash_program_single (urj_flash_cfi_array_t *cfi_array, uint32_t adr, } static int -intel_flash_program_buffer (urj_flash_cfi_array_t *cfi_array, uint32_t adr, - uint32_t *buffer, int count) +intel_flash_program_buffer (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr, uint32_t *buffer, int count) { /* NOTE: Write-to-buffer programming operation according to [5], Figure 9 */ uint16_t sr; - urj_bus_t *bus = cfi_array->bus; - urj_flash_cfi_chip_t *cfi_chip = cfi_array->cfi_chips[0]; + urj_bus_t *bus = urj_flash_cfi_array->bus; + urj_flash_cfi_chip_t *cfi_chip = urj_flash_cfi_array->cfi_chips[0]; int wb_bytes = cfi_chip->cfi.device_geometry.max_bytes_write; int chip_width = cfi_chip->width; int offset = 0; @@ -347,11 +358,11 @@ intel_flash_program_buffer (urj_flash_cfi_array_t *cfi_array, uint32_t adr, wcount = count; /* issue command WRITE_TO_BUFFER */ - URJ_BUS_WRITE (bus, cfi_array->address, + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address, CFI_INTEL_CMD_CLEAR_STATUS_REGISTER); URJ_BUS_WRITE (bus, adr, CFI_INTEL_CMD_WRITE_TO_BUFFER); /* poll XSR7 == 1 */ - while (!((sr = URJ_BUS_READ (bus, cfi_array->address) & 0xFE) & CFI_INTEL_SR_READY)); /* TODO: add timeout */ + while (!((sr = URJ_BUS_READ (bus, urj_flash_cfi_array->address) & 0xFE) & CFI_INTEL_SR_READY)); /* TODO: add timeout */ /* write count value (number of upcoming writes - 1) */ URJ_BUS_WRITE (bus, adr, wcount - 1); @@ -360,7 +371,7 @@ intel_flash_program_buffer (urj_flash_cfi_array_t *cfi_array, uint32_t adr, for (idx = 0; idx < wcount; idx++) { URJ_BUS_WRITE (bus, adr, buffer[offset + idx]); - adr += cfi_array->bus_width; + adr += urj_flash_cfi_array->bus_width; } offset += wcount; @@ -371,7 +382,7 @@ intel_flash_program_buffer (urj_flash_cfi_array_t *cfi_array, uint32_t adr, } /* poll SR7 == 1 */ - while (!((sr = URJ_BUS_READ (bus, cfi_array->address) & 0xFE) & CFI_INTEL_SR_READY)); /* TODO: add timeout */ + while (!((sr = URJ_BUS_READ (bus, urj_flash_cfi_array->address) & 0xFE) & CFI_INTEL_SR_READY)); /* TODO: add timeout */ if (sr != CFI_INTEL_SR_READY) { printf (_("flash: unknown error while programming\n")); @@ -382,10 +393,11 @@ intel_flash_program_buffer (urj_flash_cfi_array_t *cfi_array, uint32_t adr, } static int -intel_flash_program (urj_flash_cfi_array_t *cfi_array, uint32_t adr, - uint32_t *buffer, int count) +intel_flash_program (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr, uint32_t *buffer, int count) { - urj_flash_cfi_query_structure_t *cfi = &(cfi_array->cfi_chips[0]->cfi); + urj_flash_cfi_query_structure_t *cfi = + &(urj_flash_cfi_array->cfi_chips[0]->cfi); int max_bytes_write = cfi->device_geometry.max_bytes_write; #ifndef FLASH_MULTI_BYTE @@ -394,7 +406,8 @@ intel_flash_program (urj_flash_cfi_array_t *cfi_array, uint32_t adr, /* multi-byte writes supported? */ if (max_bytes_write > 1) - return intel_flash_program_buffer (cfi_array, adr, buffer, count); + return intel_flash_program_buffer (urj_flash_cfi_array, adr, buffer, + count); else { @@ -403,11 +416,11 @@ intel_flash_program (urj_flash_cfi_array_t *cfi_array, uint32_t adr, for (idx = 0; idx < count; idx++) { - int status = - intel_flash_program_single (cfi_array, adr, buffer[idx]); + int status = intel_flash_program_single (urj_flash_cfi_array, adr, + buffer[idx]); if (status) return status; - adr += cfi_array->bus_width; + adr += urj_flash_cfi_array->bus_width; } } @@ -415,12 +428,13 @@ intel_flash_program (urj_flash_cfi_array_t *cfi_array, uint32_t adr, } static int -intel_flash_erase_block32 (urj_flash_cfi_array_t *cfi_array, uint32_t adr) +intel_flash_erase_block32 (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr) { uint32_t sr; - urj_bus_t *bus = cfi_array->bus; + urj_bus_t *bus = urj_flash_cfi_array->bus; - URJ_BUS_WRITE (bus, cfi_array->address, + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address, (CFI_INTEL_CMD_CLEAR_STATUS_REGISTER << 16) | CFI_INTEL_CMD_CLEAR_STATUS_REGISTER); URJ_BUS_WRITE (bus, adr, @@ -429,7 +443,7 @@ intel_flash_erase_block32 (urj_flash_cfi_array_t *cfi_array, uint32_t adr) URJ_BUS_WRITE (bus, adr, (CFI_INTEL_CMD_CONFIRM << 16) | CFI_INTEL_CMD_CONFIRM); - while (((sr = URJ_BUS_READ (bus, cfi_array->address) & 0x00FE00FE) & ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)); /* TODO: add timeout */ + while (((sr = URJ_BUS_READ (bus, urj_flash_cfi_array->address) & 0x00FE00FE) & ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)); /* TODO: add timeout */ if (sr != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) { @@ -441,12 +455,13 @@ intel_flash_erase_block32 (urj_flash_cfi_array_t *cfi_array, uint32_t adr) } static int -intel_flash_unlock_block32 (urj_flash_cfi_array_t *cfi_array, uint32_t adr) +intel_flash_unlock_block32 (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr) { uint32_t sr; - urj_bus_t *bus = cfi_array->bus; + urj_bus_t *bus = urj_flash_cfi_array->bus; - URJ_BUS_WRITE (bus, cfi_array->address, + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address, (CFI_INTEL_CMD_CLEAR_STATUS_REGISTER << 16) | CFI_INTEL_CMD_CLEAR_STATUS_REGISTER); URJ_BUS_WRITE (bus, adr, @@ -456,7 +471,7 @@ intel_flash_unlock_block32 (urj_flash_cfi_array_t *cfi_array, uint32_t adr) (CFI_INTEL_CMD_UNLOCK_BLOCK << 16) | CFI_INTEL_CMD_UNLOCK_BLOCK); - while (((sr = URJ_BUS_READ (bus, cfi_array->address) & 0x00FE00FE) & ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)); /* TODO: add timeout */ + while (((sr = URJ_BUS_READ (bus, urj_flash_cfi_array->address) & 0x00FE00FE) & ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)); /* TODO: add timeout */ if (sr != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) { @@ -468,20 +483,20 @@ intel_flash_unlock_block32 (urj_flash_cfi_array_t *cfi_array, uint32_t adr) } static int -intel_flash_program32_single (urj_flash_cfi_array_t *cfi_array, uint32_t adr, - uint32_t data) +intel_flash_program32_single (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr, uint32_t data) { uint32_t sr; - urj_bus_t *bus = cfi_array->bus; + urj_bus_t *bus = urj_flash_cfi_array->bus; - URJ_BUS_WRITE (bus, cfi_array->address, + URJ_BUS_WRITE (bus, urj_flash_cfi_array->address, (CFI_INTEL_CMD_CLEAR_STATUS_REGISTER << 16) | CFI_INTEL_CMD_CLEAR_STATUS_REGISTER); URJ_BUS_WRITE (bus, adr, (CFI_INTEL_CMD_PROGRAM1 << 16) | CFI_INTEL_CMD_PROGRAM1); URJ_BUS_WRITE (bus, adr, data); - while (((sr = URJ_BUS_READ (bus, cfi_array->address) & 0x00FE00FE) & ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)); /* TODO: add timeout */ + while (((sr = URJ_BUS_READ (bus, urj_flash_cfi_array->address) & 0x00FE00FE) & ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)); /* TODO: add timeout */ if (sr != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) { @@ -493,8 +508,8 @@ intel_flash_program32_single (urj_flash_cfi_array_t *cfi_array, uint32_t adr, } static int -intel_flash_program32 (urj_flash_cfi_array_t *cfi_array, uint32_t adr, - uint32_t *buffer, int count) +intel_flash_program32 (urj_flash_cfi_array_t *urj_flash_cfi_array, + uint32_t adr, uint32_t *buffer, int count) { /* Single byte programming is forced for 32 bit (2x16) flash configuration. a) lack of testing capbilities for 2x16 multi-byte write operation @@ -505,31 +520,33 @@ intel_flash_program32 (urj_flash_cfi_array_t *cfi_array, uint32_t adr, /* unroll buffer to single writes */ for (idx = 0; idx < count; idx++) { - int status = - intel_flash_program32_single (cfi_array, adr, buffer[idx]); + int status = intel_flash_program32_single (urj_flash_cfi_array, adr, + buffer[idx]); if (status) return status; - adr += cfi_array->bus_width; + adr += urj_flash_cfi_array->bus_width; } return 0; } static void -intel_flash_readarray32 (urj_flash_cfi_array_t *cfi_array) +intel_flash_readarray32 (urj_flash_cfi_array_t *urj_flash_cfi_array) { /* Read Array */ - URJ_BUS_WRITE (cfi_array->bus, cfi_array->address, 0x00FF00FF); + URJ_BUS_WRITE (urj_flash_cfi_array->bus, urj_flash_cfi_array->address, + 0x00FF00FF); } static void -intel_flash_readarray (urj_flash_cfi_array_t *cfi_array) +intel_flash_readarray (urj_flash_cfi_array_t *urj_flash_cfi_array) { /* Read Array */ - URJ_BUS_WRITE (cfi_array->bus, cfi_array->address, 0x00FF00FF); + URJ_BUS_WRITE (urj_flash_cfi_array->bus, urj_flash_cfi_array->address, + 0x00FF00FF); } -urj_flash_driver_t intel_32_flash_driver = { +urj_flash_driver_t urj_flash_intel_32_flash_driver = { 4, /* buswidth */ N_("Intel Standard Command Set"), N_("supported: 28Fxxxx, 2 x 16 bit"), @@ -541,7 +558,7 @@ urj_flash_driver_t intel_32_flash_driver = { intel_flash_readarray32, }; -urj_flash_driver_t intel_16_flash_driver = { +urj_flash_driver_t urj_flash_intel_16_flash_driver = { 2, /* buswidth */ N_("Intel Standard Command Set"), N_("supported: 28Fxxxx, 1 x 16 bit"), @@ -553,7 +570,7 @@ urj_flash_driver_t intel_16_flash_driver = { intel_flash_readarray, }; -urj_flash_driver_t intel_8_flash_driver = { +urj_flash_driver_t urj_flash_intel_8_flash_driver = { 1, /* buswidth */ N_("Intel Standard Command Set"), N_("supported: 28Fxxxx, 1 x 8 bit"), diff --git a/urjtag/src/flash/jedec.c b/urjtag/src/flash/jedec.c index ac4f3daf..c8254cb3 100644 --- a/urjtag/src/flash/jedec.c +++ b/urjtag/src/flash/jedec.c @@ -709,7 +709,7 @@ static const struct amd_flash_info table[] = { int urj_flash_jedec_detect (urj_bus_t *bus, uint32_t adr, - urj_flash_cfi_array_t **cfi_array) + urj_flash_cfi_array_t **urj_flash_cfi_array) { /* Temporary containers for manufacturer and device id while probing with different Autoselect methods. */ @@ -720,26 +720,27 @@ urj_flash_jedec_detect (urj_bus_t *bus, uint32_t adr, urj_flash_cfi_query_structure_t *cfi; urj_bus_area_t area; - *cfi_array = calloc (1, sizeof (urj_flash_cfi_array_t)); - if (!*cfi_array) + *urj_flash_cfi_array = calloc (1, sizeof (urj_flash_cfi_array_t)); + if (!*urj_flash_cfi_array) return -2; /* out of memory */ - (*cfi_array)->bus = bus; - (*cfi_array)->address = adr; + (*urj_flash_cfi_array)->bus = bus; + (*urj_flash_cfi_array)->address = adr; if (URJ_BUS_AREA (bus, adr, &area) != URJ_STATUS_OK) return -8; /* bus width detection failed */ bw = area.width; if (bw != 8 && bw != 16 && bw != 32) return -3; /* invalid bus width */ - (*cfi_array)->bus_width = ba = bw / 8; + (*urj_flash_cfi_array)->bus_width = ba = bw / 8; - (*cfi_array)->cfi_chips = + (*urj_flash_cfi_array)->cfi_chips = calloc (1, sizeof (urj_flash_cfi_chip_t *) * ba); - if (!(*cfi_array)->cfi_chips) + if (!(*urj_flash_cfi_array)->cfi_chips) return -2; /* out of memory */ - (*cfi_array)->cfi_chips[0] = calloc (1, sizeof (urj_flash_cfi_chip_t)); - if (!(*cfi_array)->cfi_chips[0]) + (*urj_flash_cfi_array)->cfi_chips[0] = + calloc (1, sizeof (urj_flash_cfi_chip_t)); + if (!(*urj_flash_cfi_array)->cfi_chips[0]) return -2; /* out of memory */ /* probe device with Autoselect method 1 */ @@ -776,7 +777,7 @@ urj_flash_jedec_detect (urj_bus_t *bus, uint32_t adr, if (i == sizeof (table) / sizeof (struct amd_flash_info)) return -4; - cfi = &(*cfi_array)->cfi_chips[0]->cfi; + cfi = &(*urj_flash_cfi_array)->cfi_chips[0]->cfi; cfi->identification_string.pri_id_code = CFI_VENDOR_AMD_SCS; cfi->identification_string.pri_vendor_tbl = NULL; @@ -789,26 +790,26 @@ urj_flash_jedec_detect (urj_bus_t *bus, uint32_t adr, switch (table[i].interface_width) { case CFI_INTERFACE_X8: - (*cfi_array)->cfi_chips[0]->width = 1; + (*urj_flash_cfi_array)->cfi_chips[0]->width = 1; break; case CFI_INTERFACE_X16: - (*cfi_array)->cfi_chips[0]->width = 2; + (*urj_flash_cfi_array)->cfi_chips[0]->width = 2; break; case CFI_INTERFACE_X8_X16: fprintf (stderr, "Warning: Unsupported interface geometry %s, falling back to %s\n", "CFI_INTERFACE_X8_X16", "CFI_INTERFACE_X16"); - (*cfi_array)->cfi_chips[0]->width = 2; + (*urj_flash_cfi_array)->cfi_chips[0]->width = 2; cfi->device_geometry.device_interface = CFI_INTERFACE_X16; break; case CFI_INTERFACE_X32: - (*cfi_array)->cfi_chips[0]->width = 4; + (*urj_flash_cfi_array)->cfi_chips[0]->width = 4; break; case CFI_INTERFACE_X16_X32: fprintf (stderr, "Warning: Unsupported interface geometry %s, falling back to %s\n", "CFI_INTERFACE_X16_X32", "CFI_INTERFACE_X32"); - (*cfi_array)->cfi_chips[0]->width = 4; + (*urj_flash_cfi_array)->cfi_chips[0]->width = 4; cfi->device_geometry.device_interface = CFI_INTERFACE_X32; break; default: @@ -816,7 +817,7 @@ urj_flash_jedec_detect (urj_bus_t *bus, uint32_t adr, fprintf (stderr, "Error: Unsupported interface geometry %d, bailing out\n", table[i].interface_width); - (*cfi_array)->cfi_chips[0]->width = 1; + (*urj_flash_cfi_array)->cfi_chips[0]->width = 1; cfi->device_geometry.device_interface = CFI_INTERFACE_X8; return -5; break; diff --git a/urjtag/src/flash/jedec.h b/urjtag/src/flash/jedec.h index 2edc21fd..1a4cb64b 100644 --- a/urjtag/src/flash/jedec.h +++ b/urjtag/src/flash/jedec.h @@ -29,12 +29,12 @@ #include int urj_flash_jedec_detect (urj_bus_t *bus, uint32_t adr, - urj_flash_cfi_array_t **cfi_array); + urj_flash_cfi_array_t **urj_flash_cfi_array); #ifdef JEDEC_EXP int urj_flash_jedec_exp_detect (urj_bus_t *bus, uint32_t adr, - urj_flash_cfi_array_t **cfi_array); + urj_flash_cfi_array_t **urj_flash_cfi_array); #endif int urj_flash_amd_detect (urj_bus_t *bus, uint32_t adr, - urj_flash_cfi_array_t **cfi_array); + urj_flash_cfi_array_t **urj_flash_cfi_array); #endif /* ndef URJ_FLASH_JEDEC_H */ diff --git a/urjtag/src/flash/jedec_exp.c b/urjtag/src/flash/jedec_exp.c index 110a2580..00293d54 100644 --- a/urjtag/src/flash/jedec_exp.c +++ b/urjtag/src/flash/jedec_exp.c @@ -61,7 +61,7 @@ urj_flash_jedec_exp_read_id (urj_bus_t *bus, uint32_t adr, uint32_t dmask, int urj_flash_jedec_exp_detect (urj_bus_t *bus, uint32_t adr, - urj_flash_cfi_array_t **cfi_array) + urj_flash_cfi_array_t **urj_flash_cfi_array) { /* Temporary containers for manufacturer and device id while probing with different Autoselect methods. */ @@ -69,12 +69,12 @@ urj_flash_jedec_exp_detect (urj_bus_t *bus, uint32_t adr, int det_buswidth; urj_bus_area_t area; - *cfi_array = calloc (1, sizeof (urj_flash_cfi_array_t)); - if (!*cfi_array) + *urj_flash_cfi_array = calloc (1, sizeof (urj_flash_cfi_array_t)); + if (!*urj_flash_cfi_array) return -2; /* out of memory */ - (*cfi_array)->bus = bus; - (*cfi_array)->address = adr; + (*urj_flash_cfi_array)->bus = bus; + (*urj_flash_cfi_array)->address = adr; if (URJ_BUS_AREA (bus, adr, &area) != URJ_STATUS_OK) return -8; /* bus width detection failed */ bw = area.width; @@ -84,14 +84,16 @@ urj_flash_jedec_exp_detect (urj_bus_t *bus, uint32_t adr, if (bw != 8 && bw != 16 && bw != 32) return -3; /* invalid bus width */ - (*cfi_array)->bus_width = ba = bw / 8; + (*urj_flash_cfi_array)->bus_width = ba = bw / 8; - (*cfi_array)->cfi_chips = calloc (1, sizeof (urj_flash_cfi_chip_t *)); - if (!(*cfi_array)->cfi_chips) + (*urj_flash_cfi_array)->cfi_chips = + calloc (1, sizeof (urj_flash_cfi_chip_t *)); + if (!(*urj_flash_cfi_array)->cfi_chips) return -2; /* out of memory */ - (*cfi_array)->cfi_chips[0] = calloc (1, sizeof (urj_flash_cfi_chip_t)); - if (!(*cfi_array)->cfi_chips[0]) + (*urj_flash_cfi_array)->cfi_chips[0] = + calloc (1, sizeof (urj_flash_cfi_chip_t)); + if (!(*urj_flash_cfi_array)->cfi_chips[0]) return -2; /* out of memory */ printf diff --git a/urjtag/src/jim/intel_28f800b3.c b/urjtag/src/jim/intel_28f800b3.c index c42b1f7c..fdfb1ed8 100644 --- a/urjtag/src/jim/intel_28f800b3.c +++ b/urjtag/src/jim/intel_28f800b3.c @@ -411,7 +411,7 @@ urj_jim_intel_28fxxxb3_update (urj_jim_bus_device_t *d, } } -urj_jim_bus_device_t intel_28f800b3b = { +urj_jim_bus_device_t urj_jim_intel_28f800b3b = { 2, /* width [bytes] */ 0x80000, /* size [words, each bytes] */ NULL, /* state */ diff --git a/urjtag/src/jim/some_cpu.c b/urjtag/src/jim/some_cpu.c index f4041fdb..4429a8fd 100644 --- a/urjtag/src/jim/some_cpu.c +++ b/urjtag/src/jim/some_cpu.c @@ -30,7 +30,7 @@ #undef VERBOSE -extern urj_jim_bus_device_t intel_28f800b3b; +extern urj_jim_bus_device_t urj_jim_intel_28f800b3b; static urj_jim_attached_part_t some_cpu_attached[] = { /* 1. Address offset: base offset [bytes] @@ -38,7 +38,7 @@ static urj_jim_attached_part_t some_cpu_attached[] = { * 3. Data shift: Distance between D0 of device and CPU e.g. 0, 8, 16 or 24 bits * 4. Part: Pointer to part structure */ - {0x00000000, 1, 0, &intel_28f800b3b}, + {0x00000000, 1, 0, &urj_jim_intel_28f800b3b}, {0xFFFFFFFF, 0, 0, NULL} /* Always end list with part == NULL */ }; diff --git a/urjtag/src/jtag.c b/urjtag/src/jtag.c index 1887ce2e..df9a736c 100644 --- a/urjtag/src/jtag.c +++ b/urjtag/src/jtag.c @@ -58,7 +58,7 @@ ssize_t urj_lib_getline (char **lineptr, size_t *n, FILE * stream); int debug_mode = 0; int big_endian = 0; int interactive = 0; -extern urj_flash_cfi_array_t *cfi_array; +extern urj_flash_cfi_array_t *urj_flash_cfi_array; #define JTAGDIR ".jtag" #define HISTORYFILE "history" @@ -274,8 +274,8 @@ jtag_parse_rc (urj_chain_t *chain) static void cleanup (urj_chain_t *chain) { - urj_flash_cfi_array_free (cfi_array); - cfi_array = NULL; + urj_flash_cfi_array_free (urj_flash_cfi_array); + urj_flash_cfi_array = NULL; if (urj_bus) { diff --git a/urjtag/src/tap/cable.c b/urjtag/src/tap/cable.c index 4a057563..b2ddfe17 100644 --- a/urjtag/src/tap/cable.c +++ b/urjtag/src/tap/cable.c @@ -39,109 +39,109 @@ #undef VERBOSE -extern urj_cable_driver_t arcom_cable_driver; -extern urj_cable_driver_t byteblaster_cable_driver; -extern urj_cable_driver_t usbblaster_cable_driver; -extern urj_cable_driver_t ft2232_cable_driver; -extern urj_cable_driver_t ft2232_jtagkey_cable_driver; -extern urj_cable_driver_t ft2232_armusbocd_cable_driver; -extern urj_cable_driver_t ft2232_gnice_cable_driver; -extern urj_cable_driver_t ft2232_oocdlinks_cable_driver; -extern urj_cable_driver_t ft2232_signalyzer_cable_driver; -extern urj_cable_driver_t ft2232_turtelizer2_cable_driver; -extern urj_cable_driver_t ft2232_usbtojtagif_cable_driver; -extern urj_cable_driver_t ft2232_flyswatter_cable_driver; -extern urj_cable_driver_t ft2232_usbscarab2_cable_driver; -extern urj_cable_driver_t dlc5_cable_driver; -extern urj_cable_driver_t ea253_cable_driver; -extern urj_cable_driver_t ei012_cable_driver; -extern urj_cable_driver_t igloo_cable_driver; -extern urj_cable_driver_t keithkoep_cable_driver; -extern urj_cable_driver_t lattice_cable_driver; -extern urj_cable_driver_t mpcbdm_cable_driver; -extern urj_cable_driver_t triton_cable_driver; -extern urj_cable_driver_t jim_cable_driver; -extern urj_cable_driver_t wiggler_cable_driver; -extern urj_cable_driver_t wiggler2_cable_driver; -extern urj_cable_driver_t wiggler_cable_driver; -extern urj_cable_driver_t xpc_int_cable_driver; -extern urj_cable_driver_t xpc_ext_cable_driver; -extern urj_cable_driver_t jlink_cable_driver; -extern urj_cable_driver_t ep9307_cable_driver; -extern urj_cable_driver_t ts7800_cable_driver; - -urj_cable_driver_t *cable_drivers[] = { +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_gnice_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_wiggler_driver; +extern urj_cable_driver_t urj_tap_cable_wiggler2_driver; +extern urj_cable_driver_t urj_tap_cable_wiggler_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; + +urj_cable_driver_t *urj_tap_cable_drivers[] = { #ifdef ENABLE_CABLE_ARCOM - &arcom_cable_driver, + &urj_tap_cable_arcom_driver, #endif #ifdef ENABLE_CABLE_BYTEBLASTER - &byteblaster_cable_driver, + &urj_tap_cable_byteblaster_driver, #endif #ifdef ENABLE_CABLE_USBBLASTER - &usbblaster_cable_driver, + &urj_tap_cable_usbblaster_driver, #endif #ifdef ENABLE_CABLE_FT2232 - &ft2232_cable_driver, - &ft2232_jtagkey_cable_driver, - &ft2232_armusbocd_cable_driver, - &ft2232_gnice_cable_driver, - &ft2232_oocdlinks_cable_driver, - &ft2232_signalyzer_cable_driver, - &ft2232_turtelizer2_cable_driver, - &ft2232_usbtojtagif_cable_driver, - &ft2232_flyswatter_cable_driver, - &ft2232_usbscarab2_cable_driver, + &urj_tap_cable_ft2232_driver, + &urj_tap_cable_ft2232_jtagkey_driver, + &urj_tap_cable_ft2232_armusbocd_driver, + &urj_tap_cable_ft2232_gnice_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 - &dlc5_cable_driver, + &urj_tap_cable_dlc5_driver, #endif #ifdef ENABLE_CABLE_EA253 - &ea253_cable_driver, + &urj_tap_cable_ea253_driver, #endif #ifdef ENABLE_CABLE_EI012 - &ei012_cable_driver, + &urj_tap_cable_ei012_driver, #endif #ifdef ENABLE_CABLE_IGLOO - &igloo_cable_driver, + &urj_tap_cable_igloo_driver, #endif #ifdef ENABLE_CABLE_KEITHKOEP - &keithkoep_cable_driver, + &urj_tap_cable_keithkoep_driver, #endif #ifdef ENABLE_CABLE_LATTICE - &lattice_cable_driver, + &urj_tap_cable_lattice_driver, #endif #ifdef ENABLE_CABLE_MPCBDM - &mpcbdm_cable_driver, + &urj_tap_cable_mpcbdm_driver, #endif #ifdef ENABLE_CABLE_TRITON - &triton_cable_driver, + &urj_tap_cable_triton_driver, #endif #ifdef ENABLE_JIM - &jim_cable_driver, + &urj_tap_cable_jim_driver, #endif #ifdef ENABLE_CABLE_WIGGLER - &wiggler_cable_driver, - &wiggler2_cable_driver, + &urj_tap_cable_wiggler_driver, + &urj_tap_cable_wiggler2_driver, #endif #ifdef ENABLE_CABLE_XPC - &xpc_int_cable_driver, - &xpc_ext_cable_driver, + &urj_tap_cable_xpc_int_driver, + &urj_tap_cable_xpc_ext_driver, #endif #ifdef ENABLE_CABLE_JLINK - &jlink_cable_driver, + &urj_tap_cable_jlink_driver, #endif #ifdef ENABLE_CABLE_EP9307 - &ep9307_cable_driver, + &urj_tap_cable_ep9307_driver, #endif #ifdef ENABLE_CABLE_TS7800 - &ts7800_cable_driver, + &urj_tap_cable_ts7800_driver, #endif NULL /* last must be NULL */ }; diff --git a/urjtag/src/tap/cable/arcom.c b/urjtag/src/tap/cable/arcom.c index ecab9393..5e18681b 100644 --- a/urjtag/src/tap/cable/arcom.c +++ b/urjtag/src/tap/cable/arcom.c @@ -132,7 +132,7 @@ arcom_set_signal (urj_cable_t *cable, int mask, int val) return prev_sigs; } -urj_cable_driver_t arcom_cable_driver = { +urj_cable_driver_t urj_tap_cable_arcom_driver = { "ARCOM", N_("Arcom JTAG Cable"), urj_tap_cable_generic_parport_connect, diff --git a/urjtag/src/tap/cable/byteblaster.c b/urjtag/src/tap/cable/byteblaster.c index f18b90ba..2bcd3f4f 100644 --- a/urjtag/src/tap/cable/byteblaster.c +++ b/urjtag/src/tap/cable/byteblaster.c @@ -154,7 +154,7 @@ byteblaster_set_signal (urj_cable_t *cable, int mask, int val) return prev_sigs; } -urj_cable_driver_t byteblaster_cable_driver = { +urj_cable_driver_t urj_tap_cable_byteblaster_driver = { "ByteBlaster", N_("Altera ByteBlaster/ByteBlaster II/ByteBlasterMV Parallel Port Download Cable"), urj_tap_cable_generic_parport_connect, diff --git a/urjtag/src/tap/cable/dlc5.c b/urjtag/src/tap/cable/dlc5.c index 63082045..fe92f46a 100644 --- a/urjtag/src/tap/cable/dlc5.c +++ b/urjtag/src/tap/cable/dlc5.c @@ -126,7 +126,7 @@ dlc5_set_signal (urj_cable_t *cable, int mask, int val) return prev_sigs; } -urj_cable_driver_t dlc5_cable_driver = { +urj_cable_driver_t urj_tap_cable_dlc5_driver = { "DLC5", N_("Xilinx DLC5 JTAG Parallel Cable III"), urj_tap_cable_generic_parport_connect, diff --git a/urjtag/src/tap/cable/ea253.c b/urjtag/src/tap/cable/ea253.c index 3dbc0e8b..e22540a2 100644 --- a/urjtag/src/tap/cable/ea253.c +++ b/urjtag/src/tap/cable/ea253.c @@ -132,7 +132,7 @@ ea253_set_signal (urj_cable_t *cable, int mask, int val) return prev_sigs; } -urj_cable_driver_t ea253_cable_driver = { +urj_cable_driver_t urj_tap_cable_ea253_driver = { "EA253", N_("ETC EA253 JTAG Cable"), urj_tap_cable_generic_parport_connect, diff --git a/urjtag/src/tap/cable/ei012.c b/urjtag/src/tap/cable/ei012.c index 0f3a97bb..aa560f31 100644 --- a/urjtag/src/tap/cable/ei012.c +++ b/urjtag/src/tap/cable/ei012.c @@ -134,7 +134,7 @@ ei012_set_signal (urj_cable_t *cable, int mask, int val) return prev_sigs; } -urj_cable_driver_t ei012_cable_driver = { +urj_cable_driver_t urj_tap_cable_ei012_driver = { "EI012", N_("ETC EI012 JTAG Cable"), urj_tap_cable_generic_parport_connect, diff --git a/urjtag/src/tap/cable/ft2232.c b/urjtag/src/tap/cable/ft2232.c index 7d97d833..18381bc6 100644 --- a/urjtag/src/tap/cable/ft2232.c +++ b/urjtag/src/tap/cable/ft2232.c @@ -1769,16 +1769,16 @@ ft2232_cable_free (urj_cable_t *cable) } -urj_usbconn_cable_t usbconn_cable_ft2232_ftdi; -urj_usbconn_cable_t usbconn_cable_armusbocd_ftdi; -urj_usbconn_cable_t usbconn_cable_gnice_ftdi; -urj_usbconn_cable_t usbconn_cable_jtagkey_ftdi; -urj_usbconn_cable_t usbconn_cable_oocdlinks_ftdi; -urj_usbconn_cable_t usbconn_cable_turtelizer2_ftdi; -urj_usbconn_cable_t usbconn_cable_usbtojtagif_ftdi; -urj_usbconn_cable_t usbconn_cable_signalyzer_ftdi; -urj_usbconn_cable_t usbconn_cable_flyswatter_ftdi; -urj_usbconn_cable_t usbconn_cable_usbscarab2_ftdi; +urj_usbconn_cable_t urj_tap_cable_usbconn_ft2232_ftdi; +urj_usbconn_cable_t urj_tap_cable_usbconn_armusbocd_ftdi; +urj_usbconn_cable_t urj_tap_cable_usbconn_gnice_ftdi; +urj_usbconn_cable_t urj_tap_cable_usbconn_jtagkey_ftdi; +urj_usbconn_cable_t urj_tap_cable_usbconn_oocdlinks_ftdi; +urj_usbconn_cable_t urj_tap_cable_usbconn_turtelizer2_ftdi; +urj_usbconn_cable_t urj_tap_cable_usbconn_usbtojtagif_ftdi; +urj_usbconn_cable_t urj_tap_cable_usbconn_signalyzer_ftdi; +urj_usbconn_cable_t urj_tap_cable_usbconn_flyswatter_ftdi; +urj_usbconn_cable_t urj_tap_cable_usbconn_usbscarab2_ftdi; static void @@ -1786,34 +1786,34 @@ ft2232_usbcable_help (const char *cablename) { urj_usbconn_cable_t *conn; - conn = &usbconn_cable_armusbocd_ftdi; + conn = &urj_tap_cable_usbconn_armusbocd_ftdi; if (strcasecmp (conn->name, cablename) == 0) goto found; - conn = &usbconn_cable_gnice_ftdi; + conn = &urj_tap_cable_usbconn_gnice_ftdi; if (strcasecmp (conn->name, cablename) == 0) goto found; - conn = &usbconn_cable_jtagkey_ftdi; + conn = &urj_tap_cable_usbconn_jtagkey_ftdi; if (strcasecmp (conn->name, cablename) == 0) goto found; - conn = &usbconn_cable_oocdlinks_ftdi; + conn = &urj_tap_cable_usbconn_oocdlinks_ftdi; if (strcasecmp (conn->name, cablename) == 0) goto found; - conn = &usbconn_cable_turtelizer2_ftdi; + conn = &urj_tap_cable_usbconn_turtelizer2_ftdi; if (strcasecmp (conn->name, cablename) == 0) goto found; - conn = &usbconn_cable_usbtojtagif_ftdi; + conn = &urj_tap_cable_usbconn_usbtojtagif_ftdi; if (strcasecmp (conn->name, cablename) == 0) goto found; - conn = &usbconn_cable_signalyzer_ftdi; + conn = &urj_tap_cable_usbconn_signalyzer_ftdi; if (strcasecmp (conn->name, cablename) == 0) goto found; - conn = &usbconn_cable_flyswatter_ftdi; + conn = &urj_tap_cable_usbconn_flyswatter_ftdi; if (strcasecmp (conn->name, cablename) == 0) goto found; - conn = &usbconn_cable_usbscarab2_ftdi; + conn = &urj_tap_cable_usbconn_usbscarab2_ftdi; if (strcasecmp (conn->name, cablename) == 0) goto found; - conn = &usbconn_cable_ft2232_ftdi; + conn = &urj_tap_cable_usbconn_ft2232_ftdi; found: printf (_ @@ -1827,7 +1827,7 @@ ft2232_usbcable_help (const char *cablename) } -urj_cable_driver_t ft2232_cable_driver = { +urj_cable_driver_t urj_tap_cable_ft2232_driver = { "FT2232", N_("Generic FTDI FT2232 Cable"), ft2232_connect, @@ -1844,14 +1844,14 @@ urj_cable_driver_t ft2232_cable_driver = { ft2232_flush, ft2232_usbcable_help }; -urj_usbconn_cable_t usbconn_cable_ft2232_ftdi = { +urj_usbconn_cable_t urj_tap_cable_usbconn_ft2232_ftdi = { "FT2232", /* cable name */ NULL, /* string pattern, not used */ "ftdi-mpsse", /* default usbconn driver */ 0x0000, /* VID */ 0x0000 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_ft2232_ftd2xx = { +urj_usbconn_cable_t urj_tap_cable_usbconn_ft2232_ftd2xx = { "FT2232", /* cable name */ NULL, /* string pattern, not used */ "ftd2xx-mpsse", /* default usbconn driver */ @@ -1859,7 +1859,7 @@ urj_usbconn_cable_t usbconn_cable_ft2232_ftd2xx = { 0x0000 /* PID */ }; -urj_cable_driver_t ft2232_armusbocd_cable_driver = { +urj_cable_driver_t urj_tap_cable_ft2232_armusbocd_driver = { "ARM-USB-OCD", N_("Olimex ARM-USB-OCD[-TINY] (FT2232) Cable"), ft2232_connect, @@ -1876,28 +1876,28 @@ urj_cable_driver_t ft2232_armusbocd_cable_driver = { ft2232_flush, ft2232_usbcable_help }; -urj_usbconn_cable_t usbconn_cable_armusbocd_ftdi = { +urj_usbconn_cable_t urj_tap_cable_usbconn_armusbocd_ftdi = { "ARM-USB-OCD", /* cable name */ NULL, /* string pattern, not used */ "ftdi-mpsse", /* default usbconn driver */ 0x15BA, /* VID */ 0x0003 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_armusbocd_ftd2xx = { +urj_usbconn_cable_t urj_tap_cable_usbconn_armusbocd_ftd2xx = { "ARM-USB-OCD", /* cable name */ NULL, /* string pattern, not used */ "ftd2xx-mpsse", /* default usbconn driver */ 0x15BA, /* VID */ 0x0003 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_armusbocdtiny_ftdi = { +urj_usbconn_cable_t urj_tap_cable_usbconn_armusbocdtiny_ftdi = { "ARM-USB-OCD", /* cable name */ NULL, /* string pattern, not used */ "ftdi-mpsse", /* default usbconn driver */ 0x15BA, /* VID */ 0x0004 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_armusbocdtiny_ftd2xx = { +urj_usbconn_cable_t urj_tap_cable_usbconn_armusbocdtiny_ftd2xx = { "ARM-USB-OCD", /* cable name */ NULL, /* string pattern, not used */ "ftd2xx-mpsse", /* default usbconn driver */ @@ -1905,7 +1905,7 @@ urj_usbconn_cable_t usbconn_cable_armusbocdtiny_ftd2xx = { 0x0004 /* PID */ }; -urj_cable_driver_t ft2232_gnice_cable_driver = { +urj_cable_driver_t urj_tap_cable_ft2232_gnice_driver = { "gnICE", N_("Analog Devices Blackfin gnICE (FT2232) Cable (EXPERIMENTAL)"), ft2232_connect, @@ -1922,14 +1922,14 @@ urj_cable_driver_t ft2232_gnice_cable_driver = { ft2232_flush, ft2232_usbcable_help }; -urj_usbconn_cable_t usbconn_cable_gnice_ftdi = { +urj_usbconn_cable_t urj_tap_cable_usbconn_gnice_ftdi = { "gnICE", /* cable name */ NULL, /* string pattern, not used */ "ftdi-mpsse", /* default usbconn driver */ 0x0456, /* VID */ 0xF000 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_gnice_ftd2xx = { +urj_usbconn_cable_t urj_tap_cable_usbconn_gnice_ftd2xx = { "gnICE", /* cable name */ NULL, /* string pattern, not used */ "ftd2xx-mpsse", /* default usbconn driver */ @@ -1937,7 +1937,7 @@ urj_usbconn_cable_t usbconn_cable_gnice_ftd2xx = { 0xF000 /* PID */ }; -urj_cable_driver_t ft2232_jtagkey_cable_driver = { +urj_cable_driver_t urj_tap_cable_ft2232_jtagkey_driver = { "JTAGkey", N_("Amontec JTAGkey (FT2232) Cable"), ft2232_connect, @@ -1954,14 +1954,14 @@ urj_cable_driver_t ft2232_jtagkey_cable_driver = { ft2232_flush, ft2232_usbcable_help }; -urj_usbconn_cable_t usbconn_cable_jtagkey_ftdi = { +urj_usbconn_cable_t urj_tap_cable_usbconn_jtagkey_ftdi = { "JTAGkey", /* cable name */ NULL, /* string pattern, not used */ "ftdi-mpsse", /* default usbconn driver */ 0x0403, /* VID */ 0xCFF8 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_jtagkey_ftd2xx = { +urj_usbconn_cable_t urj_tap_cable_usbconn_jtagkey_ftd2xx = { "JTAGkey", /* cable name */ NULL, /* string pattern, not used */ "ftd2xx-mpsse", /* default usbconn driver */ @@ -1969,7 +1969,7 @@ urj_usbconn_cable_t usbconn_cable_jtagkey_ftd2xx = { 0xCFF8 /* PID */ }; -urj_cable_driver_t ft2232_oocdlinks_cable_driver = { +urj_cable_driver_t urj_tap_cable_ft2232_oocdlinks_driver = { "OOCDLink-s", N_("OOCDLink-s (FT2232) Cable (EXPERIMENTAL)"), ft2232_connect, @@ -1986,14 +1986,14 @@ urj_cable_driver_t ft2232_oocdlinks_cable_driver = { ft2232_flush, ft2232_usbcable_help }; -urj_usbconn_cable_t usbconn_cable_oocdlinks_ftdi = { +urj_usbconn_cable_t urj_tap_cable_usbconn_oocdlinks_ftdi = { "OOCDLink-s", /* cable name */ NULL, /* string pattern, not used */ "ftdi-mpsse", /* default usbconn driver */ 0x0403, /* VID */ 0xbaf8 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_oocdlinks_ftd2xx = { +urj_usbconn_cable_t urj_tap_cable_usbconn_oocdlinks_ftd2xx = { "OOCDLink-s", /* cable name */ NULL, /* string pattern, not used */ "ftd2xx-mpsse", /* default usbconn driver */ @@ -2001,7 +2001,7 @@ urj_usbconn_cable_t usbconn_cable_oocdlinks_ftd2xx = { 0xbaf8 /* PID */ }; -urj_cable_driver_t ft2232_turtelizer2_cable_driver = { +urj_cable_driver_t urj_tap_cable_ft2232_turtelizer2_driver = { "Turtelizer2", N_("Turtelizer 2 Rev. B (FT2232) Cable (EXPERIMENTAL)"), ft2232_connect, @@ -2018,14 +2018,14 @@ urj_cable_driver_t ft2232_turtelizer2_cable_driver = { ft2232_flush, ft2232_usbcable_help }; -urj_usbconn_cable_t usbconn_cable_turtelizer2_ftdi = { +urj_usbconn_cable_t urj_tap_cable_usbconn_turtelizer2_ftdi = { "Turtelizer2", /* cable name */ NULL, /* string pattern, not used */ "ftdi-mpsse", /* default usbconn driver */ 0x0403, /* VID */ 0xBDC8 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_turtelizer2_ftd2xx = { +urj_usbconn_cable_t urj_tap_cable_usbconn_turtelizer2_ftd2xx = { "Turtelizer2", /* cable name */ NULL, /* string pattern, not used */ "ftd2xx-mpsse", /* default usbconn driver */ @@ -2033,7 +2033,7 @@ urj_usbconn_cable_t usbconn_cable_turtelizer2_ftd2xx = { 0xBDC8 /* PID */ }; -urj_cable_driver_t ft2232_usbtojtagif_cable_driver = { +urj_cable_driver_t urj_tap_cable_ft2232_usbtojtagif_driver = { "USB-to-JTAG-IF", N_("USB to JTAG Interface (FT2232) Cable (EXPERIMENTAL)"), ft2232_connect, @@ -2050,14 +2050,14 @@ urj_cable_driver_t ft2232_usbtojtagif_cable_driver = { ft2232_flush, ft2232_usbcable_help }; -urj_usbconn_cable_t usbconn_cable_usbtojtagif_ftdi = { +urj_usbconn_cable_t urj_tap_cable_usbconn_usbtojtagif_ftdi = { "USB-to-JTAG-IF", /* cable name */ NULL, /* string pattern, not used */ "ftdi-mpsse", /* default usbconn driver */ 0x0000, /* VID */ 0x0000 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_usbtojtagif_ftd2xx = { +urj_usbconn_cable_t urj_tap_cable_usbconn_usbtojtagif_ftd2xx = { "USB-to-JTAG-IF", /* cable name */ NULL, /* string pattern, not used */ "ftd2xx-mpsse", /* default usbconn driver */ @@ -2065,7 +2065,7 @@ urj_usbconn_cable_t usbconn_cable_usbtojtagif_ftd2xx = { 0x0000 /* PID */ }; -urj_cable_driver_t ft2232_signalyzer_cable_driver = { +urj_cable_driver_t urj_tap_cable_ft2232_signalyzer_driver = { "Signalyzer", N_("Xverve DT-USB-ST Signalyzer Tool (FT2232) Cable (EXPERIMENTAL)"), ft2232_connect, @@ -2082,14 +2082,14 @@ urj_cable_driver_t ft2232_signalyzer_cable_driver = { ft2232_flush, ft2232_usbcable_help }; -urj_usbconn_cable_t usbconn_cable_signalyzer_ftdi = { +urj_usbconn_cable_t urj_tap_cable_usbconn_signalyzer_ftdi = { "Signalyzer", /* cable name */ NULL, /* string pattern, not used */ "ftdi-mpsse", /* default usbconn driver */ 0x0000, /* VID */ 0x0000 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_signalyzer_ftd2xx = { +urj_usbconn_cable_t urj_tap_cable_usbconn_signalyzer_ftd2xx = { "Signalyzer", /* cable name */ NULL, /* string pattern, not used */ "ftd2xx-mpsse", /* default usbconn driver */ @@ -2097,7 +2097,7 @@ urj_usbconn_cable_t usbconn_cable_signalyzer_ftd2xx = { 0x0000 /* PID */ }; -urj_cable_driver_t ft2232_flyswatter_cable_driver = { +urj_cable_driver_t urj_tap_cable_ft2232_flyswatter_driver = { "Flyswatter", N_("TinCanTools Flyswatter (FT2232) Cable"), ft2232_connect, @@ -2114,14 +2114,14 @@ urj_cable_driver_t ft2232_flyswatter_cable_driver = { ft2232_flush, ft2232_usbcable_help }; -urj_usbconn_cable_t usbconn_cable_flyswatter_ftdi = { +urj_usbconn_cable_t urj_tap_cable_usbconn_flyswatter_ftdi = { "Flyswatter", /* cable name */ NULL, /* string pattern, not used */ "ftdi-mpsse", /* default usbconn driver */ 0x0403, /* VID */ 0x6010 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_flyswatter_ftd2xx = { +urj_usbconn_cable_t urj_tap_cable_usbconn_flyswatter_ftd2xx = { "Flyswatter", /* cable name */ NULL, /* string pattern, not used */ "ftd2xx-mpsse", /* default usbconn driver */ @@ -2129,7 +2129,7 @@ urj_usbconn_cable_t usbconn_cable_flyswatter_ftd2xx = { 0x6010 /* PID */ }; -urj_cable_driver_t ft2232_usbscarab2_cable_driver = { +urj_cable_driver_t urj_tap_cable_ft2232_usbscarab2_driver = { "usbScarab2", N_("KrisTech usbScarabeus2 (FT2232) Cable"), ft2232_connect, @@ -2146,14 +2146,14 @@ urj_cable_driver_t ft2232_usbscarab2_cable_driver = { ft2232_flush, ft2232_usbcable_help }; -urj_usbconn_cable_t usbconn_cable_usbscarab2_ftdi = { +urj_usbconn_cable_t urj_tap_cable_usbconn_usbscarab2_ftdi = { "usbScarab2", /* cable name */ "usbScarab2", /* string pattern, not used */ "ftdi-mpsse", /* default usbconn driver */ 0x0403, /* VID */ 0xbbe0 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_usbscarab2_ftd2xx = { +urj_usbconn_cable_t urj_tap_cable_usbconn_usbscarab2_ftd2xx = { "usbScarab2", /* cable name */ "usbScarab2", /* string pattern, not used */ "ftd2xx-mpsse", /* default usbconn driver */ diff --git a/urjtag/src/tap/cable/generic_parport.c b/urjtag/src/tap/cable/generic_parport.c index 63db59c7..1969b1c3 100644 --- a/urjtag/src/tap/cable/generic_parport.c +++ b/urjtag/src/tap/cable/generic_parport.c @@ -62,18 +62,18 @@ urj_tap_cable_generic_parport_connect (char *params[], urj_cable_t *cable) } /* search parport driver list */ - for (i = 0; parport_drivers[i]; i++) - if (strcasecmp (params[1], parport_drivers[i]->type) == 0) + for (i = 0; urj_tap_parport_drivers[i]; i++) + if (strcasecmp (params[1], urj_tap_parport_drivers[i]->type) == 0) break; - if (!parport_drivers[i]) + if (!urj_tap_parport_drivers[i]) { printf (_("Unknown port driver: %s\n"), params[1]); return 2; } /* set up parport driver */ - port = parport_drivers[i]->connect ((const char **) ¶ms[2], - urj_cmd_params (params) - 2); + port = urj_tap_parport_drivers[i]->connect ((const char **) ¶ms[2], + urj_cmd_params (params) - 2); if (port == NULL) { @@ -85,7 +85,7 @@ urj_tap_cable_generic_parport_connect (char *params[], urj_cable_t *cable) if (!cable_params) { printf (_("%s(%d) malloc failed!\n"), __FILE__, __LINE__); - parport_drivers[i]->parport_free (port); + urj_tap_parport_drivers[i]->parport_free (port); return 4; } diff --git a/urjtag/src/tap/cable/generic_usbconn.c b/urjtag/src/tap/cable/generic_usbconn.c index 951997bc..207b3c51 100644 --- a/urjtag/src/tap/cable/generic_usbconn.c +++ b/urjtag/src/tap/cable/generic_usbconn.c @@ -38,103 +38,103 @@ #undef VERBOSE #ifdef ENABLE_CABLE_XPC -extern urj_usbconn_cable_t usbconn_cable_xpc_int; -extern urj_usbconn_cable_t usbconn_cable_xpc_ext; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_xpc_int; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_xpc_ext; #endif #ifdef ENABLE_CABLE_JLINK -extern urj_usbconn_cable_t usbconn_cable_jlink; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_jlink; #endif #ifdef ENABLE_CABLE_FT2232 #ifdef ENABLE_LOWLEVEL_FTD2XX -extern urj_usbconn_cable_t usbconn_cable_ft2232_ftd2xx; -extern urj_usbconn_cable_t usbconn_cable_armusbocd_ftd2xx; -extern urj_usbconn_cable_t usbconn_cable_armusbocdtiny_ftd2xx; -extern urj_usbconn_cable_t usbconn_cable_gnice_ftd2xx; -extern urj_usbconn_cable_t usbconn_cable_jtagkey_ftd2xx; -extern urj_usbconn_cable_t usbconn_cable_oocdlinks_ftd2xx; -extern urj_usbconn_cable_t usbconn_cable_turtelizer2_ftd2xx; -extern urj_usbconn_cable_t usbconn_cable_usbtojtagif_ftd2xx; -extern urj_usbconn_cable_t usbconn_cable_signalyzer_ftd2xx; -extern urj_usbconn_cable_t usbconn_cable_flyswatter_ftd2xx; -extern urj_usbconn_cable_t usbconn_cable_usbscarab2_ftd2xx; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_ft2232_ftd2xx; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_armusbocd_ftd2xx; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_armusbocdtiny_ftd2xx; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_gnice_ftd2xx; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_jtagkey_ftd2xx; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_oocdlinks_ftd2xx; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_turtelizer2_ftd2xx; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_usbtojtagif_ftd2xx; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_signalyzer_ftd2xx; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_flyswatter_ftd2xx; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_usbscarab2_ftd2xx; #endif #ifdef ENABLE_LOWLEVEL_FTDI -extern urj_usbconn_cable_t usbconn_cable_ft2232_ftdi; -extern urj_usbconn_cable_t usbconn_cable_armusbocd_ftdi; -extern urj_usbconn_cable_t usbconn_cable_armusbocdtiny_ftdi; -extern urj_usbconn_cable_t usbconn_cable_gnice_ftdi; -extern urj_usbconn_cable_t usbconn_cable_jtagkey_ftdi; -extern urj_usbconn_cable_t usbconn_cable_oocdlinks_ftdi; -extern urj_usbconn_cable_t usbconn_cable_turtelizer2_ftdi; -extern urj_usbconn_cable_t usbconn_cable_usbtojtagif_ftdi; -extern urj_usbconn_cable_t usbconn_cable_signalyzer_ftdi; -extern urj_usbconn_cable_t usbconn_cable_flyswatter_ftdi; -extern urj_usbconn_cable_t usbconn_cable_usbscarab2_ftdi; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_ft2232_ftdi; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_armusbocd_ftdi; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_armusbocdtiny_ftdi; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_gnice_ftdi; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_jtagkey_ftdi; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_oocdlinks_ftdi; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_turtelizer2_ftdi; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_usbtojtagif_ftdi; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_signalyzer_ftdi; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_flyswatter_ftdi; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_usbscarab2_ftdi; #endif #endif #ifdef ENABLE_CABLE_USBBLASTER #ifdef ENABLE_LOWLEVEL_FTD2XX -extern urj_usbconn_cable_t usbconn_cable_usbblaster_ftd2xx; -extern urj_usbconn_cable_t usbconn_cable_cubic_cyclonium_ftd2xx; -extern urj_usbconn_cable_t usbconn_cable_nios_eval_ftd2xx; -extern urj_usbconn_cable_t usbconn_cable_usb_jtag_ftd2xx; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_usbblaster_ftd2xx; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_cubic_cyclonium_ftd2xx; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_nios_eval_ftd2xx; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_usb_jtag_ftd2xx; #endif #ifdef ENABLE_LOWLEVEL_FTDI -extern urj_usbconn_cable_t usbconn_cable_usbblaster_ftdi; -extern urj_usbconn_cable_t usbconn_cable_cubic_cyclonium_ftdi; -extern urj_usbconn_cable_t usbconn_cable_nios_eval_ftdi; -extern urj_usbconn_cable_t usbconn_cable_usb_jtag_ftdi; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_usbblaster_ftdi; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_cubic_cyclonium_ftdi; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_nios_eval_ftdi; +extern urj_usbconn_cable_t urj_tap_cable_usbconn_usb_jtag_ftdi; #endif #endif -urj_usbconn_cable_t *usbconn_cables[] = { +urj_usbconn_cable_t *urj_tap_cable_usbconn_cables[] = { #ifdef ENABLE_CABLE_XPC - &usbconn_cable_xpc_int, - &usbconn_cable_xpc_ext, + &urj_tap_cable_usbconn_xpc_int, + &urj_tap_cable_usbconn_xpc_ext, #endif #ifdef ENABLE_CABLE_JLINK - &usbconn_cable_jlink, + &urj_tap_cable_usbconn_jlink, #endif #ifdef ENABLE_CABLE_FT2232 #ifdef ENABLE_LOWLEVEL_FTD2XX - &usbconn_cable_ft2232_ftd2xx, - &usbconn_cable_armusbocd_ftd2xx, - &usbconn_cable_armusbocdtiny_ftd2xx, - &usbconn_cable_gnice_ftd2xx, - &usbconn_cable_jtagkey_ftd2xx, - &usbconn_cable_oocdlinks_ftd2xx, - &usbconn_cable_turtelizer2_ftd2xx, - &usbconn_cable_usbtojtagif_ftd2xx, - &usbconn_cable_signalyzer_ftd2xx, - &usbconn_cable_flyswatter_ftd2xx, - &usbconn_cable_usbscarab2_ftd2xx, + &urj_tap_cable_usbconn_ft2232_ftd2xx, + &urj_tap_cable_usbconn_armusbocd_ftd2xx, + &urj_tap_cable_usbconn_armusbocdtiny_ftd2xx, + &urj_tap_cable_usbconn_gnice_ftd2xx, + &urj_tap_cable_usbconn_jtagkey_ftd2xx, + &urj_tap_cable_usbconn_oocdlinks_ftd2xx, + &urj_tap_cable_usbconn_turtelizer2_ftd2xx, + &urj_tap_cable_usbconn_usbtojtagif_ftd2xx, + &urj_tap_cable_usbconn_signalyzer_ftd2xx, + &urj_tap_cable_usbconn_flyswatter_ftd2xx, + &urj_tap_cable_usbconn_usbscarab2_ftd2xx, #endif #ifdef ENABLE_LOWLEVEL_FTDI - &usbconn_cable_ft2232_ftdi, - &usbconn_cable_armusbocd_ftdi, - &usbconn_cable_armusbocdtiny_ftdi, - &usbconn_cable_gnice_ftdi, - &usbconn_cable_jtagkey_ftdi, - &usbconn_cable_oocdlinks_ftdi, - &usbconn_cable_turtelizer2_ftdi, - &usbconn_cable_usbtojtagif_ftdi, - &usbconn_cable_signalyzer_ftdi, - &usbconn_cable_flyswatter_ftdi, - &usbconn_cable_usbscarab2_ftdi, + &urj_tap_cable_usbconn_ft2232_ftdi, + &urj_tap_cable_usbconn_armusbocd_ftdi, + &urj_tap_cable_usbconn_armusbocdtiny_ftdi, + &urj_tap_cable_usbconn_gnice_ftdi, + &urj_tap_cable_usbconn_jtagkey_ftdi, + &urj_tap_cable_usbconn_oocdlinks_ftdi, + &urj_tap_cable_usbconn_turtelizer2_ftdi, + &urj_tap_cable_usbconn_usbtojtagif_ftdi, + &urj_tap_cable_usbconn_signalyzer_ftdi, + &urj_tap_cable_usbconn_flyswatter_ftdi, + &urj_tap_cable_usbconn_usbscarab2_ftdi, #endif #endif #ifdef ENABLE_CABLE_USBBLASTER #ifdef ENABLE_LOWLEVEL_FTD2XX - &usbconn_cable_usbblaster_ftd2xx, - &usbconn_cable_cubic_cyclonium_ftd2xx, - &usbconn_cable_nios_eval_ftd2xx, - &usbconn_cable_usb_jtag_ftd2xx, + &urj_tap_cable_usbconn_usbblaster_ftd2xx, + &urj_tap_cable_usbconn_cubic_cyclonium_ftd2xx, + &urj_tap_cable_usbconn_nios_eval_ftd2xx, + &urj_tap_cable_usbconn_usb_jtag_ftd2xx, #endif #ifdef ENABLE_LOWLEVEL_FTDI - &usbconn_cable_usbblaster_ftdi, - &usbconn_cable_cubic_cyclonium_ftdi, - &usbconn_cable_nios_eval_ftdi, - &usbconn_cable_usb_jtag_ftdi, + &urj_tap_cable_usbconn_usbblaster_ftdi, + &urj_tap_cable_usbconn_cubic_cyclonium_ftdi, + &urj_tap_cable_usbconn_nios_eval_ftdi, + &urj_tap_cable_usbconn_usb_jtag_ftdi, #endif #endif NULL @@ -183,27 +183,30 @@ urj_tap_cable_generic_usbconn_connect (char *params[], urj_cable_t *cable) } /* search usbconn driver list */ - for (i = 0; usbconn_drivers[i] && !conn; i++) + for (i = 0; urj_tap_usbconn_drivers[i] && !conn; i++) { if ((user_specified.driver == NULL) - || (strcasecmp (user_specified.driver, usbconn_drivers[i]->type) - == 0)) + || + (strcasecmp + (user_specified.driver, urj_tap_usbconn_drivers[i]->type) == 0)) { int j; /* search cable list */ - for (j = 0; usbconn_cables[j] && !conn; j++) + for (j = 0; urj_tap_cable_usbconn_cables[j] && !conn; j++) { if ((user_specified.name == NULL) || - (strcasecmp (user_specified.name, usbconn_cables[j]->name) - == 0)) + (strcasecmp + (user_specified.name, + urj_tap_cable_usbconn_cables[j]->name) == 0)) { if (strcasecmp - (usbconn_cables[j]->driver, - usbconn_drivers[i]->type) == 0) + (urj_tap_cable_usbconn_cables[j]->driver, + urj_tap_usbconn_drivers[i]->type) == 0) { - urj_usbconn_cable_t cable_try = *(usbconn_cables[j]); + urj_usbconn_cable_t cable_try = + *(urj_tap_cable_usbconn_cables[j]); if (user_specified.vid >= 0) cable_try.vid = user_specified.vid; @@ -213,7 +216,7 @@ urj_tap_cable_generic_usbconn_connect (char *params[], urj_cable_t *cable) cable_try.desc = user_specified.desc; conn = - usbconn_drivers[i]-> + urj_tap_usbconn_drivers[i]-> connect ((const char **) ¶ms[1], paramc - 1, &cable_try); } @@ -232,7 +235,7 @@ urj_tap_cable_generic_usbconn_connect (char *params[], urj_cable_t *cable) if (!cable_params) { printf (_("%s(%d) malloc failed!\n"), __FILE__, __LINE__); - usbconn_drivers[i]->free (conn); + urj_tap_usbconn_drivers[i]->free (conn); return 4; } diff --git a/urjtag/src/tap/cable/jim.c b/urjtag/src/tap/cable/jim.c index fe657977..7fae17f4 100644 --- a/urjtag/src/tap/cable/jim.c +++ b/urjtag/src/tap/cable/jim.c @@ -153,7 +153,7 @@ jim_cable_help (const char *cablename) printf (_("Usage: cable %s\n"), cablename); } -urj_cable_driver_t jim_cable_driver = { +urj_cable_driver_t urj_tap_cable_jim_driver = { "JIM", N_("JTAG target simulator JIM"), urj_tap_cable_jim_cable_connect, diff --git a/urjtag/src/tap/cable/jlink.c b/urjtag/src/tap/cable/jlink.c index 8bcd0cf7..778e1044 100644 --- a/urjtag/src/tap/cable/jlink.c +++ b/urjtag/src/tap/cable/jlink.c @@ -574,7 +574,7 @@ jlink_set_signal (urj_cable_t *cable, int mask, int val) return 1; } -urj_cable_driver_t jlink_cable_driver = { +urj_cable_driver_t urj_tap_cable_jlink_driver = { "jlink", N_("Segger/IAR J-Link, Atmel SAM-ICE and others."), urj_tap_cable_generic_usbconn_connect, @@ -592,7 +592,7 @@ urj_cable_driver_t jlink_cable_driver = { urj_tap_cable_generic_usbconn_help }; -urj_usbconn_cable_t usbconn_cable_jlink = { +urj_usbconn_cable_t urj_tap_cable_usbconn_jlink = { "jlink", /* cable name */ NULL, /* string pattern, not used */ "libusb", /* usbconn driver */ diff --git a/urjtag/src/tap/cable/keithkoep.c b/urjtag/src/tap/cable/keithkoep.c index e860a012..ce5df496 100644 --- a/urjtag/src/tap/cable/keithkoep.c +++ b/urjtag/src/tap/cable/keithkoep.c @@ -143,7 +143,7 @@ keithkoep_set_signal (urj_cable_t *cable, int mask, int val) return prev_sigs; } -urj_cable_driver_t keithkoep_cable_driver = { +urj_cable_driver_t urj_tap_cable_keithkoep_driver = { "KeithKoep", N_("Keith & Koep JTAG cable"), urj_tap_cable_generic_parport_connect, diff --git a/urjtag/src/tap/cable/lattice.c b/urjtag/src/tap/cable/lattice.c index f94dad82..b6c94f11 100644 --- a/urjtag/src/tap/cable/lattice.c +++ b/urjtag/src/tap/cable/lattice.c @@ -134,7 +134,7 @@ lattice_set_signal (urj_cable_t *cable, int mask, int val) return prev_sigs; } -urj_cable_driver_t lattice_cable_driver = { +urj_cable_driver_t urj_tap_cable_lattice_driver = { "Lattice", N_("Lattice Parallel Port JTAG Cable"), urj_tap_cable_generic_parport_connect, diff --git a/urjtag/src/tap/cable/mpcbdm.c b/urjtag/src/tap/cable/mpcbdm.c index 592f1a3c..af2478b1 100644 --- a/urjtag/src/tap/cable/mpcbdm.c +++ b/urjtag/src/tap/cable/mpcbdm.c @@ -141,7 +141,7 @@ mpcbdm_set_signal (urj_cable_t *cable, int mask, int val) return prev_sigs; } -urj_cable_driver_t mpcbdm_cable_driver = { +urj_cable_driver_t urj_tap_cable_mpcbdm_driver = { "MPCBDM", N_("Mpcbdm JTAG cable"), urj_tap_cable_generic_parport_connect, diff --git a/urjtag/src/tap/cable/triton.c b/urjtag/src/tap/cable/triton.c index a2368bf3..7597a62c 100644 --- a/urjtag/src/tap/cable/triton.c +++ b/urjtag/src/tap/cable/triton.c @@ -148,7 +148,7 @@ triton_set_signal (urj_cable_t *cable, int mask, int val) return prev_sigs; } -urj_cable_driver_t triton_cable_driver = { +urj_cable_driver_t urj_tap_cable_triton_driver = { "TRITON", N_("Ka-Ro TRITON Starterkit II (PXA255/250) JTAG Cable"), urj_tap_cable_generic_parport_connect, diff --git a/urjtag/src/tap/cable/ts7800.c b/urjtag/src/tap/cable/ts7800.c index a3f28821..bad959c3 100644 --- a/urjtag/src/tap/cable/ts7800.c +++ b/urjtag/src/tap/cable/ts7800.c @@ -294,7 +294,7 @@ ts7800_help (const char *cablename) printf (_("Usage: cable %s\n" "\n"), cablename); } -urj_cable_driver_t ts7800_cable_driver = { +urj_cable_driver_t urj_tap_cable_ts7800_driver = { "ts7800", N_("TS-7800 Built-in JTAG Chain"), ts7800_connect, diff --git a/urjtag/src/tap/cable/usbblaster.c b/urjtag/src/tap/cable/usbblaster.c index c17dc5dd..a7bd270c 100644 --- a/urjtag/src/tap/cable/usbblaster.c +++ b/urjtag/src/tap/cable/usbblaster.c @@ -504,7 +504,7 @@ usbblaster_help (const char *cablename) DEFAULT_DRIVER); } -urj_cable_driver_t usbblaster_cable_driver = { +urj_cable_driver_t urj_tap_cable_usbblaster_driver = { "UsbBlaster", N_("Altera USB-Blaster Cable"), usbblaster_connect, @@ -523,56 +523,56 @@ urj_cable_driver_t usbblaster_cable_driver = { usbblaster_flush, usbblaster_help, }; -urj_usbconn_cable_t usbconn_cable_usbblaster_ftdi = { +urj_usbconn_cable_t urj_tap_cable_usbconn_usbblaster_ftdi = { "UsbBlaster", /* cable name */ NULL, /* string pattern, not used */ "ftdi", /* default usbconn driver */ 0x09FB, /* VID */ 0x6001 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_cubic_cyclonium_ftdi = { +urj_usbconn_cable_t urj_tap_cable_usbconn_cubic_cyclonium_ftdi = { "UsbBlaster", /* cable name */ NULL, /* string pattern, not used */ "ftdi", /* default usbconn driver */ 0x09FB, /* VID */ 0x6002 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_nios_eval_ftdi = { +urj_usbconn_cable_t urj_tap_cable_usbconn_nios_eval_ftdi = { "UsbBlaster", /* cable name */ NULL, /* string pattern, not used */ "ftdi", /* default usbconn driver */ 0x09FB, /* VID */ 0x6003 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_usb_jtag_ftdi = { +urj_usbconn_cable_t urj_tap_cable_usbconn_usb_jtag_ftdi = { "UsbBlaster", /* cable name */ NULL, /* string pattern, not used */ "ftdi", /* default usbconn driver */ 0x16C0, /* VID */ 0x06AD /* PID */ }; -urj_usbconn_cable_t usbconn_cable_usbblaster_ftd2xx = { +urj_usbconn_cable_t urj_tap_cable_usbconn_usbblaster_ftd2xx = { "UsbBlaster", /* cable name */ NULL, /* string pattern, not used */ "ftd2xx", /* default usbconn driver */ 0x09FB, /* VID */ 0x6001 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_cubic_cyclonium_ftd2xx = { +urj_usbconn_cable_t urj_tap_cable_usbconn_cubic_cyclonium_ftd2xx = { "UsbBlaster", /* cable name */ NULL, /* string pattern, not used */ "ftd2xx", /* default usbconn driver */ 0x09FB, /* VID */ 0x6002 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_nios_eval_ftd2xx = { +urj_usbconn_cable_t urj_tap_cable_usbconn_nios_eval_ftd2xx = { "UsbBlaster", /* cable name */ NULL, /* string pattern, not used */ "ftdi", /* default usbconn driver */ 0x09FB, /* VID */ 0x6003 /* PID */ }; -urj_usbconn_cable_t usbconn_cable_usb_jtag_ftd2xx = { +urj_usbconn_cable_t urj_tap_cable_usbconn_usb_jtag_ftd2xx = { "UsbBlaster", /* cable name */ NULL, /* string pattern, not used */ "ftd2xx", /* default usbconn driver */ diff --git a/urjtag/src/tap/cable/vision_ep9307.c b/urjtag/src/tap/cable/vision_ep9307.c index dc263960..f1deb73d 100644 --- a/urjtag/src/tap/cable/vision_ep9307.c +++ b/urjtag/src/tap/cable/vision_ep9307.c @@ -340,7 +340,7 @@ ep9307_help (const char *cablename) printf (_("Usage: cable %s\n" "\n"), cablename); } -urj_cable_driver_t ep9307_cable_driver = { +urj_cable_driver_t urj_tap_cable_ep9307_driver = { "EP9307", N_("Vision EP9307 SoM GPIO JTAG Cable"), ep9307_connect, diff --git a/urjtag/src/tap/cable/wiggler.c b/urjtag/src/tap/cable/wiggler.c index 3e6416fd..db3ac896 100644 --- a/urjtag/src/tap/cable/wiggler.c +++ b/urjtag/src/tap/cable/wiggler.c @@ -400,7 +400,7 @@ cablename, cablename, std_wgl_map); } -urj_cable_driver_t wiggler_cable_driver = { +urj_cable_driver_t urj_tap_cable_wiggler_driver = { "WIGGLER", N_("Macraigor Wiggler JTAG Cable"), wiggler_connect, @@ -418,7 +418,7 @@ urj_cable_driver_t wiggler_cable_driver = { wiggler_help }; -urj_cable_driver_t igloo_cable_driver = { +urj_cable_driver_t urj_tap_cable_igloo_driver = { "IGLOO", N_("Excelpoint IGLOO JTAG Cable"), wiggler_connect, diff --git a/urjtag/src/tap/cable/wiggler2.c b/urjtag/src/tap/cable/wiggler2.c index 5466ed74..3b1b5171 100644 --- a/urjtag/src/tap/cable/wiggler2.c +++ b/urjtag/src/tap/cable/wiggler2.c @@ -153,7 +153,7 @@ wiggler2_set_signal (urj_cable_t *cable, int mask, int val) return prev_sigs; } -urj_cable_driver_t wiggler2_cable_driver = { +urj_cable_driver_t urj_tap_cable_wiggler2_driver = { "WIGGLER2", N_("Modified (with CPU Reset) WIGGLER JTAG Cable"), urj_tap_cable_generic_parport_connect, diff --git a/urjtag/src/tap/cable/xpc.c b/urjtag/src/tap/cable/xpc.c index 2251520c..cef3d43c 100644 --- a/urjtag/src/tap/cable/xpc.c +++ b/urjtag/src/tap/cable/xpc.c @@ -672,7 +672,7 @@ xpc_ext_transfer (urj_cable_t *cable, int len, char *in, char *out) /* ---------------------------------------------------------------------- */ -urj_cable_driver_t xpc_int_cable_driver = { +urj_cable_driver_t urj_tap_cable_xpc_int_driver = { "xpc_int", N_("Xilinx Platform Cable USB internal chain"), urj_tap_cable_generic_usbconn_connect, @@ -690,7 +690,7 @@ urj_cable_driver_t xpc_int_cable_driver = { urj_tap_cable_generic_usbconn_help }; -urj_usbconn_cable_t usbconn_cable_xpc_int = { +urj_usbconn_cable_t urj_tap_cable_usbconn_xpc_int = { "xpc_int", /* cable name */ NULL, /* string pattern, not used */ "libusb", /* usbconn driver */ @@ -698,7 +698,7 @@ urj_usbconn_cable_t usbconn_cable_xpc_int = { 0x0008 /* PID (8) */ }; -urj_cable_driver_t xpc_ext_cable_driver = { +urj_cable_driver_t urj_tap_cable_xpc_ext_driver = { "xpc_ext", N_("Xilinx Platform Cable USB external chain"), urj_tap_cable_generic_usbconn_connect, @@ -716,7 +716,7 @@ urj_cable_driver_t xpc_ext_cable_driver = { urj_tap_cable_generic_usbconn_help }; -urj_usbconn_cable_t usbconn_cable_xpc_ext = { +urj_usbconn_cable_t urj_tap_cable_usbconn_xpc_ext = { "xpc_ext", /* cable name */ NULL, /* string pattern, not used */ "libusb", /* usbconn driver */ diff --git a/urjtag/src/tap/parport.c b/urjtag/src/tap/parport.c index 12697716..5c7c04ab 100644 --- a/urjtag/src/tap/parport.c +++ b/urjtag/src/tap/parport.c @@ -26,21 +26,21 @@ #include "parport.h" -extern urj_parport_driver_t direct_parport_driver; -extern urj_parport_driver_t ppdev_parport_driver; -extern urj_parport_driver_t ppi_parport_driver; +extern urj_parport_driver_t urj_tap_parport_direct_parport_driver; +extern urj_parport_driver_t urj_tap_parport_ppdev_parport_driver; +extern urj_parport_driver_t urj_tap_parport_ppi_parport_driver; -urj_parport_driver_t *parport_drivers[] = { +urj_parport_driver_t *urj_tap_parport_drivers[] = { #ifdef ENABLE_LOWLEVEL_DIRECT - &direct_parport_driver, + &urj_tap_parport_direct_parport_driver, #endif /* ENABLE_LOWLEVEL_DIRECT */ #ifdef ENABLE_LOWLEVEL_PPDEV - &ppdev_parport_driver, + &urj_tap_parport_ppdev_parport_driver, #endif /* ENABLE_LOWLEVEL_PPDEV */ #ifdef ENABLE_LOWLEVEL_PPI - &ppi_parport_driver, + &urj_tap_parport_ppi_parport_driver, #endif /* ENABLE_LOWLEVEL_PPI */ NULL /* last must be NULL */ }; diff --git a/urjtag/src/tap/parport/direct.c b/urjtag/src/tap/parport/direct.c index db3d554d..2260014a 100644 --- a/urjtag/src/tap/parport/direct.c +++ b/urjtag/src/tap/parport/direct.c @@ -107,7 +107,7 @@ outb (unsigned char value, unsigned short int port) } #endif /* HAVE_I386_SET_IOPERM */ -urj_parport_driver_t direct_parport_driver; +urj_parport_driver_t urj_tap_parport_direct_parport_driver; typedef struct port_node_t port_node_t; @@ -162,7 +162,7 @@ direct_parport_alloc (unsigned int port) params->port = port; parport->params = params; - parport->driver = &direct_parport_driver; + parport->driver = &urj_tap_parport_direct_parport_driver; parport->cable = NULL; node->port = parport; @@ -302,7 +302,7 @@ direct_set_control (urj_parport_t *parport, uint8_t data) return 0; } -urj_parport_driver_t direct_parport_driver = { +urj_parport_driver_t urj_tap_parport_direct_parport_driver = { "parallel", direct_connect, direct_parport_free, diff --git a/urjtag/src/tap/parport/ppdev.c b/urjtag/src/tap/parport/ppdev.c index 500c7c18..c3509a1a 100644 --- a/urjtag/src/tap/parport/ppdev.c +++ b/urjtag/src/tap/parport/ppdev.c @@ -42,7 +42,7 @@ #include "parport.h" #include "cable.h" -urj_parport_driver_t ppdev_parport_driver; +urj_parport_driver_t urj_tap_parport_ppdev_parport_driver; typedef struct port_node_t port_node_t; @@ -81,7 +81,7 @@ ppdev_parport_alloc (const char *port) params->fd = -1; parport->params = params; - parport->driver = &ppdev_parport_driver; + parport->driver = &urj_tap_parport_ppdev_parport_driver; parport->cable = NULL; node->port = parport; @@ -235,7 +235,7 @@ ppdev_set_control (urj_parport_t *parport, uint8_t data) return 0; } -urj_parport_driver_t ppdev_parport_driver = { +urj_parport_driver_t urj_tap_parport_ppdev_parport_driver = { "ppdev", ppdev_connect, ppdev_parport_free, diff --git a/urjtag/src/tap/parport/ppi.c b/urjtag/src/tap/parport/ppi.c index 41094254..806bb6c7 100644 --- a/urjtag/src/tap/parport/ppi.c +++ b/urjtag/src/tap/parport/ppi.c @@ -38,7 +38,7 @@ #include "parport.h" #include "cable.h" -urj_parport_driver_t ppi_parport_driver; +urj_parport_driver_t urj_tap_parport_ppi_parport_driver; typedef struct port_node_t port_node_t; @@ -77,7 +77,7 @@ ppi_parport_alloc (const char *port) params->fd = -1; parport->params = params; - parport->driver = &ppi_parport_driver; + parport->driver = &urj_tap_parport_ppi_parport_driver; parport->cable = NULL; node->port = parport; @@ -215,7 +215,7 @@ ppi_set_control (urj_parport_t *parport, uint8_t data) return 0; } -urj_parport_driver_t ppi_parport_driver = { +urj_parport_driver_t urj_tap_parport_ppi_parport_driver = { "ppi", ppi_connect, ppi_parport_free, diff --git a/urjtag/src/tap/usbconn.c b/urjtag/src/tap/usbconn.c index 5dfde1fc..db3ddfb9 100644 --- a/urjtag/src/tap/usbconn.c +++ b/urjtag/src/tap/usbconn.c @@ -29,28 +29,28 @@ #include "usbconn.h" #ifdef HAVE_LIBUSB -extern urj_usbconn_driver_t usbconn_libusb_driver; +extern urj_usbconn_driver_t urj_tap_usbconn_libusb_driver; #endif /* HAVE_LIBUSB */ #ifdef ENABLE_LOWLEVEL_FTD2XX -extern urj_usbconn_driver_t usbconn_ftd2xx_driver; -extern urj_usbconn_driver_t usbconn_ftd2xx_mpsse_driver; +extern urj_usbconn_driver_t urj_tap_usbconn_ftd2xx_driver; +extern urj_usbconn_driver_t urj_tap_usbconn_ftd2xx_mpsse_driver; #endif /* ENABLE_LOWLEVEL_FTD2XX */ #ifdef ENABLE_LOWLEVEL_FTDI -extern urj_usbconn_driver_t usbconn_ftdi_driver; -extern urj_usbconn_driver_t usbconn_ftdi_mpsse_driver; +extern urj_usbconn_driver_t urj_tap_usbconn_ftdi_driver; +extern urj_usbconn_driver_t urj_tap_usbconn_ftdi_mpsse_driver; #endif /* ENABLE_LOWLEVEL_FTDI */ -urj_usbconn_driver_t *usbconn_drivers[] = { +urj_usbconn_driver_t *urj_tap_usbconn_drivers[] = { #ifdef HAVE_LIBUSB - &usbconn_libusb_driver, + &urj_tap_usbconn_libusb_driver, #endif /* HAVE_LIBUSB */ #ifdef ENABLE_LOWLEVEL_FTD2XX - &usbconn_ftd2xx_driver, - &usbconn_ftd2xx_mpsse_driver, + &urj_tap_usbconn_ftd2xx_driver, + &urj_tap_usbconn_ftd2xx_mpsse_driver, #endif /* ENABLE_LOWLEVEL_FTD2XX */ #ifdef ENABLE_LOWLEVEL_FTDI - &usbconn_ftdi_driver, - &usbconn_ftdi_mpsse_driver, + &urj_tap_usbconn_ftdi_driver, + &urj_tap_usbconn_ftdi_mpsse_driver, #endif /* ENABLE_LOWLEVEL_FTDI */ NULL /* last must be NULL */ }; diff --git a/urjtag/src/tap/usbconn/libftd2xx.c b/urjtag/src/tap/usbconn/libftd2xx.c index 299a3c82..b29bf58f 100644 --- a/urjtag/src/tap/usbconn/libftd2xx.c +++ b/urjtag/src/tap/usbconn/libftd2xx.c @@ -69,8 +69,8 @@ typedef struct uint8_t *recv_buf; } ftd2xx_param_t; -urj_usbconn_driver_t usbconn_ftd2xx_driver; -urj_usbconn_driver_t usbconn_ftd2xx_mpsse_driver; +urj_usbconn_driver_t urj_tap_usbconn_ftd2xx_driver; +urj_usbconn_driver_t urj_tap_usbconn_ftd2xx_mpsse_driver; static int usbconn_ftd2xx_common_open (urj_usbconn_t *conn, int printerr); static void usbconn_ftd2xx_free (urj_usbconn_t *conn); @@ -311,7 +311,7 @@ usbconn_ftd2xx_connect (const char **param, int paramc, p->serial = template->desc ? strdup (template->desc) : NULL; c->params = p; - c->driver = &usbconn_ftd2xx_driver; + c->driver = &urj_tap_usbconn_ftd2xx_driver; c->cable = NULL; /* do a test open with the specified cable paramters, @@ -337,7 +337,7 @@ usbconn_ftd2xx_mpsse_connect (const char **param, int paramc, urj_usbconn_t *conn = usbconn_ftd2xx_connect (param, paramc, template); if (conn) - conn->driver = &usbconn_ftd2xx_mpsse_driver; + conn->driver = &urj_tap_usbconn_ftd2xx_mpsse_driver; return conn; } @@ -548,7 +548,7 @@ usbconn_ftd2xx_free (urj_usbconn_t *conn) /* ---------------------------------------------------------------------- */ -urj_usbconn_driver_t usbconn_ftd2xx_driver = { +urj_usbconn_driver_t urj_tap_usbconn_ftd2xx_driver = { "ftd2xx", usbconn_ftd2xx_connect, usbconn_ftd2xx_free, @@ -558,7 +558,7 @@ urj_usbconn_driver_t usbconn_ftd2xx_driver = { usbconn_ftd2xx_write }; -urj_usbconn_driver_t usbconn_ftd2xx_mpsse_driver = { +urj_usbconn_driver_t urj_tap_usbconn_ftd2xx_mpsse_driver = { "ftd2xx-mpsse", usbconn_ftd2xx_mpsse_connect, usbconn_ftd2xx_free, diff --git a/urjtag/src/tap/usbconn/libftdi.c b/urjtag/src/tap/usbconn/libftdi.c index 5d7fb993..df5f0623 100644 --- a/urjtag/src/tap/usbconn/libftdi.c +++ b/urjtag/src/tap/usbconn/libftdi.c @@ -61,8 +61,8 @@ typedef struct uint8_t *recv_buf; } ftdi_param_t; -urj_usbconn_driver_t usbconn_ftdi_driver; -urj_usbconn_driver_t usbconn_ftdi_mpsse_driver; +urj_usbconn_driver_t urj_tap_usbconn_ftdi_driver; +urj_usbconn_driver_t urj_tap_usbconn_ftdi_mpsse_driver; static int usbconn_ftdi_common_open (urj_usbconn_t *conn, int printerr); static void usbconn_ftdi_free (urj_usbconn_t *conn); @@ -278,7 +278,7 @@ usbconn_ftdi_connect (const char **param, int paramc, p->serial = template->desc ? strdup (template->desc) : NULL; c->params = p; - c->driver = &usbconn_ftdi_driver; + c->driver = &urj_tap_usbconn_ftdi_driver; c->cable = NULL; /* do a test open with the specified cable paramters, @@ -304,7 +304,7 @@ usbconn_ftdi_mpsse_connect (const char **param, int paramc, urj_usbconn_t *conn = usbconn_ftdi_connect (param, paramc, template); if (conn) - conn->driver = &usbconn_ftdi_mpsse_driver; + conn->driver = &urj_tap_usbconn_ftdi_mpsse_driver; return conn; } @@ -593,7 +593,7 @@ usbconn_ftdi_free (urj_usbconn_t *conn) /* ---------------------------------------------------------------------- */ -urj_usbconn_driver_t usbconn_ftdi_driver = { +urj_usbconn_driver_t urj_tap_usbconn_ftdi_driver = { "ftdi", usbconn_ftdi_connect, usbconn_ftdi_free, @@ -603,7 +603,7 @@ urj_usbconn_driver_t usbconn_ftdi_driver = { usbconn_ftdi_write }; -urj_usbconn_driver_t usbconn_ftdi_mpsse_driver = { +urj_usbconn_driver_t urj_tap_usbconn_ftdi_mpsse_driver = { "ftdi-mpsse", usbconn_ftdi_mpsse_connect, usbconn_ftdi_free, diff --git a/urjtag/src/tap/usbconn/libusb.c b/urjtag/src/tap/usbconn/libusb.c index b27f1430..614f5b39 100644 --- a/urjtag/src/tap/usbconn/libusb.c +++ b/urjtag/src/tap/usbconn/libusb.c @@ -52,7 +52,7 @@ typedef struct struct usb_dev_handle *handle; } urj_usbconn_libusb_param_t; -urj_usbconn_driver_t usbconn_libusb_driver; +urj_usbconn_driver_t urj_tap_usbconn_libusb_driver; /* ---------------------------------------------------------------------- */ @@ -169,7 +169,7 @@ usbconn_libusb_connect (const char **param, int paramc, libusb_params->dev = found_dev; libusb_params->handle = NULL; libusb_conn->params = libusb_params; - libusb_conn->driver = &usbconn_libusb_driver; + libusb_conn->driver = &urj_tap_usbconn_libusb_driver; libusb_conn->cable = NULL; return libusb_conn; @@ -243,7 +243,7 @@ usbconn_libusb_free (urj_usbconn_t *conn) /* ---------------------------------------------------------------------- */ -urj_usbconn_driver_t usbconn_libusb_driver = { +urj_usbconn_driver_t urj_tap_usbconn_libusb_driver = { "libusb", usbconn_libusb_connect, usbconn_libusb_free,