Lines Matching +full:tx +full:- +full:rings +full:- +full:empty
1 /* SPDX-License-Identifier: GPL-2.0+ */
19 * rings are all offset from 0.
29 /* cassini register map: 2M memory mapped in 32-bit memory space accessible as
30 * 32-bit words. there is no i/o port access. REG_ addresses are
42 * if rx weight == 1 and tx weight == 0, rx == 2x tx transfer credit
62 /* top level interrupts [0-9] are auto-cleared to 0 when the status
63 * register is read. second level interrupts [13 - 18] are cleared at
64 * the source. tx completion register 3 is replicated in [19 - 31]
70 TX FIFO */
72 TX FIFO. i.e.,
73 TX Kick == TX complete. if
74 PACED_MODE set, then TX FIFO
75 also empty */
76 #define INTR_TX_DONE 0x00000004 /* any frame xferred into tx
78 #define INTR_TX_TAG_ERROR 0x00000008 /* TX FIFO tag framing
104 len of non-reassembly pkt
116 #define INTR_TX_MAC_STATUS 0x00004000 /* TX MAC status register has at
128 #define INTR_TX_COMP_3_MASK 0xFFF80000 /* mask for TX completion
183 #define BIM_CFG_64BIT_DISABLE 0x004 /* disable 64-bit mode */
185 #define BIM_CFG_32BIT 0x010 /* (ro) 1 = 32-bit slot, 0 = 64-bit */
205 * reset. poll until TX and RX read back as 0's for completion.
208 #define SW_RESET_TX 0x00000001 /* reset TX DMA engine. poll until
216 reset when hot-swap is being
253 /* Cassini only. 64-bit register used to check PCI datapath. when read,
254 * value written has both lower and upper 32-bit halves rotated to the right
255 * one bit position. e.g., FFFFFFFF FFFFFFFF -> 7FFFFFFF 7FFFFFFF
286 #define BIM_BUFFER_ADDR_MASK 0x3F /* index (0 - 23) of buffer */
293 /* set BIM_RAM_BIST_START to start built-in self test for BIM read buffer.
294 * bit auto-clears when done with status read from _SUMMARY and _PASS bits.
324 * 0x0: internal probe[7:0] (pci arb state, wtc empty w, wtc full w, wtc empty w,
325 * wtc empty r, post pci)
338 * 0xc: rx probe[7:0] 0xd: tx probe[7:0]
348 0x30 = tx[1:0]
361 #define REG_PLUS_INTRN_MASK(x) (REG_PLUS_INTR_MASK_1 + ((x) - 1)*16)
363 * all of the alternate (2-4) INTR registers while _1 corresponds to only
371 #define INTR_RX_BUF_AE_1 0x10 /* almost empty */
380 #define REG_PLUS_INTRN_STATUS(x) (REG_PLUS_INTR_STATUS_1 + ((x) - 1)*16)
386 #define REG_PLUS_ALIASN_CLEAR(x) (REG_PLUS_ALIAS_CLEAR_1 + ((x) - 1)*16)
390 #define REG_PLUS_INTRN_STATUS_ALIAS(x) (REG_PLUS_INTR_STATUS_ALIAS_1 + ((x) - 1)*16)
420 #define MAX_TX_RINGS_MASK (MAX_TX_RINGS - 1)
422 /* TX configuration.
426 #define REG_TX_CFG 0x2004 /* TX config */
427 #define TX_CFG_DMA_EN 0x00000001 /* enable TX DMA. if cleared, DMA
430 #define TX_CFG_FIFO_PIO_SEL 0x00000002 /* TX DMA FIFO can be
433 TX DMA should be
441 TX FIFO becomes empty.
443 if descr queue empty. */
457 #define TX_CFG_INTR_COMPWB_DIS 0x20000000 /* disable pre-interrupt completion
459 #define TX_CFG_CTX_SEL_MASK 0xC0000000 /* selects tx test port
461 0b00: tx mac req,
462 tx mac retry req,
463 tx ack and tx tag.
474 /* 11-bit counters that point to next location in FIFO to be loaded/retrieved.
477 #define REG_TX_FIFO_WRITE_PTR 0x2014 /* TX FIFO write pointer */
478 #define REG_TX_FIFO_SHADOW_WRITE_PTR 0x2018 /* TX FIFO shadow write
481 #define REG_TX_FIFO_READ_PTR 0x201C /* TX FIFO read pointer */
482 #define REG_TX_FIFO_SHADOW_READ_PTR 0x2020 /* TX FIFO shadow read
485 /* (ro) 11-bit up/down counter w/ # of frames currently in TX FIFO */
486 #define REG_TX_FIFO_PKT_CNT 0x2024 /* TX FIFO packet counter */
488 /* current state of all state machines in TX */
489 #define REG_TX_SM_1 0x2028 /* TX state machine reg #1 */
493 = 0x01 when TX disabled. */
499 #define REG_TX_SM_2 0x202C /* TX state machine reg #2 */
504 /* 64-bit pointer to the transmit data buffer. only the 50 LSB are incremented
505 * while the upper 23 bits are taken from the TX descriptor
507 #define REG_TX_DATA_PTR_LOW 0x2030 /* TX data pointer low */
508 #define REG_TX_DATA_PTR_HI 0x2034 /* TX data pointer high */
512 * the xmit dma engine to control tx descr fetching. if > 1 valid
513 * tx descr is available within the cache line being read, cassini will
516 #define REG_TX_KICK0 0x2038 /* TX kick reg #1 */
518 #define REG_TX_COMP0 0x2048 /* TX completion reg #1 */
521 /* values of TX_COMPLETE_1-4 are written. each completion register
524 * TX_ALL interrupts. at all other times, the most up-to-date index values
538 #define REG_TX_COMPWB_DB_LOW 0x2058 /* TX completion write back
540 #define REG_TX_COMPWB_DB_HI 0x205C /* TX completion write back
548 /* 53 MSB used as base address. 11 LSB assumed to be 0. TX desc pointer must
549 * be 2KB-aligned. */
550 #define REG_TX_DB0_LOW 0x2060 /* TX descriptor base low #1 */
551 #define REG_TX_DB0_HI 0x2064 /* TX descriptor base hi #1 */
555 /* 16-bit registers hold weights for the weighted round-robin of the
556 * four CBQ TX descr rings. weights correspond to # bytes xferred from
560 * these registers causes a queue1 pre-emption with all historical bw
562 * pre-emption/re-allocation of network bandwidth
564 #define REG_TX_MAXBURST_0 0x2080 /* TX MaxBurst #1 */
565 #define REG_TX_MAXBURST_1 0x2084 /* TX MaxBurst #2 */
566 #define REG_TX_MAXBURST_2 0x2088 /* TX MaxBurst #3 */
567 #define REG_TX_MAXBURST_3 0x208C /* TX MaxBurst #4 */
569 /* diagnostics access to any TX FIFO location. every access is 65
572 * bit high. TX_FIFO_PIO_SEL must be set for TX FIFO PIO access. if
573 * TX FIFO data integrity is desired, TX DMA should be
576 #define REG_TX_FIFO_ADDR 0x2104 /* TX FIFO address */
577 #define REG_TX_FIFO_TAG 0x2108 /* TX FIFO tag */
578 #define REG_TX_FIFO_DATA_LOW 0x210C /* TX FIFO data low */
579 #define REG_TX_FIFO_DATA_HI_T1 0x2110 /* TX FIFO data high t1 */
580 #define REG_TX_FIFO_DATA_HI_T0 0x2114 /* TX FIFO data high t0 */
581 #define REG_TX_FIFO_SIZE 0x2118 /* (ro) TX FIFO size = 0x090 = 9KB */
583 /* 9-bit register controls BIST of TX FIFO. bit set indicates that the BIST
586 #define REG_TX_RAMBIST 0x211C /* TX RAMBIST control/status */
602 * free ring size = (1 << n)*32 -> [32 - 8k]
603 * completion ring size = (1 << n)*128 -> [128 - 32k], n < 9
643 * [--------------------------------------------------------------] page
645 * |--------------| = PAGE_SIZE_BUFFER_STRIDE
684 /* 11-bit counter points to next location in RX FIFO to be loaded/read.
686 * DEFAULT: 0x0. generated on 64-bit boundaries.
695 pointer. (8-bit counter) */
762 * XOFF PAUSE uses pause time value pre-programmed in the Send PAUSE MAC reg
785 /* 13-bit register used to control RX desc fetching and intr generation. if 4+
788 * be a multiple of 4 (N % 4 = 0). first desc should be cache-line aligned.
793 /* 8KB aligned 64-bit pointer to the base of the RX free/completion rings.
794 * lower 13 bits of the low register are hard-wired to 0.
804 /* 13-bit register indicate desc used by cassini for receive frames. used
848 #define REG_RX_AE_THRESH 0x4048 /* RX almost empty
963 /* diagnostic assess to RX CTRL FIFO. 8-bit FIFO_ADDR holds address of
964 * 81 bit control entry and 6 bit flow id. LOW and MID are both 32-bit
965 * accesses. HI is 7-bits with 6-bit flow id and 1 bit control
992 /* 64-bit pointer to receive data buffer in host memory used for headers and
1007 /* PIO diagnostic access to RX reassembly DMA Table RAM. 6-bit register holds
1008 * one of 64 79-bit locations in the RX Reassembly DMA table and the addr of
1028 /* 8KB aligned 64-bit pointer to base of RX rings. lower 13 bits hardwired to
1029 * 0. same semantics as primary desc/complete rings.
1039 #define REG_PLUS_RX_CBN_LOW(x) (REG_PLUS_RX_CB1_LOW + 8*((x) - 1))
1040 #define REG_PLUS_RX_CBN_HI(x) (REG_PLUS_RX_CB1_HI + 8*((x) - 1))
1048 #define REG_PLUS_RX_COMPN_HEAD(x) (REG_PLUS_RX_COMP1_HEAD + 8*((x) - 1))
1049 #define REG_PLUS_RX_COMPN_TAIL(x) (REG_PLUS_RX_COMP1_TAIL + 8*((x) - 1))
1050 #define REG_PLUS_RX_AE1_THRESH 0x4240 /* RX almost empty 2
1074 /* access to RX Instruction RAM. 5-bit register/counter holds addr
1082 #define HP_INSTR_RAM_ADDR_MASK 0x01F /* 5-bit mask */
1117 * 11-bit register. Data fills the LSB portion of bus if less than 32 bits.
1119 * RAM bytes = 4*(x - 1) + [3:0]. e.g., 0 -> [3:0], 31 -> [123:120]
1120 * FLOWDB: write DATA_RAM_FDB register and then read/write FDB1-12 to access
1132 #define HP_DATA_RAM_FDB_FDB_MASK 0x3F00 /* 1 of 64 353-bit locations
1136 /* HP flow database registers: 1 - 12, 0x415C - 0x4188, 4 8-bit bytes
1226 /* reset bits are set using a PIO write and self-cleared after the command
1229 #define REG_MAC_TX_RESET 0x6000 /* TX MAC software reset
1243 /* bit set indicates that event occurred. auto-cleared when status register
1249 #define REG_MAC_TX_STATUS 0x6010 /* TX MAC status reg */
1257 length passed to TX MAC
1308 /* layout identical to TX MAC[8:0] */
1309 #define REG_MAC_TX_MASK 0x6020 /* TX MAC mask reg */
1319 * the delay for a 1518-byte frame on a 100Mbps network is 125us.
1321 * NOTE: on half-duplex 1Gbps, TX_CFG_CARRIER_EXTEND and
1325 #define REG_MAC_TX_CFG 0x6030 /* TX MAC config reg */
1326 #define MAC_TX_CFG_EN 0x0001 /* enable TX MAC. 0 will
1342 Rx-to-TX IPG. after
1343 receiving a frame, TX
1352 back-to-pack (Tx-to-Tx
1353 IPG), TX MAC ignores
1357 #define MAC_TX_CFG_NEVER_GIVE_UP_EN 0x0010 /* TX MAC will not easily
1367 TX MAC will execute
1369 #define MAC_TX_CFG_NEVER_GIVE_UP_LIM 0x0020 /* when set, TX MAC will
1372 0, TX MAC will continue
1378 backoff algorithm. TX
1387 duration of IPG. TX MAC
1392 #define MAC_TX_CFG_NO_FCS 0x0100 /* TX MAC will not generate
1398 TX DMA */
1408 for half-duplex at 1Gbps,
1413 * CRC is layer 2. however, non-reassembly packets will still contain the CRC
1453 to half-duplex 1Gbps */
1467 * a hw or global sw reset, RX/TX MAC software reset and initialization
1489 or in half-duplex SERDES
1491 in half-duplex when
1502 #define REG_MAC_IPG0 0x6040 /* inter-packet gap0 reg.
1504 #define REG_MAC_IPG1 0x6044 /* inter-packet gap1 reg
1506 #define REG_MAC_IPG2 0x6048 /* inter-packet gap2 reg
1523 TX MAC will xmit at the
1533 of attempts TX MAC will
1538 reached, TX MAC may or
1549 /* mac address registers: 0 - 44, 0x6080 - 0x6130, 4 8-bit bytes.
1554 * 3*x 16MSB of alt MAC addr 1-15 [47:32] of DA field
1580 mask reg. 8-bit reg
1586 /* hash table registers: 0 - 15, 0x6160 - 0x619C, 4 8-bit bytes
1587 * 16-bit registers contain bits of the hash table.
1588 * reg x -> [16*(15 - x) + 15 : 16*(15 - x)].
1589 * e.g., 15 -> [15:0], 0 -> [255:240]
1595 * overflow. recommended initialization: 0x0000. most are 16-bits except
1619 10-bit register used as a
1623 programmed after power-on
1636 /* 27-bit register has the current state for key state machines in the MAC */
1655 /** MIF registers. the MIF can be programmed in either bit-bang or
1658 #define REG_MIF_BIT_BANG_CLOCK 0x6200 /* MIF bit-bang clock.
1659 1 -> 0 will generate a
1660 rising edge. 0 -> 1 will
1662 #define REG_MIF_BIT_BANG_DATA 0x6204 /* MIF bit-bang data. 1-bit
1664 #define REG_MIF_BIT_BANG_OUTPUT_EN 0x6208 /* MIF bit-bang output
1669 /* 32-bit register serves as an instruction register when the MIF is
1673 * contain the 16-bit data returned by the tranceiver. unless specified
1709 load with 16-bit data
1717 and 16-bit data
1723 #define MIF_CFG_PHY_SELECT 0x0001 /* 1 -> select MDIO_1
1724 0 -> select MDIO_0 */
1728 #define MIF_CFG_BB_MODE 0x0004 /* 1 -> bit-bang mode
1729 0 -> frame mode */
1737 1 -> tranceiver is
1740 w/ MDIO_0 in bit-bang
1746 1 -> transceiver is
1749 w/ MDIO_1 in bit-bang
1757 /* 16-bit register used to determine which bits in the POLL_STATUS portion of
1764 /* 32-bit register used when in poll mode. auto-cleared after being read */
1779 /* 7-bit register has current state for all state machines in the MIF */
1791 /* the auto-negotiation enable bit should be programmed the same at
1792 * the link partner as in the local device to enable auto-negotiation to
1793 * complete. when that bit is reprogrammed, auto-neg/manual config is
1808 restart auto-
1823 #define PCS_MII_RESET 0x8000 /* reset PCS. self-clears
1830 #define PCS_MII_STATUS_LINK_STATUS 0x0004 /* 1 -> link up.
1831 0 -> link down. 0 is
1837 auto-neg) */
1838 #define PCS_MII_STATUS_REMOTE_FAULT 0x0010 /* 1 -> remote fault detected
1841 auto-neg completed */
1842 #define PCS_MII_STATUS_AUTONEG_COMP 0x0020 /* 1 -> auto-negotiation
1844 0 -> auto-negotiation not
1848 a 1000 Base-X PHY. writes
1851 /* used during auto-negotiation.
1857 1000 Base-X */
1858 #define PCS_MII_ADVERT_HD 0x0040 /* advertise half-duplex
1859 1000 Base-X */
1867 going off-line. bit12 will
1895 non-resettable */
1910 #define PCS_CFG_10MS_TIMER_OVERRIDE 0x20 /* shortens 10-20ms auto-
1915 /* used for diagnostic purposes. bits 20-22 autoclear on read */
1927 #define PCS_SM_SEQ_DETECT_STATE_MASK 0x00001800 /* cycling through 0-3
1930 through 0-1 indicates
1986 10-bit interface */
1996 #define PCS_SERDES_CTRL_LOCKREF 0x04 /* frequency-lock RBC[0:1]
2007 * 0b011 txmac req, tx ack, tx tag, tx retry req
2008 * 0b100 tx tp3, tx tp2, tx tp1, tx tp0
2009 * 0b101 R period RX, R period TX, R period HP, R period BIM
2037 /** LocalBus Devices. the following provides run-time access to the
2091 #define CAS_BMSR_1000_EXTEND 0x0100 /* supports 1000Base-T extended status */
2511 * is the actual size. the default index for the various rings is
2512 * 8. NOTE: there a bunch of alignment constraints for the rings. to
2513 * deal with that, i just allocate rings to create the desired
2515 * RX DESC and COMP rings must be 8KB aligned
2516 * TX DESC must be 2KB aligned.
2544 /* number of flows that can go through re-assembly */
2570 bytes. 0 - 9256 */
2598 /* descriptor ring for free buffers contains page-sized buffers. the index
2706 * TX DESC, RX DESC, and RX COMP must each be 8K aligned.
2707 * TX COMPWB must be 8-byte aligned.
2714 * TX COMPWB
2741 spinlock_t tx_lock[N_TX_RINGS]; /* tx bits */
2765 /* we use sk_buffs for tx and pages for rx. the rx skbuffs
2766 * are there for flow re-assembly. */
2805 int crc_size; /* 4 if half-duplex */
2808 int min_frame_size; /* for tx fifo workaround */
2833 /* Link-down problem workaround */
2850 int casreg_len; /* reg-space size for dumping */
2867 #define TX_DESC_NEXT(r, x) (((x) + 1) & (TX_DESC_RINGN_SIZE(r) - 1))
2868 #define RX_DESC_ENTRY(r, x) ((x) & (RX_DESC_RINGN_SIZE(r) - 1))
2869 #define RX_COMP_ENTRY(r, x) ((x) & (RX_COMP_RINGN_SIZE(r) - 1))
2871 #define TX_BUFF_COUNT(r, x, y) ((x) <= (y) ? ((y) - (x)) : \
2872 (TX_DESC_RINGN_SIZE(r) - (x) + (y)))
2874 #define TX_BUFFS_AVAIL(cp, i) ((cp)->tx_old[(i)] <= (cp)->tx_new[(i)] ? \
2875 (cp)->tx_old[(i)] + (TX_DESC_RINGN_SIZE(i) - 1) - (cp)->tx_new[(i)] : \
2876 (cp)->tx_old[(i)] - (cp)->tx_new[(i)] - 1)
2879 (((unsigned long) (addr) + ((align) - 1UL)) & ~((align) - 1))