cleaning up jtag, jtag430, jtag430x2, jtagarm7tdmi includes
authordodge-this <dodge-this@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Wed, 11 Aug 2010 17:23:45 +0000 (17:23 +0000)
committerdodge-this <dodge-this@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Wed, 11 Aug 2010 17:23:45 +0000 (17:23 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@690 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

firmware/apps/jtag/jtag.c
firmware/apps/jtag/jtag430.c
firmware/apps/jtag/jtag430x2.c
firmware/apps/jtag/jtagarm7tdmi.c
firmware/include/jtag.h
firmware/include/jtag430.h

index 415f36a..906dd14 100644 (file)
@@ -25,10 +25,8 @@ void jtagsetup(){
 /************************** JTAG Primitives ****************************/
 // these have been turned into functions to save flash space
 void jtag_tcktock() {
-  //delay(1);  // FIXME: Should never wait this long...
   CLRTCK; 
   PLEDOUT^=PLEDPIN; 
-  //delay(1);  // FIXME: Should never wait this long...
   SETTCK; 
   PLEDOUT^=PLEDPIN;
 }
@@ -186,7 +184,7 @@ unsigned char jtagtrans8(unsigned char byte){
   SAVETCLK;
   
   for (bit = 0; bit < bitcount; bit++) {
-    //* write MOSI on trailing edge of previous clock *
+    // write MOSI on trailing edge of previous clock *
     if (word & high)
       {SETMOSI;}
     else
@@ -197,7 +195,7 @@ unsigned char jtagtrans8(unsigned char byte){
       SETTMS;//TMS high on last bit to exit.
     
     TCKTOCK;
-    //* read MISO on trailing edge *
+    // read MISO on trailing edge *
     word |= READMISO;
   }
   
index 52cfa71..f98cc5f 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "platform.h"
 #include "command.h"
-#include "jtag.h"
+#include "jtag430.h"
 
 
 unsigned int jtag430mode=MSP430X2MODE;
index db3b613..b08f739 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "platform.h"
 #include "command.h"
-#include "jtag.h"
+#include "jtag430.h"
 
 unsigned char jtagid;
 
index a0449ee..d4f777d 100644 (file)
@@ -128,7 +128,7 @@ unsigned long jtagarmtransn(unsigned long word, unsigned char bitcount, unsigned
   SAVETCLK;
   if (lsb) {
     for (bit = bitcount; bit > 0; bit--) {
-      /* write MOSI on trailing edge of previous clock *
+      // write MOSI on trailing edge of previous clock *
       if (word & 1)
         {SETMOSI;}
       else
@@ -140,14 +140,14 @@ unsigned long jtagarmtransn(unsigned long word, unsigned char bitcount, unsigned
        
       jtag_arm_tcktock();
 
-      //* read MISO on trailing edge *
+      // read MISO on trailing edge *
       if (READMISO){
         word += (high);
       }
     }
   } else {
     for (bit = bitcount; bit > 0; bit--) {
-      //* write MOSI on trailing edge of previous clock *
+      // write MOSI on trailing edge of previous clock *
       if (word & high)
         {SETMOSI;}
       else
@@ -159,7 +159,7 @@ unsigned long jtagarmtransn(unsigned long word, unsigned char bitcount, unsigned
 
       jtag_arm_tcktock();
 
-      //* read MISO on trailing edge *
+      // read MISO on trailing edge *
       word |= (READMISO);
     }
   }
index aab18fe..352e044 100644 (file)
 #include <io.h>
 #include <iomacros.h>
 
-extern unsigned int drwidth;
-
-#define MSP430MODE 0
-#define MSP430XMODE 1
-#define MSP430X2MODE 2
-extern unsigned int jtag430mode;
 
 // Generic Commands
 
@@ -37,31 +31,14 @@ void jtag_stop();
 //! Setup the JTAG pin directions.
 void jtagsetup();
 
-// JTAG430 Commands
-
-//! Start JTAG, unique to the '430.
-void jtag430_start();
-//! Reset the TAP state machine, check the fuse.
-void jtag430_resettap();
-
-//! Defined in jtag430asm.S
-void jtag430_tclk_flashpulses(int);
-
-//High-level Macros follow
-//! Write data to address.
-void jtag430_writemem(unsigned int adr, unsigned int data);
-//! Read data from address
-unsigned int jtag430_readmem(unsigned int adr);
-//! Halt the CPU
-void jtag430_haltcpu();
-//! Release the CPU
-void jtag430_releasecpu();
-//! Set CPU to Instruction Fetch
-void jtag430_setinstrfetch();
-//! Set the program counter.
-void jtag430_setpc(unsigned int adr);
-//! Write data to address.
-void jtag430_writeflash(unsigned int adr, unsigned int data);
+//! Ratchet Clock Down and Up
+void jtag_tcktock();
+//! Go to SHIFT_IR
+void jtag_goto_shift_ir();
+//! Go to SHIFT_DR
+void jtag_goto_shift_dr();
+//! TAP RESET
+void jtag_reset_to_runtest_idle();
 
 //Pins.  Both SPI and JTAG names are acceptable.
 //#define SS   BIT0
@@ -112,44 +89,6 @@ extern int savedtclk;
 //Replace every "CLRTCK SETTCK" with this.
 #define TCKTOCK CLRTCK,SETTCK
 
-
-//16-bit MSP430 JTAG commands, bit-swapped
-//Rewrite these with MSP430 prefix.
-#define IR_CNTRL_SIG_16BIT         0xC8   // 0x13
-#define IR_CNTRL_SIG_CAPTURE       0x28   // 0x14
-#define IR_CNTRL_SIG_RELEASE       0xA8   // 0x15
-// Instructions for the JTAG Fuse
-#define IR_PREPARE_BLOW            0x44   // 0x22
-#define IR_EX_BLOW                 0x24   // 0x24
-// Instructions for the JTAG data register
-#define IR_DATA_16BIT              0x82   // 0x41
-#define IR_DATA_QUICK              0xC2   // 0x43
-// Instructions for the JTAG PSA mode
-#define IR_DATA_PSA                0x22   // 0x44
-#define IR_SHIFT_OUT_PSA           0x62   // 0x46
-// Instructions for the JTAG address register
-#define IR_ADDR_16BIT              0xC1   // 0x83
-#define IR_ADDR_CAPTURE            0x21   // 0x84
-#define IR_DATA_TO_ADDR            0xA1   // 0x85
-// Bypass instruction
-#define IR_BYPASS                  0xFF   // 0xFF
-
-//MSP430X2 unique
-#define IR_COREIP_ID               0xE8   // 0x17 
-#define IR_DEVICE_ID               0xE1   // 0x87
-
-//MSP430 or MSP430X
-#define MSP430JTAGID 0x89
-//MSP430X2 only
-#define MSP430X2JTAGID 0x91
-
-//! Syncs a POR.
-unsigned int jtag430x2_syncpor();
-//! Executes an MSP430X2 POR
-unsigned int jtag430x2_por();
-//! Power-On Reset
-void jtag430_por();
-
 //JTAG commands
 #define JTAG_IR_SHIFT 0x80
 #define JTAG_DR_SHIFT 0x81
@@ -162,6 +101,6 @@ void jtag430_por();
 
 
 //JTAG430 commands
-#include "jtag430.h"
+//#include "jtag430.h"
 
 #endif
index cc32fc9..7d38bc7 100644 (file)
@@ -1,11 +1,6 @@
-/*! \file jtag.h
+/*! \file jtag430.h
   \author Travis Goodspeed
   \brief JTAG handler functions.
-
-FIXME: Remove these when proven compiling
-#include <signal.h>
-#include <io.h>
-#include <iomacros.h>
 */