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_PHYName 0 45 #define DbgPrn_DumpMACCnt 0 46 #define DbgPrn_Info 0 47 #define DbgPrn_FRAME_LEN 0 48 49 #ifdef DBG_LOG_FUNC_NAME 50 #define nt_log_func_name() \ 51 do{printf("%s\n", __func__); debug_pause();}while(0) 52 #else 53 #define nt_log_func_name(...) 54 #endif 55 /* ============ Enable or Disable Check item of the descriptor ============ */ 56 #define CheckRxOwn 57 #define CheckRxLen 58 #define CheckRxErr 59 #define CheckCRC 60 #define CheckFTL 61 #define CheckRunt 62 // #define CheckOddNibble 63 #define CheckRxFIFOFull 64 65 66 // #define CheckRxbufUNAVA 67 #define CheckRPktLost 68 // #define CheckNPTxbufUNAVA 69 #define CheckTPktLost 70 #define CheckRxBuf 71 //#define CHECK_RX_DATA 72 73 74 /* error mask of the RX descriptor */ 75 #define RXDES_EM_RXERR BIT(18) 76 #define RXDES_EM_CRC BIT(19) 77 #define RXDES_EM_FTL BIT(20) 78 #define RXDES_EM_RUNT BIT(21) 79 #define RXDES_EM_ODD_NB BIT(22) 80 #define RXDES_EM_FIFO_FULL BIT(23) 81 #define RXDES_EM_ALL \ 82 (RXDES_EM_RXERR | RXDES_EM_CRC | RXDES_EM_FTL | RXDES_EM_RUNT | \ 83 RXDES_EM_ODD_NB | RXDES_EM_FIFO_FULL) 84 85 #endif // SWFUNC_H 86