diff --git a/jtag/ChangeLog b/jtag/ChangeLog index b3f9162c..2b7e151f 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,22 @@ +2008-06-06 Kolja Waschk + + * src/bus/bcm1250.c: Allow for 8 IO_CS_L signals, not just 7 + (Hartley Sweeten) + + * src/bus/bf548_ezkit.c, src/bus/fjmem.c, src/bus/ppc405ep.c, + src/bus/sh7727.c, src/bus/prototype.c, src/bus/sa1110.c, + src/bus/ppc440gx_ebc8.c, src/bus/sh7750r.c, src/bus/tx4925.c, + src/bus/pxa2x0.c, src/bus/bf533_stamp.c, src/bus/bf533_ezkit.c, + src/bus/bf537_stamp.c, src/bus/ixp425.c, src/bus/avr32.c, + src/bus/zefant-xs3.c, src/bus/h7202.c, src/bus/mpc824x.c, + src/bus/bcm1250.c, src/bus/sharc21065l.c, src/bus/au1500.c, + src/bus/lh7a400.c, src/bus/sh7751r.c, src/bus/generic_bus.c, + src/bus/mpc5200.c, src/bus/jopcyc.c, src/bus/Makefile.am, + src/bus/slsup3.c, src/bus/bf561_ezkit.c, src/bus/s3c4510x.c, + src/bus/ejtag.c, src/bus/generic_bus.h: [ 1984813 ] Bus driver + cleanup: Unified *bus_free functions and moved them to new + src/bus/generic_bus.c/h (Hartley Sweeten) + 2008-06-05 Arnim Laeuger * src/tap/usbconn/libftdi.c: issue device reset in usbconn_ftdi_open(), fixes @@ -17,16 +36,16 @@ src/bus/lh7a400.c, src/bus/sh7751r.c, src/bus/mpc5200.c, src/bus/jopcyc.c, src/bus/slsup3.c, src/bus/bf561_ezkit.c, src/bus/s3c4510x.c, src/bus/ejtag.c: Partial [ 1984813 ] - Bus driver cleanup: Changed mallocs to callocs, added (NULL) pointer - for *init to the drivers where it was missing (Hartley Sweeten) + Bus driver cleanup: Changed mallocs to callocs, added (NULL) pointer + for *init to the drivers where it was missing (Hartley Sweeten) 2008-05-29 Kolja Waschk - * src/tap/cable/wiggler.c src/tap/cable/generic_usbconn.c, - src/tap/cable/usbblaster.c, src/tap/cable/vision_ep9307.c, - src/tap/cable/jim.c, src/tap/cable/ft2232.c, - src/tap/cable/generic_parport.c: More malloc/free cleanup - in cable drivers (Hartley Sweeten) + * src/tap/cable/wiggler.c src/tap/cable/generic_usbconn.c, + src/tap/cable/usbblaster.c, src/tap/cable/vision_ep9307.c, + src/tap/cable/jim.c, src/tap/cable/ft2232.c, + src/tap/cable/generic_parport.c: More malloc/free cleanup + in cable drivers (Hartley Sweeten) 2008-05-28 Kolja Waschk diff --git a/jtag/src/bus/Makefile.am b/jtag/src/bus/Makefile.am index 50ef6818..2b253cc4 100644 --- a/jtag/src/bus/Makefile.am +++ b/jtag/src/bus/Makefile.am @@ -28,6 +28,8 @@ noinst_LIBRARIES = libbus.a libbus_a_SOURCES = \ buses.c \ buses.h \ + generic_bus.c \ + generic_bus.h \ pxa2x0_mc.h \ readmem.c \ writemem.c diff --git a/jtag/src/bus/au1500.c b/jtag/src/bus/au1500.c index c8dc9ca4..35fd3006 100644 --- a/jtag/src/bus/au1500.c +++ b/jtag/src/bus/au1500.c @@ -39,6 +39,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct{ chain_t *chain; @@ -206,13 +207,6 @@ au1500_bus_area(bus_t *bus, uint32_t addr, bus_area_t *area) } -static void -au1500_bus_free( bus_t *bus ) -{ - free( bus->params ); - free ( bus ); -} - static void au1500_bus_printinfo( bus_t *bus) { @@ -321,7 +315,7 @@ const bus_driver_t au1500_bus = { "au1500", N_("AU1500 BUS Driver via BSR"), au1500_bus_new, - au1500_bus_free, + generic_bus_free, au1500_bus_printinfo, au1500_bus_prepare, au1500_bus_area, diff --git a/jtag/src/bus/avr32.c b/jtag/src/bus/avr32.c index e8d5f211..54015bb2 100644 --- a/jtag/src/bus/avr32.c +++ b/jtag/src/bus/avr32.c @@ -37,6 +37,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" #include "data_register.h" void jtag_reset (chain_t * chain); @@ -600,13 +601,6 @@ avr32_bus_area (bus_t * bus, uint32_t addr, bus_area_t * area) return 0; } -static void -avr32_bus_free (bus_t * bus) -{ - free (bus->params); - free (bus); -} - static void avr32_bus_setup (bus_t * bus, chain_t * chain, part_t * part, unsigned int mode) @@ -759,7 +753,7 @@ const bus_driver_t avr32_bus_driver = { " HSBC: 32 bit bus for the cached HSB area, via SAB\n" " HSBU: 32 bit bus for the uncached HSB area, via SAB"), avr32_bus_new, - avr32_bus_free, + generic_bus_free, avr32_bus_printinfo, avr32_bus_prepare, avr32_bus_area, diff --git a/jtag/src/bus/bcm1250.c b/jtag/src/bus/bcm1250.c index 729edbf2..372b8cd5 100644 --- a/jtag/src/bus/bcm1250.c +++ b/jtag/src/bus/bcm1250.c @@ -36,6 +36,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" #ifdef USE_BCM_EJTAG int bcm1250_ejtag_do(bus_t *, uint64_t, uint64_t, int, int, unsigned char *, int); @@ -44,7 +45,7 @@ typedef struct { chain_t *chain; part_t *part; signal_t *io_ad[32]; - signal_t *io_cs_l[7]; + signal_t *io_cs_l[8]; signal_t *io_rw; signal_t *io_wr_l; signal_t *io_oe_l; @@ -261,13 +262,6 @@ bcm1250_bus_prepare( bus_t *bus ) chain_shift_instructions( CHAIN ); } -static void -bcm1250_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * bcm1250_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -479,7 +473,7 @@ const bus_driver_t bcm1250_bus = { "bcm1250", N_("Broadcom BCM1250 compatible bus driver via BSR"), bcm1250_bus_new, - bcm1250_bus_free, + generic_bus_free, bcm1250_bus_printinfo, bcm1250_bus_prepare, bcm1250_bus_area, diff --git a/jtag/src/bus/bf533_ezkit.c b/jtag/src/bus/bf533_ezkit.c index e3a08f6f..aaa731a7 100644 --- a/jtag/src/bus/bf533_ezkit.c +++ b/jtag/src/bus/bf533_ezkit.c @@ -35,6 +35,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct { chain_t *chain; @@ -245,13 +246,6 @@ bf533_ezkit_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -bf533_ezkit_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * bf533_ezkit_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -367,7 +361,7 @@ const bus_driver_t bf533_ezkit_bus = { "bf533_ezkit", N_("Blackfin BF533 EZKit board bus driver"), bf533_ezkit_bus_new, - bf533_ezkit_bus_free, + generic_bus_free, bf533_ezkit_bus_printinfo, bf533_ezkit_bus_prepare, bf533_ezkit_bus_area, diff --git a/jtag/src/bus/bf533_stamp.c b/jtag/src/bus/bf533_stamp.c index 88f7f504..5df16b95 100644 --- a/jtag/src/bus/bf533_stamp.c +++ b/jtag/src/bus/bf533_stamp.c @@ -35,6 +35,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct { chain_t *chain; @@ -245,13 +246,6 @@ bf533_stamp_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -bf533_stamp_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * bf533_stamp_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -365,7 +359,7 @@ const bus_driver_t bf533_stamp_bus = { "bf533_stamp", N_("Blackfin BF533 Stamp board bus driver"), bf533_stamp_bus_new, - bf533_stamp_bus_free, + generic_bus_free, bf533_stamp_bus_printinfo, bf533_stamp_bus_prepare, bf533_stamp_bus_area, diff --git a/jtag/src/bus/bf537_stamp.c b/jtag/src/bus/bf537_stamp.c index 8629b31f..4a644320 100644 --- a/jtag/src/bus/bf537_stamp.c +++ b/jtag/src/bus/bf537_stamp.c @@ -35,6 +35,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct { chain_t *chain; @@ -234,13 +235,6 @@ bf537_stamp_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -bf537_stamp_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * bf537_stamp_bus_new_1( chain_t *chain, char *cmd_params[] ) { @@ -377,7 +371,7 @@ const bus_driver_t bf537_stamp_bus = { "bf537_stamp", N_("Blackfin BF537 Stamp board bus driver"), bf537_stamp_bus_new, - bf537_stamp_bus_free, + generic_bus_free, bf537_stamp_bus_printinfo, bf537_stamp_bus_prepare, bf537_stamp_bus_area, @@ -416,7 +410,7 @@ const bus_driver_t bf537_ezkit_bus = { "bf537_ezkit", N_("Blackfin BF537 EZ-KIT board bus driver"), bf537_ezkit_bus_new, - bf537_stamp_bus_free, + generic_bus_free, bf537_ezkit_bus_printinfo, bf537_stamp_bus_prepare, bf537_stamp_bus_area, @@ -455,7 +449,7 @@ const bus_driver_t bf527_ezkit_bus = { "bf527_ezkit", N_("Blackfin BF527 EZ-KIT board bus driver"), bf527_ezkit_bus_new, - bf537_stamp_bus_free, + generic_bus_free, bf527_ezkit_bus_printinfo, bf537_stamp_bus_prepare, bf537_stamp_bus_area, diff --git a/jtag/src/bus/bf548_ezkit.c b/jtag/src/bus/bf548_ezkit.c index 3f01aac4..827af199 100644 --- a/jtag/src/bus/bf548_ezkit.c +++ b/jtag/src/bus/bf548_ezkit.c @@ -34,6 +34,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct { chain_t *chain; @@ -230,13 +231,6 @@ bf548_ezkit_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -bf548_ezkit_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * bf548_ezkit_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -355,7 +349,7 @@ const bus_driver_t bf548_ezkit_bus = { "bf548_ezkit", N_("Blackfin BF548 EZ-KIT board bus driver"), bf548_ezkit_bus_new, - bf548_ezkit_bus_free, + generic_bus_free, bf548_ezkit_bus_printinfo, bf548_ezkit_bus_prepare, bf548_ezkit_bus_area, diff --git a/jtag/src/bus/bf561_ezkit.c b/jtag/src/bus/bf561_ezkit.c index ff6af568..5ff85e7d 100644 --- a/jtag/src/bus/bf561_ezkit.c +++ b/jtag/src/bus/bf561_ezkit.c @@ -35,6 +35,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct { chain_t *chain; @@ -253,13 +254,6 @@ bf561_ezkit_bus_area( bus_t *bus, uint32_t addr, bus_area_t *area ) return 0; } -static void -bf561_ezkit_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * bf561_ezkit_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -378,7 +372,7 @@ const bus_driver_t bf561_ezkit_bus = { "bf561_ezkit", N_("Blackfin BF561 EZ-KIT board bus driver"), bf561_ezkit_bus_new, - bf561_ezkit_bus_free, + generic_bus_free, bf561_ezkit_bus_printinfo, bf561_ezkit_bus_prepare, bf561_ezkit_bus_area, diff --git a/jtag/src/bus/ejtag.c b/jtag/src/bus/ejtag.c index bace483c..5dc07bac 100644 --- a/jtag/src/bus/ejtag.c +++ b/jtag/src/bus/ejtag.c @@ -39,6 +39,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct { chain_t *chain; @@ -446,13 +447,6 @@ ejtag_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -ejtag_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * ejtag_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -483,7 +477,7 @@ const bus_driver_t ejtag_bus = { "ejtag", N_("EJTAG compatible bus driver via PrAcc"), ejtag_bus_new, - ejtag_bus_free, + generic_bus_free, ejtag_bus_printinfo, ejtag_bus_prepare, ejtag_bus_area, diff --git a/jtag/src/bus/fjmem.c b/jtag/src/bus/fjmem.c index dfcc2dd5..4801aeb5 100644 --- a/jtag/src/bus/fjmem.c +++ b/jtag/src/bus/fjmem.c @@ -28,13 +28,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include "part.h" +#include "bus.h" +#include "chain.h" +#include "jtag.h" +#include "buses.h" +#include "generic_bus.h" +#include "cmd.h" +#include "tap.h" #undef DEBUG @@ -373,8 +374,8 @@ fjmem_bus_free( bus_t *bus ) fjmem_free_blocks( BLOCK_DESC.blocks ); BLOCK_DESC.blocks = NULL; - free( bus->params ); - free( bus ); + + generic_bus_free( bus ); } static int diff --git a/jtag/src/bus/generic_bus.c b/jtag/src/bus/generic_bus.c new file mode 100644 index 00000000..7b16ba4c --- /dev/null +++ b/jtag/src/bus/generic_bus.c @@ -0,0 +1,40 @@ +/* + * $Id: generic_bus.c $ + * + * Generic bus driver utility functions + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * Written by H Hartley Sweeten , 2008. + * + */ + +#include "sysdep.h" + +#include + +#include "generic_bus.h" + +/** + * bus->driver->(*free_bus) + * + */ +void +generic_bus_free( bus_t *bus ) +{ + free( bus->params ); + free( bus ); +} diff --git a/jtag/src/bus/generic_bus.h b/jtag/src/bus/generic_bus.h new file mode 100644 index 00000000..18b8faf2 --- /dev/null +++ b/jtag/src/bus/generic_bus.h @@ -0,0 +1,32 @@ +/* + * $Id: generic_bus.h $ + * + * Generic bus driver utility functions + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * Written by H Hartley Sweeten , 2008. + * + */ + +#ifndef GENERIC_BUS_H +#define GENERIC_BUS_H + +#include "bus.h" + +void generic_bus_free( bus_t *bus ); + +#endif /* GENERIC_BUS_H */ diff --git a/jtag/src/bus/h7202.c b/jtag/src/bus/h7202.c index bb6f7ca7..be02825a 100644 --- a/jtag/src/bus/h7202.c +++ b/jtag/src/bus/h7202.c @@ -35,6 +35,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct { chain_t *chain; @@ -229,13 +230,6 @@ h7202_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -h7202_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * h7202_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -316,7 +310,7 @@ const bus_driver_t h7202_bus = { "h7202", "H7202 compatible bus driver via BSR", h7202_bus_new, - h7202_bus_free, + generic_bus_free, h7202_bus_printinfo, h7202_bus_prepare, h7202_bus_area, diff --git a/jtag/src/bus/ixp425.c b/jtag/src/bus/ixp425.c index 84d3a418..ab887a10 100644 --- a/jtag/src/bus/ixp425.c +++ b/jtag/src/bus/ixp425.c @@ -35,6 +35,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct { chain_t *chain; @@ -224,13 +225,6 @@ ixp425_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -ixp425_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * ixp425_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -307,7 +301,7 @@ const bus_driver_t ixp425_bus = { "ixp425", N_("Intel IXP425 compatible bus driver via BSR"), ixp425_bus_new, - ixp425_bus_free, + generic_bus_free, ixp425_bus_printinfo, ixp425_bus_prepare, ixp425_bus_area, diff --git a/jtag/src/bus/jopcyc.c b/jtag/src/bus/jopcyc.c index ad9066b0..34a4384f 100644 --- a/jtag/src/bus/jopcyc.c +++ b/jtag/src/bus/jopcyc.c @@ -66,6 +66,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" #define RAM_ADDR_WIDTH 18 #define RAM_DATA_WIDTH 16 @@ -478,13 +479,6 @@ jopcyc_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) } -static void -jopcyc_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static int attach_sig( bus_t *bus, signal_t **sig, char *id ) { @@ -705,7 +699,7 @@ const bus_driver_t jopcyc_bus = { "jopcyc", N_("JOP.design Cyclone Board compatible bus driver via BSR"), jopcyc_bus_new, - jopcyc_bus_free, + generic_bus_free, jopcyc_bus_printinfo, jopcyc_bus_prepare, jopcyc_bus_area, diff --git a/jtag/src/bus/lh7a400.c b/jtag/src/bus/lh7a400.c index 366447bc..619306ab 100644 --- a/jtag/src/bus/lh7a400.c +++ b/jtag/src/bus/lh7a400.c @@ -44,6 +44,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" #define ADR_NUM 24 #define D_NUM 32 @@ -250,13 +251,6 @@ lh7a400_bus_area ( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -lh7a400_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * lh7a400_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -342,7 +336,7 @@ const bus_driver_t lh7a400_bus = { "lh7a400", N_("Sharp LH7A400 compatible bus driver via BSR (flash access only!)"), lh7a400_bus_new, - lh7a400_bus_free, + generic_bus_free, lh7a400_bus_printinfo, lh7a400_bus_prepare, lh7a400_bus_area, diff --git a/jtag/src/bus/mpc5200.c b/jtag/src/bus/mpc5200.c index ee377d10..eb761989 100644 --- a/jtag/src/bus/mpc5200.c +++ b/jtag/src/bus/mpc5200.c @@ -38,6 +38,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct { chain_t *chain; @@ -235,13 +236,6 @@ mpc5200_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -mpc5200_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * mpc5200_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -320,7 +314,7 @@ const bus_driver_t mpc5200_bus = { "mpc5200", N_("Freescale MPC5200 compatible bus driver via BSR"), mpc5200_bus_new, - mpc5200_bus_free, + generic_bus_free, mpc5200_bus_printinfo, mpc5200_bus_prepare, mpc5200_bus_area, diff --git a/jtag/src/bus/mpc824x.c b/jtag/src/bus/mpc824x.c index 251293a0..bf1752ca 100644 --- a/jtag/src/bus/mpc824x.c +++ b/jtag/src/bus/mpc824x.c @@ -38,6 +38,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct { chain_t *chain; @@ -349,13 +350,6 @@ mpc824x_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -mpc824x_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * mpc824x_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -552,7 +546,7 @@ const bus_driver_t mpc824x_bus = { "mpc824x", N_("Motorola MPC824x compatible bus driver via BSR"), mpc824x_bus_new, - mpc824x_bus_free, + generic_bus_free, mpc824x_bus_printinfo, mpc824x_bus_prepare, mpc824x_bus_area, diff --git a/jtag/src/bus/ppc405ep.c b/jtag/src/bus/ppc405ep.c index 574d5fc3..da38fe92 100644 --- a/jtag/src/bus/ppc405ep.c +++ b/jtag/src/bus/ppc405ep.c @@ -32,6 +32,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct { chain_t *chain; @@ -209,13 +210,6 @@ ppc405ep_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -ppc405ep_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * ppc405ep_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -289,7 +283,7 @@ const bus_driver_t ppc405ep_bus = { "ppc405ep", N_("IBM PowerPC 405EP compatible bus driver via BSR"), ppc405ep_bus_new, - ppc405ep_bus_free, + generic_bus_free, ppc405ep_bus_printinfo, ppc405ep_bus_prepare, ppc405ep_bus_area, diff --git a/jtag/src/bus/ppc440gx_ebc8.c b/jtag/src/bus/ppc440gx_ebc8.c index 8a0b50bd..d2ed8760 100644 --- a/jtag/src/bus/ppc440gx_ebc8.c +++ b/jtag/src/bus/ppc440gx_ebc8.c @@ -31,6 +31,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" #define PPC440GX_ADDR_LINES 32 #define PPC440GX_DATA_LINES 8 @@ -207,13 +208,6 @@ ppc440gx_ebc8_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -ppc440gx_ebc8_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * ppc440gx_ebc8_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -287,7 +281,7 @@ const bus_driver_t ppc440gx_ebc8_bus = { "ppc440gx_ebc8", N_("IBM PowerPC 440GX 8-bit EBC compatible bus driver via BSR"), ppc440gx_ebc8_bus_new, - ppc440gx_ebc8_bus_free, + generic_bus_free, ppc440gx_ebc8_bus_printinfo, ppc440gx_ebc8_bus_prepare, ppc440gx_ebc8_bus_area, diff --git a/jtag/src/bus/prototype.c b/jtag/src/bus/prototype.c index d61ef217..41491ce6 100644 --- a/jtag/src/bus/prototype.c +++ b/jtag/src/bus/prototype.c @@ -35,6 +35,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct { chain_t *chain; @@ -228,13 +229,6 @@ prototype_bus_write( bus_t *bus, uint32_t adr, uint32_t data ) chain_shift_data_registers( chain, 0 ); } -static void -prototype_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static void prototype_bus_signal_parse( char *str, char *fmt, int *inst ) { @@ -442,7 +436,7 @@ const bus_driver_t prototype_bus = { " amsb= alsb= dmsb= dlsb=\n" " ncs=|cs= noe=|oe= nwe=|we= [amode=auto|x8|x16|x32]"), prototype_bus_new, - prototype_bus_free, + generic_bus_free, prototype_bus_printinfo, prototype_bus_prepare, prototype_bus_area, diff --git a/jtag/src/bus/pxa2x0.c b/jtag/src/bus/pxa2x0.c index eaa3dde4..015d31da 100644 --- a/jtag/src/bus/pxa2x0.c +++ b/jtag/src/bus/pxa2x0.c @@ -41,6 +41,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" #include "pxa2x0_mc.h" @@ -599,14 +600,6 @@ pxa27x_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -//pxa250_bus_free( bus_t *bus ) -pxa2xx_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - //static bus_t * //pxa2x0_bus_new( void ) static int @@ -796,7 +789,7 @@ const bus_driver_t pxa2x0_bus = { "pxa2x0", N_("Intel PXA2x0 compatible bus driver via BSR"), pxa2x0_bus_new, - pxa2xx_bus_free, + generic_bus_free, pxa2x0_bus_printinfo, pxa2xx_bus_prepare, pxa2xx_bus_area, @@ -812,7 +805,7 @@ const bus_driver_t pxa27x_bus = { "pxa27x", N_("Intel PXA27x compatible bus driver via BSR"), pxa27x_bus_new, - pxa2xx_bus_free, + generic_bus_free, pxa27x_bus_printinfo, pxa2xx_bus_prepare, pxa27x_bus_area, diff --git a/jtag/src/bus/s3c4510x.c b/jtag/src/bus/s3c4510x.c index 8849cd9f..4e61e6dd 100644 --- a/jtag/src/bus/s3c4510x.c +++ b/jtag/src/bus/s3c4510x.c @@ -64,6 +64,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" #ifndef DEBUG_LVL2 @@ -318,13 +319,6 @@ s3c4510_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) } } -static void -s3c4510_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * s3c4510_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -427,7 +421,7 @@ const bus_driver_t s3c4510_bus = { "s3c4510x", N_("Samsung S3C4510B compatible bus driver via BSR"), s3c4510_bus_new, - s3c4510_bus_free, + generic_bus_free, s3c4510_bus_printinfo, s3c4510_bus_prepare, s3c4510_bus_area, diff --git a/jtag/src/bus/sa1110.c b/jtag/src/bus/sa1110.c index 987d4e86..fa08dc9a 100644 --- a/jtag/src/bus/sa1110.c +++ b/jtag/src/bus/sa1110.c @@ -38,6 +38,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct { chain_t *chain; @@ -238,13 +239,6 @@ sa1110_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -sa1110_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * sa1110_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -326,7 +320,7 @@ const bus_driver_t sa1110_bus = { "sa1110", N_("Intel SA-1110 compatible bus driver via BSR"), sa1110_bus_new, - sa1110_bus_free, + generic_bus_free, sa1110_bus_printinfo, sa1110_bus_prepare, sa1110_bus_area, diff --git a/jtag/src/bus/sh7727.c b/jtag/src/bus/sh7727.c index fbac787c..12f1c8f5 100644 --- a/jtag/src/bus/sh7727.c +++ b/jtag/src/bus/sh7727.c @@ -35,6 +35,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct { chain_t *chain; @@ -270,13 +271,6 @@ sh7727_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) } } -static void -sh7727_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * sh7727_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -374,7 +368,7 @@ const bus_driver_t sh7727_bus = { "sh7727", N_("Hitachi SH7727 compatible bus driver via BSR"), sh7727_bus_new, - sh7727_bus_free, + generic_bus_free, sh7727_bus_printinfo, sh7727_bus_prepare, sh7727_bus_area, diff --git a/jtag/src/bus/sh7750r.c b/jtag/src/bus/sh7750r.c index aba3aa24..7bd954e3 100644 --- a/jtag/src/bus/sh7750r.c +++ b/jtag/src/bus/sh7750r.c @@ -35,6 +35,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct { chain_t *chain; @@ -252,13 +253,6 @@ sh7750r_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -sh7750r_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * sh7750r_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -354,7 +348,7 @@ const bus_driver_t sh7750r_bus = { "sh7750r", N_("Hitachi SH7750R compatible bus driver via BSR"), sh7750r_bus_new, - sh7750r_bus_free, + generic_bus_free, sh7750r_bus_printinfo, sh7750r_bus_prepare, sh7750r_bus_area, diff --git a/jtag/src/bus/sh7751r.c b/jtag/src/bus/sh7751r.c index 47f98611..f6237e06 100644 --- a/jtag/src/bus/sh7751r.c +++ b/jtag/src/bus/sh7751r.c @@ -35,6 +35,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" typedef struct { chain_t *chain; @@ -245,13 +246,6 @@ sh7751r_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -sh7751r_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * sh7751r_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -337,7 +331,7 @@ const bus_driver_t sh7751r_bus = { "sh7751r", N_("Hitachi SH7751R compatible bus driver via BSR"), sh7751r_bus_new, - sh7751r_bus_free, + generic_bus_free, sh7751r_bus_printinfo, sh7751r_bus_prepare, sh7751r_bus_area, diff --git a/jtag/src/bus/sharc21065l.c b/jtag/src/bus/sharc21065l.c index 3f346fd0..708b24a3 100644 --- a/jtag/src/bus/sharc21065l.c +++ b/jtag/src/bus/sharc21065l.c @@ -38,6 +38,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" //no SDRAM access @@ -252,13 +253,6 @@ static int sharc_21065L_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) } -static void sharc_21065L_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - - static bus_t *sharc_21065L_bus_new( chain_t *chain, char *cmd_params[] ) { bus_t *bus; @@ -332,7 +326,7 @@ const bus_driver_t sharc_21065L_bus = { "SHARC_21065L", N_("SHARC_21065L compatible bus driver via BSR"), sharc_21065L_bus_new, - sharc_21065L_bus_free, + generic_bus_free, sharc_21065L_bus_printinfo, sharc_21065L_bus_prepare, sharc_21065L_bus_area, diff --git a/jtag/src/bus/slsup3.c b/jtag/src/bus/slsup3.c index 7b0a1440..a68754a4 100644 --- a/jtag/src/bus/slsup3.c +++ b/jtag/src/bus/slsup3.c @@ -37,6 +37,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" int databusio[16] = {94,96,98,100,102,104,106,113,95,97,99,101,103,105,107,114}; int addrbusio[20] = {93,88,87,86,85,84,83,63,64,65,66,67,68,74,75,76,77,82,81,78}; @@ -348,13 +349,6 @@ slsup3_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -slsup3_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * slsup3_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -480,7 +474,7 @@ const bus_driver_t slsup3_bus = { "slsup3", N_("SLS UP3 compatible bus driver via BSR"), slsup3_bus_new, - slsup3_bus_free, + generic_bus_free, slsup3_bus_printinfo, slsup3_bus_prepare, slsup3_bus_area, diff --git a/jtag/src/bus/tx4925.c b/jtag/src/bus/tx4925.c index 1c4fc3af..60f70da9 100644 --- a/jtag/src/bus/tx4925.c +++ b/jtag/src/bus/tx4925.c @@ -36,6 +36,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" // FIXME board level write protect is ignored here // should be okay because pin isn't implemented @@ -242,13 +243,6 @@ tx4925_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) return 0; } -static void -tx4925_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static bus_t * tx4925_bus_new( chain_t *chain, char *cmd_params[] ) { @@ -339,7 +333,7 @@ const bus_driver_t tx4925_bus = { "tx4925", N_("Toshiba TX4925 compatible bus driver via BSR"), tx4925_bus_new, - tx4925_bus_free, + generic_bus_free, tx4925_bus_printinfo, tx4925_bus_prepare, tx4925_bus_area, diff --git a/jtag/src/bus/zefant-xs3.c b/jtag/src/bus/zefant-xs3.c index 25a0bc79..a961ee89 100644 --- a/jtag/src/bus/zefant-xs3.c +++ b/jtag/src/bus/zefant-xs3.c @@ -66,6 +66,7 @@ #include "bssignal.h" #include "jtag.h" #include "buses.h" +#include "generic_bus.h" /* EEPROM commands */ #define EEPROM_CMD_WREN 0x06 @@ -700,13 +701,6 @@ zefant_xs3_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) } -static void -zefant_xs3_bus_free( bus_t *bus ) -{ - free( bus->params ); - free( bus ); -} - static int attach_sig( bus_t *bus, signal_t **sig, char *id ) { @@ -983,7 +977,7 @@ const bus_driver_t zefant_xs3_bus = { "zefant-xs3", N_("Simple Solutions Zefant-XS3 Board compatible bus driver via BSR"), zefant_xs3_bus_new, - zefant_xs3_bus_free, + generic_bus_free, zefant_xs3_bus_printinfo, zefant_xs3_bus_prepare, zefant_xs3_bus_area,