Lines Matching +full:link +full:- +full:loss +full:- +full:low

1 /* SPDX-License-Identifier: GPL-2.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
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]
104 len of non-reassembly pkt
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 */
212 #define SW_RESET_RSTOUT 0x00000004 /* force RSTOUT# pin active (low).
216 reset when hot-swap is being
221 i.e., link won't drop. */
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 */
290 #define REG_BIM_BUFFER_DATA_LOW 0x1028 /* BIM buffer data low */
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.
307 #define BIM_RAM_BIST_RD_LOW_PASS 0x10 /* read low bank passes BIST */
309 #define BIM_RAM_BIST_WR_LOW_PASS 0x40 /* write low bank passes BIST.
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
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)
414 polarity active low. */
420 #define MAX_TX_RINGS_MASK (MAX_TX_RINGS - 1)
457 #define TX_CFG_INTR_COMPWB_DIS 0x20000000 /* disable pre-interrupt completion
474 /* 11-bit counters that point to next location in FIFO to be loaded/retrieved.
485 /* (ro) 11-bit up/down counter w/ # of frames currently in TX FIFO */
504 /* 64-bit pointer to the transmit data buffer. only the 50 LSB are incremented
507 #define REG_TX_DATA_PTR_LOW 0x2030 /* TX data pointer low */
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
539 base low */
549 * be 2KB-aligned. */
550 #define REG_TX_DB0_LOW 0x2060 /* TX descriptor base low #1 */
555 /* 16-bit registers hold weights for the weighted round-robin of the
560 * these registers causes a queue1 pre-emption with all historical bw
562 * pre-emption/re-allocation of network bandwidth
571 * writing _DATA_HI_T0 sets tag bit low, writing _DATA_HI_T1 sets tag
578 #define REG_TX_FIFO_DATA_LOW 0x210C /* TX FIFO data low */
583 /* 9-bit register controls BIST of TX FIFO. bit set indicates that the BIST
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.
797 base low */
801 base low */
804 /* 13-bit register indicate desc used by cassini for receive frames. used
883 #define REG_RX_WORK_DMA_PTR_LOW 0x4058 /* RX working DMA ptr low */
959 #define REG_RX_FIFO_DATA_LOW 0x4088 /* RX FIFO data low */
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
973 low */
986 #define REG_RX_IPP_FIFO_DATA_LOW 0x410C /* RX IPP FIFO data low */
992 /* 64-bit pointer to receive data buffer in host memory used for headers and
999 low */
1003 low */
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
1009 * one of the 64 byte locations in the Batching table. LOW holds 32 LSB.
1021 data low */
1028 /* 8KB aligned 64-bit pointer to base of RX rings. lower 13 bits hardwired to
1032 2 base low */
1036 2 base low. 4 total */
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))
1074 /* access to RX Instruction RAM. 5-bit register/counter holds addr
1082 #define HP_INSTR_RAM_ADDR_MASK 0x01F /* 5-bit mask */
1084 data low */
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
1243 /* bit set indicates that event occurred. auto-cleared when status register
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
1342 Rx-to-TX IPG. after
1352 back-to-pack (Tx-to-Tx
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 */
1489 or in half-duplex SERDES
1491 in half-duplex when
1499 #define MAC_XIF_LINK_LED 0x0020 /* LINKLED# active (low) */
1500 #define MAC_XIF_FDPLX_LED 0x0040 /* FDPLXLED# active (low) */
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
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-
1816 link config before it
1818 link can be used
1819 w/out any link config
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
1835 link has gone up again */
1837 auto-neg) */
1838 #define PCS_MII_STATUS_REMOTE_FAULT 0x0010 /* 1 -> remote fault detected
1839 from received link code
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 */
1866 link partner that chip is
1867 going off-line. bit12 will
1878 #define REG_PCS_MII_LPA 0x900C /* PCS MII link partner
1895 non-resettable */
1899 signal is low */
1907 0x2 = low freq test
1910 #define PCS_CFG_10MS_TIMER_OVERRIDE 0x20 /* shortens 10-20ms auto-
1915 /* used for diagnostic purposes. bits 20-22 autoclear on read */
1925 #define PCS_SM_WORD_SYNC_STATE_MASK 0x00000700 /* 0 indicates loss of
1927 #define PCS_SM_SEQ_DETECT_STATE_MASK 0x00001800 /* cycling through 0-3
1930 through 0-1 indicates
1933 #define SM_LINK_STATE_UP 0x00016000 /* link state is up */
1935 #define PCS_SM_LOSS_LINK_C 0x00100000 /* loss of link due to
1938 #define PCS_SM_LOSS_LINK_SYNC 0x00200000 /* loss of link due to
1939 loss of sync */
1944 #define PCS_SM_NO_LINK_BREAKLINK 0x01000000 /* link not up due to
1962 #define PCS_SM_NO_LINK_NO_IDLE 0x20000000 /* link partner continues
1969 * for link status change.
1972 #define PCS_INTR_STATUS_LINK_CHANGE 0x04 /* link status has changed
1986 10-bit interface */
1996 #define PCS_SERDES_CTRL_LOCKREF 0x04 /* frequency-lock RBC[0:1]
2037 /** LocalBus Devices. the following provides run-time access to the
2091 #define CAS_BMSR_1000_EXTEND 0x0100 /* supports 1000Base-T extended status */
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
2689 link_down = 0, /* No link, will retry */
2691 link_force_try, /* Try Forced link speed */
2694 link_up /* Link is up */
2707 * TX COMPWB must be 8-byte aligned.
2766 * are there for flow re-assembly. */
2805 int crc_size; /* 4 if half-duplex */
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))