make tap configurarable with TAP enviroment var
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 4 Jul 2016 18:12:44 +0000 (20:12 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 4 Jul 2016 18:12:44 +0000 (20:12 +0200)
openocd-jtag-boundary-scan.pl

index 726b30d..72f9ac7 100755 (executable)
@@ -9,7 +9,9 @@ use Storable;
 
 my $openocd_remote = shift @ARGV || 'picam:4444';
 my $bsdl_file = $ENV{BSDL} || '_3128at100.bsd';
-$bsdl_file = '3064at44.bsd'; # XXX 
+#$bsdl_file = '3064at44.bsd'; # XXX 
+my $tap = $ENV{TAP} || 'x300.tap';
+
 my $BOUNDARY_LENGTH = 288;
 my $entity;
 
@@ -187,8 +189,8 @@ sub bin2hex {
 my $BSR;
 
 # first sample
-print $sock "irscan x300.tap 0x55\n"; # SAMPLE/PRELOAD
-print $sock "drscan x300.tap $BOUNDARY_LENGTH 0\n";
+print $sock "irscan $tap 0x55\n"; # SAMPLE/PRELOAD
+print $sock "drscan $tap $BOUNDARY_LENGTH 0\n";
 
 while(1) {
 
@@ -266,19 +268,19 @@ warn "XXX",length($old_bsr), " == ",length($b);
 
        diff_bits( $BSR, $b ), $/;
 
-#      print $sock "irscan x300.tap 0x55\n"; # SAMPLE/PRELOAD
-       print $sock "drscan x300.tap $BOUNDARY_LENGTH 0x", bin2hex($b), "\n";
-       print $sock "irscan x300.tap 0x00\n"; # EXTEST
-#      print $sock "drscan x300.tap $BOUNDARY_LENGTH 0x", bin2hex($b), "\n";
+#      print $sock "irscan $tap 0x55\n"; # SAMPLE/PRELOAD
+       print $sock "drscan $tap $BOUNDARY_LENGTH 0x", bin2hex($b), "\n";
+       print $sock "irscan $tap 0x00\n"; # EXTEST
+#      print $sock "drscan $tap $BOUNDARY_LENGTH 0x", bin2hex($b), "\n";
 
 } elsif ( $cmd =~ m/\?/ ) {
        $last_bits = '';
-       print $sock "irscan x300.tap 0x55\n"; # SAMPLE/PRELOAD
-       print $sock "drscan x300.tap $BOUNDARY_LENGTH 0\n";
+       print $sock "irscan $tap 0x55\n"; # SAMPLE/PRELOAD
+       print $sock "drscan $tap $BOUNDARY_LENGTH 0\n";
 } else {
        gpio::cmd( $cmd );
-       print $sock "irscan x300.tap 0x55\n"; # SAMPLE/PRELOAD
-       print $sock "drscan x300.tap $BOUNDARY_LENGTH 0\n";
+       print $sock "irscan $tap 0x55\n"; # SAMPLE/PRELOAD
+       print $sock "drscan $tap $BOUNDARY_LENGTH 0\n";
 }