You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.1 KiB
C

/*
* $Id$
*
* Bus driver interface
* Copyright (C) 2002 ETC s.r.o.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Written by Marcel Telka <marcel@telka.sk>, 2002.
*
*/
#ifndef BUS_H
#define BUS_H
#include <stdint.h>
2003-03-13 Marcel Telka <marcel@telka.sk> * include/chain.h: New file. * src/tap/chain.c: Ditto. * src/tap/Makefile.am (libtap_a_SOURCES): Added chain.c. * include/Makefile.am (noinst_HEADERS): Added chain.h. * src/jtag.c: Encapsulated parts, cable and TAP state into one object - chain. All relevant function parameters changed to `chain'. * src/tap/state.c: `trst' state moved to cable drivers. All cable drivers changed. * include/cable.h (cable_driver_t) <set_trst>: Changed return value from void to int. All cable drivers changed. (cable_driver_t) <get_trst>: New function. Implemented this function to all cable drivers. * include/part.h (part_shift_instruction, part_shift_data_register) (parts_shift_instructions, parts_shift_data_registers): Funcions removed. * src/part/part.c (part_shift_instruction, part_shift_data_register) (parts_shift_instructions, parts_shift_data_registers): Ditto. * src/tap/cable/arcom.c: Removed dependency on state.h. * src/tap/cable/byteblaster.c: Ditto. * src/tap/cable/dlc5.c: Ditto. * src/tap/cable/ea253.c: Ditto. * src/tap/cable/ei012.c: Ditto. * src/tap/cable/mpcbdm.c: Ditto. * src/tap/cable/wiggler.c: Ditto. * include/state.h (bit): Replaced with common.h include. (Unknown_State, Run_Test_Idle, Select_DR_Scan, Select_IR_Scan): Removed parentheses. * include/tap.h (write_command): Removed unused declaration. * src/detect.h: Removed file. * src/jtag.h: New file with common jtag function declarations. * src/Makefile.am (jtag_SOURCES): Removed detect.h, added jtag.h. * src/cfi.c: Added jtag.h include. Moved common function declarations to jtag.h file. * src/detect.c: Ditto. * src/discovery.c: Ditto. * src/flash.c: Ditto. * src/help.c: Ditto. * src/jtag.c: Ditto. * src/readmem.c: Ditto. * src/jtag.c (jtag_create_jtagdir, jtag_load_history, jtag_save_history, jtag_parse_line) (jtag_readline_loop, jtag_parse_file, jtag_parse_rc): Changed functions to `static'. * src/tap/tap.c: Added l10n support. * po/POTFILES.in: Added src/tap/chain.c and src/tap/tap.c. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@392 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
#include "chain.h"
#include <brux/bus.h>
2003-04-29 Marcel Telka <marcel@telka.sk> * data/MANUFACTURERS: Added new manufacturer: DEC. * src/jtag.c (jtag_create_jtagdir): Changed permissions for jtag directory. * include/part.h (part_alloc, read_part): Changed return type from `part *' to `part_t *'. (struct parts): Changed parts member type from `part **' to `part_t **'. (parts_alloc): Changed return type from `parts *' to `parts_t *'. * src/bus/ixp425.c (select_flash, unselect_flash, setup_address, set_data_in, setup_data): Changed first parameter type from `part *' to `part_t *'. * src/bus/pxa250.c (setup_address, set_data_in, setup_data): Ditto. * src/bus/sa1110.c (setup_address, set_data_in, setup_data): Ditto. * include/bus.h: Replaced static bus_driver_t architecture with dynamic bus_t. Removed direct chain_t dependency. Added `params' and `prepare' members. All related functions' parameter types changed. * src/bus/ixp425.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (ixp425_bus_prepare, ixp425_bus_free, new_ixp425_bus): New functions. (ixp425_bus_driver, ixp425_bus): Renamed `ixp425_bus_driver' to `ixp425_bus' and updated for new bus driver architecture. * src/bus/pxa250.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (pxa250_bus_prepare, pxa250_bus_free, new_pxa250_bus): New functions. (pxa250_bus_driver, pxa250_bus): Renamed `pxa250_bus_driver' to `pxa250_bus' and updated for new bus driver architecture. * src/bus/sa1110.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (sa1110_bus_prepare, sa1110_bus_free, new_sa1110_bus): New functions. (sa1110_bus_driver, sa1110_bus): Renamed `sa1110_bus_driver' to `sa1110_bus' and updated for new bus driver architecture. * src/readmem.c (detectflash, readmem): Moved JTAG chain initialization to bus->prepare(). * src/flash.c (flashcheck): Ditto. (flashmsbin, flashmem): Removed BYPASS instruction setup. * src/jtag.c (bus_driver, bus): Replaced `bus_driver' with `bus' global variable. (jtag_parse_line, main): Added `bus' deallocation. * src/flash.h (flash_driver_t): Changed parameter type for all function members from `chain_t*' to `bus_t *'. All function callers changed. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@423 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
typedef struct {
int len;
bus_t **buses;
} buses_t;
extern buses_t buses;
2003-09-05 Marcel Telka <marcel@telka.sk> * include/bus.h (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.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 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 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 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 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 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 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 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 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 bus_free(). * src/jtag.c (main): Ditto. * src/cmd/cmd.c (cmds): Added 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. * data/broadcom/bcm1250/bcm1250: Added 'initbus' command call. * data/hitachi/sh7727/sh7727: Ditto. * data/intel/ixp425/ixp425: Ditto. * data/intel/pxa250/pxa250: Ditto. * data/intel/pxa250/pxa250c0: Ditto. * data/intel/sa1110/sa1110: Ditto. * data/samsung/s3c4510b/s3c4510b: Ditto. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@558 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
extern const bus_driver_t *bus_drivers[];
void buses_free( void );
void buses_add( bus_t *abus );
void buses_delete( bus_t *abus );
#endif /* BUS_H */