1 /* 2 * This program is distributed in the hope that it will be useful, 3 * but WITHOUT ANY WARRANTY; without even the implied warranty of 4 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 5 * GNU General Public License for more details. 6 * 7 * You should have received a copy of the GNU General Public License 8 * along with this program; if not, write to the Free Software 9 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 10 */ 11 12 #ifndef SWFUNC_H 13 #define SWFUNC_H 14 15 #include <config.h> // for uboot system 16 17 //--------------------------------------------------------- 18 // Program information 19 //--------------------------------------------------------- 20 /* PHY in Normal mode */ 21 #define VER_NAME "Ver 0.77 version @2017/12/20 1310" 22 23 /* ========================================================== */ 24 #define NETESTCMD_MAX_ARGS CONFIG_SYS_MAXARGS 25 26 /* == Step 4:========== Select PHY ================== */ 27 28 /* ======================== Program flow control ======================== */ 29 #define RUN_STEP 5 30 // 1: parameter setup 31 // 2: mdc/mdio pinmux, 32 // 4: Data Initial 33 // 5: ALL 34 35 /* ====================== Switch print debug message ====================== */ 36 //#define DbgPrn_Enable_Debug_pause //[off] 37 //#define DBG_LOG_FUNC_NAME 38 #define DBG_PRINT_ERR_FLAG 0 39 #define DbgPrn_BufAdr 0 40 #define DbgPrn_Bufdat 0 41 #define DbgPrn_BufdatDetail 0 42 #define DbgPrn_PHYRW 0 43 #define DbgPrn_PHYInit 0 44 #define DbgPrn_DumpMACCnt 0 45 #define DbgPrn_Info 0 46 #define DbgPrn_FRAME_LEN 0 47 48 #ifdef DBG_LOG_FUNC_NAME 49 #define nt_log_func_name() \ 50 do{printf("%s\n", __func__); debug_pause();}while(0) 51 #else 52 #define nt_log_func_name(...) 53 #endif 54 /* ============ Enable or Disable Check item of the descriptor ============ */ 55 #define CheckRxOwn 56 #define CheckRxLen 57 #define CheckRxErr 58 #define CheckCRC 59 #define CheckFTL 60 #define CheckRunt 61 // #define CheckOddNibble 62 #define CheckRxFIFOFull 63 64 65 // #define CheckRxbufUNAVA 66 #define CheckRPktLost 67 // #define CheckNPTxbufUNAVA 68 #define CheckTPktLost 69 #define CheckRxBuf 70 //#define CHECK_RX_DATA 71 72 73 /* error mask of the RX descriptor */ 74 #define RXDES_EM_RXERR BIT(18) 75 #define RXDES_EM_CRC BIT(19) 76 #define RXDES_EM_FTL BIT(20) 77 #define RXDES_EM_RUNT BIT(21) 78 #define RXDES_EM_ODD_NB BIT(22) 79 #define RXDES_EM_FIFO_FULL BIT(23) 80 #define RXDES_EM_ALL \ 81 (RXDES_EM_RXERR | RXDES_EM_CRC | RXDES_EM_FTL | RXDES_EM_RUNT | \ 82 RXDES_EM_ODD_NB | RXDES_EM_FIFO_FULL) 83 84 #endif // SWFUNC_H 85