X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Finclude%2Fjtagxscale.h;h=0f85b0abfc27d1bebccd9cffb3184f07327759c4;hp=f1f17fa9401ceb1e79156d70c00d56d31f9ab6b6;hb=a031b4a563978102c664466d1e91a9c3ab0553dd;hpb=278a9487e60fdcf3e96236580f9542c218a8c1f1 diff --git a/firmware/include/jtagxscale.h b/firmware/include/jtagxscale.h index f1f17fa..0f85b0a 100644 --- a/firmware/include/jtagxscale.h +++ b/firmware/include/jtagxscale.h @@ -7,22 +7,12 @@ /* NOTE: I heavily cribbed from the ARM7TDMI jtag implementation. Credit where * credit is due. */ -/* - * Utility Macros - */ - -/* XTT (LED TCK TOCK) toggles the CLK line while turning on/off the LED */ -#define XTT CLRTCK;PLEDOUT^=PLEDPIN;SETTCK;PLEDOUT^=PLEDPIN; - -/* RUN_TEST_IDLE gets us into run-test-idle from anywhere in the TAP FSM */ -#define RUN_TEST_IDLE SETTMS;XTT;XTT;XTT;XTT;XTT;XTT;XTT;XTT;CLRTMS;XTT; +#ifndef JTAGXSCALE_H +#define JTAGXSCALE_H -/* SHIFT_IR gets us into the "Shift IR" state from the run-test-idle state */ -#define SHIFT_IR SETTMS;XTT;XTT;CLRTMS;XTT;XTT; - -/* SHIFT_DIR gets us into the "Shift DR" state from the run-test-idle state */ -#define SHIFT_DR SETTMS;XTT;CLRTMS;XTT;XTT; +#include "app.h" +#define JTAGXSCALE 0x15 /* * XScale 5-bit JTAG Commands @@ -38,7 +28,7 @@ * between TDI and TDO. This register can be accessed via the JTAG Test-Access * Port throughout the device operation. Access to the Bypass register can also * be obtained with the bypass instruction. */ -#define XSCALE_IR_HIGHZ 0x08 +#define XSCALE_IR_HIGHZ 0x08 /* 11110 - Get ID Code * The idcode instruction is used in conjunction with the device identification @@ -47,7 +37,7 @@ * identification code (32 bits) on TDO into the identification register on the * rising edge of TCK in the Capture_DR state. Note: The device identification * register is not altered by data being shifted in on TDI.*/ -#define XSCALE_IR_IDCODE 0x1E +#define XSCALE_IR_IDCODE 0x1E /* 11111 - Bypass * The bypass instruction selects the Bypass register between TDI and TDO pins @@ -56,14 +46,12 @@ * all other test data registers have no effect on the operation of the system. * Test data registers with both test and system functionality perform their * system functions when this instruction is selected. */ -#define XSCALE_IR_BYPASS 0x1F +#define XSCALE_IR_BYPASS 0x1F /* * GoodFET Commands from the Client */ - -/* Get CHIP ID */ -#define XSCALE_GET_CHIP_ID 0xF1 +/* commands start at 0xF0 */ /* @@ -77,8 +65,7 @@ unsigned long jtag_xscale_shift_n(unsigned long word, unsigned char nbits, unsigned char flags); -/* this handles shifting in the IDCODE instruction and shifting the result - * out the TDO and return it. */ -unsigned long jtag_xscale_idcode(); +extern app_t const jtagxscale_app; +#endif // JTAGXSCALE_H