diff --git a/jtag/include/ctrl.h b/jtag/include/ctrl.h index 93e5c10b..4ad9585a 100644 --- a/jtag/include/ctrl.h +++ b/jtag/include/ctrl.h @@ -28,7 +28,7 @@ /* * low level tap functions, hardware dependent */ -void tap_init( void ); +int tap_init( void ); void tap_done( void ); void tap_clock( int tms, int tdi ); diff --git a/jtag/src/jtag.c b/jtag/src/jtag.c index 7b6bd879..ad5c1f84 100644 --- a/jtag/src/jtag.c +++ b/jtag/src/jtag.c @@ -57,7 +57,10 @@ main( void ) "There is absolutely no warranty for " PACKAGE ".\n\n" ); - tap_init(); + if (!tap_init()) { + printf( "TAP initialization failed! Exiting.\n" ); + return 1; + } tap_set_trst( 0 ); tap_set_trst( 1 ); diff --git a/jtag/src/tap/ctrl.c b/jtag/src/tap/ctrl.c index 5a11b800..773d759c 100644 --- a/jtag/src/tap/ctrl.c +++ b/jtag/src/tap/ctrl.c @@ -36,16 +36,18 @@ static unsigned short int port = 0x378; -void +int tap_init( void ) { tap_state_init(); printf( "Initilizing parallel TAP on port 0x%x\n", port ); if (ioperm( port, 2, 1 )) { printf( "Error: Initialization failed!\n" ); - return; + return 0; } tap_state_set_trst( (inb( port ) >> TRST) & 1 ); + + return 1; } void