00001 #ifndef _XSVF_H_ 00002 #define _XSVF_H_ 00003 00004 /* 00005 * Copyright (C) 2004 by egnite Software GmbH. All rights reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 00011 * 1. Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * 2. Redistributions in binary form must reproduce the above copyright 00014 * notice, this list of conditions and the following disclaimer in the 00015 * documentation and/or other materials provided with the distribution. 00016 * 3. Neither the name of the copyright holders nor the names of 00017 * contributors may be used to endorse or promote products derived 00018 * from this software without specific prior written permission. 00019 * 00020 * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS 00021 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00022 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00023 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE 00024 * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00025 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00026 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 00027 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00028 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00029 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 00030 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00031 * SUCH DAMAGE. 00032 * 00033 * For additional information see http://www.ethernut.de/ 00034 */ 00035 00036 /* 00037 * $Log$ 00038 */ 00039 00040 /*! 00041 * \file xsvf.h 00042 * \brief TAP state header file. 00043 */ 00044 00045 /*! 00046 * \addtogroup xgXEDefs 00047 */ 00048 /*@{*/ 00049 00050 /*! 00051 * \brief Maximum number of bytes required to store bit strings. 00052 * 00053 * A value of five is sufficient for up to six devices in a chain. 00054 */ 00055 #define MAX_BITVEC_BYTES 5 00056 00057 /*! 00058 * \brief Default repeat. 00059 * 00060 * Number of times that TDO is tested against the expected value before 00061 * the operation is considered a failure. 00062 */ 00063 #define DEFAULT_REPEAT 32 00064 00065 /*@}*/ 00066 00067 /*! 00068 * \addtogroup xgXsvfExec 00069 */ 00070 /*@{*/ 00071 00072 /* 00073 * XSVF error codes. 00074 */ 00075 00076 /*! Error code. Unknown error. */ 00077 #define XE_UNKNOWN 1 00078 00079 /*! Error code. Captured TDO value differs from expected TDO value. */ 00080 #define XE_TDOMISMATCH 2 00081 00082 /*! Error code. XSVF buffer contains illegal command. */ 00083 #define XE_ILLEGALCMD 4 00084 00085 /*! Error code. XSVF buffer contains illegal TAP state. */ 00086 #define XE_ILLEGALSTATE 5 00087 00088 /*! Error code. Bit string overflow. */ 00089 #define XE_DATAOVERFLOW 6 00090 00091 /*! Error code. End of XSVF data reached without XCOMPLETE. */ 00092 #define XE_DATAUNDERFLOW 7 00093 00094 /* 00095 * XSVF instruction codes. 00096 */ 00097 00098 /*! XSVF command code. End of XSVF buffer. */ 00099 #define XCOMPLETE 0x00 00100 00101 /*! XSVF command code. Set the TDO mask. Length has been specified by the last XSDRSIZE command. */ 00102 #define XTDOMASK 0x01 00103 00104 /*! XSVF command code. Go to the Shift-IR state and shift in the TDI value. XSIR uses 00105 a single byte for the TDI size. */ 00106 #define XSIR 0x02 00107 00108 /*! 00109 * XSVF command code. Go to the Shift-DR state and shift in the TDI value; compare the expected 00110 * value from the last XSDRTDO command against the TDO value that was 00111 * shifted out. Use the TDO mask which was generated by the last XTDOMASK 00112 * instruction. 00113 */ 00114 #define XSDR 0x03 00115 00116 /*! 00117 * XSVF command code. Set the number of microseconds the device should stay in the Run-Test-Idle 00118 * state after each visit to the SDR state. 00119 */ 00120 #define XRUNTEST 0x04 00121 00122 /*! 00123 * XSVF command code. Set the number of times that TDO is tested against the expected value before 00124 * the programming operation is considered a failure. 00125 */ 00126 #define XREPEAT 0x07 00127 00128 /*! XSVF command code. Set the length of the next XSDR/XSDRTDO records that follow. */ 00129 #define XSDRSIZE 0x08 00130 00131 /*! 00132 * XSVF command code. Go to the Shift-DR state and shift in the TDI value; compare the expected 00133 * value against the TDO value that was shifted out. Use the TDO mask which 00134 * was generated by the last XTDOMASK command. 00135 * 00136 * The expected TDO value is re-used in successive XSDR commands. 00137 */ 00138 #define XSDRTDO 0x09 00139 00140 /*! XSVF command code. Set SDR address and data masks for interatin XSDR commands. */ 00141 #define XSETSDRMASKS 0x0A 00142 00143 /*! Do iterating XSDR commands. */ 00144 #define XSDRINC 0x0B 00145 00146 /*! 00147 * XSVF command code. Go to the Shift-DR state and shift in the TDI value. No comparison of TDO 00148 * value with the last specified expected value is performed. 00149 */ 00150 #define XSDRB 0x0C 00151 00152 /*! 00153 * XSVF command code. Continue to stay in Shift-DR state and shift in the TDI value. No comparison 00154 * of TDO value with the last specified expected value is performed. 00155 */ 00156 #define XSDRC 0x0D 00157 00158 /*! 00159 * XSVF command code. Continue to stay in Shift-DR state and shift in the TDI value. At the end 00160 * of the operation, go to the state specified in the last XENDDR command. No 00161 * comparison of TDO value with the last specified expected value is performed. 00162 */ 00163 #define XSDRE 0x0E 00164 00165 /*! 00166 * XSVF command code. Go to the Shift-DR state and shift in the TDI value. Compare all bits of the 00167 * expected value against the TDO value that is shifted out. No retries are 00168 * performed. 00169 */ 00170 #define XSDRTDOB 0x0F 00171 00172 /*! 00173 * XSVF command code. Continue to stay in Shift-DR state and shift in the TDI value. Compare all 00174 * bits of the expected value against the TDO value that is shifted out. 00175 */ 00176 #define XSDRTDOC 0x10 00177 00178 /*! 00179 * XSVF command code. Continue to stay in Shift-DR state and shift in the TDI value. Compare all 00180 * bits of the expected value against the TDO value that is shifted out. At the 00181 * end of the operation, go to the state specified in the last XENDDR command. 00182 * No retries are performed. 00183 */ 00184 #define XSDRTDOE 0x11 00185 00186 /*! XSVF command code. Immediately set the TAP controller to Test-Logic-Reset (0) or Run-Test_idle (1). */ 00187 #define XSTATE 0x12 00188 00189 /*! XSVF command code. Set the XSIR end state to Run-Test-Idle (0) or Pause-IR (1). */ 00190 #define XENDIR 0x13 00191 00192 /*! XSVF command code. Set the XSDR/XSDRTDO end state to Run-Test-Idle (0) or Pause-DR (1). */ 00193 #define XENDDR 0x14 00194 00195 /*! XSVF command code. Go to the Shift-IR state and shift in the TDI value. XSIR2 uses two bytes for the TDI size. */ 00196 #define XSIR2 0x15 00197 00198 /*! XSVF command code. Embedded comment string follows. */ 00199 #define XCOMMENT 0x16 00200 00201 /*! XSVF command code. Not implemented. */ 00202 #define XWAIT 0x17 00203 00204 /*! Unknown XSVF command code, indicates an error. */ 00205 #define XUNKNOWN 0x18 00206 00207 /*@}*/ 00208 00209 00210 #endif