X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Finclude%2Fjtag.h;fp=firmware%2Finclude%2Fjtag.h;h=352e0442092b39778ba1188876f39d339cacbc59;hp=aab18fe74f9b176807d0df3f5f34064d0a78492b;hb=386bb6b2c16f5d729a49e8eb8f42bbfad6a42d10;hpb=d85d45d823dda71280f4ed9083717ec8e5ce28ae diff --git a/firmware/include/jtag.h b/firmware/include/jtag.h index aab18fe..352e044 100644 --- a/firmware/include/jtag.h +++ b/firmware/include/jtag.h @@ -10,12 +10,6 @@ #include #include -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