174ba9207SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 2baf0fbfeSJeff Kirsher /* 3baf0fbfeSJeff Kirsher * Faraday FTGMAC100 Gigabit Ethernet 4baf0fbfeSJeff Kirsher * 5baf0fbfeSJeff Kirsher * (C) Copyright 2009-2011 Faraday Technology 6baf0fbfeSJeff Kirsher * Po-Yu Chuang <ratbert@faraday-tech.com> 7baf0fbfeSJeff Kirsher */ 8baf0fbfeSJeff Kirsher 9baf0fbfeSJeff Kirsher #ifndef __FTGMAC100_H 10baf0fbfeSJeff Kirsher #define __FTGMAC100_H 11baf0fbfeSJeff Kirsher 12baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_ISR 0x00 13baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_IER 0x04 14baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_MAC_MADR 0x08 15baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_MAC_LADR 0x0c 16baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_MAHT0 0x10 17baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_MAHT1 0x14 18baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_NPTXPD 0x18 19baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_RXPD 0x1c 20baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_NPTXR_BADR 0x20 21baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_RXR_BADR 0x24 22baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_HPTXPD 0x28 23baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_HPTXR_BADR 0x2c 24baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_ITC 0x30 25baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_APTC 0x34 26baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_DBLAC 0x38 27baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_DMAFIFOS 0x3c 28baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_REVR 0x40 29baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_FEAR 0x44 30baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_TPAFCR 0x48 31baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_RBSR 0x4c 32baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_MACCR 0x50 33baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_MACSR 0x54 34baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_TM 0x58 35baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_PHYCR 0x60 36baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_PHYDATA 0x64 37baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_FCR 0x68 38baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_BPR 0x6c 39baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_WOLCR 0x70 40baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_WOLSR 0x74 41baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_WFCRC 0x78 42baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_WFBM1 0x80 43baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_WFBM2 0x84 44baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_WFBM3 0x88 45baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_WFBM4 0x8c 46baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_NPTXR_PTR 0x90 47baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_HPTXR_PTR 0x94 48baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_RXR_PTR 0x98 49baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_TX 0xa0 50baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_TX_MCOL_SCOL 0xa4 51baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_TX_ECOL_FAIL 0xa8 52baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_TX_LCOL_UND 0xac 53baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_RX 0xb0 54baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_RX_BC 0xb4 55baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_RX_MC 0xb8 56baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_RX_PF_AEP 0xbc 57baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_RX_RUNT 0xc0 58baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_RX_CRCER_FTL 0xc4 59baf0fbfeSJeff Kirsher #define FTGMAC100_OFFSET_RX_COL_LOST 0xc8 60baf0fbfeSJeff Kirsher 61baf0fbfeSJeff Kirsher /* 62baf0fbfeSJeff Kirsher * Interrupt status register & interrupt enable register 63baf0fbfeSJeff Kirsher */ 64baf0fbfeSJeff Kirsher #define FTGMAC100_INT_RPKT_BUF (1 << 0) 65baf0fbfeSJeff Kirsher #define FTGMAC100_INT_RPKT_FIFO (1 << 1) 66baf0fbfeSJeff Kirsher #define FTGMAC100_INT_NO_RXBUF (1 << 2) 67baf0fbfeSJeff Kirsher #define FTGMAC100_INT_RPKT_LOST (1 << 3) 68baf0fbfeSJeff Kirsher #define FTGMAC100_INT_XPKT_ETH (1 << 4) 69baf0fbfeSJeff Kirsher #define FTGMAC100_INT_XPKT_FIFO (1 << 5) 70baf0fbfeSJeff Kirsher #define FTGMAC100_INT_NO_NPTXBUF (1 << 6) 71baf0fbfeSJeff Kirsher #define FTGMAC100_INT_XPKT_LOST (1 << 7) 72baf0fbfeSJeff Kirsher #define FTGMAC100_INT_AHB_ERR (1 << 8) 73baf0fbfeSJeff Kirsher #define FTGMAC100_INT_PHYSTS_CHG (1 << 9) 74baf0fbfeSJeff Kirsher #define FTGMAC100_INT_NO_HPTXBUF (1 << 10) 75baf0fbfeSJeff Kirsher 7610cbd640SBenjamin Herrenschmidt /* Interrupts we care about in NAPI mode */ 7710cbd640SBenjamin Herrenschmidt #define FTGMAC100_INT_BAD (FTGMAC100_INT_RPKT_LOST | \ 7810cbd640SBenjamin Herrenschmidt FTGMAC100_INT_XPKT_LOST | \ 7910cbd640SBenjamin Herrenschmidt FTGMAC100_INT_AHB_ERR | \ 8010cbd640SBenjamin Herrenschmidt FTGMAC100_INT_NO_RXBUF) 8110cbd640SBenjamin Herrenschmidt 8210cbd640SBenjamin Herrenschmidt /* Normal RX/TX interrupts, enabled when NAPI off */ 8310cbd640SBenjamin Herrenschmidt #define FTGMAC100_INT_RXTX (FTGMAC100_INT_XPKT_ETH | \ 8410cbd640SBenjamin Herrenschmidt FTGMAC100_INT_RPKT_BUF) 8510cbd640SBenjamin Herrenschmidt 8610cbd640SBenjamin Herrenschmidt /* All the interrupts we care about */ 87*fef2843bSJacky Chou #define FTGMAC100_INT_ALL (FTGMAC100_INT_RXTX | \ 8810cbd640SBenjamin Herrenschmidt FTGMAC100_INT_BAD) 8910cbd640SBenjamin Herrenschmidt 90baf0fbfeSJeff Kirsher /* 91baf0fbfeSJeff Kirsher * Interrupt timer control register 92baf0fbfeSJeff Kirsher */ 93baf0fbfeSJeff Kirsher #define FTGMAC100_ITC_RXINT_CNT(x) (((x) & 0xf) << 0) 94baf0fbfeSJeff Kirsher #define FTGMAC100_ITC_RXINT_THR(x) (((x) & 0x7) << 4) 95baf0fbfeSJeff Kirsher #define FTGMAC100_ITC_RXINT_TIME_SEL (1 << 7) 96baf0fbfeSJeff Kirsher #define FTGMAC100_ITC_TXINT_CNT(x) (((x) & 0xf) << 8) 97baf0fbfeSJeff Kirsher #define FTGMAC100_ITC_TXINT_THR(x) (((x) & 0x7) << 12) 98baf0fbfeSJeff Kirsher #define FTGMAC100_ITC_TXINT_TIME_SEL (1 << 15) 99baf0fbfeSJeff Kirsher 100baf0fbfeSJeff Kirsher /* 101baf0fbfeSJeff Kirsher * Automatic polling timer control register 102baf0fbfeSJeff Kirsher */ 103baf0fbfeSJeff Kirsher #define FTGMAC100_APTC_RXPOLL_CNT(x) (((x) & 0xf) << 0) 104baf0fbfeSJeff Kirsher #define FTGMAC100_APTC_RXPOLL_TIME_SEL (1 << 4) 105baf0fbfeSJeff Kirsher #define FTGMAC100_APTC_TXPOLL_CNT(x) (((x) & 0xf) << 8) 106baf0fbfeSJeff Kirsher #define FTGMAC100_APTC_TXPOLL_TIME_SEL (1 << 12) 107baf0fbfeSJeff Kirsher 108baf0fbfeSJeff Kirsher /* 109baf0fbfeSJeff Kirsher * DMA burst length and arbitration control register 110baf0fbfeSJeff Kirsher */ 111baf0fbfeSJeff Kirsher #define FTGMAC100_DBLAC_RXFIFO_LTHR(x) (((x) & 0x7) << 0) 112baf0fbfeSJeff Kirsher #define FTGMAC100_DBLAC_RXFIFO_HTHR(x) (((x) & 0x7) << 3) 113baf0fbfeSJeff Kirsher #define FTGMAC100_DBLAC_RX_THR_EN (1 << 6) 114baf0fbfeSJeff Kirsher #define FTGMAC100_DBLAC_RXBURST_SIZE(x) (((x) & 0x3) << 8) 115baf0fbfeSJeff Kirsher #define FTGMAC100_DBLAC_TXBURST_SIZE(x) (((x) & 0x3) << 10) 116baf0fbfeSJeff Kirsher #define FTGMAC100_DBLAC_RXDES_SIZE(x) (((x) & 0xf) << 12) 117baf0fbfeSJeff Kirsher #define FTGMAC100_DBLAC_TXDES_SIZE(x) (((x) & 0xf) << 16) 118baf0fbfeSJeff Kirsher #define FTGMAC100_DBLAC_IFG_CNT(x) (((x) & 0x7) << 20) 119baf0fbfeSJeff Kirsher #define FTGMAC100_DBLAC_IFG_INC (1 << 23) 120baf0fbfeSJeff Kirsher 121baf0fbfeSJeff Kirsher /* 122baf0fbfeSJeff Kirsher * DMA FIFO status register 123baf0fbfeSJeff Kirsher */ 124baf0fbfeSJeff Kirsher #define FTGMAC100_DMAFIFOS_RXDMA1_SM(dmafifos) ((dmafifos) & 0xf) 125baf0fbfeSJeff Kirsher #define FTGMAC100_DMAFIFOS_RXDMA2_SM(dmafifos) (((dmafifos) >> 4) & 0xf) 126baf0fbfeSJeff Kirsher #define FTGMAC100_DMAFIFOS_RXDMA3_SM(dmafifos) (((dmafifos) >> 8) & 0x7) 127baf0fbfeSJeff Kirsher #define FTGMAC100_DMAFIFOS_TXDMA1_SM(dmafifos) (((dmafifos) >> 12) & 0xf) 128baf0fbfeSJeff Kirsher #define FTGMAC100_DMAFIFOS_TXDMA2_SM(dmafifos) (((dmafifos) >> 16) & 0x3) 129baf0fbfeSJeff Kirsher #define FTGMAC100_DMAFIFOS_TXDMA3_SM(dmafifos) (((dmafifos) >> 18) & 0xf) 130baf0fbfeSJeff Kirsher #define FTGMAC100_DMAFIFOS_RXFIFO_EMPTY (1 << 26) 131baf0fbfeSJeff Kirsher #define FTGMAC100_DMAFIFOS_TXFIFO_EMPTY (1 << 27) 132baf0fbfeSJeff Kirsher #define FTGMAC100_DMAFIFOS_RXDMA_GRANT (1 << 28) 133baf0fbfeSJeff Kirsher #define FTGMAC100_DMAFIFOS_TXDMA_GRANT (1 << 29) 134baf0fbfeSJeff Kirsher #define FTGMAC100_DMAFIFOS_RXDMA_REQ (1 << 30) 135baf0fbfeSJeff Kirsher #define FTGMAC100_DMAFIFOS_TXDMA_REQ (1 << 31) 136baf0fbfeSJeff Kirsher 137baf0fbfeSJeff Kirsher /* 138e07dc63bSJoel Stanley * Feature Register 139e07dc63bSJoel Stanley */ 140e07dc63bSJoel Stanley #define FTGMAC100_REVR_NEW_MDIO_INTERFACE BIT(31) 141e07dc63bSJoel Stanley 142e07dc63bSJoel Stanley /* 143baf0fbfeSJeff Kirsher * Receive buffer size register 144baf0fbfeSJeff Kirsher */ 145baf0fbfeSJeff Kirsher #define FTGMAC100_RBSR_SIZE(x) ((x) & 0x3fff) 146baf0fbfeSJeff Kirsher 147baf0fbfeSJeff Kirsher /* 148baf0fbfeSJeff Kirsher * MAC control register 149baf0fbfeSJeff Kirsher */ 150baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_TXDMA_EN (1 << 0) 151baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_RXDMA_EN (1 << 1) 152baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_TXMAC_EN (1 << 2) 153baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_RXMAC_EN (1 << 3) 154baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_RM_VLAN (1 << 4) 155baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_HPTXR_EN (1 << 5) 156baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_LOOP_EN (1 << 6) 157baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_ENRX_IN_HALFTX (1 << 7) 158baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_FULLDUP (1 << 8) 159baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_GIGA_MODE (1 << 9) 160baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_CRC_APD (1 << 10) 161edcd692fSJoel Stanley #define FTGMAC100_MACCR_PHY_LINK_LEVEL (1 << 11) 162baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_RX_RUNT (1 << 12) 163baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_JUMBO_LF (1 << 13) 164baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_RX_ALL (1 << 14) 165baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_HT_MULTI_EN (1 << 15) 166baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_RX_MULTIPKT (1 << 16) 167baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_RX_BROADPKT (1 << 17) 168baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_DISCARD_CRCERR (1 << 18) 169baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_FAST_MODE (1 << 19) 170baf0fbfeSJeff Kirsher #define FTGMAC100_MACCR_SW_RST (1 << 31) 171baf0fbfeSJeff Kirsher 172baf0fbfeSJeff Kirsher /* 173137d23ceSDylan Hung * test mode control register 174137d23ceSDylan Hung */ 175137d23ceSDylan Hung #define FTGMAC100_TM_RQ_TX_VALID_DIS (1 << 28) 176137d23ceSDylan Hung #define FTGMAC100_TM_RQ_RR_IDLE_PREV (1 << 27) 177137d23ceSDylan Hung #define FTGMAC100_TM_DEFAULT \ 178137d23ceSDylan Hung (FTGMAC100_TM_RQ_TX_VALID_DIS | FTGMAC100_TM_RQ_RR_IDLE_PREV) 179137d23ceSDylan Hung 180137d23ceSDylan Hung /* 181baf0fbfeSJeff Kirsher * PHY control register 182baf0fbfeSJeff Kirsher */ 183baf0fbfeSJeff Kirsher #define FTGMAC100_PHYCR_MDC_CYCTHR_MASK 0x3f 184baf0fbfeSJeff Kirsher #define FTGMAC100_PHYCR_MDC_CYCTHR(x) ((x) & 0x3f) 185baf0fbfeSJeff Kirsher #define FTGMAC100_PHYCR_PHYAD(x) (((x) & 0x1f) << 16) 186baf0fbfeSJeff Kirsher #define FTGMAC100_PHYCR_REGAD(x) (((x) & 0x1f) << 21) 187baf0fbfeSJeff Kirsher #define FTGMAC100_PHYCR_MIIRD (1 << 26) 188baf0fbfeSJeff Kirsher #define FTGMAC100_PHYCR_MIIWR (1 << 27) 189baf0fbfeSJeff Kirsher 190baf0fbfeSJeff Kirsher /* 191baf0fbfeSJeff Kirsher * PHY data register 192baf0fbfeSJeff Kirsher */ 193baf0fbfeSJeff Kirsher #define FTGMAC100_PHYDATA_MIIWDATA(x) ((x) & 0xffff) 194baf0fbfeSJeff Kirsher #define FTGMAC100_PHYDATA_MIIRDATA(phydata) (((phydata) >> 16) & 0xffff) 195baf0fbfeSJeff Kirsher 196baf0fbfeSJeff Kirsher /* 1977c8e5141SBenjamin Herrenschmidt * Flow control register 1987c8e5141SBenjamin Herrenschmidt */ 1997c8e5141SBenjamin Herrenschmidt #define FTGMAC100_FCR_FC_EN (1 << 0) 2007c8e5141SBenjamin Herrenschmidt #define FTGMAC100_FCR_FCTHR_EN (1 << 2) 2017c8e5141SBenjamin Herrenschmidt #define FTGMAC100_FCR_PAUSE_TIME(x) (((x) & 0xffff) << 16) 2027c8e5141SBenjamin Herrenschmidt 2037c8e5141SBenjamin Herrenschmidt /* 204baf0fbfeSJeff Kirsher * Transmit descriptor, aligned to 16 bytes 205baf0fbfeSJeff Kirsher */ 206baf0fbfeSJeff Kirsher struct ftgmac100_txdes { 20752c0cae8SBenjamin Herrenschmidt __le32 txdes0; /* Control & status bits */ 20852c0cae8SBenjamin Herrenschmidt __le32 txdes1; /* Irq, checksum and vlan control */ 20952c0cae8SBenjamin Herrenschmidt __le32 txdes2; /* Reserved */ 21052c0cae8SBenjamin Herrenschmidt __le32 txdes3; /* DMA buffer address */ 211baf0fbfeSJeff Kirsher } __attribute__ ((aligned(16))); 212baf0fbfeSJeff Kirsher 213baf0fbfeSJeff Kirsher #define FTGMAC100_TXDES0_TXBUF_SIZE(x) ((x) & 0x3fff) 214baf0fbfeSJeff Kirsher #define FTGMAC100_TXDES0_CRC_ERR (1 << 19) 215baf0fbfeSJeff Kirsher #define FTGMAC100_TXDES0_LTS (1 << 28) 216baf0fbfeSJeff Kirsher #define FTGMAC100_TXDES0_FTS (1 << 29) 217baf0fbfeSJeff Kirsher #define FTGMAC100_TXDES0_TXDMA_OWN (1 << 31) 218baf0fbfeSJeff Kirsher 219baf0fbfeSJeff Kirsher #define FTGMAC100_TXDES1_VLANTAG_CI(x) ((x) & 0xffff) 220baf0fbfeSJeff Kirsher #define FTGMAC100_TXDES1_INS_VLANTAG (1 << 16) 221baf0fbfeSJeff Kirsher #define FTGMAC100_TXDES1_TCP_CHKSUM (1 << 17) 222baf0fbfeSJeff Kirsher #define FTGMAC100_TXDES1_UDP_CHKSUM (1 << 18) 223baf0fbfeSJeff Kirsher #define FTGMAC100_TXDES1_IP_CHKSUM (1 << 19) 224baf0fbfeSJeff Kirsher #define FTGMAC100_TXDES1_LLC (1 << 22) 225baf0fbfeSJeff Kirsher #define FTGMAC100_TXDES1_TX2FIC (1 << 30) 226baf0fbfeSJeff Kirsher #define FTGMAC100_TXDES1_TXIC (1 << 31) 227baf0fbfeSJeff Kirsher 228baf0fbfeSJeff Kirsher /* 229baf0fbfeSJeff Kirsher * Receive descriptor, aligned to 16 bytes 230baf0fbfeSJeff Kirsher */ 231baf0fbfeSJeff Kirsher struct ftgmac100_rxdes { 2324ca24152SBenjamin Herrenschmidt __le32 rxdes0; /* Control & status bits */ 2334ca24152SBenjamin Herrenschmidt __le32 rxdes1; /* Checksum and vlan status */ 2344ca24152SBenjamin Herrenschmidt __le32 rxdes2; /* length/type on AST2500 */ 2354ca24152SBenjamin Herrenschmidt __le32 rxdes3; /* DMA buffer address */ 236baf0fbfeSJeff Kirsher } __attribute__ ((aligned(16))); 237baf0fbfeSJeff Kirsher 238baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES0_VDBC 0x3fff 239baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES0_MULTICAST (1 << 16) 240baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES0_BROADCAST (1 << 17) 241baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES0_RX_ERR (1 << 18) 242baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES0_CRC_ERR (1 << 19) 243baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES0_FTL (1 << 20) 244baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES0_RUNT (1 << 21) 245baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES0_RX_ODD_NB (1 << 22) 246baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES0_FIFO_FULL (1 << 23) 247baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES0_PAUSE_OPCODE (1 << 24) 248baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES0_PAUSE_FRAME (1 << 25) 249baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES0_LRS (1 << 28) 250baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES0_FRS (1 << 29) 251baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES0_RXPKT_RDY (1 << 31) 252baf0fbfeSJeff Kirsher 2534ca24152SBenjamin Herrenschmidt /* Errors we care about for dropping packets */ 2544ca24152SBenjamin Herrenschmidt #define RXDES0_ANY_ERROR ( \ 2554ca24152SBenjamin Herrenschmidt FTGMAC100_RXDES0_RX_ERR | \ 2564ca24152SBenjamin Herrenschmidt FTGMAC100_RXDES0_CRC_ERR | \ 2574ca24152SBenjamin Herrenschmidt FTGMAC100_RXDES0_FTL | \ 2584ca24152SBenjamin Herrenschmidt FTGMAC100_RXDES0_RUNT | \ 2594ca24152SBenjamin Herrenschmidt FTGMAC100_RXDES0_RX_ODD_NB) 2604ca24152SBenjamin Herrenschmidt 261baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES1_VLANTAG_CI 0xffff 262baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES1_PROT_MASK (0x3 << 20) 263baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES1_PROT_NONIP (0x0 << 20) 264baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES1_PROT_IP (0x1 << 20) 265baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES1_PROT_TCPIP (0x2 << 20) 266baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES1_PROT_UDPIP (0x3 << 20) 267baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES1_LLC (1 << 22) 268baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES1_DF (1 << 23) 269baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES1_VLANTAG_AVAIL (1 << 24) 270baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES1_TCP_CHKSUM_ERR (1 << 25) 271baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES1_UDP_CHKSUM_ERR (1 << 26) 272baf0fbfeSJeff Kirsher #define FTGMAC100_RXDES1_IP_CHKSUM_ERR (1 << 27) 273baf0fbfeSJeff Kirsher 274baf0fbfeSJeff Kirsher #endif /* __FTGMAC100_H */ 275