18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Definitions for the new Marvell Yukon / SysKonnect driver. 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci#ifndef _SKGE_H 68c2ecf20Sopenharmony_ci#define _SKGE_H 78c2ecf20Sopenharmony_ci#include <linux/interrupt.h> 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci/* PCI config registers */ 108c2ecf20Sopenharmony_ci#define PCI_DEV_REG1 0x40 118c2ecf20Sopenharmony_ci#define PCI_PHY_COMA 0x8000000 128c2ecf20Sopenharmony_ci#define PCI_VIO 0x2000000 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#define PCI_DEV_REG2 0x44 158c2ecf20Sopenharmony_ci#define PCI_VPD_ROM_SZ 7L<<14 /* VPD ROM size 0=256, 1=512, ... */ 168c2ecf20Sopenharmony_ci#define PCI_REV_DESC 1<<2 /* Reverse Descriptor bytes */ 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_cienum csr_regs { 198c2ecf20Sopenharmony_ci B0_RAP = 0x0000, 208c2ecf20Sopenharmony_ci B0_CTST = 0x0004, 218c2ecf20Sopenharmony_ci B0_LED = 0x0006, 228c2ecf20Sopenharmony_ci B0_POWER_CTRL = 0x0007, 238c2ecf20Sopenharmony_ci B0_ISRC = 0x0008, 248c2ecf20Sopenharmony_ci B0_IMSK = 0x000c, 258c2ecf20Sopenharmony_ci B0_HWE_ISRC = 0x0010, 268c2ecf20Sopenharmony_ci B0_HWE_IMSK = 0x0014, 278c2ecf20Sopenharmony_ci B0_SP_ISRC = 0x0018, 288c2ecf20Sopenharmony_ci B0_XM1_IMSK = 0x0020, 298c2ecf20Sopenharmony_ci B0_XM1_ISRC = 0x0028, 308c2ecf20Sopenharmony_ci B0_XM1_PHY_ADDR = 0x0030, 318c2ecf20Sopenharmony_ci B0_XM1_PHY_DATA = 0x0034, 328c2ecf20Sopenharmony_ci B0_XM2_IMSK = 0x0040, 338c2ecf20Sopenharmony_ci B0_XM2_ISRC = 0x0048, 348c2ecf20Sopenharmony_ci B0_XM2_PHY_ADDR = 0x0050, 358c2ecf20Sopenharmony_ci B0_XM2_PHY_DATA = 0x0054, 368c2ecf20Sopenharmony_ci B0_R1_CSR = 0x0060, 378c2ecf20Sopenharmony_ci B0_R2_CSR = 0x0064, 388c2ecf20Sopenharmony_ci B0_XS1_CSR = 0x0068, 398c2ecf20Sopenharmony_ci B0_XA1_CSR = 0x006c, 408c2ecf20Sopenharmony_ci B0_XS2_CSR = 0x0070, 418c2ecf20Sopenharmony_ci B0_XA2_CSR = 0x0074, 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci B2_MAC_1 = 0x0100, 448c2ecf20Sopenharmony_ci B2_MAC_2 = 0x0108, 458c2ecf20Sopenharmony_ci B2_MAC_3 = 0x0110, 468c2ecf20Sopenharmony_ci B2_CONN_TYP = 0x0118, 478c2ecf20Sopenharmony_ci B2_PMD_TYP = 0x0119, 488c2ecf20Sopenharmony_ci B2_MAC_CFG = 0x011a, 498c2ecf20Sopenharmony_ci B2_CHIP_ID = 0x011b, 508c2ecf20Sopenharmony_ci B2_E_0 = 0x011c, 518c2ecf20Sopenharmony_ci B2_E_1 = 0x011d, 528c2ecf20Sopenharmony_ci B2_E_2 = 0x011e, 538c2ecf20Sopenharmony_ci B2_E_3 = 0x011f, 548c2ecf20Sopenharmony_ci B2_FAR = 0x0120, 558c2ecf20Sopenharmony_ci B2_FDP = 0x0124, 568c2ecf20Sopenharmony_ci B2_LD_CTRL = 0x0128, 578c2ecf20Sopenharmony_ci B2_LD_TEST = 0x0129, 588c2ecf20Sopenharmony_ci B2_TI_INI = 0x0130, 598c2ecf20Sopenharmony_ci B2_TI_VAL = 0x0134, 608c2ecf20Sopenharmony_ci B2_TI_CTRL = 0x0138, 618c2ecf20Sopenharmony_ci B2_TI_TEST = 0x0139, 628c2ecf20Sopenharmony_ci B2_IRQM_INI = 0x0140, 638c2ecf20Sopenharmony_ci B2_IRQM_VAL = 0x0144, 648c2ecf20Sopenharmony_ci B2_IRQM_CTRL = 0x0148, 658c2ecf20Sopenharmony_ci B2_IRQM_TEST = 0x0149, 668c2ecf20Sopenharmony_ci B2_IRQM_MSK = 0x014c, 678c2ecf20Sopenharmony_ci B2_IRQM_HWE_MSK = 0x0150, 688c2ecf20Sopenharmony_ci B2_TST_CTRL1 = 0x0158, 698c2ecf20Sopenharmony_ci B2_TST_CTRL2 = 0x0159, 708c2ecf20Sopenharmony_ci B2_GP_IO = 0x015c, 718c2ecf20Sopenharmony_ci B2_I2C_CTRL = 0x0160, 728c2ecf20Sopenharmony_ci B2_I2C_DATA = 0x0164, 738c2ecf20Sopenharmony_ci B2_I2C_IRQ = 0x0168, 748c2ecf20Sopenharmony_ci B2_I2C_SW = 0x016c, 758c2ecf20Sopenharmony_ci B2_BSC_INI = 0x0170, 768c2ecf20Sopenharmony_ci B2_BSC_VAL = 0x0174, 778c2ecf20Sopenharmony_ci B2_BSC_CTRL = 0x0178, 788c2ecf20Sopenharmony_ci B2_BSC_STAT = 0x0179, 798c2ecf20Sopenharmony_ci B2_BSC_TST = 0x017a, 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ci B3_RAM_ADDR = 0x0180, 828c2ecf20Sopenharmony_ci B3_RAM_DATA_LO = 0x0184, 838c2ecf20Sopenharmony_ci B3_RAM_DATA_HI = 0x0188, 848c2ecf20Sopenharmony_ci B3_RI_WTO_R1 = 0x0190, 858c2ecf20Sopenharmony_ci B3_RI_WTO_XA1 = 0x0191, 868c2ecf20Sopenharmony_ci B3_RI_WTO_XS1 = 0x0192, 878c2ecf20Sopenharmony_ci B3_RI_RTO_R1 = 0x0193, 888c2ecf20Sopenharmony_ci B3_RI_RTO_XA1 = 0x0194, 898c2ecf20Sopenharmony_ci B3_RI_RTO_XS1 = 0x0195, 908c2ecf20Sopenharmony_ci B3_RI_WTO_R2 = 0x0196, 918c2ecf20Sopenharmony_ci B3_RI_WTO_XA2 = 0x0197, 928c2ecf20Sopenharmony_ci B3_RI_WTO_XS2 = 0x0198, 938c2ecf20Sopenharmony_ci B3_RI_RTO_R2 = 0x0199, 948c2ecf20Sopenharmony_ci B3_RI_RTO_XA2 = 0x019a, 958c2ecf20Sopenharmony_ci B3_RI_RTO_XS2 = 0x019b, 968c2ecf20Sopenharmony_ci B3_RI_TO_VAL = 0x019c, 978c2ecf20Sopenharmony_ci B3_RI_CTRL = 0x01a0, 988c2ecf20Sopenharmony_ci B3_RI_TEST = 0x01a2, 998c2ecf20Sopenharmony_ci B3_MA_TOINI_RX1 = 0x01b0, 1008c2ecf20Sopenharmony_ci B3_MA_TOINI_RX2 = 0x01b1, 1018c2ecf20Sopenharmony_ci B3_MA_TOINI_TX1 = 0x01b2, 1028c2ecf20Sopenharmony_ci B3_MA_TOINI_TX2 = 0x01b3, 1038c2ecf20Sopenharmony_ci B3_MA_TOVAL_RX1 = 0x01b4, 1048c2ecf20Sopenharmony_ci B3_MA_TOVAL_RX2 = 0x01b5, 1058c2ecf20Sopenharmony_ci B3_MA_TOVAL_TX1 = 0x01b6, 1068c2ecf20Sopenharmony_ci B3_MA_TOVAL_TX2 = 0x01b7, 1078c2ecf20Sopenharmony_ci B3_MA_TO_CTRL = 0x01b8, 1088c2ecf20Sopenharmony_ci B3_MA_TO_TEST = 0x01ba, 1098c2ecf20Sopenharmony_ci B3_MA_RCINI_RX1 = 0x01c0, 1108c2ecf20Sopenharmony_ci B3_MA_RCINI_RX2 = 0x01c1, 1118c2ecf20Sopenharmony_ci B3_MA_RCINI_TX1 = 0x01c2, 1128c2ecf20Sopenharmony_ci B3_MA_RCINI_TX2 = 0x01c3, 1138c2ecf20Sopenharmony_ci B3_MA_RCVAL_RX1 = 0x01c4, 1148c2ecf20Sopenharmony_ci B3_MA_RCVAL_RX2 = 0x01c5, 1158c2ecf20Sopenharmony_ci B3_MA_RCVAL_TX1 = 0x01c6, 1168c2ecf20Sopenharmony_ci B3_MA_RCVAL_TX2 = 0x01c7, 1178c2ecf20Sopenharmony_ci B3_MA_RC_CTRL = 0x01c8, 1188c2ecf20Sopenharmony_ci B3_MA_RC_TEST = 0x01ca, 1198c2ecf20Sopenharmony_ci B3_PA_TOINI_RX1 = 0x01d0, 1208c2ecf20Sopenharmony_ci B3_PA_TOINI_RX2 = 0x01d4, 1218c2ecf20Sopenharmony_ci B3_PA_TOINI_TX1 = 0x01d8, 1228c2ecf20Sopenharmony_ci B3_PA_TOINI_TX2 = 0x01dc, 1238c2ecf20Sopenharmony_ci B3_PA_TOVAL_RX1 = 0x01e0, 1248c2ecf20Sopenharmony_ci B3_PA_TOVAL_RX2 = 0x01e4, 1258c2ecf20Sopenharmony_ci B3_PA_TOVAL_TX1 = 0x01e8, 1268c2ecf20Sopenharmony_ci B3_PA_TOVAL_TX2 = 0x01ec, 1278c2ecf20Sopenharmony_ci B3_PA_CTRL = 0x01f0, 1288c2ecf20Sopenharmony_ci B3_PA_TEST = 0x01f2, 1298c2ecf20Sopenharmony_ci}; 1308c2ecf20Sopenharmony_ci 1318c2ecf20Sopenharmony_ci/* B0_CTST 16 bit Control/Status register */ 1328c2ecf20Sopenharmony_cienum { 1338c2ecf20Sopenharmony_ci CS_CLK_RUN_HOT = 1<<13,/* CLK_RUN hot m. (YUKON-Lite only) */ 1348c2ecf20Sopenharmony_ci CS_CLK_RUN_RST = 1<<12,/* CLK_RUN reset (YUKON-Lite only) */ 1358c2ecf20Sopenharmony_ci CS_CLK_RUN_ENA = 1<<11,/* CLK_RUN enable (YUKON-Lite only) */ 1368c2ecf20Sopenharmony_ci CS_VAUX_AVAIL = 1<<10,/* VAUX available (YUKON only) */ 1378c2ecf20Sopenharmony_ci CS_BUS_CLOCK = 1<<9, /* Bus Clock 0/1 = 33/66 MHz */ 1388c2ecf20Sopenharmony_ci CS_BUS_SLOT_SZ = 1<<8, /* Slot Size 0/1 = 32/64 bit slot */ 1398c2ecf20Sopenharmony_ci CS_ST_SW_IRQ = 1<<7, /* Set IRQ SW Request */ 1408c2ecf20Sopenharmony_ci CS_CL_SW_IRQ = 1<<6, /* Clear IRQ SW Request */ 1418c2ecf20Sopenharmony_ci CS_STOP_DONE = 1<<5, /* Stop Master is finished */ 1428c2ecf20Sopenharmony_ci CS_STOP_MAST = 1<<4, /* Command Bit to stop the master */ 1438c2ecf20Sopenharmony_ci CS_MRST_CLR = 1<<3, /* Clear Master reset */ 1448c2ecf20Sopenharmony_ci CS_MRST_SET = 1<<2, /* Set Master reset */ 1458c2ecf20Sopenharmony_ci CS_RST_CLR = 1<<1, /* Clear Software reset */ 1468c2ecf20Sopenharmony_ci CS_RST_SET = 1, /* Set Software reset */ 1478c2ecf20Sopenharmony_ci 1488c2ecf20Sopenharmony_ci/* B0_LED 8 Bit LED register */ 1498c2ecf20Sopenharmony_ci/* Bit 7.. 2: reserved */ 1508c2ecf20Sopenharmony_ci LED_STAT_ON = 1<<1, /* Status LED on */ 1518c2ecf20Sopenharmony_ci LED_STAT_OFF = 1, /* Status LED off */ 1528c2ecf20Sopenharmony_ci 1538c2ecf20Sopenharmony_ci/* B0_POWER_CTRL 8 Bit Power Control reg (YUKON only) */ 1548c2ecf20Sopenharmony_ci PC_VAUX_ENA = 1<<7, /* Switch VAUX Enable */ 1558c2ecf20Sopenharmony_ci PC_VAUX_DIS = 1<<6, /* Switch VAUX Disable */ 1568c2ecf20Sopenharmony_ci PC_VCC_ENA = 1<<5, /* Switch VCC Enable */ 1578c2ecf20Sopenharmony_ci PC_VCC_DIS = 1<<4, /* Switch VCC Disable */ 1588c2ecf20Sopenharmony_ci PC_VAUX_ON = 1<<3, /* Switch VAUX On */ 1598c2ecf20Sopenharmony_ci PC_VAUX_OFF = 1<<2, /* Switch VAUX Off */ 1608c2ecf20Sopenharmony_ci PC_VCC_ON = 1<<1, /* Switch VCC On */ 1618c2ecf20Sopenharmony_ci PC_VCC_OFF = 1<<0, /* Switch VCC Off */ 1628c2ecf20Sopenharmony_ci}; 1638c2ecf20Sopenharmony_ci 1648c2ecf20Sopenharmony_ci/* B2_IRQM_MSK 32 bit IRQ Moderation Mask */ 1658c2ecf20Sopenharmony_cienum { 1668c2ecf20Sopenharmony_ci IS_ALL_MSK = 0xbffffffful, /* All Interrupt bits */ 1678c2ecf20Sopenharmony_ci IS_HW_ERR = 1<<31, /* Interrupt HW Error */ 1688c2ecf20Sopenharmony_ci /* Bit 30: reserved */ 1698c2ecf20Sopenharmony_ci IS_PA_TO_RX1 = 1<<29, /* Packet Arb Timeout Rx1 */ 1708c2ecf20Sopenharmony_ci IS_PA_TO_RX2 = 1<<28, /* Packet Arb Timeout Rx2 */ 1718c2ecf20Sopenharmony_ci IS_PA_TO_TX1 = 1<<27, /* Packet Arb Timeout Tx1 */ 1728c2ecf20Sopenharmony_ci IS_PA_TO_TX2 = 1<<26, /* Packet Arb Timeout Tx2 */ 1738c2ecf20Sopenharmony_ci IS_I2C_READY = 1<<25, /* IRQ on end of I2C Tx */ 1748c2ecf20Sopenharmony_ci IS_IRQ_SW = 1<<24, /* SW forced IRQ */ 1758c2ecf20Sopenharmony_ci IS_EXT_REG = 1<<23, /* IRQ from LM80 or PHY (GENESIS only) */ 1768c2ecf20Sopenharmony_ci /* IRQ from PHY (YUKON only) */ 1778c2ecf20Sopenharmony_ci IS_TIMINT = 1<<22, /* IRQ from Timer */ 1788c2ecf20Sopenharmony_ci IS_MAC1 = 1<<21, /* IRQ from MAC 1 */ 1798c2ecf20Sopenharmony_ci IS_LNK_SYNC_M1 = 1<<20, /* Link Sync Cnt wrap MAC 1 */ 1808c2ecf20Sopenharmony_ci IS_MAC2 = 1<<19, /* IRQ from MAC 2 */ 1818c2ecf20Sopenharmony_ci IS_LNK_SYNC_M2 = 1<<18, /* Link Sync Cnt wrap MAC 2 */ 1828c2ecf20Sopenharmony_ci/* Receive Queue 1 */ 1838c2ecf20Sopenharmony_ci IS_R1_B = 1<<17, /* Q_R1 End of Buffer */ 1848c2ecf20Sopenharmony_ci IS_R1_F = 1<<16, /* Q_R1 End of Frame */ 1858c2ecf20Sopenharmony_ci IS_R1_C = 1<<15, /* Q_R1 Encoding Error */ 1868c2ecf20Sopenharmony_ci/* Receive Queue 2 */ 1878c2ecf20Sopenharmony_ci IS_R2_B = 1<<14, /* Q_R2 End of Buffer */ 1888c2ecf20Sopenharmony_ci IS_R2_F = 1<<13, /* Q_R2 End of Frame */ 1898c2ecf20Sopenharmony_ci IS_R2_C = 1<<12, /* Q_R2 Encoding Error */ 1908c2ecf20Sopenharmony_ci/* Synchronous Transmit Queue 1 */ 1918c2ecf20Sopenharmony_ci IS_XS1_B = 1<<11, /* Q_XS1 End of Buffer */ 1928c2ecf20Sopenharmony_ci IS_XS1_F = 1<<10, /* Q_XS1 End of Frame */ 1938c2ecf20Sopenharmony_ci IS_XS1_C = 1<<9, /* Q_XS1 Encoding Error */ 1948c2ecf20Sopenharmony_ci/* Asynchronous Transmit Queue 1 */ 1958c2ecf20Sopenharmony_ci IS_XA1_B = 1<<8, /* Q_XA1 End of Buffer */ 1968c2ecf20Sopenharmony_ci IS_XA1_F = 1<<7, /* Q_XA1 End of Frame */ 1978c2ecf20Sopenharmony_ci IS_XA1_C = 1<<6, /* Q_XA1 Encoding Error */ 1988c2ecf20Sopenharmony_ci/* Synchronous Transmit Queue 2 */ 1998c2ecf20Sopenharmony_ci IS_XS2_B = 1<<5, /* Q_XS2 End of Buffer */ 2008c2ecf20Sopenharmony_ci IS_XS2_F = 1<<4, /* Q_XS2 End of Frame */ 2018c2ecf20Sopenharmony_ci IS_XS2_C = 1<<3, /* Q_XS2 Encoding Error */ 2028c2ecf20Sopenharmony_ci/* Asynchronous Transmit Queue 2 */ 2038c2ecf20Sopenharmony_ci IS_XA2_B = 1<<2, /* Q_XA2 End of Buffer */ 2048c2ecf20Sopenharmony_ci IS_XA2_F = 1<<1, /* Q_XA2 End of Frame */ 2058c2ecf20Sopenharmony_ci IS_XA2_C = 1<<0, /* Q_XA2 Encoding Error */ 2068c2ecf20Sopenharmony_ci 2078c2ecf20Sopenharmony_ci IS_TO_PORT1 = IS_PA_TO_RX1 | IS_PA_TO_TX1, 2088c2ecf20Sopenharmony_ci IS_TO_PORT2 = IS_PA_TO_RX2 | IS_PA_TO_TX2, 2098c2ecf20Sopenharmony_ci 2108c2ecf20Sopenharmony_ci IS_PORT_1 = IS_XA1_F| IS_R1_F | IS_TO_PORT1 | IS_MAC1, 2118c2ecf20Sopenharmony_ci IS_PORT_2 = IS_XA2_F| IS_R2_F | IS_TO_PORT2 | IS_MAC2, 2128c2ecf20Sopenharmony_ci}; 2138c2ecf20Sopenharmony_ci 2148c2ecf20Sopenharmony_ci 2158c2ecf20Sopenharmony_ci/* B2_IRQM_HWE_MSK 32 bit IRQ Moderation HW Error Mask */ 2168c2ecf20Sopenharmony_cienum { 2178c2ecf20Sopenharmony_ci IS_IRQ_TIST_OV = 1<<13, /* Time Stamp Timer Overflow (YUKON only) */ 2188c2ecf20Sopenharmony_ci IS_IRQ_SENSOR = 1<<12, /* IRQ from Sensor (YUKON only) */ 2198c2ecf20Sopenharmony_ci IS_IRQ_MST_ERR = 1<<11, /* IRQ master error detected */ 2208c2ecf20Sopenharmony_ci IS_IRQ_STAT = 1<<10, /* IRQ status exception */ 2218c2ecf20Sopenharmony_ci IS_NO_STAT_M1 = 1<<9, /* No Rx Status from MAC 1 */ 2228c2ecf20Sopenharmony_ci IS_NO_STAT_M2 = 1<<8, /* No Rx Status from MAC 2 */ 2238c2ecf20Sopenharmony_ci IS_NO_TIST_M1 = 1<<7, /* No Time Stamp from MAC 1 */ 2248c2ecf20Sopenharmony_ci IS_NO_TIST_M2 = 1<<6, /* No Time Stamp from MAC 2 */ 2258c2ecf20Sopenharmony_ci IS_RAM_RD_PAR = 1<<5, /* RAM Read Parity Error */ 2268c2ecf20Sopenharmony_ci IS_RAM_WR_PAR = 1<<4, /* RAM Write Parity Error */ 2278c2ecf20Sopenharmony_ci IS_M1_PAR_ERR = 1<<3, /* MAC 1 Parity Error */ 2288c2ecf20Sopenharmony_ci IS_M2_PAR_ERR = 1<<2, /* MAC 2 Parity Error */ 2298c2ecf20Sopenharmony_ci IS_R1_PAR_ERR = 1<<1, /* Queue R1 Parity Error */ 2308c2ecf20Sopenharmony_ci IS_R2_PAR_ERR = 1<<0, /* Queue R2 Parity Error */ 2318c2ecf20Sopenharmony_ci 2328c2ecf20Sopenharmony_ci IS_ERR_MSK = IS_IRQ_MST_ERR | IS_IRQ_STAT 2338c2ecf20Sopenharmony_ci | IS_RAM_RD_PAR | IS_RAM_WR_PAR 2348c2ecf20Sopenharmony_ci | IS_M1_PAR_ERR | IS_M2_PAR_ERR 2358c2ecf20Sopenharmony_ci | IS_R1_PAR_ERR | IS_R2_PAR_ERR, 2368c2ecf20Sopenharmony_ci}; 2378c2ecf20Sopenharmony_ci 2388c2ecf20Sopenharmony_ci/* B2_TST_CTRL1 8 bit Test Control Register 1 */ 2398c2ecf20Sopenharmony_cienum { 2408c2ecf20Sopenharmony_ci TST_FRC_DPERR_MR = 1<<7, /* force DATAPERR on MST RD */ 2418c2ecf20Sopenharmony_ci TST_FRC_DPERR_MW = 1<<6, /* force DATAPERR on MST WR */ 2428c2ecf20Sopenharmony_ci TST_FRC_DPERR_TR = 1<<5, /* force DATAPERR on TRG RD */ 2438c2ecf20Sopenharmony_ci TST_FRC_DPERR_TW = 1<<4, /* force DATAPERR on TRG WR */ 2448c2ecf20Sopenharmony_ci TST_FRC_APERR_M = 1<<3, /* force ADDRPERR on MST */ 2458c2ecf20Sopenharmony_ci TST_FRC_APERR_T = 1<<2, /* force ADDRPERR on TRG */ 2468c2ecf20Sopenharmony_ci TST_CFG_WRITE_ON = 1<<1, /* Enable Config Reg WR */ 2478c2ecf20Sopenharmony_ci TST_CFG_WRITE_OFF= 1<<0, /* Disable Config Reg WR */ 2488c2ecf20Sopenharmony_ci}; 2498c2ecf20Sopenharmony_ci 2508c2ecf20Sopenharmony_ci/* B2_MAC_CFG 8 bit MAC Configuration / Chip Revision */ 2518c2ecf20Sopenharmony_cienum { 2528c2ecf20Sopenharmony_ci CFG_CHIP_R_MSK = 0xf<<4, /* Bit 7.. 4: Chip Revision */ 2538c2ecf20Sopenharmony_ci /* Bit 3.. 2: reserved */ 2548c2ecf20Sopenharmony_ci CFG_DIS_M2_CLK = 1<<1, /* Disable Clock for 2nd MAC */ 2558c2ecf20Sopenharmony_ci CFG_SNG_MAC = 1<<0, /* MAC Config: 0=2 MACs / 1=1 MAC*/ 2568c2ecf20Sopenharmony_ci}; 2578c2ecf20Sopenharmony_ci 2588c2ecf20Sopenharmony_ci/* B2_CHIP_ID 8 bit Chip Identification Number */ 2598c2ecf20Sopenharmony_cienum { 2608c2ecf20Sopenharmony_ci CHIP_ID_GENESIS = 0x0a, /* Chip ID for GENESIS */ 2618c2ecf20Sopenharmony_ci CHIP_ID_YUKON = 0xb0, /* Chip ID for YUKON */ 2628c2ecf20Sopenharmony_ci CHIP_ID_YUKON_LITE = 0xb1, /* Chip ID for YUKON-Lite (Rev. A1-A3) */ 2638c2ecf20Sopenharmony_ci CHIP_ID_YUKON_LP = 0xb2, /* Chip ID for YUKON-LP */ 2648c2ecf20Sopenharmony_ci CHIP_ID_YUKON_XL = 0xb3, /* Chip ID for YUKON-2 XL */ 2658c2ecf20Sopenharmony_ci CHIP_ID_YUKON_EC = 0xb6, /* Chip ID for YUKON-2 EC */ 2668c2ecf20Sopenharmony_ci CHIP_ID_YUKON_FE = 0xb7, /* Chip ID for YUKON-2 FE */ 2678c2ecf20Sopenharmony_ci 2688c2ecf20Sopenharmony_ci CHIP_REV_YU_LITE_A1 = 3, /* Chip Rev. for YUKON-Lite A1,A2 */ 2698c2ecf20Sopenharmony_ci CHIP_REV_YU_LITE_A3 = 7, /* Chip Rev. for YUKON-Lite A3 */ 2708c2ecf20Sopenharmony_ci}; 2718c2ecf20Sopenharmony_ci 2728c2ecf20Sopenharmony_ci/* B2_TI_CTRL 8 bit Timer control */ 2738c2ecf20Sopenharmony_ci/* B2_IRQM_CTRL 8 bit IRQ Moderation Timer Control */ 2748c2ecf20Sopenharmony_cienum { 2758c2ecf20Sopenharmony_ci TIM_START = 1<<2, /* Start Timer */ 2768c2ecf20Sopenharmony_ci TIM_STOP = 1<<1, /* Stop Timer */ 2778c2ecf20Sopenharmony_ci TIM_CLR_IRQ = 1<<0, /* Clear Timer IRQ (!IRQM) */ 2788c2ecf20Sopenharmony_ci}; 2798c2ecf20Sopenharmony_ci 2808c2ecf20Sopenharmony_ci/* B2_TI_TEST 8 Bit Timer Test */ 2818c2ecf20Sopenharmony_ci/* B2_IRQM_TEST 8 bit IRQ Moderation Timer Test */ 2828c2ecf20Sopenharmony_ci/* B28_DPT_TST 8 bit Descriptor Poll Timer Test Reg */ 2838c2ecf20Sopenharmony_cienum { 2848c2ecf20Sopenharmony_ci TIM_T_ON = 1<<2, /* Test mode on */ 2858c2ecf20Sopenharmony_ci TIM_T_OFF = 1<<1, /* Test mode off */ 2868c2ecf20Sopenharmony_ci TIM_T_STEP = 1<<0, /* Test step */ 2878c2ecf20Sopenharmony_ci}; 2888c2ecf20Sopenharmony_ci 2898c2ecf20Sopenharmony_ci/* B2_GP_IO 32 bit General Purpose I/O Register */ 2908c2ecf20Sopenharmony_cienum { 2918c2ecf20Sopenharmony_ci GP_DIR_9 = 1<<25, /* IO_9 direct, 0=In/1=Out */ 2928c2ecf20Sopenharmony_ci GP_DIR_8 = 1<<24, /* IO_8 direct, 0=In/1=Out */ 2938c2ecf20Sopenharmony_ci GP_DIR_7 = 1<<23, /* IO_7 direct, 0=In/1=Out */ 2948c2ecf20Sopenharmony_ci GP_DIR_6 = 1<<22, /* IO_6 direct, 0=In/1=Out */ 2958c2ecf20Sopenharmony_ci GP_DIR_5 = 1<<21, /* IO_5 direct, 0=In/1=Out */ 2968c2ecf20Sopenharmony_ci GP_DIR_4 = 1<<20, /* IO_4 direct, 0=In/1=Out */ 2978c2ecf20Sopenharmony_ci GP_DIR_3 = 1<<19, /* IO_3 direct, 0=In/1=Out */ 2988c2ecf20Sopenharmony_ci GP_DIR_2 = 1<<18, /* IO_2 direct, 0=In/1=Out */ 2998c2ecf20Sopenharmony_ci GP_DIR_1 = 1<<17, /* IO_1 direct, 0=In/1=Out */ 3008c2ecf20Sopenharmony_ci GP_DIR_0 = 1<<16, /* IO_0 direct, 0=In/1=Out */ 3018c2ecf20Sopenharmony_ci 3028c2ecf20Sopenharmony_ci GP_IO_9 = 1<<9, /* IO_9 pin */ 3038c2ecf20Sopenharmony_ci GP_IO_8 = 1<<8, /* IO_8 pin */ 3048c2ecf20Sopenharmony_ci GP_IO_7 = 1<<7, /* IO_7 pin */ 3058c2ecf20Sopenharmony_ci GP_IO_6 = 1<<6, /* IO_6 pin */ 3068c2ecf20Sopenharmony_ci GP_IO_5 = 1<<5, /* IO_5 pin */ 3078c2ecf20Sopenharmony_ci GP_IO_4 = 1<<4, /* IO_4 pin */ 3088c2ecf20Sopenharmony_ci GP_IO_3 = 1<<3, /* IO_3 pin */ 3098c2ecf20Sopenharmony_ci GP_IO_2 = 1<<2, /* IO_2 pin */ 3108c2ecf20Sopenharmony_ci GP_IO_1 = 1<<1, /* IO_1 pin */ 3118c2ecf20Sopenharmony_ci GP_IO_0 = 1<<0, /* IO_0 pin */ 3128c2ecf20Sopenharmony_ci}; 3138c2ecf20Sopenharmony_ci 3148c2ecf20Sopenharmony_ci/* Descriptor Bit Definition */ 3158c2ecf20Sopenharmony_ci/* TxCtrl Transmit Buffer Control Field */ 3168c2ecf20Sopenharmony_ci/* RxCtrl Receive Buffer Control Field */ 3178c2ecf20Sopenharmony_cienum { 3188c2ecf20Sopenharmony_ci BMU_OWN = 1<<31, /* OWN bit: 0=host/1=BMU */ 3198c2ecf20Sopenharmony_ci BMU_STF = 1<<30, /* Start of Frame */ 3208c2ecf20Sopenharmony_ci BMU_EOF = 1<<29, /* End of Frame */ 3218c2ecf20Sopenharmony_ci BMU_IRQ_EOB = 1<<28, /* Req "End of Buffer" IRQ */ 3228c2ecf20Sopenharmony_ci BMU_IRQ_EOF = 1<<27, /* Req "End of Frame" IRQ */ 3238c2ecf20Sopenharmony_ci /* TxCtrl specific bits */ 3248c2ecf20Sopenharmony_ci BMU_STFWD = 1<<26, /* (Tx) Store & Forward Frame */ 3258c2ecf20Sopenharmony_ci BMU_NO_FCS = 1<<25, /* (Tx) Disable MAC FCS (CRC) generation */ 3268c2ecf20Sopenharmony_ci BMU_SW = 1<<24, /* (Tx) 1 bit res. for SW use */ 3278c2ecf20Sopenharmony_ci /* RxCtrl specific bits */ 3288c2ecf20Sopenharmony_ci BMU_DEV_0 = 1<<26, /* (Rx) Transfer data to Dev0 */ 3298c2ecf20Sopenharmony_ci BMU_STAT_VAL = 1<<25, /* (Rx) Rx Status Valid */ 3308c2ecf20Sopenharmony_ci BMU_TIST_VAL = 1<<24, /* (Rx) Rx TimeStamp Valid */ 3318c2ecf20Sopenharmony_ci /* Bit 23..16: BMU Check Opcodes */ 3328c2ecf20Sopenharmony_ci BMU_CHECK = 0x55<<16, /* Default BMU check */ 3338c2ecf20Sopenharmony_ci BMU_TCP_CHECK = 0x56<<16, /* Descr with TCP ext */ 3348c2ecf20Sopenharmony_ci BMU_UDP_CHECK = 0x57<<16, /* Descr with UDP ext (YUKON only) */ 3358c2ecf20Sopenharmony_ci BMU_BBC = 0xffffL, /* Bit 15.. 0: Buffer Byte Counter */ 3368c2ecf20Sopenharmony_ci}; 3378c2ecf20Sopenharmony_ci 3388c2ecf20Sopenharmony_ci/* B2_BSC_CTRL 8 bit Blink Source Counter Control */ 3398c2ecf20Sopenharmony_cienum { 3408c2ecf20Sopenharmony_ci BSC_START = 1<<1, /* Start Blink Source Counter */ 3418c2ecf20Sopenharmony_ci BSC_STOP = 1<<0, /* Stop Blink Source Counter */ 3428c2ecf20Sopenharmony_ci}; 3438c2ecf20Sopenharmony_ci 3448c2ecf20Sopenharmony_ci/* B2_BSC_STAT 8 bit Blink Source Counter Status */ 3458c2ecf20Sopenharmony_cienum { 3468c2ecf20Sopenharmony_ci BSC_SRC = 1<<0, /* Blink Source, 0=Off / 1=On */ 3478c2ecf20Sopenharmony_ci}; 3488c2ecf20Sopenharmony_ci 3498c2ecf20Sopenharmony_ci/* B2_BSC_TST 16 bit Blink Source Counter Test Reg */ 3508c2ecf20Sopenharmony_cienum { 3518c2ecf20Sopenharmony_ci BSC_T_ON = 1<<2, /* Test mode on */ 3528c2ecf20Sopenharmony_ci BSC_T_OFF = 1<<1, /* Test mode off */ 3538c2ecf20Sopenharmony_ci BSC_T_STEP = 1<<0, /* Test step */ 3548c2ecf20Sopenharmony_ci}; 3558c2ecf20Sopenharmony_ci 3568c2ecf20Sopenharmony_ci/* B3_RAM_ADDR 32 bit RAM Address, to read or write */ 3578c2ecf20Sopenharmony_ci /* Bit 31..19: reserved */ 3588c2ecf20Sopenharmony_ci#define RAM_ADR_RAN 0x0007ffffL /* Bit 18.. 0: RAM Address Range */ 3598c2ecf20Sopenharmony_ci/* RAM Interface Registers */ 3608c2ecf20Sopenharmony_ci 3618c2ecf20Sopenharmony_ci/* B3_RI_CTRL 16 bit RAM Iface Control Register */ 3628c2ecf20Sopenharmony_cienum { 3638c2ecf20Sopenharmony_ci RI_CLR_RD_PERR = 1<<9, /* Clear IRQ RAM Read Parity Err */ 3648c2ecf20Sopenharmony_ci RI_CLR_WR_PERR = 1<<8, /* Clear IRQ RAM Write Parity Err*/ 3658c2ecf20Sopenharmony_ci 3668c2ecf20Sopenharmony_ci RI_RST_CLR = 1<<1, /* Clear RAM Interface Reset */ 3678c2ecf20Sopenharmony_ci RI_RST_SET = 1<<0, /* Set RAM Interface Reset */ 3688c2ecf20Sopenharmony_ci}; 3698c2ecf20Sopenharmony_ci 3708c2ecf20Sopenharmony_ci/* MAC Arbiter Registers */ 3718c2ecf20Sopenharmony_ci/* B3_MA_TO_CTRL 16 bit MAC Arbiter Timeout Ctrl Reg */ 3728c2ecf20Sopenharmony_cienum { 3738c2ecf20Sopenharmony_ci MA_FOE_ON = 1<<3, /* XMAC Fast Output Enable ON */ 3748c2ecf20Sopenharmony_ci MA_FOE_OFF = 1<<2, /* XMAC Fast Output Enable OFF */ 3758c2ecf20Sopenharmony_ci MA_RST_CLR = 1<<1, /* Clear MAC Arbiter Reset */ 3768c2ecf20Sopenharmony_ci MA_RST_SET = 1<<0, /* Set MAC Arbiter Reset */ 3778c2ecf20Sopenharmony_ci 3788c2ecf20Sopenharmony_ci}; 3798c2ecf20Sopenharmony_ci 3808c2ecf20Sopenharmony_ci/* Timeout values */ 3818c2ecf20Sopenharmony_ci#define SK_MAC_TO_53 72 /* MAC arbiter timeout */ 3828c2ecf20Sopenharmony_ci#define SK_PKT_TO_53 0x2000 /* Packet arbiter timeout */ 3838c2ecf20Sopenharmony_ci#define SK_PKT_TO_MAX 0xffff /* Maximum value */ 3848c2ecf20Sopenharmony_ci#define SK_RI_TO_53 36 /* RAM interface timeout */ 3858c2ecf20Sopenharmony_ci 3868c2ecf20Sopenharmony_ci/* Packet Arbiter Registers */ 3878c2ecf20Sopenharmony_ci/* B3_PA_CTRL 16 bit Packet Arbiter Ctrl Register */ 3888c2ecf20Sopenharmony_cienum { 3898c2ecf20Sopenharmony_ci PA_CLR_TO_TX2 = 1<<13,/* Clear IRQ Packet Timeout TX2 */ 3908c2ecf20Sopenharmony_ci PA_CLR_TO_TX1 = 1<<12,/* Clear IRQ Packet Timeout TX1 */ 3918c2ecf20Sopenharmony_ci PA_CLR_TO_RX2 = 1<<11,/* Clear IRQ Packet Timeout RX2 */ 3928c2ecf20Sopenharmony_ci PA_CLR_TO_RX1 = 1<<10,/* Clear IRQ Packet Timeout RX1 */ 3938c2ecf20Sopenharmony_ci PA_ENA_TO_TX2 = 1<<9, /* Enable Timeout Timer TX2 */ 3948c2ecf20Sopenharmony_ci PA_DIS_TO_TX2 = 1<<8, /* Disable Timeout Timer TX2 */ 3958c2ecf20Sopenharmony_ci PA_ENA_TO_TX1 = 1<<7, /* Enable Timeout Timer TX1 */ 3968c2ecf20Sopenharmony_ci PA_DIS_TO_TX1 = 1<<6, /* Disable Timeout Timer TX1 */ 3978c2ecf20Sopenharmony_ci PA_ENA_TO_RX2 = 1<<5, /* Enable Timeout Timer RX2 */ 3988c2ecf20Sopenharmony_ci PA_DIS_TO_RX2 = 1<<4, /* Disable Timeout Timer RX2 */ 3998c2ecf20Sopenharmony_ci PA_ENA_TO_RX1 = 1<<3, /* Enable Timeout Timer RX1 */ 4008c2ecf20Sopenharmony_ci PA_DIS_TO_RX1 = 1<<2, /* Disable Timeout Timer RX1 */ 4018c2ecf20Sopenharmony_ci PA_RST_CLR = 1<<1, /* Clear MAC Arbiter Reset */ 4028c2ecf20Sopenharmony_ci PA_RST_SET = 1<<0, /* Set MAC Arbiter Reset */ 4038c2ecf20Sopenharmony_ci}; 4048c2ecf20Sopenharmony_ci 4058c2ecf20Sopenharmony_ci#define PA_ENA_TO_ALL (PA_ENA_TO_RX1 | PA_ENA_TO_RX2 |\ 4068c2ecf20Sopenharmony_ci PA_ENA_TO_TX1 | PA_ENA_TO_TX2) 4078c2ecf20Sopenharmony_ci 4088c2ecf20Sopenharmony_ci 4098c2ecf20Sopenharmony_ci/* Transmit Arbiter Registers MAC 1 and 2, use SK_REG() to access */ 4108c2ecf20Sopenharmony_ci/* TXA_ITI_INI 32 bit Tx Arb Interval Timer Init Val */ 4118c2ecf20Sopenharmony_ci/* TXA_ITI_VAL 32 bit Tx Arb Interval Timer Value */ 4128c2ecf20Sopenharmony_ci/* TXA_LIM_INI 32 bit Tx Arb Limit Counter Init Val */ 4138c2ecf20Sopenharmony_ci/* TXA_LIM_VAL 32 bit Tx Arb Limit Counter Value */ 4148c2ecf20Sopenharmony_ci 4158c2ecf20Sopenharmony_ci#define TXA_MAX_VAL 0x00ffffffUL /* Bit 23.. 0: Max TXA Timer/Cnt Val */ 4168c2ecf20Sopenharmony_ci 4178c2ecf20Sopenharmony_ci/* TXA_CTRL 8 bit Tx Arbiter Control Register */ 4188c2ecf20Sopenharmony_cienum { 4198c2ecf20Sopenharmony_ci TXA_ENA_FSYNC = 1<<7, /* Enable force of sync Tx queue */ 4208c2ecf20Sopenharmony_ci TXA_DIS_FSYNC = 1<<6, /* Disable force of sync Tx queue */ 4218c2ecf20Sopenharmony_ci TXA_ENA_ALLOC = 1<<5, /* Enable alloc of free bandwidth */ 4228c2ecf20Sopenharmony_ci TXA_DIS_ALLOC = 1<<4, /* Disable alloc of free bandwidth */ 4238c2ecf20Sopenharmony_ci TXA_START_RC = 1<<3, /* Start sync Rate Control */ 4248c2ecf20Sopenharmony_ci TXA_STOP_RC = 1<<2, /* Stop sync Rate Control */ 4258c2ecf20Sopenharmony_ci TXA_ENA_ARB = 1<<1, /* Enable Tx Arbiter */ 4268c2ecf20Sopenharmony_ci TXA_DIS_ARB = 1<<0, /* Disable Tx Arbiter */ 4278c2ecf20Sopenharmony_ci}; 4288c2ecf20Sopenharmony_ci 4298c2ecf20Sopenharmony_ci/* 4308c2ecf20Sopenharmony_ci * Bank 4 - 5 4318c2ecf20Sopenharmony_ci */ 4328c2ecf20Sopenharmony_ci/* Transmit Arbiter Registers MAC 1 and 2, use SK_REG() to access */ 4338c2ecf20Sopenharmony_cienum { 4348c2ecf20Sopenharmony_ci TXA_ITI_INI = 0x0200,/* 32 bit Tx Arb Interval Timer Init Val*/ 4358c2ecf20Sopenharmony_ci TXA_ITI_VAL = 0x0204,/* 32 bit Tx Arb Interval Timer Value */ 4368c2ecf20Sopenharmony_ci TXA_LIM_INI = 0x0208,/* 32 bit Tx Arb Limit Counter Init Val */ 4378c2ecf20Sopenharmony_ci TXA_LIM_VAL = 0x020c,/* 32 bit Tx Arb Limit Counter Value */ 4388c2ecf20Sopenharmony_ci TXA_CTRL = 0x0210,/* 8 bit Tx Arbiter Control Register */ 4398c2ecf20Sopenharmony_ci TXA_TEST = 0x0211,/* 8 bit Tx Arbiter Test Register */ 4408c2ecf20Sopenharmony_ci TXA_STAT = 0x0212,/* 8 bit Tx Arbiter Status Register */ 4418c2ecf20Sopenharmony_ci}; 4428c2ecf20Sopenharmony_ci 4438c2ecf20Sopenharmony_ci 4448c2ecf20Sopenharmony_cienum { 4458c2ecf20Sopenharmony_ci B6_EXT_REG = 0x0300,/* External registers (GENESIS only) */ 4468c2ecf20Sopenharmony_ci B7_CFG_SPC = 0x0380,/* copy of the Configuration register */ 4478c2ecf20Sopenharmony_ci B8_RQ1_REGS = 0x0400,/* Receive Queue 1 */ 4488c2ecf20Sopenharmony_ci B8_RQ2_REGS = 0x0480,/* Receive Queue 2 */ 4498c2ecf20Sopenharmony_ci B8_TS1_REGS = 0x0600,/* Transmit sync queue 1 */ 4508c2ecf20Sopenharmony_ci B8_TA1_REGS = 0x0680,/* Transmit async queue 1 */ 4518c2ecf20Sopenharmony_ci B8_TS2_REGS = 0x0700,/* Transmit sync queue 2 */ 4528c2ecf20Sopenharmony_ci B8_TA2_REGS = 0x0780,/* Transmit sync queue 2 */ 4538c2ecf20Sopenharmony_ci B16_RAM_REGS = 0x0800,/* RAM Buffer Registers */ 4548c2ecf20Sopenharmony_ci}; 4558c2ecf20Sopenharmony_ci 4568c2ecf20Sopenharmony_ci/* Queue Register Offsets, use Q_ADDR() to access */ 4578c2ecf20Sopenharmony_cienum { 4588c2ecf20Sopenharmony_ci B8_Q_REGS = 0x0400, /* base of Queue registers */ 4598c2ecf20Sopenharmony_ci Q_D = 0x00, /* 8*32 bit Current Descriptor */ 4608c2ecf20Sopenharmony_ci Q_DA_L = 0x20, /* 32 bit Current Descriptor Address Low dWord */ 4618c2ecf20Sopenharmony_ci Q_DA_H = 0x24, /* 32 bit Current Descriptor Address High dWord */ 4628c2ecf20Sopenharmony_ci Q_AC_L = 0x28, /* 32 bit Current Address Counter Low dWord */ 4638c2ecf20Sopenharmony_ci Q_AC_H = 0x2c, /* 32 bit Current Address Counter High dWord */ 4648c2ecf20Sopenharmony_ci Q_BC = 0x30, /* 32 bit Current Byte Counter */ 4658c2ecf20Sopenharmony_ci Q_CSR = 0x34, /* 32 bit BMU Control/Status Register */ 4668c2ecf20Sopenharmony_ci Q_F = 0x38, /* 32 bit Flag Register */ 4678c2ecf20Sopenharmony_ci Q_T1 = 0x3c, /* 32 bit Test Register 1 */ 4688c2ecf20Sopenharmony_ci Q_T1_TR = 0x3c, /* 8 bit Test Register 1 Transfer SM */ 4698c2ecf20Sopenharmony_ci Q_T1_WR = 0x3d, /* 8 bit Test Register 1 Write Descriptor SM */ 4708c2ecf20Sopenharmony_ci Q_T1_RD = 0x3e, /* 8 bit Test Register 1 Read Descriptor SM */ 4718c2ecf20Sopenharmony_ci Q_T1_SV = 0x3f, /* 8 bit Test Register 1 Supervisor SM */ 4728c2ecf20Sopenharmony_ci Q_T2 = 0x40, /* 32 bit Test Register 2 */ 4738c2ecf20Sopenharmony_ci Q_T3 = 0x44, /* 32 bit Test Register 3 */ 4748c2ecf20Sopenharmony_ci 4758c2ecf20Sopenharmony_ci}; 4768c2ecf20Sopenharmony_ci#define Q_ADDR(reg, offs) (B8_Q_REGS + (reg) + (offs)) 4778c2ecf20Sopenharmony_ci 4788c2ecf20Sopenharmony_ci/* RAM Buffer Register Offsets */ 4798c2ecf20Sopenharmony_cienum { 4808c2ecf20Sopenharmony_ci 4818c2ecf20Sopenharmony_ci RB_START= 0x00,/* 32 bit RAM Buffer Start Address */ 4828c2ecf20Sopenharmony_ci RB_END = 0x04,/* 32 bit RAM Buffer End Address */ 4838c2ecf20Sopenharmony_ci RB_WP = 0x08,/* 32 bit RAM Buffer Write Pointer */ 4848c2ecf20Sopenharmony_ci RB_RP = 0x0c,/* 32 bit RAM Buffer Read Pointer */ 4858c2ecf20Sopenharmony_ci RB_RX_UTPP= 0x10,/* 32 bit Rx Upper Threshold, Pause Packet */ 4868c2ecf20Sopenharmony_ci RB_RX_LTPP= 0x14,/* 32 bit Rx Lower Threshold, Pause Packet */ 4878c2ecf20Sopenharmony_ci RB_RX_UTHP= 0x18,/* 32 bit Rx Upper Threshold, High Prio */ 4888c2ecf20Sopenharmony_ci RB_RX_LTHP= 0x1c,/* 32 bit Rx Lower Threshold, High Prio */ 4898c2ecf20Sopenharmony_ci /* 0x10 - 0x1f: reserved at Tx RAM Buffer Registers */ 4908c2ecf20Sopenharmony_ci RB_PC = 0x20,/* 32 bit RAM Buffer Packet Counter */ 4918c2ecf20Sopenharmony_ci RB_LEV = 0x24,/* 32 bit RAM Buffer Level Register */ 4928c2ecf20Sopenharmony_ci RB_CTRL = 0x28,/* 32 bit RAM Buffer Control Register */ 4938c2ecf20Sopenharmony_ci RB_TST1 = 0x29,/* 8 bit RAM Buffer Test Register 1 */ 4948c2ecf20Sopenharmony_ci RB_TST2 = 0x2a,/* 8 bit RAM Buffer Test Register 2 */ 4958c2ecf20Sopenharmony_ci}; 4968c2ecf20Sopenharmony_ci 4978c2ecf20Sopenharmony_ci/* Receive and Transmit Queues */ 4988c2ecf20Sopenharmony_cienum { 4998c2ecf20Sopenharmony_ci Q_R1 = 0x0000, /* Receive Queue 1 */ 5008c2ecf20Sopenharmony_ci Q_R2 = 0x0080, /* Receive Queue 2 */ 5018c2ecf20Sopenharmony_ci Q_XS1 = 0x0200, /* Synchronous Transmit Queue 1 */ 5028c2ecf20Sopenharmony_ci Q_XA1 = 0x0280, /* Asynchronous Transmit Queue 1 */ 5038c2ecf20Sopenharmony_ci Q_XS2 = 0x0300, /* Synchronous Transmit Queue 2 */ 5048c2ecf20Sopenharmony_ci Q_XA2 = 0x0380, /* Asynchronous Transmit Queue 2 */ 5058c2ecf20Sopenharmony_ci}; 5068c2ecf20Sopenharmony_ci 5078c2ecf20Sopenharmony_ci/* Different MAC Types */ 5088c2ecf20Sopenharmony_cienum { 5098c2ecf20Sopenharmony_ci SK_MAC_XMAC = 0, /* Xaqti XMAC II */ 5108c2ecf20Sopenharmony_ci SK_MAC_GMAC = 1, /* Marvell GMAC */ 5118c2ecf20Sopenharmony_ci}; 5128c2ecf20Sopenharmony_ci 5138c2ecf20Sopenharmony_ci/* Different PHY Types */ 5148c2ecf20Sopenharmony_cienum { 5158c2ecf20Sopenharmony_ci SK_PHY_XMAC = 0,/* integrated in XMAC II */ 5168c2ecf20Sopenharmony_ci SK_PHY_BCOM = 1,/* Broadcom BCM5400 */ 5178c2ecf20Sopenharmony_ci SK_PHY_LONE = 2,/* Level One LXT1000 [not supported]*/ 5188c2ecf20Sopenharmony_ci SK_PHY_NAT = 3,/* National DP83891 [not supported] */ 5198c2ecf20Sopenharmony_ci SK_PHY_MARV_COPPER= 4,/* Marvell 88E1011S */ 5208c2ecf20Sopenharmony_ci SK_PHY_MARV_FIBER = 5,/* Marvell 88E1011S working on fiber */ 5218c2ecf20Sopenharmony_ci}; 5228c2ecf20Sopenharmony_ci 5238c2ecf20Sopenharmony_ci/* PHY addresses (bits 12..8 of PHY address reg) */ 5248c2ecf20Sopenharmony_cienum { 5258c2ecf20Sopenharmony_ci PHY_ADDR_XMAC = 0<<8, 5268c2ecf20Sopenharmony_ci PHY_ADDR_BCOM = 1<<8, 5278c2ecf20Sopenharmony_ci 5288c2ecf20Sopenharmony_ci/* GPHY address (bits 15..11 of SMI control reg) */ 5298c2ecf20Sopenharmony_ci PHY_ADDR_MARV = 0, 5308c2ecf20Sopenharmony_ci}; 5318c2ecf20Sopenharmony_ci 5328c2ecf20Sopenharmony_ci#define RB_ADDR(offs, queue) ((u16)B16_RAM_REGS + (u16)(queue) + (offs)) 5338c2ecf20Sopenharmony_ci 5348c2ecf20Sopenharmony_ci/* Receive MAC FIFO, Receive LED, and Link_Sync regs (GENESIS only) */ 5358c2ecf20Sopenharmony_cienum { 5368c2ecf20Sopenharmony_ci RX_MFF_EA = 0x0c00,/* 32 bit Receive MAC FIFO End Address */ 5378c2ecf20Sopenharmony_ci RX_MFF_WP = 0x0c04,/* 32 bit Receive MAC FIFO Write Pointer */ 5388c2ecf20Sopenharmony_ci 5398c2ecf20Sopenharmony_ci RX_MFF_RP = 0x0c0c,/* 32 bit Receive MAC FIFO Read Pointer */ 5408c2ecf20Sopenharmony_ci RX_MFF_PC = 0x0c10,/* 32 bit Receive MAC FIFO Packet Cnt */ 5418c2ecf20Sopenharmony_ci RX_MFF_LEV = 0x0c14,/* 32 bit Receive MAC FIFO Level */ 5428c2ecf20Sopenharmony_ci RX_MFF_CTRL1 = 0x0c18,/* 16 bit Receive MAC FIFO Control Reg 1*/ 5438c2ecf20Sopenharmony_ci RX_MFF_STAT_TO = 0x0c1a,/* 8 bit Receive MAC Status Timeout */ 5448c2ecf20Sopenharmony_ci RX_MFF_TIST_TO = 0x0c1b,/* 8 bit Receive MAC Time Stamp Timeout */ 5458c2ecf20Sopenharmony_ci RX_MFF_CTRL2 = 0x0c1c,/* 8 bit Receive MAC FIFO Control Reg 2*/ 5468c2ecf20Sopenharmony_ci RX_MFF_TST1 = 0x0c1d,/* 8 bit Receive MAC FIFO Test Reg 1 */ 5478c2ecf20Sopenharmony_ci RX_MFF_TST2 = 0x0c1e,/* 8 bit Receive MAC FIFO Test Reg 2 */ 5488c2ecf20Sopenharmony_ci 5498c2ecf20Sopenharmony_ci RX_LED_INI = 0x0c20,/* 32 bit Receive LED Cnt Init Value */ 5508c2ecf20Sopenharmony_ci RX_LED_VAL = 0x0c24,/* 32 bit Receive LED Cnt Current Value */ 5518c2ecf20Sopenharmony_ci RX_LED_CTRL = 0x0c28,/* 8 bit Receive LED Cnt Control Reg */ 5528c2ecf20Sopenharmony_ci RX_LED_TST = 0x0c29,/* 8 bit Receive LED Cnt Test Register */ 5538c2ecf20Sopenharmony_ci 5548c2ecf20Sopenharmony_ci LNK_SYNC_INI = 0x0c30,/* 32 bit Link Sync Cnt Init Value */ 5558c2ecf20Sopenharmony_ci LNK_SYNC_VAL = 0x0c34,/* 32 bit Link Sync Cnt Current Value */ 5568c2ecf20Sopenharmony_ci LNK_SYNC_CTRL = 0x0c38,/* 8 bit Link Sync Cnt Control Register */ 5578c2ecf20Sopenharmony_ci LNK_SYNC_TST = 0x0c39,/* 8 bit Link Sync Cnt Test Register */ 5588c2ecf20Sopenharmony_ci LNK_LED_REG = 0x0c3c,/* 8 bit Link LED Register */ 5598c2ecf20Sopenharmony_ci}; 5608c2ecf20Sopenharmony_ci 5618c2ecf20Sopenharmony_ci/* Receive and Transmit MAC FIFO Registers (GENESIS only) */ 5628c2ecf20Sopenharmony_ci/* RX_MFF_CTRL1 16 bit Receive MAC FIFO Control Reg 1 */ 5638c2ecf20Sopenharmony_cienum { 5648c2ecf20Sopenharmony_ci MFF_ENA_RDY_PAT = 1<<13, /* Enable Ready Patch */ 5658c2ecf20Sopenharmony_ci MFF_DIS_RDY_PAT = 1<<12, /* Disable Ready Patch */ 5668c2ecf20Sopenharmony_ci MFF_ENA_TIM_PAT = 1<<11, /* Enable Timing Patch */ 5678c2ecf20Sopenharmony_ci MFF_DIS_TIM_PAT = 1<<10, /* Disable Timing Patch */ 5688c2ecf20Sopenharmony_ci MFF_ENA_ALM_FUL = 1<<9, /* Enable AlmostFull Sign */ 5698c2ecf20Sopenharmony_ci MFF_DIS_ALM_FUL = 1<<8, /* Disable AlmostFull Sign */ 5708c2ecf20Sopenharmony_ci MFF_ENA_PAUSE = 1<<7, /* Enable Pause Signaling */ 5718c2ecf20Sopenharmony_ci MFF_DIS_PAUSE = 1<<6, /* Disable Pause Signaling */ 5728c2ecf20Sopenharmony_ci MFF_ENA_FLUSH = 1<<5, /* Enable Frame Flushing */ 5738c2ecf20Sopenharmony_ci MFF_DIS_FLUSH = 1<<4, /* Disable Frame Flushing */ 5748c2ecf20Sopenharmony_ci MFF_ENA_TIST = 1<<3, /* Enable Time Stamp Gener */ 5758c2ecf20Sopenharmony_ci MFF_DIS_TIST = 1<<2, /* Disable Time Stamp Gener */ 5768c2ecf20Sopenharmony_ci MFF_CLR_INTIST = 1<<1, /* Clear IRQ No Time Stamp */ 5778c2ecf20Sopenharmony_ci MFF_CLR_INSTAT = 1<<0, /* Clear IRQ No Status */ 5788c2ecf20Sopenharmony_ci MFF_RX_CTRL_DEF = MFF_ENA_TIM_PAT, 5798c2ecf20Sopenharmony_ci}; 5808c2ecf20Sopenharmony_ci 5818c2ecf20Sopenharmony_ci/* TX_MFF_CTRL1 16 bit Transmit MAC FIFO Control Reg 1 */ 5828c2ecf20Sopenharmony_cienum { 5838c2ecf20Sopenharmony_ci MFF_CLR_PERR = 1<<15, /* Clear Parity Error IRQ */ 5848c2ecf20Sopenharmony_ci 5858c2ecf20Sopenharmony_ci MFF_ENA_PKT_REC = 1<<13, /* Enable Packet Recovery */ 5868c2ecf20Sopenharmony_ci MFF_DIS_PKT_REC = 1<<12, /* Disable Packet Recovery */ 5878c2ecf20Sopenharmony_ci 5888c2ecf20Sopenharmony_ci MFF_ENA_W4E = 1<<7, /* Enable Wait for Empty */ 5898c2ecf20Sopenharmony_ci MFF_DIS_W4E = 1<<6, /* Disable Wait for Empty */ 5908c2ecf20Sopenharmony_ci 5918c2ecf20Sopenharmony_ci MFF_ENA_LOOPB = 1<<3, /* Enable Loopback */ 5928c2ecf20Sopenharmony_ci MFF_DIS_LOOPB = 1<<2, /* Disable Loopback */ 5938c2ecf20Sopenharmony_ci MFF_CLR_MAC_RST = 1<<1, /* Clear XMAC Reset */ 5948c2ecf20Sopenharmony_ci MFF_SET_MAC_RST = 1<<0, /* Set XMAC Reset */ 5958c2ecf20Sopenharmony_ci 5968c2ecf20Sopenharmony_ci MFF_TX_CTRL_DEF = MFF_ENA_PKT_REC | (u16) MFF_ENA_TIM_PAT | MFF_ENA_FLUSH, 5978c2ecf20Sopenharmony_ci}; 5988c2ecf20Sopenharmony_ci 5998c2ecf20Sopenharmony_ci 6008c2ecf20Sopenharmony_ci/* RX_MFF_TST2 8 bit Receive MAC FIFO Test Register 2 */ 6018c2ecf20Sopenharmony_ci/* TX_MFF_TST2 8 bit Transmit MAC FIFO Test Register 2 */ 6028c2ecf20Sopenharmony_cienum { 6038c2ecf20Sopenharmony_ci MFF_WSP_T_ON = 1<<6, /* Tx: Write Shadow Ptr TestOn */ 6048c2ecf20Sopenharmony_ci MFF_WSP_T_OFF = 1<<5, /* Tx: Write Shadow Ptr TstOff */ 6058c2ecf20Sopenharmony_ci MFF_WSP_INC = 1<<4, /* Tx: Write Shadow Ptr Increment */ 6068c2ecf20Sopenharmony_ci MFF_PC_DEC = 1<<3, /* Packet Counter Decrement */ 6078c2ecf20Sopenharmony_ci MFF_PC_T_ON = 1<<2, /* Packet Counter Test On */ 6088c2ecf20Sopenharmony_ci MFF_PC_T_OFF = 1<<1, /* Packet Counter Test Off */ 6098c2ecf20Sopenharmony_ci MFF_PC_INC = 1<<0, /* Packet Counter Increment */ 6108c2ecf20Sopenharmony_ci}; 6118c2ecf20Sopenharmony_ci 6128c2ecf20Sopenharmony_ci/* RX_MFF_TST1 8 bit Receive MAC FIFO Test Register 1 */ 6138c2ecf20Sopenharmony_ci/* TX_MFF_TST1 8 bit Transmit MAC FIFO Test Register 1 */ 6148c2ecf20Sopenharmony_cienum { 6158c2ecf20Sopenharmony_ci MFF_WP_T_ON = 1<<6, /* Write Pointer Test On */ 6168c2ecf20Sopenharmony_ci MFF_WP_T_OFF = 1<<5, /* Write Pointer Test Off */ 6178c2ecf20Sopenharmony_ci MFF_WP_INC = 1<<4, /* Write Pointer Increm */ 6188c2ecf20Sopenharmony_ci 6198c2ecf20Sopenharmony_ci MFF_RP_T_ON = 1<<2, /* Read Pointer Test On */ 6208c2ecf20Sopenharmony_ci MFF_RP_T_OFF = 1<<1, /* Read Pointer Test Off */ 6218c2ecf20Sopenharmony_ci MFF_RP_DEC = 1<<0, /* Read Pointer Decrement */ 6228c2ecf20Sopenharmony_ci}; 6238c2ecf20Sopenharmony_ci 6248c2ecf20Sopenharmony_ci/* RX_MFF_CTRL2 8 bit Receive MAC FIFO Control Reg 2 */ 6258c2ecf20Sopenharmony_ci/* TX_MFF_CTRL2 8 bit Transmit MAC FIFO Control Reg 2 */ 6268c2ecf20Sopenharmony_cienum { 6278c2ecf20Sopenharmony_ci MFF_ENA_OP_MD = 1<<3, /* Enable Operation Mode */ 6288c2ecf20Sopenharmony_ci MFF_DIS_OP_MD = 1<<2, /* Disable Operation Mode */ 6298c2ecf20Sopenharmony_ci MFF_RST_CLR = 1<<1, /* Clear MAC FIFO Reset */ 6308c2ecf20Sopenharmony_ci MFF_RST_SET = 1<<0, /* Set MAC FIFO Reset */ 6318c2ecf20Sopenharmony_ci}; 6328c2ecf20Sopenharmony_ci 6338c2ecf20Sopenharmony_ci 6348c2ecf20Sopenharmony_ci/* Link LED Counter Registers (GENESIS only) */ 6358c2ecf20Sopenharmony_ci 6368c2ecf20Sopenharmony_ci/* RX_LED_CTRL 8 bit Receive LED Cnt Control Reg */ 6378c2ecf20Sopenharmony_ci/* TX_LED_CTRL 8 bit Transmit LED Cnt Control Reg */ 6388c2ecf20Sopenharmony_ci/* LNK_SYNC_CTRL 8 bit Link Sync Cnt Control Register */ 6398c2ecf20Sopenharmony_cienum { 6408c2ecf20Sopenharmony_ci LED_START = 1<<2, /* Start Timer */ 6418c2ecf20Sopenharmony_ci LED_STOP = 1<<1, /* Stop Timer */ 6428c2ecf20Sopenharmony_ci LED_STATE = 1<<0, /* Rx/Tx: LED State, 1=LED on */ 6438c2ecf20Sopenharmony_ci}; 6448c2ecf20Sopenharmony_ci 6458c2ecf20Sopenharmony_ci/* RX_LED_TST 8 bit Receive LED Cnt Test Register */ 6468c2ecf20Sopenharmony_ci/* TX_LED_TST 8 bit Transmit LED Cnt Test Register */ 6478c2ecf20Sopenharmony_ci/* LNK_SYNC_TST 8 bit Link Sync Cnt Test Register */ 6488c2ecf20Sopenharmony_cienum { 6498c2ecf20Sopenharmony_ci LED_T_ON = 1<<2, /* LED Counter Test mode On */ 6508c2ecf20Sopenharmony_ci LED_T_OFF = 1<<1, /* LED Counter Test mode Off */ 6518c2ecf20Sopenharmony_ci LED_T_STEP = 1<<0, /* LED Counter Step */ 6528c2ecf20Sopenharmony_ci}; 6538c2ecf20Sopenharmony_ci 6548c2ecf20Sopenharmony_ci/* LNK_LED_REG 8 bit Link LED Register */ 6558c2ecf20Sopenharmony_cienum { 6568c2ecf20Sopenharmony_ci LED_BLK_ON = 1<<5, /* Link LED Blinking On */ 6578c2ecf20Sopenharmony_ci LED_BLK_OFF = 1<<4, /* Link LED Blinking Off */ 6588c2ecf20Sopenharmony_ci LED_SYNC_ON = 1<<3, /* Use Sync Wire to switch LED */ 6598c2ecf20Sopenharmony_ci LED_SYNC_OFF = 1<<2, /* Disable Sync Wire Input */ 6608c2ecf20Sopenharmony_ci LED_REG_ON = 1<<1, /* switch LED on */ 6618c2ecf20Sopenharmony_ci LED_REG_OFF = 1<<0, /* switch LED off */ 6628c2ecf20Sopenharmony_ci}; 6638c2ecf20Sopenharmony_ci 6648c2ecf20Sopenharmony_ci/* Receive GMAC FIFO (YUKON) */ 6658c2ecf20Sopenharmony_cienum { 6668c2ecf20Sopenharmony_ci RX_GMF_EA = 0x0c40,/* 32 bit Rx GMAC FIFO End Address */ 6678c2ecf20Sopenharmony_ci RX_GMF_AF_THR = 0x0c44,/* 32 bit Rx GMAC FIFO Almost Full Thresh. */ 6688c2ecf20Sopenharmony_ci RX_GMF_CTRL_T = 0x0c48,/* 32 bit Rx GMAC FIFO Control/Test */ 6698c2ecf20Sopenharmony_ci RX_GMF_FL_MSK = 0x0c4c,/* 32 bit Rx GMAC FIFO Flush Mask */ 6708c2ecf20Sopenharmony_ci RX_GMF_FL_THR = 0x0c50,/* 32 bit Rx GMAC FIFO Flush Threshold */ 6718c2ecf20Sopenharmony_ci RX_GMF_WP = 0x0c60,/* 32 bit Rx GMAC FIFO Write Pointer */ 6728c2ecf20Sopenharmony_ci RX_GMF_WLEV = 0x0c68,/* 32 bit Rx GMAC FIFO Write Level */ 6738c2ecf20Sopenharmony_ci RX_GMF_RP = 0x0c70,/* 32 bit Rx GMAC FIFO Read Pointer */ 6748c2ecf20Sopenharmony_ci RX_GMF_RLEV = 0x0c78,/* 32 bit Rx GMAC FIFO Read Level */ 6758c2ecf20Sopenharmony_ci}; 6768c2ecf20Sopenharmony_ci 6778c2ecf20Sopenharmony_ci 6788c2ecf20Sopenharmony_ci/* TXA_TEST 8 bit Tx Arbiter Test Register */ 6798c2ecf20Sopenharmony_cienum { 6808c2ecf20Sopenharmony_ci TXA_INT_T_ON = 1<<5, /* Tx Arb Interval Timer Test On */ 6818c2ecf20Sopenharmony_ci TXA_INT_T_OFF = 1<<4, /* Tx Arb Interval Timer Test Off */ 6828c2ecf20Sopenharmony_ci TXA_INT_T_STEP = 1<<3, /* Tx Arb Interval Timer Step */ 6838c2ecf20Sopenharmony_ci TXA_LIM_T_ON = 1<<2, /* Tx Arb Limit Timer Test On */ 6848c2ecf20Sopenharmony_ci TXA_LIM_T_OFF = 1<<1, /* Tx Arb Limit Timer Test Off */ 6858c2ecf20Sopenharmony_ci TXA_LIM_T_STEP = 1<<0, /* Tx Arb Limit Timer Step */ 6868c2ecf20Sopenharmony_ci}; 6878c2ecf20Sopenharmony_ci 6888c2ecf20Sopenharmony_ci/* TXA_STAT 8 bit Tx Arbiter Status Register */ 6898c2ecf20Sopenharmony_cienum { 6908c2ecf20Sopenharmony_ci TXA_PRIO_XS = 1<<0, /* sync queue has prio to send */ 6918c2ecf20Sopenharmony_ci}; 6928c2ecf20Sopenharmony_ci 6938c2ecf20Sopenharmony_ci 6948c2ecf20Sopenharmony_ci/* Q_BC 32 bit Current Byte Counter */ 6958c2ecf20Sopenharmony_ci 6968c2ecf20Sopenharmony_ci/* BMU Control Status Registers */ 6978c2ecf20Sopenharmony_ci/* B0_R1_CSR 32 bit BMU Ctrl/Stat Rx Queue 1 */ 6988c2ecf20Sopenharmony_ci/* B0_R2_CSR 32 bit BMU Ctrl/Stat Rx Queue 2 */ 6998c2ecf20Sopenharmony_ci/* B0_XA1_CSR 32 bit BMU Ctrl/Stat Sync Tx Queue 1 */ 7008c2ecf20Sopenharmony_ci/* B0_XS1_CSR 32 bit BMU Ctrl/Stat Async Tx Queue 1 */ 7018c2ecf20Sopenharmony_ci/* B0_XA2_CSR 32 bit BMU Ctrl/Stat Sync Tx Queue 2 */ 7028c2ecf20Sopenharmony_ci/* B0_XS2_CSR 32 bit BMU Ctrl/Stat Async Tx Queue 2 */ 7038c2ecf20Sopenharmony_ci/* Q_CSR 32 bit BMU Control/Status Register */ 7048c2ecf20Sopenharmony_ci 7058c2ecf20Sopenharmony_cienum { 7068c2ecf20Sopenharmony_ci CSR_SV_IDLE = 1<<24, /* BMU SM Idle */ 7078c2ecf20Sopenharmony_ci 7088c2ecf20Sopenharmony_ci CSR_DESC_CLR = 1<<21, /* Clear Reset for Descr */ 7098c2ecf20Sopenharmony_ci CSR_DESC_SET = 1<<20, /* Set Reset for Descr */ 7108c2ecf20Sopenharmony_ci CSR_FIFO_CLR = 1<<19, /* Clear Reset for FIFO */ 7118c2ecf20Sopenharmony_ci CSR_FIFO_SET = 1<<18, /* Set Reset for FIFO */ 7128c2ecf20Sopenharmony_ci CSR_HPI_RUN = 1<<17, /* Release HPI SM */ 7138c2ecf20Sopenharmony_ci CSR_HPI_RST = 1<<16, /* Reset HPI SM to Idle */ 7148c2ecf20Sopenharmony_ci CSR_SV_RUN = 1<<15, /* Release Supervisor SM */ 7158c2ecf20Sopenharmony_ci CSR_SV_RST = 1<<14, /* Reset Supervisor SM */ 7168c2ecf20Sopenharmony_ci CSR_DREAD_RUN = 1<<13, /* Release Descr Read SM */ 7178c2ecf20Sopenharmony_ci CSR_DREAD_RST = 1<<12, /* Reset Descr Read SM */ 7188c2ecf20Sopenharmony_ci CSR_DWRITE_RUN = 1<<11, /* Release Descr Write SM */ 7198c2ecf20Sopenharmony_ci CSR_DWRITE_RST = 1<<10, /* Reset Descr Write SM */ 7208c2ecf20Sopenharmony_ci CSR_TRANS_RUN = 1<<9, /* Release Transfer SM */ 7218c2ecf20Sopenharmony_ci CSR_TRANS_RST = 1<<8, /* Reset Transfer SM */ 7228c2ecf20Sopenharmony_ci CSR_ENA_POL = 1<<7, /* Enable Descr Polling */ 7238c2ecf20Sopenharmony_ci CSR_DIS_POL = 1<<6, /* Disable Descr Polling */ 7248c2ecf20Sopenharmony_ci CSR_STOP = 1<<5, /* Stop Rx/Tx Queue */ 7258c2ecf20Sopenharmony_ci CSR_START = 1<<4, /* Start Rx/Tx Queue */ 7268c2ecf20Sopenharmony_ci CSR_IRQ_CL_P = 1<<3, /* (Rx) Clear Parity IRQ */ 7278c2ecf20Sopenharmony_ci CSR_IRQ_CL_B = 1<<2, /* Clear EOB IRQ */ 7288c2ecf20Sopenharmony_ci CSR_IRQ_CL_F = 1<<1, /* Clear EOF IRQ */ 7298c2ecf20Sopenharmony_ci CSR_IRQ_CL_C = 1<<0, /* Clear ERR IRQ */ 7308c2ecf20Sopenharmony_ci}; 7318c2ecf20Sopenharmony_ci 7328c2ecf20Sopenharmony_ci#define CSR_SET_RESET (CSR_DESC_SET | CSR_FIFO_SET | CSR_HPI_RST |\ 7338c2ecf20Sopenharmony_ci CSR_SV_RST | CSR_DREAD_RST | CSR_DWRITE_RST |\ 7348c2ecf20Sopenharmony_ci CSR_TRANS_RST) 7358c2ecf20Sopenharmony_ci#define CSR_CLR_RESET (CSR_DESC_CLR | CSR_FIFO_CLR | CSR_HPI_RUN |\ 7368c2ecf20Sopenharmony_ci CSR_SV_RUN | CSR_DREAD_RUN | CSR_DWRITE_RUN |\ 7378c2ecf20Sopenharmony_ci CSR_TRANS_RUN) 7388c2ecf20Sopenharmony_ci 7398c2ecf20Sopenharmony_ci/* Q_F 32 bit Flag Register */ 7408c2ecf20Sopenharmony_cienum { 7418c2ecf20Sopenharmony_ci F_ALM_FULL = 1<<27, /* Rx FIFO: almost full */ 7428c2ecf20Sopenharmony_ci F_EMPTY = 1<<27, /* Tx FIFO: empty flag */ 7438c2ecf20Sopenharmony_ci F_FIFO_EOF = 1<<26, /* Tag (EOF Flag) bit in FIFO */ 7448c2ecf20Sopenharmony_ci F_WM_REACHED = 1<<25, /* Watermark reached */ 7458c2ecf20Sopenharmony_ci 7468c2ecf20Sopenharmony_ci F_FIFO_LEVEL = 0x1fL<<16, /* Bit 23..16: # of Qwords in FIFO */ 7478c2ecf20Sopenharmony_ci F_WATER_MARK = 0x0007ffL, /* Bit 10.. 0: Watermark */ 7488c2ecf20Sopenharmony_ci}; 7498c2ecf20Sopenharmony_ci 7508c2ecf20Sopenharmony_ci/* RAM Buffer Register Offsets, use RB_ADDR(Queue, Offs) to access */ 7518c2ecf20Sopenharmony_ci/* RB_START 32 bit RAM Buffer Start Address */ 7528c2ecf20Sopenharmony_ci/* RB_END 32 bit RAM Buffer End Address */ 7538c2ecf20Sopenharmony_ci/* RB_WP 32 bit RAM Buffer Write Pointer */ 7548c2ecf20Sopenharmony_ci/* RB_RP 32 bit RAM Buffer Read Pointer */ 7558c2ecf20Sopenharmony_ci/* RB_RX_UTPP 32 bit Rx Upper Threshold, Pause Pack */ 7568c2ecf20Sopenharmony_ci/* RB_RX_LTPP 32 bit Rx Lower Threshold, Pause Pack */ 7578c2ecf20Sopenharmony_ci/* RB_RX_UTHP 32 bit Rx Upper Threshold, High Prio */ 7588c2ecf20Sopenharmony_ci/* RB_RX_LTHP 32 bit Rx Lower Threshold, High Prio */ 7598c2ecf20Sopenharmony_ci/* RB_PC 32 bit RAM Buffer Packet Counter */ 7608c2ecf20Sopenharmony_ci/* RB_LEV 32 bit RAM Buffer Level Register */ 7618c2ecf20Sopenharmony_ci 7628c2ecf20Sopenharmony_ci#define RB_MSK 0x0007ffff /* Bit 18.. 0: RAM Buffer Pointer Bits */ 7638c2ecf20Sopenharmony_ci/* RB_TST2 8 bit RAM Buffer Test Register 2 */ 7648c2ecf20Sopenharmony_ci/* RB_TST1 8 bit RAM Buffer Test Register 1 */ 7658c2ecf20Sopenharmony_ci 7668c2ecf20Sopenharmony_ci/* RB_CTRL 8 bit RAM Buffer Control Register */ 7678c2ecf20Sopenharmony_cienum { 7688c2ecf20Sopenharmony_ci RB_ENA_STFWD = 1<<5, /* Enable Store & Forward */ 7698c2ecf20Sopenharmony_ci RB_DIS_STFWD = 1<<4, /* Disable Store & Forward */ 7708c2ecf20Sopenharmony_ci RB_ENA_OP_MD = 1<<3, /* Enable Operation Mode */ 7718c2ecf20Sopenharmony_ci RB_DIS_OP_MD = 1<<2, /* Disable Operation Mode */ 7728c2ecf20Sopenharmony_ci RB_RST_CLR = 1<<1, /* Clear RAM Buf STM Reset */ 7738c2ecf20Sopenharmony_ci RB_RST_SET = 1<<0, /* Set RAM Buf STM Reset */ 7748c2ecf20Sopenharmony_ci}; 7758c2ecf20Sopenharmony_ci 7768c2ecf20Sopenharmony_ci/* Transmit MAC FIFO and Transmit LED Registers (GENESIS only), */ 7778c2ecf20Sopenharmony_cienum { 7788c2ecf20Sopenharmony_ci TX_MFF_EA = 0x0d00,/* 32 bit Transmit MAC FIFO End Address */ 7798c2ecf20Sopenharmony_ci TX_MFF_WP = 0x0d04,/* 32 bit Transmit MAC FIFO WR Pointer */ 7808c2ecf20Sopenharmony_ci TX_MFF_WSP = 0x0d08,/* 32 bit Transmit MAC FIFO WR Shadow Ptr */ 7818c2ecf20Sopenharmony_ci TX_MFF_RP = 0x0d0c,/* 32 bit Transmit MAC FIFO RD Pointer */ 7828c2ecf20Sopenharmony_ci TX_MFF_PC = 0x0d10,/* 32 bit Transmit MAC FIFO Packet Cnt */ 7838c2ecf20Sopenharmony_ci TX_MFF_LEV = 0x0d14,/* 32 bit Transmit MAC FIFO Level */ 7848c2ecf20Sopenharmony_ci TX_MFF_CTRL1 = 0x0d18,/* 16 bit Transmit MAC FIFO Ctrl Reg 1 */ 7858c2ecf20Sopenharmony_ci TX_MFF_WAF = 0x0d1a,/* 8 bit Transmit MAC Wait after flush */ 7868c2ecf20Sopenharmony_ci 7878c2ecf20Sopenharmony_ci TX_MFF_CTRL2 = 0x0d1c,/* 8 bit Transmit MAC FIFO Ctrl Reg 2 */ 7888c2ecf20Sopenharmony_ci TX_MFF_TST1 = 0x0d1d,/* 8 bit Transmit MAC FIFO Test Reg 1 */ 7898c2ecf20Sopenharmony_ci TX_MFF_TST2 = 0x0d1e,/* 8 bit Transmit MAC FIFO Test Reg 2 */ 7908c2ecf20Sopenharmony_ci 7918c2ecf20Sopenharmony_ci TX_LED_INI = 0x0d20,/* 32 bit Transmit LED Cnt Init Value */ 7928c2ecf20Sopenharmony_ci TX_LED_VAL = 0x0d24,/* 32 bit Transmit LED Cnt Current Val */ 7938c2ecf20Sopenharmony_ci TX_LED_CTRL = 0x0d28,/* 8 bit Transmit LED Cnt Control Reg */ 7948c2ecf20Sopenharmony_ci TX_LED_TST = 0x0d29,/* 8 bit Transmit LED Cnt Test Reg */ 7958c2ecf20Sopenharmony_ci}; 7968c2ecf20Sopenharmony_ci 7978c2ecf20Sopenharmony_ci/* Counter and Timer constants, for a host clock of 62.5 MHz */ 7988c2ecf20Sopenharmony_ci#define SK_XMIT_DUR 0x002faf08UL /* 50 ms */ 7998c2ecf20Sopenharmony_ci#define SK_BLK_DUR 0x01dcd650UL /* 500 ms */ 8008c2ecf20Sopenharmony_ci 8018c2ecf20Sopenharmony_ci#define SK_DPOLL_DEF 0x00ee6b28UL /* 250 ms at 62.5 MHz */ 8028c2ecf20Sopenharmony_ci 8038c2ecf20Sopenharmony_ci#define SK_DPOLL_MAX 0x00ffffffUL /* 268 ms at 62.5 MHz */ 8048c2ecf20Sopenharmony_ci /* 215 ms at 78.12 MHz */ 8058c2ecf20Sopenharmony_ci 8068c2ecf20Sopenharmony_ci#define SK_FACT_62 100 /* is given in percent */ 8078c2ecf20Sopenharmony_ci#define SK_FACT_53 85 /* on GENESIS: 53.12 MHz */ 8088c2ecf20Sopenharmony_ci#define SK_FACT_78 125 /* on YUKON: 78.12 MHz */ 8098c2ecf20Sopenharmony_ci 8108c2ecf20Sopenharmony_ci 8118c2ecf20Sopenharmony_ci/* Transmit GMAC FIFO (YUKON only) */ 8128c2ecf20Sopenharmony_cienum { 8138c2ecf20Sopenharmony_ci TX_GMF_EA = 0x0d40,/* 32 bit Tx GMAC FIFO End Address */ 8148c2ecf20Sopenharmony_ci TX_GMF_AE_THR = 0x0d44,/* 32 bit Tx GMAC FIFO Almost Empty Thresh.*/ 8158c2ecf20Sopenharmony_ci TX_GMF_CTRL_T = 0x0d48,/* 32 bit Tx GMAC FIFO Control/Test */ 8168c2ecf20Sopenharmony_ci 8178c2ecf20Sopenharmony_ci TX_GMF_WP = 0x0d60,/* 32 bit Tx GMAC FIFO Write Pointer */ 8188c2ecf20Sopenharmony_ci TX_GMF_WSP = 0x0d64,/* 32 bit Tx GMAC FIFO Write Shadow Ptr. */ 8198c2ecf20Sopenharmony_ci TX_GMF_WLEV = 0x0d68,/* 32 bit Tx GMAC FIFO Write Level */ 8208c2ecf20Sopenharmony_ci 8218c2ecf20Sopenharmony_ci TX_GMF_RP = 0x0d70,/* 32 bit Tx GMAC FIFO Read Pointer */ 8228c2ecf20Sopenharmony_ci TX_GMF_RSTP = 0x0d74,/* 32 bit Tx GMAC FIFO Restart Pointer */ 8238c2ecf20Sopenharmony_ci TX_GMF_RLEV = 0x0d78,/* 32 bit Tx GMAC FIFO Read Level */ 8248c2ecf20Sopenharmony_ci 8258c2ecf20Sopenharmony_ci /* Descriptor Poll Timer Registers */ 8268c2ecf20Sopenharmony_ci B28_DPT_INI = 0x0e00,/* 24 bit Descriptor Poll Timer Init Val */ 8278c2ecf20Sopenharmony_ci B28_DPT_VAL = 0x0e04,/* 24 bit Descriptor Poll Timer Curr Val */ 8288c2ecf20Sopenharmony_ci B28_DPT_CTRL = 0x0e08,/* 8 bit Descriptor Poll Timer Ctrl Reg */ 8298c2ecf20Sopenharmony_ci 8308c2ecf20Sopenharmony_ci B28_DPT_TST = 0x0e0a,/* 8 bit Descriptor Poll Timer Test Reg */ 8318c2ecf20Sopenharmony_ci 8328c2ecf20Sopenharmony_ci /* Time Stamp Timer Registers (YUKON only) */ 8338c2ecf20Sopenharmony_ci GMAC_TI_ST_VAL = 0x0e14,/* 32 bit Time Stamp Timer Curr Val */ 8348c2ecf20Sopenharmony_ci GMAC_TI_ST_CTRL = 0x0e18,/* 8 bit Time Stamp Timer Ctrl Reg */ 8358c2ecf20Sopenharmony_ci GMAC_TI_ST_TST = 0x0e1a,/* 8 bit Time Stamp Timer Test Reg */ 8368c2ecf20Sopenharmony_ci}; 8378c2ecf20Sopenharmony_ci 8388c2ecf20Sopenharmony_ci 8398c2ecf20Sopenharmony_cienum { 8408c2ecf20Sopenharmony_ci LINKLED_OFF = 0x01, 8418c2ecf20Sopenharmony_ci LINKLED_ON = 0x02, 8428c2ecf20Sopenharmony_ci LINKLED_LINKSYNC_OFF = 0x04, 8438c2ecf20Sopenharmony_ci LINKLED_LINKSYNC_ON = 0x08, 8448c2ecf20Sopenharmony_ci LINKLED_BLINK_OFF = 0x10, 8458c2ecf20Sopenharmony_ci LINKLED_BLINK_ON = 0x20, 8468c2ecf20Sopenharmony_ci}; 8478c2ecf20Sopenharmony_ci 8488c2ecf20Sopenharmony_ci/* GMAC and GPHY Control Registers (YUKON only) */ 8498c2ecf20Sopenharmony_cienum { 8508c2ecf20Sopenharmony_ci GMAC_CTRL = 0x0f00,/* 32 bit GMAC Control Reg */ 8518c2ecf20Sopenharmony_ci GPHY_CTRL = 0x0f04,/* 32 bit GPHY Control Reg */ 8528c2ecf20Sopenharmony_ci GMAC_IRQ_SRC = 0x0f08,/* 8 bit GMAC Interrupt Source Reg */ 8538c2ecf20Sopenharmony_ci GMAC_IRQ_MSK = 0x0f0c,/* 8 bit GMAC Interrupt Mask Reg */ 8548c2ecf20Sopenharmony_ci GMAC_LINK_CTRL = 0x0f10,/* 16 bit Link Control Reg */ 8558c2ecf20Sopenharmony_ci 8568c2ecf20Sopenharmony_ci/* Wake-up Frame Pattern Match Control Registers (YUKON only) */ 8578c2ecf20Sopenharmony_ci 8588c2ecf20Sopenharmony_ci WOL_REG_OFFS = 0x20,/* HW-Bug: Address is + 0x20 against spec. */ 8598c2ecf20Sopenharmony_ci 8608c2ecf20Sopenharmony_ci WOL_CTRL_STAT = 0x0f20,/* 16 bit WOL Control/Status Reg */ 8618c2ecf20Sopenharmony_ci WOL_MATCH_CTL = 0x0f22,/* 8 bit WOL Match Control Reg */ 8628c2ecf20Sopenharmony_ci WOL_MATCH_RES = 0x0f23,/* 8 bit WOL Match Result Reg */ 8638c2ecf20Sopenharmony_ci WOL_MAC_ADDR = 0x0f24,/* 32 bit WOL MAC Address */ 8648c2ecf20Sopenharmony_ci WOL_PATT_RPTR = 0x0f2c,/* 8 bit WOL Pattern Read Pointer */ 8658c2ecf20Sopenharmony_ci 8668c2ecf20Sopenharmony_ci/* WOL Pattern Length Registers (YUKON only) */ 8678c2ecf20Sopenharmony_ci 8688c2ecf20Sopenharmony_ci WOL_PATT_LEN_LO = 0x0f30,/* 32 bit WOL Pattern Length 3..0 */ 8698c2ecf20Sopenharmony_ci WOL_PATT_LEN_HI = 0x0f34,/* 24 bit WOL Pattern Length 6..4 */ 8708c2ecf20Sopenharmony_ci 8718c2ecf20Sopenharmony_ci/* WOL Pattern Counter Registers (YUKON only) */ 8728c2ecf20Sopenharmony_ci 8738c2ecf20Sopenharmony_ci WOL_PATT_CNT_0 = 0x0f38,/* 32 bit WOL Pattern Counter 3..0 */ 8748c2ecf20Sopenharmony_ci WOL_PATT_CNT_4 = 0x0f3c,/* 24 bit WOL Pattern Counter 6..4 */ 8758c2ecf20Sopenharmony_ci}; 8768c2ecf20Sopenharmony_ci#define WOL_REGS(port, x) (x + (port)*0x80) 8778c2ecf20Sopenharmony_ci 8788c2ecf20Sopenharmony_cienum { 8798c2ecf20Sopenharmony_ci WOL_PATT_RAM_1 = 0x1000,/* WOL Pattern RAM Link 1 */ 8808c2ecf20Sopenharmony_ci WOL_PATT_RAM_2 = 0x1400,/* WOL Pattern RAM Link 2 */ 8818c2ecf20Sopenharmony_ci}; 8828c2ecf20Sopenharmony_ci#define WOL_PATT_RAM_BASE(port) (WOL_PATT_RAM_1 + (port)*0x400) 8838c2ecf20Sopenharmony_ci 8848c2ecf20Sopenharmony_cienum { 8858c2ecf20Sopenharmony_ci BASE_XMAC_1 = 0x2000,/* XMAC 1 registers */ 8868c2ecf20Sopenharmony_ci BASE_GMAC_1 = 0x2800,/* GMAC 1 registers */ 8878c2ecf20Sopenharmony_ci BASE_XMAC_2 = 0x3000,/* XMAC 2 registers */ 8888c2ecf20Sopenharmony_ci BASE_GMAC_2 = 0x3800,/* GMAC 2 registers */ 8898c2ecf20Sopenharmony_ci}; 8908c2ecf20Sopenharmony_ci 8918c2ecf20Sopenharmony_ci/* 8928c2ecf20Sopenharmony_ci * Receive Frame Status Encoding 8938c2ecf20Sopenharmony_ci */ 8948c2ecf20Sopenharmony_cienum { 8958c2ecf20Sopenharmony_ci XMR_FS_LEN = 0x3fff<<18, /* Bit 31..18: Rx Frame Length */ 8968c2ecf20Sopenharmony_ci XMR_FS_LEN_SHIFT = 18, 8978c2ecf20Sopenharmony_ci XMR_FS_2L_VLAN = 1<<17, /* Bit 17: tagged wh 2Lev VLAN ID*/ 8988c2ecf20Sopenharmony_ci XMR_FS_1_VLAN = 1<<16, /* Bit 16: tagged wh 1ev VLAN ID*/ 8998c2ecf20Sopenharmony_ci XMR_FS_BC = 1<<15, /* Bit 15: Broadcast Frame */ 9008c2ecf20Sopenharmony_ci XMR_FS_MC = 1<<14, /* Bit 14: Multicast Frame */ 9018c2ecf20Sopenharmony_ci XMR_FS_UC = 1<<13, /* Bit 13: Unicast Frame */ 9028c2ecf20Sopenharmony_ci 9038c2ecf20Sopenharmony_ci XMR_FS_BURST = 1<<11, /* Bit 11: Burst Mode */ 9048c2ecf20Sopenharmony_ci XMR_FS_CEX_ERR = 1<<10, /* Bit 10: Carrier Ext. Error */ 9058c2ecf20Sopenharmony_ci XMR_FS_802_3 = 1<<9, /* Bit 9: 802.3 Frame */ 9068c2ecf20Sopenharmony_ci XMR_FS_COL_ERR = 1<<8, /* Bit 8: Collision Error */ 9078c2ecf20Sopenharmony_ci XMR_FS_CAR_ERR = 1<<7, /* Bit 7: Carrier Event Error */ 9088c2ecf20Sopenharmony_ci XMR_FS_LEN_ERR = 1<<6, /* Bit 6: In-Range Length Error */ 9098c2ecf20Sopenharmony_ci XMR_FS_FRA_ERR = 1<<5, /* Bit 5: Framing Error */ 9108c2ecf20Sopenharmony_ci XMR_FS_RUNT = 1<<4, /* Bit 4: Runt Frame */ 9118c2ecf20Sopenharmony_ci XMR_FS_LNG_ERR = 1<<3, /* Bit 3: Giant (Jumbo) Frame */ 9128c2ecf20Sopenharmony_ci XMR_FS_FCS_ERR = 1<<2, /* Bit 2: Frame Check Sequ Err */ 9138c2ecf20Sopenharmony_ci XMR_FS_ERR = 1<<1, /* Bit 1: Frame Error */ 9148c2ecf20Sopenharmony_ci XMR_FS_MCTRL = 1<<0, /* Bit 0: MAC Control Packet */ 9158c2ecf20Sopenharmony_ci 9168c2ecf20Sopenharmony_ci/* 9178c2ecf20Sopenharmony_ci * XMR_FS_ERR will be set if 9188c2ecf20Sopenharmony_ci * XMR_FS_FCS_ERR, XMR_FS_LNG_ERR, XMR_FS_RUNT, 9198c2ecf20Sopenharmony_ci * XMR_FS_FRA_ERR, XMR_FS_LEN_ERR, or XMR_FS_CEX_ERR 9208c2ecf20Sopenharmony_ci * is set. XMR_FS_LNG_ERR and XMR_FS_LEN_ERR will issue 9218c2ecf20Sopenharmony_ci * XMR_FS_ERR unless the corresponding bit in the Receive Command 9228c2ecf20Sopenharmony_ci * Register is set. 9238c2ecf20Sopenharmony_ci */ 9248c2ecf20Sopenharmony_ci}; 9258c2ecf20Sopenharmony_ci 9268c2ecf20Sopenharmony_ci/* 9278c2ecf20Sopenharmony_ci,* XMAC-PHY Registers, indirect addressed over the XMAC 9288c2ecf20Sopenharmony_ci */ 9298c2ecf20Sopenharmony_cienum { 9308c2ecf20Sopenharmony_ci PHY_XMAC_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ 9318c2ecf20Sopenharmony_ci PHY_XMAC_STAT = 0x01,/* 16 bit r/w PHY Status Register */ 9328c2ecf20Sopenharmony_ci PHY_XMAC_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ 9338c2ecf20Sopenharmony_ci PHY_XMAC_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ 9348c2ecf20Sopenharmony_ci PHY_XMAC_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ 9358c2ecf20Sopenharmony_ci PHY_XMAC_AUNE_LP = 0x05,/* 16 bit r/o Link Partner Abi Reg */ 9368c2ecf20Sopenharmony_ci PHY_XMAC_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ 9378c2ecf20Sopenharmony_ci PHY_XMAC_NEPG = 0x07,/* 16 bit r/w Next Page Register */ 9388c2ecf20Sopenharmony_ci PHY_XMAC_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ 9398c2ecf20Sopenharmony_ci 9408c2ecf20Sopenharmony_ci PHY_XMAC_EXT_STAT = 0x0f,/* 16 bit r/o Ext Status Register */ 9418c2ecf20Sopenharmony_ci PHY_XMAC_RES_ABI = 0x10,/* 16 bit r/o PHY Resolved Ability */ 9428c2ecf20Sopenharmony_ci}; 9438c2ecf20Sopenharmony_ci/* 9448c2ecf20Sopenharmony_ci * Broadcom-PHY Registers, indirect addressed over XMAC 9458c2ecf20Sopenharmony_ci */ 9468c2ecf20Sopenharmony_cienum { 9478c2ecf20Sopenharmony_ci PHY_BCOM_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ 9488c2ecf20Sopenharmony_ci PHY_BCOM_STAT = 0x01,/* 16 bit r/o PHY Status Register */ 9498c2ecf20Sopenharmony_ci PHY_BCOM_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ 9508c2ecf20Sopenharmony_ci PHY_BCOM_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ 9518c2ecf20Sopenharmony_ci PHY_BCOM_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ 9528c2ecf20Sopenharmony_ci PHY_BCOM_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */ 9538c2ecf20Sopenharmony_ci PHY_BCOM_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ 9548c2ecf20Sopenharmony_ci PHY_BCOM_NEPG = 0x07,/* 16 bit r/w Next Page Register */ 9558c2ecf20Sopenharmony_ci PHY_BCOM_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ 9568c2ecf20Sopenharmony_ci /* Broadcom-specific registers */ 9578c2ecf20Sopenharmony_ci PHY_BCOM_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ 9588c2ecf20Sopenharmony_ci PHY_BCOM_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ 9598c2ecf20Sopenharmony_ci PHY_BCOM_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */ 9608c2ecf20Sopenharmony_ci PHY_BCOM_P_EXT_CTRL = 0x10,/* 16 bit r/w PHY Extended Ctrl Reg */ 9618c2ecf20Sopenharmony_ci PHY_BCOM_P_EXT_STAT = 0x11,/* 16 bit r/o PHY Extended Stat Reg */ 9628c2ecf20Sopenharmony_ci PHY_BCOM_RE_CTR = 0x12,/* 16 bit r/w Receive Error Counter */ 9638c2ecf20Sopenharmony_ci PHY_BCOM_FC_CTR = 0x13,/* 16 bit r/w False Carrier Sense Cnt */ 9648c2ecf20Sopenharmony_ci PHY_BCOM_RNO_CTR = 0x14,/* 16 bit r/w Receiver NOT_OK Cnt */ 9658c2ecf20Sopenharmony_ci 9668c2ecf20Sopenharmony_ci PHY_BCOM_AUX_CTRL = 0x18,/* 16 bit r/w Auxiliary Control Reg */ 9678c2ecf20Sopenharmony_ci PHY_BCOM_AUX_STAT = 0x19,/* 16 bit r/o Auxiliary Stat Summary */ 9688c2ecf20Sopenharmony_ci PHY_BCOM_INT_STAT = 0x1a,/* 16 bit r/o Interrupt Status Reg */ 9698c2ecf20Sopenharmony_ci PHY_BCOM_INT_MASK = 0x1b,/* 16 bit r/w Interrupt Mask Reg */ 9708c2ecf20Sopenharmony_ci}; 9718c2ecf20Sopenharmony_ci 9728c2ecf20Sopenharmony_ci/* 9738c2ecf20Sopenharmony_ci * Marvel-PHY Registers, indirect addressed over GMAC 9748c2ecf20Sopenharmony_ci */ 9758c2ecf20Sopenharmony_cienum { 9768c2ecf20Sopenharmony_ci PHY_MARV_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ 9778c2ecf20Sopenharmony_ci PHY_MARV_STAT = 0x01,/* 16 bit r/o PHY Status Register */ 9788c2ecf20Sopenharmony_ci PHY_MARV_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ 9798c2ecf20Sopenharmony_ci PHY_MARV_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ 9808c2ecf20Sopenharmony_ci PHY_MARV_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ 9818c2ecf20Sopenharmony_ci PHY_MARV_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */ 9828c2ecf20Sopenharmony_ci PHY_MARV_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ 9838c2ecf20Sopenharmony_ci PHY_MARV_NEPG = 0x07,/* 16 bit r/w Next Page Register */ 9848c2ecf20Sopenharmony_ci PHY_MARV_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ 9858c2ecf20Sopenharmony_ci /* Marvel-specific registers */ 9868c2ecf20Sopenharmony_ci PHY_MARV_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ 9878c2ecf20Sopenharmony_ci PHY_MARV_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ 9888c2ecf20Sopenharmony_ci PHY_MARV_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */ 9898c2ecf20Sopenharmony_ci PHY_MARV_PHY_CTRL = 0x10,/* 16 bit r/w PHY Specific Ctrl Reg */ 9908c2ecf20Sopenharmony_ci PHY_MARV_PHY_STAT = 0x11,/* 16 bit r/o PHY Specific Stat Reg */ 9918c2ecf20Sopenharmony_ci PHY_MARV_INT_MASK = 0x12,/* 16 bit r/w Interrupt Mask Reg */ 9928c2ecf20Sopenharmony_ci PHY_MARV_INT_STAT = 0x13,/* 16 bit r/o Interrupt Status Reg */ 9938c2ecf20Sopenharmony_ci PHY_MARV_EXT_CTRL = 0x14,/* 16 bit r/w Ext. PHY Specific Ctrl */ 9948c2ecf20Sopenharmony_ci PHY_MARV_RXE_CNT = 0x15,/* 16 bit r/w Receive Error Counter */ 9958c2ecf20Sopenharmony_ci PHY_MARV_EXT_ADR = 0x16,/* 16 bit r/w Ext. Ad. for Cable Diag. */ 9968c2ecf20Sopenharmony_ci PHY_MARV_PORT_IRQ = 0x17,/* 16 bit r/o Port 0 IRQ (88E1111 only) */ 9978c2ecf20Sopenharmony_ci PHY_MARV_LED_CTRL = 0x18,/* 16 bit r/w LED Control Reg */ 9988c2ecf20Sopenharmony_ci PHY_MARV_LED_OVER = 0x19,/* 16 bit r/w Manual LED Override Reg */ 9998c2ecf20Sopenharmony_ci PHY_MARV_EXT_CTRL_2 = 0x1a,/* 16 bit r/w Ext. PHY Specific Ctrl 2 */ 10008c2ecf20Sopenharmony_ci PHY_MARV_EXT_P_STAT = 0x1b,/* 16 bit r/w Ext. PHY Spec. Stat Reg */ 10018c2ecf20Sopenharmony_ci PHY_MARV_CABLE_DIAG = 0x1c,/* 16 bit r/o Cable Diagnostic Reg */ 10028c2ecf20Sopenharmony_ci PHY_MARV_PAGE_ADDR = 0x1d,/* 16 bit r/w Extended Page Address Reg */ 10038c2ecf20Sopenharmony_ci PHY_MARV_PAGE_DATA = 0x1e,/* 16 bit r/w Extended Page Data Reg */ 10048c2ecf20Sopenharmony_ci 10058c2ecf20Sopenharmony_ci/* for 10/100 Fast Ethernet PHY (88E3082 only) */ 10068c2ecf20Sopenharmony_ci PHY_MARV_FE_LED_PAR = 0x16,/* 16 bit r/w LED Parallel Select Reg. */ 10078c2ecf20Sopenharmony_ci PHY_MARV_FE_LED_SER = 0x17,/* 16 bit r/w LED Stream Select S. LED */ 10088c2ecf20Sopenharmony_ci PHY_MARV_FE_VCT_TX = 0x1a,/* 16 bit r/w VCT Reg. for TXP/N Pins */ 10098c2ecf20Sopenharmony_ci PHY_MARV_FE_VCT_RX = 0x1b,/* 16 bit r/o VCT Reg. for RXP/N Pins */ 10108c2ecf20Sopenharmony_ci PHY_MARV_FE_SPEC_2 = 0x1c,/* 16 bit r/w Specific Control Reg. 2 */ 10118c2ecf20Sopenharmony_ci}; 10128c2ecf20Sopenharmony_ci 10138c2ecf20Sopenharmony_cienum { 10148c2ecf20Sopenharmony_ci PHY_CT_RESET = 1<<15, /* Bit 15: (sc) clear all PHY related regs */ 10158c2ecf20Sopenharmony_ci PHY_CT_LOOP = 1<<14, /* Bit 14: enable Loopback over PHY */ 10168c2ecf20Sopenharmony_ci PHY_CT_SPS_LSB = 1<<13, /* Bit 13: Speed select, lower bit */ 10178c2ecf20Sopenharmony_ci PHY_CT_ANE = 1<<12, /* Bit 12: Auto-Negotiation Enabled */ 10188c2ecf20Sopenharmony_ci PHY_CT_PDOWN = 1<<11, /* Bit 11: Power Down Mode */ 10198c2ecf20Sopenharmony_ci PHY_CT_ISOL = 1<<10, /* Bit 10: Isolate Mode */ 10208c2ecf20Sopenharmony_ci PHY_CT_RE_CFG = 1<<9, /* Bit 9: (sc) Restart Auto-Negotiation */ 10218c2ecf20Sopenharmony_ci PHY_CT_DUP_MD = 1<<8, /* Bit 8: Duplex Mode */ 10228c2ecf20Sopenharmony_ci PHY_CT_COL_TST = 1<<7, /* Bit 7: Collision Test enabled */ 10238c2ecf20Sopenharmony_ci PHY_CT_SPS_MSB = 1<<6, /* Bit 6: Speed select, upper bit */ 10248c2ecf20Sopenharmony_ci}; 10258c2ecf20Sopenharmony_ci 10268c2ecf20Sopenharmony_cienum { 10278c2ecf20Sopenharmony_ci PHY_CT_SP1000 = PHY_CT_SPS_MSB, /* enable speed of 1000 Mbps */ 10288c2ecf20Sopenharmony_ci PHY_CT_SP100 = PHY_CT_SPS_LSB, /* enable speed of 100 Mbps */ 10298c2ecf20Sopenharmony_ci PHY_CT_SP10 = 0, /* enable speed of 10 Mbps */ 10308c2ecf20Sopenharmony_ci}; 10318c2ecf20Sopenharmony_ci 10328c2ecf20Sopenharmony_cienum { 10338c2ecf20Sopenharmony_ci PHY_ST_EXT_ST = 1<<8, /* Bit 8: Extended Status Present */ 10348c2ecf20Sopenharmony_ci 10358c2ecf20Sopenharmony_ci PHY_ST_PRE_SUP = 1<<6, /* Bit 6: Preamble Suppression */ 10368c2ecf20Sopenharmony_ci PHY_ST_AN_OVER = 1<<5, /* Bit 5: Auto-Negotiation Over */ 10378c2ecf20Sopenharmony_ci PHY_ST_REM_FLT = 1<<4, /* Bit 4: Remote Fault Condition Occurred */ 10388c2ecf20Sopenharmony_ci PHY_ST_AN_CAP = 1<<3, /* Bit 3: Auto-Negotiation Capability */ 10398c2ecf20Sopenharmony_ci PHY_ST_LSYNC = 1<<2, /* Bit 2: Link Synchronized */ 10408c2ecf20Sopenharmony_ci PHY_ST_JAB_DET = 1<<1, /* Bit 1: Jabber Detected */ 10418c2ecf20Sopenharmony_ci PHY_ST_EXT_REG = 1<<0, /* Bit 0: Extended Register available */ 10428c2ecf20Sopenharmony_ci}; 10438c2ecf20Sopenharmony_ci 10448c2ecf20Sopenharmony_cienum { 10458c2ecf20Sopenharmony_ci PHY_I1_OUI_MSK = 0x3f<<10, /* Bit 15..10: Organization Unique ID */ 10468c2ecf20Sopenharmony_ci PHY_I1_MOD_NUM = 0x3f<<4, /* Bit 9.. 4: Model Number */ 10478c2ecf20Sopenharmony_ci PHY_I1_REV_MSK = 0xf, /* Bit 3.. 0: Revision Number */ 10488c2ecf20Sopenharmony_ci}; 10498c2ecf20Sopenharmony_ci 10508c2ecf20Sopenharmony_ci/* different Broadcom PHY Ids */ 10518c2ecf20Sopenharmony_cienum { 10528c2ecf20Sopenharmony_ci PHY_BCOM_ID1_A1 = 0x6041, 10538c2ecf20Sopenharmony_ci PHY_BCOM_ID1_B2 = 0x6043, 10548c2ecf20Sopenharmony_ci PHY_BCOM_ID1_C0 = 0x6044, 10558c2ecf20Sopenharmony_ci PHY_BCOM_ID1_C5 = 0x6047, 10568c2ecf20Sopenharmony_ci}; 10578c2ecf20Sopenharmony_ci 10588c2ecf20Sopenharmony_ci/* different Marvell PHY Ids */ 10598c2ecf20Sopenharmony_cienum { 10608c2ecf20Sopenharmony_ci PHY_MARV_ID0_VAL= 0x0141, /* Marvell Unique Identifier */ 10618c2ecf20Sopenharmony_ci PHY_MARV_ID1_B0 = 0x0C23, /* Yukon (PHY 88E1011) */ 10628c2ecf20Sopenharmony_ci PHY_MARV_ID1_B2 = 0x0C25, /* Yukon-Plus (PHY 88E1011) */ 10638c2ecf20Sopenharmony_ci PHY_MARV_ID1_C2 = 0x0CC2, /* Yukon-EC (PHY 88E1111) */ 10648c2ecf20Sopenharmony_ci PHY_MARV_ID1_Y2 = 0x0C91, /* Yukon-2 (PHY 88E1112) */ 10658c2ecf20Sopenharmony_ci}; 10668c2ecf20Sopenharmony_ci 10678c2ecf20Sopenharmony_ci/* Advertisement register bits */ 10688c2ecf20Sopenharmony_cienum { 10698c2ecf20Sopenharmony_ci PHY_AN_NXT_PG = 1<<15, /* Bit 15: Request Next Page */ 10708c2ecf20Sopenharmony_ci PHY_AN_ACK = 1<<14, /* Bit 14: (ro) Acknowledge Received */ 10718c2ecf20Sopenharmony_ci PHY_AN_RF = 1<<13, /* Bit 13: Remote Fault Bits */ 10728c2ecf20Sopenharmony_ci 10738c2ecf20Sopenharmony_ci PHY_AN_PAUSE_ASYM = 1<<11,/* Bit 11: Try for asymmetric */ 10748c2ecf20Sopenharmony_ci PHY_AN_PAUSE_CAP = 1<<10, /* Bit 10: Try for pause */ 10758c2ecf20Sopenharmony_ci PHY_AN_100BASE4 = 1<<9, /* Bit 9: Try for 100mbps 4k packets */ 10768c2ecf20Sopenharmony_ci PHY_AN_100FULL = 1<<8, /* Bit 8: Try for 100mbps full-duplex */ 10778c2ecf20Sopenharmony_ci PHY_AN_100HALF = 1<<7, /* Bit 7: Try for 100mbps half-duplex */ 10788c2ecf20Sopenharmony_ci PHY_AN_10FULL = 1<<6, /* Bit 6: Try for 10mbps full-duplex */ 10798c2ecf20Sopenharmony_ci PHY_AN_10HALF = 1<<5, /* Bit 5: Try for 10mbps half-duplex */ 10808c2ecf20Sopenharmony_ci PHY_AN_CSMA = 1<<0, /* Bit 0: Only selector supported */ 10818c2ecf20Sopenharmony_ci PHY_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/ 10828c2ecf20Sopenharmony_ci PHY_AN_FULL = PHY_AN_100FULL | PHY_AN_10FULL | PHY_AN_CSMA, 10838c2ecf20Sopenharmony_ci PHY_AN_ALL = PHY_AN_10HALF | PHY_AN_10FULL | 10848c2ecf20Sopenharmony_ci PHY_AN_100HALF | PHY_AN_100FULL, 10858c2ecf20Sopenharmony_ci}; 10868c2ecf20Sopenharmony_ci 10878c2ecf20Sopenharmony_ci/* Xmac Specific */ 10888c2ecf20Sopenharmony_cienum { 10898c2ecf20Sopenharmony_ci PHY_X_AN_NXT_PG = 1<<15, /* Bit 15: Request Next Page */ 10908c2ecf20Sopenharmony_ci PHY_X_AN_ACK = 1<<14, /* Bit 14: (ro) Acknowledge Received */ 10918c2ecf20Sopenharmony_ci PHY_X_AN_RFB = 3<<12,/* Bit 13..12: Remote Fault Bits */ 10928c2ecf20Sopenharmony_ci 10938c2ecf20Sopenharmony_ci PHY_X_AN_PAUSE = 3<<7,/* Bit 8.. 7: Pause Bits */ 10948c2ecf20Sopenharmony_ci PHY_X_AN_HD = 1<<6, /* Bit 6: Half Duplex */ 10958c2ecf20Sopenharmony_ci PHY_X_AN_FD = 1<<5, /* Bit 5: Full Duplex */ 10968c2ecf20Sopenharmony_ci}; 10978c2ecf20Sopenharmony_ci 10988c2ecf20Sopenharmony_ci/* Pause Bits (PHY_X_AN_PAUSE and PHY_X_RS_PAUSE) encoding */ 10998c2ecf20Sopenharmony_cienum { 11008c2ecf20Sopenharmony_ci PHY_X_P_NO_PAUSE= 0<<7,/* Bit 8..7: no Pause Mode */ 11018c2ecf20Sopenharmony_ci PHY_X_P_SYM_MD = 1<<7, /* Bit 8..7: symmetric Pause Mode */ 11028c2ecf20Sopenharmony_ci PHY_X_P_ASYM_MD = 2<<7,/* Bit 8..7: asymmetric Pause Mode */ 11038c2ecf20Sopenharmony_ci PHY_X_P_BOTH_MD = 3<<7,/* Bit 8..7: both Pause Mode */ 11048c2ecf20Sopenharmony_ci}; 11058c2ecf20Sopenharmony_ci 11068c2ecf20Sopenharmony_ci 11078c2ecf20Sopenharmony_ci/***** PHY_XMAC_EXT_STAT 16 bit r/w Extended Status Register *****/ 11088c2ecf20Sopenharmony_cienum { 11098c2ecf20Sopenharmony_ci PHY_X_EX_FD = 1<<15, /* Bit 15: Device Supports Full Duplex */ 11108c2ecf20Sopenharmony_ci PHY_X_EX_HD = 1<<14, /* Bit 14: Device Supports Half Duplex */ 11118c2ecf20Sopenharmony_ci}; 11128c2ecf20Sopenharmony_ci 11138c2ecf20Sopenharmony_ci/***** PHY_XMAC_RES_ABI 16 bit r/o PHY Resolved Ability *****/ 11148c2ecf20Sopenharmony_cienum { 11158c2ecf20Sopenharmony_ci PHY_X_RS_PAUSE = 3<<7, /* Bit 8..7: selected Pause Mode */ 11168c2ecf20Sopenharmony_ci PHY_X_RS_HD = 1<<6, /* Bit 6: Half Duplex Mode selected */ 11178c2ecf20Sopenharmony_ci PHY_X_RS_FD = 1<<5, /* Bit 5: Full Duplex Mode selected */ 11188c2ecf20Sopenharmony_ci PHY_X_RS_ABLMIS = 1<<4, /* Bit 4: duplex or pause cap mismatch */ 11198c2ecf20Sopenharmony_ci PHY_X_RS_PAUMIS = 1<<3, /* Bit 3: pause capability mismatch */ 11208c2ecf20Sopenharmony_ci}; 11218c2ecf20Sopenharmony_ci 11228c2ecf20Sopenharmony_ci/* Remote Fault Bits (PHY_X_AN_RFB) encoding */ 11238c2ecf20Sopenharmony_cienum { 11248c2ecf20Sopenharmony_ci X_RFB_OK = 0<<12,/* Bit 13..12 No errors, Link OK */ 11258c2ecf20Sopenharmony_ci X_RFB_LF = 1<<12,/* Bit 13..12 Link Failure */ 11268c2ecf20Sopenharmony_ci X_RFB_OFF = 2<<12,/* Bit 13..12 Offline */ 11278c2ecf20Sopenharmony_ci X_RFB_AN_ERR = 3<<12,/* Bit 13..12 Auto-Negotiation Error */ 11288c2ecf20Sopenharmony_ci}; 11298c2ecf20Sopenharmony_ci 11308c2ecf20Sopenharmony_ci/* Broadcom-Specific */ 11318c2ecf20Sopenharmony_ci/***** PHY_BCOM_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ 11328c2ecf20Sopenharmony_cienum { 11338c2ecf20Sopenharmony_ci PHY_B_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */ 11348c2ecf20Sopenharmony_ci PHY_B_1000C_MSE = 1<<12, /* Bit 12: Master/Slave Enable */ 11358c2ecf20Sopenharmony_ci PHY_B_1000C_MSC = 1<<11, /* Bit 11: M/S Configuration */ 11368c2ecf20Sopenharmony_ci PHY_B_1000C_RD = 1<<10, /* Bit 10: Repeater/DTE */ 11378c2ecf20Sopenharmony_ci PHY_B_1000C_AFD = 1<<9, /* Bit 9: Advertise Full Duplex */ 11388c2ecf20Sopenharmony_ci PHY_B_1000C_AHD = 1<<8, /* Bit 8: Advertise Half Duplex */ 11398c2ecf20Sopenharmony_ci}; 11408c2ecf20Sopenharmony_ci 11418c2ecf20Sopenharmony_ci/***** PHY_BCOM_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ 11428c2ecf20Sopenharmony_ci/***** PHY_MARV_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ 11438c2ecf20Sopenharmony_cienum { 11448c2ecf20Sopenharmony_ci PHY_B_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */ 11458c2ecf20Sopenharmony_ci PHY_B_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */ 11468c2ecf20Sopenharmony_ci PHY_B_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */ 11478c2ecf20Sopenharmony_ci PHY_B_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status */ 11488c2ecf20Sopenharmony_ci PHY_B_1000S_LP_FD = 1<<11, /* Bit 11: Link Partner can FD */ 11498c2ecf20Sopenharmony_ci PHY_B_1000S_LP_HD = 1<<10, /* Bit 10: Link Partner can HD */ 11508c2ecf20Sopenharmony_ci /* Bit 9..8: reserved */ 11518c2ecf20Sopenharmony_ci PHY_B_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */ 11528c2ecf20Sopenharmony_ci}; 11538c2ecf20Sopenharmony_ci 11548c2ecf20Sopenharmony_ci/***** PHY_BCOM_EXT_STAT 16 bit r/o Extended Status Register *****/ 11558c2ecf20Sopenharmony_cienum { 11568c2ecf20Sopenharmony_ci PHY_B_ES_X_FD_CAP = 1<<15, /* Bit 15: 1000Base-X FD capable */ 11578c2ecf20Sopenharmony_ci PHY_B_ES_X_HD_CAP = 1<<14, /* Bit 14: 1000Base-X HD capable */ 11588c2ecf20Sopenharmony_ci PHY_B_ES_T_FD_CAP = 1<<13, /* Bit 13: 1000Base-T FD capable */ 11598c2ecf20Sopenharmony_ci PHY_B_ES_T_HD_CAP = 1<<12, /* Bit 12: 1000Base-T HD capable */ 11608c2ecf20Sopenharmony_ci}; 11618c2ecf20Sopenharmony_ci 11628c2ecf20Sopenharmony_ci/***** PHY_BCOM_P_EXT_CTRL 16 bit r/w PHY Extended Control Reg *****/ 11638c2ecf20Sopenharmony_cienum { 11648c2ecf20Sopenharmony_ci PHY_B_PEC_MAC_PHY = 1<<15, /* Bit 15: 10BIT/GMI-Interface */ 11658c2ecf20Sopenharmony_ci PHY_B_PEC_DIS_CROSS = 1<<14, /* Bit 14: Disable MDI Crossover */ 11668c2ecf20Sopenharmony_ci PHY_B_PEC_TX_DIS = 1<<13, /* Bit 13: Tx output Disabled */ 11678c2ecf20Sopenharmony_ci PHY_B_PEC_INT_DIS = 1<<12, /* Bit 12: Interrupts Disabled */ 11688c2ecf20Sopenharmony_ci PHY_B_PEC_F_INT = 1<<11, /* Bit 11: Force Interrupt */ 11698c2ecf20Sopenharmony_ci PHY_B_PEC_BY_45 = 1<<10, /* Bit 10: Bypass 4B5B-Decoder */ 11708c2ecf20Sopenharmony_ci PHY_B_PEC_BY_SCR = 1<<9, /* Bit 9: Bypass Scrambler */ 11718c2ecf20Sopenharmony_ci PHY_B_PEC_BY_MLT3 = 1<<8, /* Bit 8: Bypass MLT3 Encoder */ 11728c2ecf20Sopenharmony_ci PHY_B_PEC_BY_RXA = 1<<7, /* Bit 7: Bypass Rx Alignm. */ 11738c2ecf20Sopenharmony_ci PHY_B_PEC_RES_SCR = 1<<6, /* Bit 6: Reset Scrambler */ 11748c2ecf20Sopenharmony_ci PHY_B_PEC_EN_LTR = 1<<5, /* Bit 5: Ena LED Traffic Mode */ 11758c2ecf20Sopenharmony_ci PHY_B_PEC_LED_ON = 1<<4, /* Bit 4: Force LED's on */ 11768c2ecf20Sopenharmony_ci PHY_B_PEC_LED_OFF = 1<<3, /* Bit 3: Force LED's off */ 11778c2ecf20Sopenharmony_ci PHY_B_PEC_EX_IPG = 1<<2, /* Bit 2: Extend Tx IPG Mode */ 11788c2ecf20Sopenharmony_ci PHY_B_PEC_3_LED = 1<<1, /* Bit 1: Three Link LED mode */ 11798c2ecf20Sopenharmony_ci PHY_B_PEC_HIGH_LA = 1<<0, /* Bit 0: GMII FIFO Elasticy */ 11808c2ecf20Sopenharmony_ci}; 11818c2ecf20Sopenharmony_ci 11828c2ecf20Sopenharmony_ci/***** PHY_BCOM_P_EXT_STAT 16 bit r/o PHY Extended Status Reg *****/ 11838c2ecf20Sopenharmony_cienum { 11848c2ecf20Sopenharmony_ci PHY_B_PES_CROSS_STAT = 1<<13, /* Bit 13: MDI Crossover Status */ 11858c2ecf20Sopenharmony_ci PHY_B_PES_INT_STAT = 1<<12, /* Bit 12: Interrupt Status */ 11868c2ecf20Sopenharmony_ci PHY_B_PES_RRS = 1<<11, /* Bit 11: Remote Receiver Stat. */ 11878c2ecf20Sopenharmony_ci PHY_B_PES_LRS = 1<<10, /* Bit 10: Local Receiver Stat. */ 11888c2ecf20Sopenharmony_ci PHY_B_PES_LOCKED = 1<<9, /* Bit 9: Locked */ 11898c2ecf20Sopenharmony_ci PHY_B_PES_LS = 1<<8, /* Bit 8: Link Status */ 11908c2ecf20Sopenharmony_ci PHY_B_PES_RF = 1<<7, /* Bit 7: Remote Fault */ 11918c2ecf20Sopenharmony_ci PHY_B_PES_CE_ER = 1<<6, /* Bit 6: Carrier Ext Error */ 11928c2ecf20Sopenharmony_ci PHY_B_PES_BAD_SSD = 1<<5, /* Bit 5: Bad SSD */ 11938c2ecf20Sopenharmony_ci PHY_B_PES_BAD_ESD = 1<<4, /* Bit 4: Bad ESD */ 11948c2ecf20Sopenharmony_ci PHY_B_PES_RX_ER = 1<<3, /* Bit 3: Receive Error */ 11958c2ecf20Sopenharmony_ci PHY_B_PES_TX_ER = 1<<2, /* Bit 2: Transmit Error */ 11968c2ecf20Sopenharmony_ci PHY_B_PES_LOCK_ER = 1<<1, /* Bit 1: Lock Error */ 11978c2ecf20Sopenharmony_ci PHY_B_PES_MLT3_ER = 1<<0, /* Bit 0: MLT3 code Error */ 11988c2ecf20Sopenharmony_ci}; 11998c2ecf20Sopenharmony_ci 12008c2ecf20Sopenharmony_ci/* PHY_BCOM_AUNE_ADV 16 bit r/w Auto-Negotiation Advertisement *****/ 12018c2ecf20Sopenharmony_ci/* PHY_BCOM_AUNE_LP 16 bit r/o Link Partner Ability Reg *****/ 12028c2ecf20Sopenharmony_cienum { 12038c2ecf20Sopenharmony_ci PHY_B_AN_RF = 1<<13, /* Bit 13: Remote Fault */ 12048c2ecf20Sopenharmony_ci 12058c2ecf20Sopenharmony_ci PHY_B_AN_ASP = 1<<11, /* Bit 11: Asymmetric Pause */ 12068c2ecf20Sopenharmony_ci PHY_B_AN_PC = 1<<10, /* Bit 10: Pause Capable */ 12078c2ecf20Sopenharmony_ci}; 12088c2ecf20Sopenharmony_ci 12098c2ecf20Sopenharmony_ci 12108c2ecf20Sopenharmony_ci/***** PHY_BCOM_FC_CTR 16 bit r/w False Carrier Counter *****/ 12118c2ecf20Sopenharmony_cienum { 12128c2ecf20Sopenharmony_ci PHY_B_FC_CTR = 0xff, /* Bit 7..0: False Carrier Counter */ 12138c2ecf20Sopenharmony_ci 12148c2ecf20Sopenharmony_ci/***** PHY_BCOM_RNO_CTR 16 bit r/w Receive NOT_OK Counter *****/ 12158c2ecf20Sopenharmony_ci PHY_B_RC_LOC_MSK = 0xff00, /* Bit 15..8: Local Rx NOT_OK cnt */ 12168c2ecf20Sopenharmony_ci PHY_B_RC_REM_MSK = 0x00ff, /* Bit 7..0: Remote Rx NOT_OK cnt */ 12178c2ecf20Sopenharmony_ci 12188c2ecf20Sopenharmony_ci/***** PHY_BCOM_AUX_CTRL 16 bit r/w Auxiliary Control Reg *****/ 12198c2ecf20Sopenharmony_ci PHY_B_AC_L_SQE = 1<<15, /* Bit 15: Low Squelch */ 12208c2ecf20Sopenharmony_ci PHY_B_AC_LONG_PACK = 1<<14, /* Bit 14: Rx Long Packets */ 12218c2ecf20Sopenharmony_ci PHY_B_AC_ER_CTRL = 3<<12,/* Bit 13..12: Edgerate Control */ 12228c2ecf20Sopenharmony_ci /* Bit 11: reserved */ 12238c2ecf20Sopenharmony_ci PHY_B_AC_TX_TST = 1<<10, /* Bit 10: Tx test bit, always 1 */ 12248c2ecf20Sopenharmony_ci /* Bit 9.. 8: reserved */ 12258c2ecf20Sopenharmony_ci PHY_B_AC_DIS_PRF = 1<<7, /* Bit 7: dis part resp filter */ 12268c2ecf20Sopenharmony_ci /* Bit 6: reserved */ 12278c2ecf20Sopenharmony_ci PHY_B_AC_DIS_PM = 1<<5, /* Bit 5: dis power management */ 12288c2ecf20Sopenharmony_ci /* Bit 4: reserved */ 12298c2ecf20Sopenharmony_ci PHY_B_AC_DIAG = 1<<3, /* Bit 3: Diagnostic Mode */ 12308c2ecf20Sopenharmony_ci}; 12318c2ecf20Sopenharmony_ci 12328c2ecf20Sopenharmony_ci/***** PHY_BCOM_AUX_STAT 16 bit r/o Auxiliary Status Reg *****/ 12338c2ecf20Sopenharmony_cienum { 12348c2ecf20Sopenharmony_ci PHY_B_AS_AN_C = 1<<15, /* Bit 15: AutoNeg complete */ 12358c2ecf20Sopenharmony_ci PHY_B_AS_AN_CA = 1<<14, /* Bit 14: AN Complete Ack */ 12368c2ecf20Sopenharmony_ci PHY_B_AS_ANACK_D = 1<<13, /* Bit 13: AN Ack Detect */ 12378c2ecf20Sopenharmony_ci PHY_B_AS_ANAB_D = 1<<12, /* Bit 12: AN Ability Detect */ 12388c2ecf20Sopenharmony_ci PHY_B_AS_NPW = 1<<11, /* Bit 11: AN Next Page Wait */ 12398c2ecf20Sopenharmony_ci PHY_B_AS_AN_RES_MSK = 7<<8,/* Bit 10..8: AN HDC */ 12408c2ecf20Sopenharmony_ci PHY_B_AS_PDF = 1<<7, /* Bit 7: Parallel Detect. Fault */ 12418c2ecf20Sopenharmony_ci PHY_B_AS_RF = 1<<6, /* Bit 6: Remote Fault */ 12428c2ecf20Sopenharmony_ci PHY_B_AS_ANP_R = 1<<5, /* Bit 5: AN Page Received */ 12438c2ecf20Sopenharmony_ci PHY_B_AS_LP_ANAB = 1<<4, /* Bit 4: LP AN Ability */ 12448c2ecf20Sopenharmony_ci PHY_B_AS_LP_NPAB = 1<<3, /* Bit 3: LP Next Page Ability */ 12458c2ecf20Sopenharmony_ci PHY_B_AS_LS = 1<<2, /* Bit 2: Link Status */ 12468c2ecf20Sopenharmony_ci PHY_B_AS_PRR = 1<<1, /* Bit 1: Pause Resolution-Rx */ 12478c2ecf20Sopenharmony_ci PHY_B_AS_PRT = 1<<0, /* Bit 0: Pause Resolution-Tx */ 12488c2ecf20Sopenharmony_ci}; 12498c2ecf20Sopenharmony_ci#define PHY_B_AS_PAUSE_MSK (PHY_B_AS_PRR | PHY_B_AS_PRT) 12508c2ecf20Sopenharmony_ci 12518c2ecf20Sopenharmony_ci/***** PHY_BCOM_INT_STAT 16 bit r/o Interrupt Status Reg *****/ 12528c2ecf20Sopenharmony_ci/***** PHY_BCOM_INT_MASK 16 bit r/w Interrupt Mask Reg *****/ 12538c2ecf20Sopenharmony_cienum { 12548c2ecf20Sopenharmony_ci PHY_B_IS_PSE = 1<<14, /* Bit 14: Pair Swap Error */ 12558c2ecf20Sopenharmony_ci PHY_B_IS_MDXI_SC = 1<<13, /* Bit 13: MDIX Status Change */ 12568c2ecf20Sopenharmony_ci PHY_B_IS_HCT = 1<<12, /* Bit 12: counter above 32k */ 12578c2ecf20Sopenharmony_ci PHY_B_IS_LCT = 1<<11, /* Bit 11: counter above 128 */ 12588c2ecf20Sopenharmony_ci PHY_B_IS_AN_PR = 1<<10, /* Bit 10: Page Received */ 12598c2ecf20Sopenharmony_ci PHY_B_IS_NO_HDCL = 1<<9, /* Bit 9: No HCD Link */ 12608c2ecf20Sopenharmony_ci PHY_B_IS_NO_HDC = 1<<8, /* Bit 8: No HCD */ 12618c2ecf20Sopenharmony_ci PHY_B_IS_NEG_USHDC = 1<<7, /* Bit 7: Negotiated Unsup. HCD */ 12628c2ecf20Sopenharmony_ci PHY_B_IS_SCR_S_ER = 1<<6, /* Bit 6: Scrambler Sync Error */ 12638c2ecf20Sopenharmony_ci PHY_B_IS_RRS_CHANGE = 1<<5, /* Bit 5: Remote Rx Stat Change */ 12648c2ecf20Sopenharmony_ci PHY_B_IS_LRS_CHANGE = 1<<4, /* Bit 4: Local Rx Stat Change */ 12658c2ecf20Sopenharmony_ci PHY_B_IS_DUP_CHANGE = 1<<3, /* Bit 3: Duplex Mode Change */ 12668c2ecf20Sopenharmony_ci PHY_B_IS_LSP_CHANGE = 1<<2, /* Bit 2: Link Speed Change */ 12678c2ecf20Sopenharmony_ci PHY_B_IS_LST_CHANGE = 1<<1, /* Bit 1: Link Status Changed */ 12688c2ecf20Sopenharmony_ci PHY_B_IS_CRC_ER = 1<<0, /* Bit 0: CRC Error */ 12698c2ecf20Sopenharmony_ci}; 12708c2ecf20Sopenharmony_ci#define PHY_B_DEF_MSK \ 12718c2ecf20Sopenharmony_ci (~(PHY_B_IS_PSE | PHY_B_IS_AN_PR | PHY_B_IS_DUP_CHANGE | \ 12728c2ecf20Sopenharmony_ci PHY_B_IS_LSP_CHANGE | PHY_B_IS_LST_CHANGE)) 12738c2ecf20Sopenharmony_ci 12748c2ecf20Sopenharmony_ci/* Pause Bits (PHY_B_AN_ASP and PHY_B_AN_PC) encoding */ 12758c2ecf20Sopenharmony_cienum { 12768c2ecf20Sopenharmony_ci PHY_B_P_NO_PAUSE = 0<<10,/* Bit 11..10: no Pause Mode */ 12778c2ecf20Sopenharmony_ci PHY_B_P_SYM_MD = 1<<10, /* Bit 11..10: symmetric Pause Mode */ 12788c2ecf20Sopenharmony_ci PHY_B_P_ASYM_MD = 2<<10,/* Bit 11..10: asymmetric Pause Mode */ 12798c2ecf20Sopenharmony_ci PHY_B_P_BOTH_MD = 3<<10,/* Bit 11..10: both Pause Mode */ 12808c2ecf20Sopenharmony_ci}; 12818c2ecf20Sopenharmony_ci/* 12828c2ecf20Sopenharmony_ci * Resolved Duplex mode and Capabilities (Aux Status Summary Reg) 12838c2ecf20Sopenharmony_ci */ 12848c2ecf20Sopenharmony_cienum { 12858c2ecf20Sopenharmony_ci PHY_B_RES_1000FD = 7<<8,/* Bit 10..8: 1000Base-T Full Dup. */ 12868c2ecf20Sopenharmony_ci PHY_B_RES_1000HD = 6<<8,/* Bit 10..8: 1000Base-T Half Dup. */ 12878c2ecf20Sopenharmony_ci}; 12888c2ecf20Sopenharmony_ci 12898c2ecf20Sopenharmony_ci/** Marvell-Specific */ 12908c2ecf20Sopenharmony_cienum { 12918c2ecf20Sopenharmony_ci PHY_M_AN_NXT_PG = 1<<15, /* Request Next Page */ 12928c2ecf20Sopenharmony_ci PHY_M_AN_ACK = 1<<14, /* (ro) Acknowledge Received */ 12938c2ecf20Sopenharmony_ci PHY_M_AN_RF = 1<<13, /* Remote Fault */ 12948c2ecf20Sopenharmony_ci 12958c2ecf20Sopenharmony_ci PHY_M_AN_ASP = 1<<11, /* Asymmetric Pause */ 12968c2ecf20Sopenharmony_ci PHY_M_AN_PC = 1<<10, /* MAC Pause implemented */ 12978c2ecf20Sopenharmony_ci PHY_M_AN_100_T4 = 1<<9, /* Not cap. 100Base-T4 (always 0) */ 12988c2ecf20Sopenharmony_ci PHY_M_AN_100_FD = 1<<8, /* Advertise 100Base-TX Full Duplex */ 12998c2ecf20Sopenharmony_ci PHY_M_AN_100_HD = 1<<7, /* Advertise 100Base-TX Half Duplex */ 13008c2ecf20Sopenharmony_ci PHY_M_AN_10_FD = 1<<6, /* Advertise 10Base-TX Full Duplex */ 13018c2ecf20Sopenharmony_ci PHY_M_AN_10_HD = 1<<5, /* Advertise 10Base-TX Half Duplex */ 13028c2ecf20Sopenharmony_ci PHY_M_AN_SEL_MSK =0x1f<<4, /* Bit 4.. 0: Selector Field Mask */ 13038c2ecf20Sopenharmony_ci}; 13048c2ecf20Sopenharmony_ci 13058c2ecf20Sopenharmony_ci/* special defines for FIBER (88E1011S only) */ 13068c2ecf20Sopenharmony_cienum { 13078c2ecf20Sopenharmony_ci PHY_M_AN_ASP_X = 1<<8, /* Asymmetric Pause */ 13088c2ecf20Sopenharmony_ci PHY_M_AN_PC_X = 1<<7, /* MAC Pause implemented */ 13098c2ecf20Sopenharmony_ci PHY_M_AN_1000X_AHD = 1<<6, /* Advertise 10000Base-X Half Duplex */ 13108c2ecf20Sopenharmony_ci PHY_M_AN_1000X_AFD = 1<<5, /* Advertise 10000Base-X Full Duplex */ 13118c2ecf20Sopenharmony_ci}; 13128c2ecf20Sopenharmony_ci 13138c2ecf20Sopenharmony_ci/* Pause Bits (PHY_M_AN_ASP_X and PHY_M_AN_PC_X) encoding */ 13148c2ecf20Sopenharmony_cienum { 13158c2ecf20Sopenharmony_ci PHY_M_P_NO_PAUSE_X = 0<<7,/* Bit 8.. 7: no Pause Mode */ 13168c2ecf20Sopenharmony_ci PHY_M_P_SYM_MD_X = 1<<7, /* Bit 8.. 7: symmetric Pause Mode */ 13178c2ecf20Sopenharmony_ci PHY_M_P_ASYM_MD_X = 2<<7,/* Bit 8.. 7: asymmetric Pause Mode */ 13188c2ecf20Sopenharmony_ci PHY_M_P_BOTH_MD_X = 3<<7,/* Bit 8.. 7: both Pause Mode */ 13198c2ecf20Sopenharmony_ci}; 13208c2ecf20Sopenharmony_ci 13218c2ecf20Sopenharmony_ci/***** PHY_MARV_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ 13228c2ecf20Sopenharmony_cienum { 13238c2ecf20Sopenharmony_ci PHY_M_1000C_TEST= 7<<13,/* Bit 15..13: Test Modes */ 13248c2ecf20Sopenharmony_ci PHY_M_1000C_MSE = 1<<12, /* Manual Master/Slave Enable */ 13258c2ecf20Sopenharmony_ci PHY_M_1000C_MSC = 1<<11, /* M/S Configuration (1=Master) */ 13268c2ecf20Sopenharmony_ci PHY_M_1000C_MPD = 1<<10, /* Multi-Port Device */ 13278c2ecf20Sopenharmony_ci PHY_M_1000C_AFD = 1<<9, /* Advertise Full Duplex */ 13288c2ecf20Sopenharmony_ci PHY_M_1000C_AHD = 1<<8, /* Advertise Half Duplex */ 13298c2ecf20Sopenharmony_ci}; 13308c2ecf20Sopenharmony_ci 13318c2ecf20Sopenharmony_ci/***** PHY_MARV_PHY_CTRL 16 bit r/w PHY Specific Ctrl Reg *****/ 13328c2ecf20Sopenharmony_cienum { 13338c2ecf20Sopenharmony_ci PHY_M_PC_TX_FFD_MSK = 3<<14,/* Bit 15..14: Tx FIFO Depth Mask */ 13348c2ecf20Sopenharmony_ci PHY_M_PC_RX_FFD_MSK = 3<<12,/* Bit 13..12: Rx FIFO Depth Mask */ 13358c2ecf20Sopenharmony_ci PHY_M_PC_ASS_CRS_TX = 1<<11, /* Assert CRS on Transmit */ 13368c2ecf20Sopenharmony_ci PHY_M_PC_FL_GOOD = 1<<10, /* Force Link Good */ 13378c2ecf20Sopenharmony_ci PHY_M_PC_EN_DET_MSK = 3<<8,/* Bit 9.. 8: Energy Detect Mask */ 13388c2ecf20Sopenharmony_ci PHY_M_PC_ENA_EXT_D = 1<<7, /* Enable Ext. Distance (10BT) */ 13398c2ecf20Sopenharmony_ci PHY_M_PC_MDIX_MSK = 3<<5,/* Bit 6.. 5: MDI/MDIX Config. Mask */ 13408c2ecf20Sopenharmony_ci PHY_M_PC_DIS_125CLK = 1<<4, /* Disable 125 CLK */ 13418c2ecf20Sopenharmony_ci PHY_M_PC_MAC_POW_UP = 1<<3, /* MAC Power up */ 13428c2ecf20Sopenharmony_ci PHY_M_PC_SQE_T_ENA = 1<<2, /* SQE Test Enabled */ 13438c2ecf20Sopenharmony_ci PHY_M_PC_POL_R_DIS = 1<<1, /* Polarity Reversal Disabled */ 13448c2ecf20Sopenharmony_ci PHY_M_PC_DIS_JABBER = 1<<0, /* Disable Jabber */ 13458c2ecf20Sopenharmony_ci}; 13468c2ecf20Sopenharmony_ci 13478c2ecf20Sopenharmony_cienum { 13488c2ecf20Sopenharmony_ci PHY_M_PC_EN_DET = 2<<8, /* Energy Detect (Mode 1) */ 13498c2ecf20Sopenharmony_ci PHY_M_PC_EN_DET_PLUS = 3<<8, /* Energy Detect Plus (Mode 2) */ 13508c2ecf20Sopenharmony_ci}; 13518c2ecf20Sopenharmony_ci 13528c2ecf20Sopenharmony_cienum { 13538c2ecf20Sopenharmony_ci PHY_M_PC_MAN_MDI = 0, /* 00 = Manual MDI configuration */ 13548c2ecf20Sopenharmony_ci PHY_M_PC_MAN_MDIX = 1, /* 01 = Manual MDIX configuration */ 13558c2ecf20Sopenharmony_ci PHY_M_PC_ENA_AUTO = 3, /* 11 = Enable Automatic Crossover */ 13568c2ecf20Sopenharmony_ci}; 13578c2ecf20Sopenharmony_ci 13588c2ecf20Sopenharmony_ci/* for 10/100 Fast Ethernet PHY (88E3082 only) */ 13598c2ecf20Sopenharmony_cienum { 13608c2ecf20Sopenharmony_ci PHY_M_PC_ENA_DTE_DT = 1<<15, /* Enable Data Terminal Equ. (DTE) Detect */ 13618c2ecf20Sopenharmony_ci PHY_M_PC_ENA_ENE_DT = 1<<14, /* Enable Energy Detect (sense & pulse) */ 13628c2ecf20Sopenharmony_ci PHY_M_PC_DIS_NLP_CK = 1<<13, /* Disable Normal Link Puls (NLP) Check */ 13638c2ecf20Sopenharmony_ci PHY_M_PC_ENA_LIP_NP = 1<<12, /* Enable Link Partner Next Page Reg. */ 13648c2ecf20Sopenharmony_ci PHY_M_PC_DIS_NLP_GN = 1<<11, /* Disable Normal Link Puls Generation */ 13658c2ecf20Sopenharmony_ci 13668c2ecf20Sopenharmony_ci PHY_M_PC_DIS_SCRAMB = 1<<9, /* Disable Scrambler */ 13678c2ecf20Sopenharmony_ci PHY_M_PC_DIS_FEFI = 1<<8, /* Disable Far End Fault Indic. (FEFI) */ 13688c2ecf20Sopenharmony_ci 13698c2ecf20Sopenharmony_ci PHY_M_PC_SH_TP_SEL = 1<<6, /* Shielded Twisted Pair Select */ 13708c2ecf20Sopenharmony_ci PHY_M_PC_RX_FD_MSK = 3<<2,/* Bit 3.. 2: Rx FIFO Depth Mask */ 13718c2ecf20Sopenharmony_ci}; 13728c2ecf20Sopenharmony_ci 13738c2ecf20Sopenharmony_ci/***** PHY_MARV_PHY_STAT 16 bit r/o PHY Specific Status Reg *****/ 13748c2ecf20Sopenharmony_cienum { 13758c2ecf20Sopenharmony_ci PHY_M_PS_SPEED_MSK = 3<<14, /* Bit 15..14: Speed Mask */ 13768c2ecf20Sopenharmony_ci PHY_M_PS_SPEED_1000 = 1<<15, /* 10 = 1000 Mbps */ 13778c2ecf20Sopenharmony_ci PHY_M_PS_SPEED_100 = 1<<14, /* 01 = 100 Mbps */ 13788c2ecf20Sopenharmony_ci PHY_M_PS_SPEED_10 = 0, /* 00 = 10 Mbps */ 13798c2ecf20Sopenharmony_ci PHY_M_PS_FULL_DUP = 1<<13, /* Full Duplex */ 13808c2ecf20Sopenharmony_ci PHY_M_PS_PAGE_REC = 1<<12, /* Page Received */ 13818c2ecf20Sopenharmony_ci PHY_M_PS_SPDUP_RES = 1<<11, /* Speed & Duplex Resolved */ 13828c2ecf20Sopenharmony_ci PHY_M_PS_LINK_UP = 1<<10, /* Link Up */ 13838c2ecf20Sopenharmony_ci PHY_M_PS_CABLE_MSK = 7<<7, /* Bit 9.. 7: Cable Length Mask */ 13848c2ecf20Sopenharmony_ci PHY_M_PS_MDI_X_STAT = 1<<6, /* MDI Crossover Stat (1=MDIX) */ 13858c2ecf20Sopenharmony_ci PHY_M_PS_DOWNS_STAT = 1<<5, /* Downshift Status (1=downsh.) */ 13868c2ecf20Sopenharmony_ci PHY_M_PS_ENDET_STAT = 1<<4, /* Energy Detect Status (1=act) */ 13878c2ecf20Sopenharmony_ci PHY_M_PS_TX_P_EN = 1<<3, /* Tx Pause Enabled */ 13888c2ecf20Sopenharmony_ci PHY_M_PS_RX_P_EN = 1<<2, /* Rx Pause Enabled */ 13898c2ecf20Sopenharmony_ci PHY_M_PS_POL_REV = 1<<1, /* Polarity Reversed */ 13908c2ecf20Sopenharmony_ci PHY_M_PS_JABBER = 1<<0, /* Jabber */ 13918c2ecf20Sopenharmony_ci}; 13928c2ecf20Sopenharmony_ci 13938c2ecf20Sopenharmony_ci#define PHY_M_PS_PAUSE_MSK (PHY_M_PS_TX_P_EN | PHY_M_PS_RX_P_EN) 13948c2ecf20Sopenharmony_ci 13958c2ecf20Sopenharmony_ci/* for 10/100 Fast Ethernet PHY (88E3082 only) */ 13968c2ecf20Sopenharmony_cienum { 13978c2ecf20Sopenharmony_ci PHY_M_PS_DTE_DETECT = 1<<15, /* Data Terminal Equipment (DTE) Detected */ 13988c2ecf20Sopenharmony_ci PHY_M_PS_RES_SPEED = 1<<14, /* Resolved Speed (1=100 Mbps, 0=10 Mbps */ 13998c2ecf20Sopenharmony_ci}; 14008c2ecf20Sopenharmony_ci 14018c2ecf20Sopenharmony_cienum { 14028c2ecf20Sopenharmony_ci PHY_M_IS_AN_ERROR = 1<<15, /* Auto-Negotiation Error */ 14038c2ecf20Sopenharmony_ci PHY_M_IS_LSP_CHANGE = 1<<14, /* Link Speed Changed */ 14048c2ecf20Sopenharmony_ci PHY_M_IS_DUP_CHANGE = 1<<13, /* Duplex Mode Changed */ 14058c2ecf20Sopenharmony_ci PHY_M_IS_AN_PR = 1<<12, /* Page Received */ 14068c2ecf20Sopenharmony_ci PHY_M_IS_AN_COMPL = 1<<11, /* Auto-Negotiation Completed */ 14078c2ecf20Sopenharmony_ci PHY_M_IS_LST_CHANGE = 1<<10, /* Link Status Changed */ 14088c2ecf20Sopenharmony_ci PHY_M_IS_SYMB_ERROR = 1<<9, /* Symbol Error */ 14098c2ecf20Sopenharmony_ci PHY_M_IS_FALSE_CARR = 1<<8, /* False Carrier */ 14108c2ecf20Sopenharmony_ci PHY_M_IS_FIFO_ERROR = 1<<7, /* FIFO Overflow/Underrun Error */ 14118c2ecf20Sopenharmony_ci PHY_M_IS_MDI_CHANGE = 1<<6, /* MDI Crossover Changed */ 14128c2ecf20Sopenharmony_ci PHY_M_IS_DOWNSH_DET = 1<<5, /* Downshift Detected */ 14138c2ecf20Sopenharmony_ci PHY_M_IS_END_CHANGE = 1<<4, /* Energy Detect Changed */ 14148c2ecf20Sopenharmony_ci 14158c2ecf20Sopenharmony_ci PHY_M_IS_DTE_CHANGE = 1<<2, /* DTE Power Det. Status Changed */ 14168c2ecf20Sopenharmony_ci PHY_M_IS_POL_CHANGE = 1<<1, /* Polarity Changed */ 14178c2ecf20Sopenharmony_ci PHY_M_IS_JABBER = 1<<0, /* Jabber */ 14188c2ecf20Sopenharmony_ci 14198c2ecf20Sopenharmony_ci PHY_M_IS_DEF_MSK = PHY_M_IS_AN_ERROR | PHY_M_IS_LSP_CHANGE | 14208c2ecf20Sopenharmony_ci PHY_M_IS_LST_CHANGE | PHY_M_IS_FIFO_ERROR, 14218c2ecf20Sopenharmony_ci 14228c2ecf20Sopenharmony_ci PHY_M_IS_AN_MSK = PHY_M_IS_AN_ERROR | PHY_M_IS_AN_COMPL, 14238c2ecf20Sopenharmony_ci}; 14248c2ecf20Sopenharmony_ci 14258c2ecf20Sopenharmony_ci/***** PHY_MARV_EXT_CTRL 16 bit r/w Ext. PHY Specific Ctrl *****/ 14268c2ecf20Sopenharmony_cienum { 14278c2ecf20Sopenharmony_ci PHY_M_EC_ENA_BC_EXT = 1<<15, /* Enable Block Carr. Ext. (88E1111 only) */ 14288c2ecf20Sopenharmony_ci PHY_M_EC_ENA_LIN_LB = 1<<14, /* Enable Line Loopback (88E1111 only) */ 14298c2ecf20Sopenharmony_ci 14308c2ecf20Sopenharmony_ci PHY_M_EC_DIS_LINK_P = 1<<12, /* Disable Link Pulses (88E1111 only) */ 14318c2ecf20Sopenharmony_ci PHY_M_EC_M_DSC_MSK = 3<<10, /* Bit 11..10: Master Downshift Counter */ 14328c2ecf20Sopenharmony_ci /* (88E1011 only) */ 14338c2ecf20Sopenharmony_ci PHY_M_EC_S_DSC_MSK = 3<<8, /* Bit 9.. 8: Slave Downshift Counter */ 14348c2ecf20Sopenharmony_ci /* (88E1011 only) */ 14358c2ecf20Sopenharmony_ci PHY_M_EC_M_DSC_MSK2 = 7<<9, /* Bit 11.. 9: Master Downshift Counter */ 14368c2ecf20Sopenharmony_ci /* (88E1111 only) */ 14378c2ecf20Sopenharmony_ci PHY_M_EC_DOWN_S_ENA = 1<<8, /* Downshift Enable (88E1111 only) */ 14388c2ecf20Sopenharmony_ci /* !!! Errata in spec. (1 = disable) */ 14398c2ecf20Sopenharmony_ci PHY_M_EC_RX_TIM_CT = 1<<7, /* RGMII Rx Timing Control*/ 14408c2ecf20Sopenharmony_ci PHY_M_EC_MAC_S_MSK = 7<<4, /* Bit 6.. 4: Def. MAC interface speed */ 14418c2ecf20Sopenharmony_ci PHY_M_EC_FIB_AN_ENA = 1<<3, /* Fiber Auto-Neg. Enable (88E1011S only) */ 14428c2ecf20Sopenharmony_ci PHY_M_EC_DTE_D_ENA = 1<<2, /* DTE Detect Enable (88E1111 only) */ 14438c2ecf20Sopenharmony_ci PHY_M_EC_TX_TIM_CT = 1<<1, /* RGMII Tx Timing Control */ 14448c2ecf20Sopenharmony_ci PHY_M_EC_TRANS_DIS = 1<<0, /* Transmitter Disable (88E1111 only) */}; 14458c2ecf20Sopenharmony_ci 14468c2ecf20Sopenharmony_ci#define PHY_M_EC_M_DSC(x) ((u16)(x)<<10) /* 00=1x; 01=2x; 10=3x; 11=4x */ 14478c2ecf20Sopenharmony_ci#define PHY_M_EC_S_DSC(x) ((u16)(x)<<8) /* 00=dis; 01=1x; 10=2x; 11=3x */ 14488c2ecf20Sopenharmony_ci#define PHY_M_EC_MAC_S(x) ((u16)(x)<<4) /* 01X=0; 110=2.5; 111=25 (MHz) */ 14498c2ecf20Sopenharmony_ci 14508c2ecf20Sopenharmony_ci#define PHY_M_EC_M_DSC_2(x) ((u16)(x)<<9) /* 000=1x; 001=2x; 010=3x; 011=4x */ 14518c2ecf20Sopenharmony_ci /* 100=5x; 101=6x; 110=7x; 111=8x */ 14528c2ecf20Sopenharmony_cienum { 14538c2ecf20Sopenharmony_ci MAC_TX_CLK_0_MHZ = 2, 14548c2ecf20Sopenharmony_ci MAC_TX_CLK_2_5_MHZ = 6, 14558c2ecf20Sopenharmony_ci MAC_TX_CLK_25_MHZ = 7, 14568c2ecf20Sopenharmony_ci}; 14578c2ecf20Sopenharmony_ci 14588c2ecf20Sopenharmony_ci/***** PHY_MARV_LED_CTRL 16 bit r/w LED Control Reg *****/ 14598c2ecf20Sopenharmony_cienum { 14608c2ecf20Sopenharmony_ci PHY_M_LEDC_DIS_LED = 1<<15, /* Disable LED */ 14618c2ecf20Sopenharmony_ci PHY_M_LEDC_PULS_MSK = 7<<12,/* Bit 14..12: Pulse Stretch Mask */ 14628c2ecf20Sopenharmony_ci PHY_M_LEDC_F_INT = 1<<11, /* Force Interrupt */ 14638c2ecf20Sopenharmony_ci PHY_M_LEDC_BL_R_MSK = 7<<8,/* Bit 10.. 8: Blink Rate Mask */ 14648c2ecf20Sopenharmony_ci PHY_M_LEDC_DP_C_LSB = 1<<7, /* Duplex Control (LSB, 88E1111 only) */ 14658c2ecf20Sopenharmony_ci PHY_M_LEDC_TX_C_LSB = 1<<6, /* Tx Control (LSB, 88E1111 only) */ 14668c2ecf20Sopenharmony_ci PHY_M_LEDC_LK_C_MSK = 7<<3,/* Bit 5.. 3: Link Control Mask */ 14678c2ecf20Sopenharmony_ci /* (88E1111 only) */ 14688c2ecf20Sopenharmony_ci}; 14698c2ecf20Sopenharmony_ci#define PHY_M_LED_PULS_DUR(x) (((u16)(x)<<12) & PHY_M_LEDC_PULS_MSK) 14708c2ecf20Sopenharmony_ci#define PHY_M_LED_BLINK_RT(x) (((u16)(x)<<8) & PHY_M_LEDC_BL_R_MSK) 14718c2ecf20Sopenharmony_ci 14728c2ecf20Sopenharmony_cienum { 14738c2ecf20Sopenharmony_ci PHY_M_LEDC_LINK_MSK = 3<<3, /* Bit 4.. 3: Link Control Mask */ 14748c2ecf20Sopenharmony_ci /* (88E1011 only) */ 14758c2ecf20Sopenharmony_ci PHY_M_LEDC_DP_CTRL = 1<<2, /* Duplex Control */ 14768c2ecf20Sopenharmony_ci PHY_M_LEDC_DP_C_MSB = 1<<2, /* Duplex Control (MSB, 88E1111 only) */ 14778c2ecf20Sopenharmony_ci PHY_M_LEDC_RX_CTRL = 1<<1, /* Rx Activity / Link */ 14788c2ecf20Sopenharmony_ci PHY_M_LEDC_TX_CTRL = 1<<0, /* Tx Activity / Link */ 14798c2ecf20Sopenharmony_ci PHY_M_LEDC_TX_C_MSB = 1<<0, /* Tx Control (MSB, 88E1111 only) */ 14808c2ecf20Sopenharmony_ci}; 14818c2ecf20Sopenharmony_ci 14828c2ecf20Sopenharmony_cienum { 14838c2ecf20Sopenharmony_ci PULS_NO_STR = 0, /* no pulse stretching */ 14848c2ecf20Sopenharmony_ci PULS_21MS = 1, /* 21 ms to 42 ms */ 14858c2ecf20Sopenharmony_ci PULS_42MS = 2, /* 42 ms to 84 ms */ 14868c2ecf20Sopenharmony_ci PULS_84MS = 3, /* 84 ms to 170 ms */ 14878c2ecf20Sopenharmony_ci PULS_170MS = 4, /* 170 ms to 340 ms */ 14888c2ecf20Sopenharmony_ci PULS_340MS = 5, /* 340 ms to 670 ms */ 14898c2ecf20Sopenharmony_ci PULS_670MS = 6, /* 670 ms to 1.3 s */ 14908c2ecf20Sopenharmony_ci PULS_1300MS = 7, /* 1.3 s to 2.7 s */ 14918c2ecf20Sopenharmony_ci}; 14928c2ecf20Sopenharmony_ci 14938c2ecf20Sopenharmony_ci 14948c2ecf20Sopenharmony_cienum { 14958c2ecf20Sopenharmony_ci BLINK_42MS = 0, /* 42 ms */ 14968c2ecf20Sopenharmony_ci BLINK_84MS = 1, /* 84 ms */ 14978c2ecf20Sopenharmony_ci BLINK_170MS = 2, /* 170 ms */ 14988c2ecf20Sopenharmony_ci BLINK_340MS = 3, /* 340 ms */ 14998c2ecf20Sopenharmony_ci BLINK_670MS = 4, /* 670 ms */ 15008c2ecf20Sopenharmony_ci}; 15018c2ecf20Sopenharmony_ci 15028c2ecf20Sopenharmony_ci/***** PHY_MARV_LED_OVER 16 bit r/w Manual LED Override Reg *****/ 15038c2ecf20Sopenharmony_ci#define PHY_M_LED_MO_SGMII(x) ((x)<<14) /* Bit 15..14: SGMII AN Timer */ 15048c2ecf20Sopenharmony_ci /* Bit 13..12: reserved */ 15058c2ecf20Sopenharmony_ci#define PHY_M_LED_MO_DUP(x) ((x)<<10) /* Bit 11..10: Duplex */ 15068c2ecf20Sopenharmony_ci#define PHY_M_LED_MO_10(x) ((x)<<8) /* Bit 9.. 8: Link 10 */ 15078c2ecf20Sopenharmony_ci#define PHY_M_LED_MO_100(x) ((x)<<6) /* Bit 7.. 6: Link 100 */ 15088c2ecf20Sopenharmony_ci#define PHY_M_LED_MO_1000(x) ((x)<<4) /* Bit 5.. 4: Link 1000 */ 15098c2ecf20Sopenharmony_ci#define PHY_M_LED_MO_RX(x) ((x)<<2) /* Bit 3.. 2: Rx */ 15108c2ecf20Sopenharmony_ci#define PHY_M_LED_MO_TX(x) ((x)<<0) /* Bit 1.. 0: Tx */ 15118c2ecf20Sopenharmony_ci 15128c2ecf20Sopenharmony_cienum { 15138c2ecf20Sopenharmony_ci MO_LED_NORM = 0, 15148c2ecf20Sopenharmony_ci MO_LED_BLINK = 1, 15158c2ecf20Sopenharmony_ci MO_LED_OFF = 2, 15168c2ecf20Sopenharmony_ci MO_LED_ON = 3, 15178c2ecf20Sopenharmony_ci}; 15188c2ecf20Sopenharmony_ci 15198c2ecf20Sopenharmony_ci/***** PHY_MARV_EXT_CTRL_2 16 bit r/w Ext. PHY Specific Ctrl 2 *****/ 15208c2ecf20Sopenharmony_cienum { 15218c2ecf20Sopenharmony_ci PHY_M_EC2_FI_IMPED = 1<<6, /* Fiber Input Impedance */ 15228c2ecf20Sopenharmony_ci PHY_M_EC2_FO_IMPED = 1<<5, /* Fiber Output Impedance */ 15238c2ecf20Sopenharmony_ci PHY_M_EC2_FO_M_CLK = 1<<4, /* Fiber Mode Clock Enable */ 15248c2ecf20Sopenharmony_ci PHY_M_EC2_FO_BOOST = 1<<3, /* Fiber Output Boost */ 15258c2ecf20Sopenharmony_ci PHY_M_EC2_FO_AM_MSK = 7, /* Bit 2.. 0: Fiber Output Amplitude */ 15268c2ecf20Sopenharmony_ci}; 15278c2ecf20Sopenharmony_ci 15288c2ecf20Sopenharmony_ci/***** PHY_MARV_EXT_P_STAT 16 bit r/w Ext. PHY Specific Status *****/ 15298c2ecf20Sopenharmony_cienum { 15308c2ecf20Sopenharmony_ci PHY_M_FC_AUTO_SEL = 1<<15, /* Fiber/Copper Auto Sel. Dis. */ 15318c2ecf20Sopenharmony_ci PHY_M_FC_AN_REG_ACC = 1<<14, /* Fiber/Copper AN Reg. Access */ 15328c2ecf20Sopenharmony_ci PHY_M_FC_RESOLUTION = 1<<13, /* Fiber/Copper Resolution */ 15338c2ecf20Sopenharmony_ci PHY_M_SER_IF_AN_BP = 1<<12, /* Ser. IF AN Bypass Enable */ 15348c2ecf20Sopenharmony_ci PHY_M_SER_IF_BP_ST = 1<<11, /* Ser. IF AN Bypass Status */ 15358c2ecf20Sopenharmony_ci PHY_M_IRQ_POLARITY = 1<<10, /* IRQ polarity */ 15368c2ecf20Sopenharmony_ci PHY_M_DIS_AUT_MED = 1<<9, /* Disable Aut. Medium Reg. Selection */ 15378c2ecf20Sopenharmony_ci /* (88E1111 only) */ 15388c2ecf20Sopenharmony_ci /* Bit 9.. 4: reserved (88E1011 only) */ 15398c2ecf20Sopenharmony_ci PHY_M_UNDOC1 = 1<<7, /* undocumented bit !! */ 15408c2ecf20Sopenharmony_ci PHY_M_DTE_POW_STAT = 1<<4, /* DTE Power Status (88E1111 only) */ 15418c2ecf20Sopenharmony_ci PHY_M_MODE_MASK = 0xf, /* Bit 3.. 0: copy of HWCFG MODE[3:0] */ 15428c2ecf20Sopenharmony_ci}; 15438c2ecf20Sopenharmony_ci 15448c2ecf20Sopenharmony_ci/***** PHY_MARV_CABLE_DIAG 16 bit r/o Cable Diagnostic Reg *****/ 15458c2ecf20Sopenharmony_cienum { 15468c2ecf20Sopenharmony_ci PHY_M_CABD_ENA_TEST = 1<<15, /* Enable Test (Page 0) */ 15478c2ecf20Sopenharmony_ci PHY_M_CABD_DIS_WAIT = 1<<15, /* Disable Waiting Period (Page 1) */ 15488c2ecf20Sopenharmony_ci /* (88E1111 only) */ 15498c2ecf20Sopenharmony_ci PHY_M_CABD_STAT_MSK = 3<<13, /* Bit 14..13: Status Mask */ 15508c2ecf20Sopenharmony_ci PHY_M_CABD_AMPL_MSK = 0x1f<<8, /* Bit 12.. 8: Amplitude Mask */ 15518c2ecf20Sopenharmony_ci /* (88E1111 only) */ 15528c2ecf20Sopenharmony_ci PHY_M_CABD_DIST_MSK = 0xff, /* Bit 7.. 0: Distance Mask */ 15538c2ecf20Sopenharmony_ci}; 15548c2ecf20Sopenharmony_ci 15558c2ecf20Sopenharmony_ci/* values for Cable Diagnostic Status (11=fail; 00=OK; 10=open; 01=short) */ 15568c2ecf20Sopenharmony_cienum { 15578c2ecf20Sopenharmony_ci CABD_STAT_NORMAL= 0, 15588c2ecf20Sopenharmony_ci CABD_STAT_SHORT = 1, 15598c2ecf20Sopenharmony_ci CABD_STAT_OPEN = 2, 15608c2ecf20Sopenharmony_ci CABD_STAT_FAIL = 3, 15618c2ecf20Sopenharmony_ci}; 15628c2ecf20Sopenharmony_ci 15638c2ecf20Sopenharmony_ci/* for 10/100 Fast Ethernet PHY (88E3082 only) */ 15648c2ecf20Sopenharmony_ci/***** PHY_MARV_FE_LED_PAR 16 bit r/w LED Parallel Select Reg. *****/ 15658c2ecf20Sopenharmony_ci /* Bit 15..12: reserved (used internally) */ 15668c2ecf20Sopenharmony_cienum { 15678c2ecf20Sopenharmony_ci PHY_M_FELP_LED2_MSK = 0xf<<8, /* Bit 11.. 8: LED2 Mask (LINK) */ 15688c2ecf20Sopenharmony_ci PHY_M_FELP_LED1_MSK = 0xf<<4, /* Bit 7.. 4: LED1 Mask (ACT) */ 15698c2ecf20Sopenharmony_ci PHY_M_FELP_LED0_MSK = 0xf, /* Bit 3.. 0: LED0 Mask (SPEED) */ 15708c2ecf20Sopenharmony_ci}; 15718c2ecf20Sopenharmony_ci 15728c2ecf20Sopenharmony_ci#define PHY_M_FELP_LED2_CTRL(x) (((x)<<8) & PHY_M_FELP_LED2_MSK) 15738c2ecf20Sopenharmony_ci#define PHY_M_FELP_LED1_CTRL(x) (((x)<<4) & PHY_M_FELP_LED1_MSK) 15748c2ecf20Sopenharmony_ci#define PHY_M_FELP_LED0_CTRL(x) (((x)<<0) & PHY_M_FELP_LED0_MSK) 15758c2ecf20Sopenharmony_ci 15768c2ecf20Sopenharmony_cienum { 15778c2ecf20Sopenharmony_ci LED_PAR_CTRL_COLX = 0x00, 15788c2ecf20Sopenharmony_ci LED_PAR_CTRL_ERROR = 0x01, 15798c2ecf20Sopenharmony_ci LED_PAR_CTRL_DUPLEX = 0x02, 15808c2ecf20Sopenharmony_ci LED_PAR_CTRL_DP_COL = 0x03, 15818c2ecf20Sopenharmony_ci LED_PAR_CTRL_SPEED = 0x04, 15828c2ecf20Sopenharmony_ci LED_PAR_CTRL_LINK = 0x05, 15838c2ecf20Sopenharmony_ci LED_PAR_CTRL_TX = 0x06, 15848c2ecf20Sopenharmony_ci LED_PAR_CTRL_RX = 0x07, 15858c2ecf20Sopenharmony_ci LED_PAR_CTRL_ACT = 0x08, 15868c2ecf20Sopenharmony_ci LED_PAR_CTRL_LNK_RX = 0x09, 15878c2ecf20Sopenharmony_ci LED_PAR_CTRL_LNK_AC = 0x0a, 15888c2ecf20Sopenharmony_ci LED_PAR_CTRL_ACT_BL = 0x0b, 15898c2ecf20Sopenharmony_ci LED_PAR_CTRL_TX_BL = 0x0c, 15908c2ecf20Sopenharmony_ci LED_PAR_CTRL_RX_BL = 0x0d, 15918c2ecf20Sopenharmony_ci LED_PAR_CTRL_COL_BL = 0x0e, 15928c2ecf20Sopenharmony_ci LED_PAR_CTRL_INACT = 0x0f 15938c2ecf20Sopenharmony_ci}; 15948c2ecf20Sopenharmony_ci 15958c2ecf20Sopenharmony_ci/*****,PHY_MARV_FE_SPEC_2 16 bit r/w Specific Control Reg. 2 *****/ 15968c2ecf20Sopenharmony_cienum { 15978c2ecf20Sopenharmony_ci PHY_M_FESC_DIS_WAIT = 1<<2, /* Disable TDR Waiting Period */ 15988c2ecf20Sopenharmony_ci PHY_M_FESC_ENA_MCLK = 1<<1, /* Enable MAC Rx Clock in sleep mode */ 15998c2ecf20Sopenharmony_ci PHY_M_FESC_SEL_CL_A = 1<<0, /* Select Class A driver (100B-TX) */ 16008c2ecf20Sopenharmony_ci}; 16018c2ecf20Sopenharmony_ci 16028c2ecf20Sopenharmony_ci 16038c2ecf20Sopenharmony_ci/***** PHY_MARV_PHY_CTRL (page 3) 16 bit r/w LED Control Reg. *****/ 16048c2ecf20Sopenharmony_cienum { 16058c2ecf20Sopenharmony_ci PHY_M_LEDC_LOS_MSK = 0xf<<12, /* Bit 15..12: LOS LED Ctrl. Mask */ 16068c2ecf20Sopenharmony_ci PHY_M_LEDC_INIT_MSK = 0xf<<8, /* Bit 11.. 8: INIT LED Ctrl. Mask */ 16078c2ecf20Sopenharmony_ci PHY_M_LEDC_STA1_MSK = 0xf<<4, /* Bit 7.. 4: STAT1 LED Ctrl. Mask */ 16088c2ecf20Sopenharmony_ci PHY_M_LEDC_STA0_MSK = 0xf, /* Bit 3.. 0: STAT0 LED Ctrl. Mask */ 16098c2ecf20Sopenharmony_ci}; 16108c2ecf20Sopenharmony_ci 16118c2ecf20Sopenharmony_ci#define PHY_M_LEDC_LOS_CTRL(x) (((x)<<12) & PHY_M_LEDC_LOS_MSK) 16128c2ecf20Sopenharmony_ci#define PHY_M_LEDC_INIT_CTRL(x) (((x)<<8) & PHY_M_LEDC_INIT_MSK) 16138c2ecf20Sopenharmony_ci#define PHY_M_LEDC_STA1_CTRL(x) (((x)<<4) & PHY_M_LEDC_STA1_MSK) 16148c2ecf20Sopenharmony_ci#define PHY_M_LEDC_STA0_CTRL(x) (((x)<<0) & PHY_M_LEDC_STA0_MSK) 16158c2ecf20Sopenharmony_ci 16168c2ecf20Sopenharmony_ci/* GMAC registers */ 16178c2ecf20Sopenharmony_ci/* Port Registers */ 16188c2ecf20Sopenharmony_cienum { 16198c2ecf20Sopenharmony_ci GM_GP_STAT = 0x0000, /* 16 bit r/o General Purpose Status */ 16208c2ecf20Sopenharmony_ci GM_GP_CTRL = 0x0004, /* 16 bit r/w General Purpose Control */ 16218c2ecf20Sopenharmony_ci GM_TX_CTRL = 0x0008, /* 16 bit r/w Transmit Control Reg. */ 16228c2ecf20Sopenharmony_ci GM_RX_CTRL = 0x000c, /* 16 bit r/w Receive Control Reg. */ 16238c2ecf20Sopenharmony_ci GM_TX_FLOW_CTRL = 0x0010, /* 16 bit r/w Transmit Flow-Control */ 16248c2ecf20Sopenharmony_ci GM_TX_PARAM = 0x0014, /* 16 bit r/w Transmit Parameter Reg. */ 16258c2ecf20Sopenharmony_ci GM_SERIAL_MODE = 0x0018, /* 16 bit r/w Serial Mode Register */ 16268c2ecf20Sopenharmony_ci/* Source Address Registers */ 16278c2ecf20Sopenharmony_ci GM_SRC_ADDR_1L = 0x001c, /* 16 bit r/w Source Address 1 (low) */ 16288c2ecf20Sopenharmony_ci GM_SRC_ADDR_1M = 0x0020, /* 16 bit r/w Source Address 1 (middle) */ 16298c2ecf20Sopenharmony_ci GM_SRC_ADDR_1H = 0x0024, /* 16 bit r/w Source Address 1 (high) */ 16308c2ecf20Sopenharmony_ci GM_SRC_ADDR_2L = 0x0028, /* 16 bit r/w Source Address 2 (low) */ 16318c2ecf20Sopenharmony_ci GM_SRC_ADDR_2M = 0x002c, /* 16 bit r/w Source Address 2 (middle) */ 16328c2ecf20Sopenharmony_ci GM_SRC_ADDR_2H = 0x0030, /* 16 bit r/w Source Address 2 (high) */ 16338c2ecf20Sopenharmony_ci 16348c2ecf20Sopenharmony_ci/* Multicast Address Hash Registers */ 16358c2ecf20Sopenharmony_ci GM_MC_ADDR_H1 = 0x0034, /* 16 bit r/w Multicast Address Hash 1 */ 16368c2ecf20Sopenharmony_ci GM_MC_ADDR_H2 = 0x0038, /* 16 bit r/w Multicast Address Hash 2 */ 16378c2ecf20Sopenharmony_ci GM_MC_ADDR_H3 = 0x003c, /* 16 bit r/w Multicast Address Hash 3 */ 16388c2ecf20Sopenharmony_ci GM_MC_ADDR_H4 = 0x0040, /* 16 bit r/w Multicast Address Hash 4 */ 16398c2ecf20Sopenharmony_ci 16408c2ecf20Sopenharmony_ci/* Interrupt Source Registers */ 16418c2ecf20Sopenharmony_ci GM_TX_IRQ_SRC = 0x0044, /* 16 bit r/o Tx Overflow IRQ Source */ 16428c2ecf20Sopenharmony_ci GM_RX_IRQ_SRC = 0x0048, /* 16 bit r/o Rx Overflow IRQ Source */ 16438c2ecf20Sopenharmony_ci GM_TR_IRQ_SRC = 0x004c, /* 16 bit r/o Tx/Rx Over. IRQ Source */ 16448c2ecf20Sopenharmony_ci 16458c2ecf20Sopenharmony_ci/* Interrupt Mask Registers */ 16468c2ecf20Sopenharmony_ci GM_TX_IRQ_MSK = 0x0050, /* 16 bit r/w Tx Overflow IRQ Mask */ 16478c2ecf20Sopenharmony_ci GM_RX_IRQ_MSK = 0x0054, /* 16 bit r/w Rx Overflow IRQ Mask */ 16488c2ecf20Sopenharmony_ci GM_TR_IRQ_MSK = 0x0058, /* 16 bit r/w Tx/Rx Over. IRQ Mask */ 16498c2ecf20Sopenharmony_ci 16508c2ecf20Sopenharmony_ci/* Serial Management Interface (SMI) Registers */ 16518c2ecf20Sopenharmony_ci GM_SMI_CTRL = 0x0080, /* 16 bit r/w SMI Control Register */ 16528c2ecf20Sopenharmony_ci GM_SMI_DATA = 0x0084, /* 16 bit r/w SMI Data Register */ 16538c2ecf20Sopenharmony_ci GM_PHY_ADDR = 0x0088, /* 16 bit r/w GPHY Address Register */ 16548c2ecf20Sopenharmony_ci}; 16558c2ecf20Sopenharmony_ci 16568c2ecf20Sopenharmony_ci/* MIB Counters */ 16578c2ecf20Sopenharmony_ci#define GM_MIB_CNT_BASE 0x0100 /* Base Address of MIB Counters */ 16588c2ecf20Sopenharmony_ci#define GM_MIB_CNT_SIZE 44 /* Number of MIB Counters */ 16598c2ecf20Sopenharmony_ci 16608c2ecf20Sopenharmony_ci/* 16618c2ecf20Sopenharmony_ci * MIB Counters base address definitions (low word) - 16628c2ecf20Sopenharmony_ci * use offset 4 for access to high word (32 bit r/o) 16638c2ecf20Sopenharmony_ci */ 16648c2ecf20Sopenharmony_cienum { 16658c2ecf20Sopenharmony_ci GM_RXF_UC_OK = GM_MIB_CNT_BASE + 0, /* Unicast Frames Received OK */ 16668c2ecf20Sopenharmony_ci GM_RXF_BC_OK = GM_MIB_CNT_BASE + 8, /* Broadcast Frames Received OK */ 16678c2ecf20Sopenharmony_ci GM_RXF_MPAUSE = GM_MIB_CNT_BASE + 16, /* Pause MAC Ctrl Frames Received */ 16688c2ecf20Sopenharmony_ci GM_RXF_MC_OK = GM_MIB_CNT_BASE + 24, /* Multicast Frames Received OK */ 16698c2ecf20Sopenharmony_ci GM_RXF_FCS_ERR = GM_MIB_CNT_BASE + 32, /* Rx Frame Check Seq. Error */ 16708c2ecf20Sopenharmony_ci /* GM_MIB_CNT_BASE + 40: reserved */ 16718c2ecf20Sopenharmony_ci GM_RXO_OK_LO = GM_MIB_CNT_BASE + 48, /* Octets Received OK Low */ 16728c2ecf20Sopenharmony_ci GM_RXO_OK_HI = GM_MIB_CNT_BASE + 56, /* Octets Received OK High */ 16738c2ecf20Sopenharmony_ci GM_RXO_ERR_LO = GM_MIB_CNT_BASE + 64, /* Octets Received Invalid Low */ 16748c2ecf20Sopenharmony_ci GM_RXO_ERR_HI = GM_MIB_CNT_BASE + 72, /* Octets Received Invalid High */ 16758c2ecf20Sopenharmony_ci GM_RXF_SHT = GM_MIB_CNT_BASE + 80, /* Frames <64 Byte Received OK */ 16768c2ecf20Sopenharmony_ci GM_RXE_FRAG = GM_MIB_CNT_BASE + 88, /* Frames <64 Byte Received with FCS Err */ 16778c2ecf20Sopenharmony_ci GM_RXF_64B = GM_MIB_CNT_BASE + 96, /* 64 Byte Rx Frame */ 16788c2ecf20Sopenharmony_ci GM_RXF_127B = GM_MIB_CNT_BASE + 104, /* 65-127 Byte Rx Frame */ 16798c2ecf20Sopenharmony_ci GM_RXF_255B = GM_MIB_CNT_BASE + 112, /* 128-255 Byte Rx Frame */ 16808c2ecf20Sopenharmony_ci GM_RXF_511B = GM_MIB_CNT_BASE + 120, /* 256-511 Byte Rx Frame */ 16818c2ecf20Sopenharmony_ci GM_RXF_1023B = GM_MIB_CNT_BASE + 128, /* 512-1023 Byte Rx Frame */ 16828c2ecf20Sopenharmony_ci GM_RXF_1518B = GM_MIB_CNT_BASE + 136, /* 1024-1518 Byte Rx Frame */ 16838c2ecf20Sopenharmony_ci GM_RXF_MAX_SZ = GM_MIB_CNT_BASE + 144, /* 1519-MaxSize Byte Rx Frame */ 16848c2ecf20Sopenharmony_ci GM_RXF_LNG_ERR = GM_MIB_CNT_BASE + 152, /* Rx Frame too Long Error */ 16858c2ecf20Sopenharmony_ci GM_RXF_JAB_PKT = GM_MIB_CNT_BASE + 160, /* Rx Jabber Packet Frame */ 16868c2ecf20Sopenharmony_ci /* GM_MIB_CNT_BASE + 168: reserved */ 16878c2ecf20Sopenharmony_ci GM_RXE_FIFO_OV = GM_MIB_CNT_BASE + 176, /* Rx FIFO overflow Event */ 16888c2ecf20Sopenharmony_ci /* GM_MIB_CNT_BASE + 184: reserved */ 16898c2ecf20Sopenharmony_ci GM_TXF_UC_OK = GM_MIB_CNT_BASE + 192, /* Unicast Frames Xmitted OK */ 16908c2ecf20Sopenharmony_ci GM_TXF_BC_OK = GM_MIB_CNT_BASE + 200, /* Broadcast Frames Xmitted OK */ 16918c2ecf20Sopenharmony_ci GM_TXF_MPAUSE = GM_MIB_CNT_BASE + 208, /* Pause MAC Ctrl Frames Xmitted */ 16928c2ecf20Sopenharmony_ci GM_TXF_MC_OK = GM_MIB_CNT_BASE + 216, /* Multicast Frames Xmitted OK */ 16938c2ecf20Sopenharmony_ci GM_TXO_OK_LO = GM_MIB_CNT_BASE + 224, /* Octets Transmitted OK Low */ 16948c2ecf20Sopenharmony_ci GM_TXO_OK_HI = GM_MIB_CNT_BASE + 232, /* Octets Transmitted OK High */ 16958c2ecf20Sopenharmony_ci GM_TXF_64B = GM_MIB_CNT_BASE + 240, /* 64 Byte Tx Frame */ 16968c2ecf20Sopenharmony_ci GM_TXF_127B = GM_MIB_CNT_BASE + 248, /* 65-127 Byte Tx Frame */ 16978c2ecf20Sopenharmony_ci GM_TXF_255B = GM_MIB_CNT_BASE + 256, /* 128-255 Byte Tx Frame */ 16988c2ecf20Sopenharmony_ci GM_TXF_511B = GM_MIB_CNT_BASE + 264, /* 256-511 Byte Tx Frame */ 16998c2ecf20Sopenharmony_ci GM_TXF_1023B = GM_MIB_CNT_BASE + 272, /* 512-1023 Byte Tx Frame */ 17008c2ecf20Sopenharmony_ci GM_TXF_1518B = GM_MIB_CNT_BASE + 280, /* 1024-1518 Byte Tx Frame */ 17018c2ecf20Sopenharmony_ci GM_TXF_MAX_SZ = GM_MIB_CNT_BASE + 288, /* 1519-MaxSize Byte Tx Frame */ 17028c2ecf20Sopenharmony_ci 17038c2ecf20Sopenharmony_ci GM_TXF_COL = GM_MIB_CNT_BASE + 304, /* Tx Collision */ 17048c2ecf20Sopenharmony_ci GM_TXF_LAT_COL = GM_MIB_CNT_BASE + 312, /* Tx Late Collision */ 17058c2ecf20Sopenharmony_ci GM_TXF_ABO_COL = GM_MIB_CNT_BASE + 320, /* Tx aborted due to Exces. Col. */ 17068c2ecf20Sopenharmony_ci GM_TXF_MUL_COL = GM_MIB_CNT_BASE + 328, /* Tx Multiple Collision */ 17078c2ecf20Sopenharmony_ci GM_TXF_SNG_COL = GM_MIB_CNT_BASE + 336, /* Tx Single Collision */ 17088c2ecf20Sopenharmony_ci GM_TXE_FIFO_UR = GM_MIB_CNT_BASE + 344, /* Tx FIFO Underrun Event */ 17098c2ecf20Sopenharmony_ci}; 17108c2ecf20Sopenharmony_ci 17118c2ecf20Sopenharmony_ci/* GMAC Bit Definitions */ 17128c2ecf20Sopenharmony_ci/* GM_GP_STAT 16 bit r/o General Purpose Status Register */ 17138c2ecf20Sopenharmony_cienum { 17148c2ecf20Sopenharmony_ci GM_GPSR_SPEED = 1<<15, /* Bit 15: Port Speed (1 = 100 Mbps) */ 17158c2ecf20Sopenharmony_ci GM_GPSR_DUPLEX = 1<<14, /* Bit 14: Duplex Mode (1 = Full) */ 17168c2ecf20Sopenharmony_ci GM_GPSR_FC_TX_DIS = 1<<13, /* Bit 13: Tx Flow-Control Mode Disabled */ 17178c2ecf20Sopenharmony_ci GM_GPSR_LINK_UP = 1<<12, /* Bit 12: Link Up Status */ 17188c2ecf20Sopenharmony_ci GM_GPSR_PAUSE = 1<<11, /* Bit 11: Pause State */ 17198c2ecf20Sopenharmony_ci GM_GPSR_TX_ACTIVE = 1<<10, /* Bit 10: Tx in Progress */ 17208c2ecf20Sopenharmony_ci GM_GPSR_EXC_COL = 1<<9, /* Bit 9: Excessive Collisions Occurred */ 17218c2ecf20Sopenharmony_ci GM_GPSR_LAT_COL = 1<<8, /* Bit 8: Late Collisions Occurred */ 17228c2ecf20Sopenharmony_ci 17238c2ecf20Sopenharmony_ci GM_GPSR_PHY_ST_CH = 1<<5, /* Bit 5: PHY Status Change */ 17248c2ecf20Sopenharmony_ci GM_GPSR_GIG_SPEED = 1<<4, /* Bit 4: Gigabit Speed (1 = 1000 Mbps) */ 17258c2ecf20Sopenharmony_ci GM_GPSR_PART_MODE = 1<<3, /* Bit 3: Partition mode */ 17268c2ecf20Sopenharmony_ci GM_GPSR_FC_RX_DIS = 1<<2, /* Bit 2: Rx Flow-Control Mode Disabled */ 17278c2ecf20Sopenharmony_ci GM_GPSR_PROM_EN = 1<<1, /* Bit 1: Promiscuous Mode Enabled */ 17288c2ecf20Sopenharmony_ci}; 17298c2ecf20Sopenharmony_ci 17308c2ecf20Sopenharmony_ci/* GM_GP_CTRL 16 bit r/w General Purpose Control Register */ 17318c2ecf20Sopenharmony_cienum { 17328c2ecf20Sopenharmony_ci GM_GPCR_PROM_ENA = 1<<14, /* Bit 14: Enable Promiscuous Mode */ 17338c2ecf20Sopenharmony_ci GM_GPCR_FC_TX_DIS = 1<<13, /* Bit 13: Disable Tx Flow-Control Mode */ 17348c2ecf20Sopenharmony_ci GM_GPCR_TX_ENA = 1<<12, /* Bit 12: Enable Transmit */ 17358c2ecf20Sopenharmony_ci GM_GPCR_RX_ENA = 1<<11, /* Bit 11: Enable Receive */ 17368c2ecf20Sopenharmony_ci GM_GPCR_BURST_ENA = 1<<10, /* Bit 10: Enable Burst Mode */ 17378c2ecf20Sopenharmony_ci GM_GPCR_LOOP_ENA = 1<<9, /* Bit 9: Enable MAC Loopback Mode */ 17388c2ecf20Sopenharmony_ci GM_GPCR_PART_ENA = 1<<8, /* Bit 8: Enable Partition Mode */ 17398c2ecf20Sopenharmony_ci GM_GPCR_GIGS_ENA = 1<<7, /* Bit 7: Gigabit Speed (1000 Mbps) */ 17408c2ecf20Sopenharmony_ci GM_GPCR_FL_PASS = 1<<6, /* Bit 6: Force Link Pass */ 17418c2ecf20Sopenharmony_ci GM_GPCR_DUP_FULL = 1<<5, /* Bit 5: Full Duplex Mode */ 17428c2ecf20Sopenharmony_ci GM_GPCR_FC_RX_DIS = 1<<4, /* Bit 4: Disable Rx Flow-Control Mode */ 17438c2ecf20Sopenharmony_ci GM_GPCR_SPEED_100 = 1<<3, /* Bit 3: Port Speed 100 Mbps */ 17448c2ecf20Sopenharmony_ci GM_GPCR_AU_DUP_DIS = 1<<2, /* Bit 2: Disable Auto-Update Duplex */ 17458c2ecf20Sopenharmony_ci GM_GPCR_AU_FCT_DIS = 1<<1, /* Bit 1: Disable Auto-Update Flow-C. */ 17468c2ecf20Sopenharmony_ci GM_GPCR_AU_SPD_DIS = 1<<0, /* Bit 0: Disable Auto-Update Speed */ 17478c2ecf20Sopenharmony_ci}; 17488c2ecf20Sopenharmony_ci 17498c2ecf20Sopenharmony_ci#define GM_GPCR_SPEED_1000 (GM_GPCR_GIGS_ENA | GM_GPCR_SPEED_100) 17508c2ecf20Sopenharmony_ci#define GM_GPCR_AU_ALL_DIS (GM_GPCR_AU_DUP_DIS | GM_GPCR_AU_FCT_DIS|GM_GPCR_AU_SPD_DIS) 17518c2ecf20Sopenharmony_ci 17528c2ecf20Sopenharmony_ci/* GM_TX_CTRL 16 bit r/w Transmit Control Register */ 17538c2ecf20Sopenharmony_cienum { 17548c2ecf20Sopenharmony_ci GM_TXCR_FORCE_JAM = 1<<15, /* Bit 15: Force Jam / Flow-Control */ 17558c2ecf20Sopenharmony_ci GM_TXCR_CRC_DIS = 1<<14, /* Bit 14: Disable insertion of CRC */ 17568c2ecf20Sopenharmony_ci GM_TXCR_PAD_DIS = 1<<13, /* Bit 13: Disable padding of packets */ 17578c2ecf20Sopenharmony_ci GM_TXCR_COL_THR_MSK = 7<<10, /* Bit 12..10: Collision Threshold */ 17588c2ecf20Sopenharmony_ci}; 17598c2ecf20Sopenharmony_ci 17608c2ecf20Sopenharmony_ci#define TX_COL_THR(x) (((x)<<10) & GM_TXCR_COL_THR_MSK) 17618c2ecf20Sopenharmony_ci#define TX_COL_DEF 0x04 /* late collision after 64 byte */ 17628c2ecf20Sopenharmony_ci 17638c2ecf20Sopenharmony_ci/* GM_RX_CTRL 16 bit r/w Receive Control Register */ 17648c2ecf20Sopenharmony_cienum { 17658c2ecf20Sopenharmony_ci GM_RXCR_UCF_ENA = 1<<15, /* Bit 15: Enable Unicast filtering */ 17668c2ecf20Sopenharmony_ci GM_RXCR_MCF_ENA = 1<<14, /* Bit 14: Enable Multicast filtering */ 17678c2ecf20Sopenharmony_ci GM_RXCR_CRC_DIS = 1<<13, /* Bit 13: Remove 4-byte CRC */ 17688c2ecf20Sopenharmony_ci GM_RXCR_PASS_FC = 1<<12, /* Bit 12: Pass FC packets to FIFO */ 17698c2ecf20Sopenharmony_ci}; 17708c2ecf20Sopenharmony_ci 17718c2ecf20Sopenharmony_ci/* GM_TX_PARAM 16 bit r/w Transmit Parameter Register */ 17728c2ecf20Sopenharmony_cienum { 17738c2ecf20Sopenharmony_ci GM_TXPA_JAMLEN_MSK = 0x03<<14, /* Bit 15..14: Jam Length */ 17748c2ecf20Sopenharmony_ci GM_TXPA_JAMIPG_MSK = 0x1f<<9, /* Bit 13..9: Jam IPG */ 17758c2ecf20Sopenharmony_ci GM_TXPA_JAMDAT_MSK = 0x1f<<4, /* Bit 8..4: IPG Jam to Data */ 17768c2ecf20Sopenharmony_ci 17778c2ecf20Sopenharmony_ci TX_JAM_LEN_DEF = 0x03, 17788c2ecf20Sopenharmony_ci TX_JAM_IPG_DEF = 0x0b, 17798c2ecf20Sopenharmony_ci TX_IPG_JAM_DEF = 0x1c, 17808c2ecf20Sopenharmony_ci}; 17818c2ecf20Sopenharmony_ci 17828c2ecf20Sopenharmony_ci#define TX_JAM_LEN_VAL(x) (((x)<<14) & GM_TXPA_JAMLEN_MSK) 17838c2ecf20Sopenharmony_ci#define TX_JAM_IPG_VAL(x) (((x)<<9) & GM_TXPA_JAMIPG_MSK) 17848c2ecf20Sopenharmony_ci#define TX_IPG_JAM_DATA(x) (((x)<<4) & GM_TXPA_JAMDAT_MSK) 17858c2ecf20Sopenharmony_ci 17868c2ecf20Sopenharmony_ci 17878c2ecf20Sopenharmony_ci/* GM_SERIAL_MODE 16 bit r/w Serial Mode Register */ 17888c2ecf20Sopenharmony_cienum { 17898c2ecf20Sopenharmony_ci GM_SMOD_DATABL_MSK = 0x1f<<11, /* Bit 15..11: Data Blinder (r/o) */ 17908c2ecf20Sopenharmony_ci GM_SMOD_LIMIT_4 = 1<<10, /* Bit 10: 4 consecutive Tx trials */ 17918c2ecf20Sopenharmony_ci GM_SMOD_VLAN_ENA = 1<<9, /* Bit 9: Enable VLAN (Max. Frame Len) */ 17928c2ecf20Sopenharmony_ci GM_SMOD_JUMBO_ENA = 1<<8, /* Bit 8: Enable Jumbo (Max. Frame Len) */ 17938c2ecf20Sopenharmony_ci GM_SMOD_IPG_MSK = 0x1f /* Bit 4..0: Inter-Packet Gap (IPG) */ 17948c2ecf20Sopenharmony_ci}; 17958c2ecf20Sopenharmony_ci 17968c2ecf20Sopenharmony_ci#define DATA_BLIND_VAL(x) (((x)<<11) & GM_SMOD_DATABL_MSK) 17978c2ecf20Sopenharmony_ci#define DATA_BLIND_DEF 0x04 17988c2ecf20Sopenharmony_ci 17998c2ecf20Sopenharmony_ci#define IPG_DATA_VAL(x) (x & GM_SMOD_IPG_MSK) 18008c2ecf20Sopenharmony_ci#define IPG_DATA_DEF 0x1e 18018c2ecf20Sopenharmony_ci 18028c2ecf20Sopenharmony_ci/* GM_SMI_CTRL 16 bit r/w SMI Control Register */ 18038c2ecf20Sopenharmony_cienum { 18048c2ecf20Sopenharmony_ci GM_SMI_CT_PHY_A_MSK = 0x1f<<11, /* Bit 15..11: PHY Device Address */ 18058c2ecf20Sopenharmony_ci GM_SMI_CT_REG_A_MSK = 0x1f<<6, /* Bit 10.. 6: PHY Register Address */ 18068c2ecf20Sopenharmony_ci GM_SMI_CT_OP_RD = 1<<5, /* Bit 5: OpCode Read (0=Write)*/ 18078c2ecf20Sopenharmony_ci GM_SMI_CT_RD_VAL = 1<<4, /* Bit 4: Read Valid (Read completed) */ 18088c2ecf20Sopenharmony_ci GM_SMI_CT_BUSY = 1<<3, /* Bit 3: Busy (Operation in progress) */ 18098c2ecf20Sopenharmony_ci}; 18108c2ecf20Sopenharmony_ci 18118c2ecf20Sopenharmony_ci#define GM_SMI_CT_PHY_AD(x) (((x)<<11) & GM_SMI_CT_PHY_A_MSK) 18128c2ecf20Sopenharmony_ci#define GM_SMI_CT_REG_AD(x) (((x)<<6) & GM_SMI_CT_REG_A_MSK) 18138c2ecf20Sopenharmony_ci 18148c2ecf20Sopenharmony_ci/* GM_PHY_ADDR 16 bit r/w GPHY Address Register */ 18158c2ecf20Sopenharmony_cienum { 18168c2ecf20Sopenharmony_ci GM_PAR_MIB_CLR = 1<<5, /* Bit 5: Set MIB Clear Counter Mode */ 18178c2ecf20Sopenharmony_ci GM_PAR_MIB_TST = 1<<4, /* Bit 4: MIB Load Counter (Test Mode) */ 18188c2ecf20Sopenharmony_ci}; 18198c2ecf20Sopenharmony_ci 18208c2ecf20Sopenharmony_ci/* Receive Frame Status Encoding */ 18218c2ecf20Sopenharmony_cienum { 18228c2ecf20Sopenharmony_ci GMR_FS_LEN = 0xffff<<16, /* Bit 31..16: Rx Frame Length */ 18238c2ecf20Sopenharmony_ci GMR_FS_LEN_SHIFT = 16, 18248c2ecf20Sopenharmony_ci GMR_FS_VLAN = 1<<13, /* Bit 13: VLAN Packet */ 18258c2ecf20Sopenharmony_ci GMR_FS_JABBER = 1<<12, /* Bit 12: Jabber Packet */ 18268c2ecf20Sopenharmony_ci GMR_FS_UN_SIZE = 1<<11, /* Bit 11: Undersize Packet */ 18278c2ecf20Sopenharmony_ci GMR_FS_MC = 1<<10, /* Bit 10: Multicast Packet */ 18288c2ecf20Sopenharmony_ci GMR_FS_BC = 1<<9, /* Bit 9: Broadcast Packet */ 18298c2ecf20Sopenharmony_ci GMR_FS_RX_OK = 1<<8, /* Bit 8: Receive OK (Good Packet) */ 18308c2ecf20Sopenharmony_ci GMR_FS_GOOD_FC = 1<<7, /* Bit 7: Good Flow-Control Packet */ 18318c2ecf20Sopenharmony_ci GMR_FS_BAD_FC = 1<<6, /* Bit 6: Bad Flow-Control Packet */ 18328c2ecf20Sopenharmony_ci GMR_FS_MII_ERR = 1<<5, /* Bit 5: MII Error */ 18338c2ecf20Sopenharmony_ci GMR_FS_LONG_ERR = 1<<4, /* Bit 4: Too Long Packet */ 18348c2ecf20Sopenharmony_ci GMR_FS_FRAGMENT = 1<<3, /* Bit 3: Fragment */ 18358c2ecf20Sopenharmony_ci 18368c2ecf20Sopenharmony_ci GMR_FS_CRC_ERR = 1<<1, /* Bit 1: CRC Error */ 18378c2ecf20Sopenharmony_ci GMR_FS_RX_FF_OV = 1<<0, /* Bit 0: Rx FIFO Overflow */ 18388c2ecf20Sopenharmony_ci 18398c2ecf20Sopenharmony_ci/* 18408c2ecf20Sopenharmony_ci * GMR_FS_ANY_ERR (analogous to XMR_FS_ANY_ERR) 18418c2ecf20Sopenharmony_ci */ 18428c2ecf20Sopenharmony_ci GMR_FS_ANY_ERR = GMR_FS_CRC_ERR | GMR_FS_LONG_ERR | 18438c2ecf20Sopenharmony_ci GMR_FS_MII_ERR | GMR_FS_BAD_FC | GMR_FS_GOOD_FC | 18448c2ecf20Sopenharmony_ci GMR_FS_JABBER, 18458c2ecf20Sopenharmony_ci/* Rx GMAC FIFO Flush Mask (default) */ 18468c2ecf20Sopenharmony_ci RX_FF_FL_DEF_MSK = GMR_FS_CRC_ERR | GMR_FS_RX_FF_OV |GMR_FS_MII_ERR | 18478c2ecf20Sopenharmony_ci GMR_FS_BAD_FC | GMR_FS_UN_SIZE | GMR_FS_JABBER, 18488c2ecf20Sopenharmony_ci}; 18498c2ecf20Sopenharmony_ci 18508c2ecf20Sopenharmony_ci/* RX_GMF_CTRL_T 32 bit Rx GMAC FIFO Control/Test */ 18518c2ecf20Sopenharmony_cienum { 18528c2ecf20Sopenharmony_ci GMF_WP_TST_ON = 1<<14, /* Write Pointer Test On */ 18538c2ecf20Sopenharmony_ci GMF_WP_TST_OFF = 1<<13, /* Write Pointer Test Off */ 18548c2ecf20Sopenharmony_ci GMF_WP_STEP = 1<<12, /* Write Pointer Step/Increment */ 18558c2ecf20Sopenharmony_ci 18568c2ecf20Sopenharmony_ci GMF_RP_TST_ON = 1<<10, /* Read Pointer Test On */ 18578c2ecf20Sopenharmony_ci GMF_RP_TST_OFF = 1<<9, /* Read Pointer Test Off */ 18588c2ecf20Sopenharmony_ci GMF_RP_STEP = 1<<8, /* Read Pointer Step/Increment */ 18598c2ecf20Sopenharmony_ci GMF_RX_F_FL_ON = 1<<7, /* Rx FIFO Flush Mode On */ 18608c2ecf20Sopenharmony_ci GMF_RX_F_FL_OFF = 1<<6, /* Rx FIFO Flush Mode Off */ 18618c2ecf20Sopenharmony_ci GMF_CLI_RX_FO = 1<<5, /* Clear IRQ Rx FIFO Overrun */ 18628c2ecf20Sopenharmony_ci GMF_CLI_RX_FC = 1<<4, /* Clear IRQ Rx Frame Complete */ 18638c2ecf20Sopenharmony_ci GMF_OPER_ON = 1<<3, /* Operational Mode On */ 18648c2ecf20Sopenharmony_ci GMF_OPER_OFF = 1<<2, /* Operational Mode Off */ 18658c2ecf20Sopenharmony_ci GMF_RST_CLR = 1<<1, /* Clear GMAC FIFO Reset */ 18668c2ecf20Sopenharmony_ci GMF_RST_SET = 1<<0, /* Set GMAC FIFO Reset */ 18678c2ecf20Sopenharmony_ci 18688c2ecf20Sopenharmony_ci RX_GMF_FL_THR_DEF = 0xa, /* flush threshold (default) */ 18698c2ecf20Sopenharmony_ci}; 18708c2ecf20Sopenharmony_ci 18718c2ecf20Sopenharmony_ci 18728c2ecf20Sopenharmony_ci/* TX_GMF_CTRL_T 32 bit Tx GMAC FIFO Control/Test */ 18738c2ecf20Sopenharmony_cienum { 18748c2ecf20Sopenharmony_ci GMF_WSP_TST_ON = 1<<18, /* Write Shadow Pointer Test On */ 18758c2ecf20Sopenharmony_ci GMF_WSP_TST_OFF = 1<<17, /* Write Shadow Pointer Test Off */ 18768c2ecf20Sopenharmony_ci GMF_WSP_STEP = 1<<16, /* Write Shadow Pointer Step/Increment */ 18778c2ecf20Sopenharmony_ci 18788c2ecf20Sopenharmony_ci GMF_CLI_TX_FU = 1<<6, /* Clear IRQ Tx FIFO Underrun */ 18798c2ecf20Sopenharmony_ci GMF_CLI_TX_FC = 1<<5, /* Clear IRQ Tx Frame Complete */ 18808c2ecf20Sopenharmony_ci GMF_CLI_TX_PE = 1<<4, /* Clear IRQ Tx Parity Error */ 18818c2ecf20Sopenharmony_ci}; 18828c2ecf20Sopenharmony_ci 18838c2ecf20Sopenharmony_ci/* GMAC_TI_ST_CTRL 8 bit Time Stamp Timer Ctrl Reg (YUKON only) */ 18848c2ecf20Sopenharmony_cienum { 18858c2ecf20Sopenharmony_ci GMT_ST_START = 1<<2, /* Start Time Stamp Timer */ 18868c2ecf20Sopenharmony_ci GMT_ST_STOP = 1<<1, /* Stop Time Stamp Timer */ 18878c2ecf20Sopenharmony_ci GMT_ST_CLR_IRQ = 1<<0, /* Clear Time Stamp Timer IRQ */ 18888c2ecf20Sopenharmony_ci}; 18898c2ecf20Sopenharmony_ci 18908c2ecf20Sopenharmony_ci/* GMAC_CTRL 32 bit GMAC Control Reg (YUKON only) */ 18918c2ecf20Sopenharmony_cienum { 18928c2ecf20Sopenharmony_ci GMC_H_BURST_ON = 1<<7, /* Half Duplex Burst Mode On */ 18938c2ecf20Sopenharmony_ci GMC_H_BURST_OFF = 1<<6, /* Half Duplex Burst Mode Off */ 18948c2ecf20Sopenharmony_ci GMC_F_LOOPB_ON = 1<<5, /* FIFO Loopback On */ 18958c2ecf20Sopenharmony_ci GMC_F_LOOPB_OFF = 1<<4, /* FIFO Loopback Off */ 18968c2ecf20Sopenharmony_ci GMC_PAUSE_ON = 1<<3, /* Pause On */ 18978c2ecf20Sopenharmony_ci GMC_PAUSE_OFF = 1<<2, /* Pause Off */ 18988c2ecf20Sopenharmony_ci GMC_RST_CLR = 1<<1, /* Clear GMAC Reset */ 18998c2ecf20Sopenharmony_ci GMC_RST_SET = 1<<0, /* Set GMAC Reset */ 19008c2ecf20Sopenharmony_ci}; 19018c2ecf20Sopenharmony_ci 19028c2ecf20Sopenharmony_ci/* GPHY_CTRL 32 bit GPHY Control Reg (YUKON only) */ 19038c2ecf20Sopenharmony_cienum { 19048c2ecf20Sopenharmony_ci GPC_SEL_BDT = 1<<28, /* Select Bi-Dir. Transfer for MDC/MDIO */ 19058c2ecf20Sopenharmony_ci GPC_INT_POL_HI = 1<<27, /* IRQ Polarity is Active HIGH */ 19068c2ecf20Sopenharmony_ci GPC_75_OHM = 1<<26, /* Use 75 Ohm Termination instead of 50 */ 19078c2ecf20Sopenharmony_ci GPC_DIS_FC = 1<<25, /* Disable Automatic Fiber/Copper Detection */ 19088c2ecf20Sopenharmony_ci GPC_DIS_SLEEP = 1<<24, /* Disable Energy Detect */ 19098c2ecf20Sopenharmony_ci GPC_HWCFG_M_3 = 1<<23, /* HWCFG_MODE[3] */ 19108c2ecf20Sopenharmony_ci GPC_HWCFG_M_2 = 1<<22, /* HWCFG_MODE[2] */ 19118c2ecf20Sopenharmony_ci GPC_HWCFG_M_1 = 1<<21, /* HWCFG_MODE[1] */ 19128c2ecf20Sopenharmony_ci GPC_HWCFG_M_0 = 1<<20, /* HWCFG_MODE[0] */ 19138c2ecf20Sopenharmony_ci GPC_ANEG_0 = 1<<19, /* ANEG[0] */ 19148c2ecf20Sopenharmony_ci GPC_ENA_XC = 1<<18, /* Enable MDI crossover */ 19158c2ecf20Sopenharmony_ci GPC_DIS_125 = 1<<17, /* Disable 125 MHz clock */ 19168c2ecf20Sopenharmony_ci GPC_ANEG_3 = 1<<16, /* ANEG[3] */ 19178c2ecf20Sopenharmony_ci GPC_ANEG_2 = 1<<15, /* ANEG[2] */ 19188c2ecf20Sopenharmony_ci GPC_ANEG_1 = 1<<14, /* ANEG[1] */ 19198c2ecf20Sopenharmony_ci GPC_ENA_PAUSE = 1<<13, /* Enable Pause (SYM_OR_REM) */ 19208c2ecf20Sopenharmony_ci GPC_PHYADDR_4 = 1<<12, /* Bit 4 of Phy Addr */ 19218c2ecf20Sopenharmony_ci GPC_PHYADDR_3 = 1<<11, /* Bit 3 of Phy Addr */ 19228c2ecf20Sopenharmony_ci GPC_PHYADDR_2 = 1<<10, /* Bit 2 of Phy Addr */ 19238c2ecf20Sopenharmony_ci GPC_PHYADDR_1 = 1<<9, /* Bit 1 of Phy Addr */ 19248c2ecf20Sopenharmony_ci GPC_PHYADDR_0 = 1<<8, /* Bit 0 of Phy Addr */ 19258c2ecf20Sopenharmony_ci /* Bits 7..2: reserved */ 19268c2ecf20Sopenharmony_ci GPC_RST_CLR = 1<<1, /* Clear GPHY Reset */ 19278c2ecf20Sopenharmony_ci GPC_RST_SET = 1<<0, /* Set GPHY Reset */ 19288c2ecf20Sopenharmony_ci}; 19298c2ecf20Sopenharmony_ci 19308c2ecf20Sopenharmony_ci#define GPC_HWCFG_GMII_COP (GPC_HWCFG_M_3|GPC_HWCFG_M_2 | GPC_HWCFG_M_1 | GPC_HWCFG_M_0) 19318c2ecf20Sopenharmony_ci#define GPC_HWCFG_GMII_FIB (GPC_HWCFG_M_2 | GPC_HWCFG_M_1 | GPC_HWCFG_M_0) 19328c2ecf20Sopenharmony_ci#define GPC_ANEG_ADV_ALL_M (GPC_ANEG_3 | GPC_ANEG_2 | GPC_ANEG_1 | GPC_ANEG_0) 19338c2ecf20Sopenharmony_ci 19348c2ecf20Sopenharmony_ci/* forced speed and duplex mode (don't mix with other ANEG bits) */ 19358c2ecf20Sopenharmony_ci#define GPC_FRC10MBIT_HALF 0 19368c2ecf20Sopenharmony_ci#define GPC_FRC10MBIT_FULL GPC_ANEG_0 19378c2ecf20Sopenharmony_ci#define GPC_FRC100MBIT_HALF GPC_ANEG_1 19388c2ecf20Sopenharmony_ci#define GPC_FRC100MBIT_FULL (GPC_ANEG_0 | GPC_ANEG_1) 19398c2ecf20Sopenharmony_ci 19408c2ecf20Sopenharmony_ci/* auto-negotiation with limited advertised speeds */ 19418c2ecf20Sopenharmony_ci/* mix only with master/slave settings (for copper) */ 19428c2ecf20Sopenharmony_ci#define GPC_ADV_1000_HALF GPC_ANEG_2 19438c2ecf20Sopenharmony_ci#define GPC_ADV_1000_FULL GPC_ANEG_3 19448c2ecf20Sopenharmony_ci#define GPC_ADV_ALL (GPC_ANEG_2 | GPC_ANEG_3) 19458c2ecf20Sopenharmony_ci 19468c2ecf20Sopenharmony_ci/* master/slave settings */ 19478c2ecf20Sopenharmony_ci/* only for copper with 1000 Mbps */ 19488c2ecf20Sopenharmony_ci#define GPC_FORCE_MASTER 0 19498c2ecf20Sopenharmony_ci#define GPC_FORCE_SLAVE GPC_ANEG_0 19508c2ecf20Sopenharmony_ci#define GPC_PREF_MASTER GPC_ANEG_1 19518c2ecf20Sopenharmony_ci#define GPC_PREF_SLAVE (GPC_ANEG_1 | GPC_ANEG_0) 19528c2ecf20Sopenharmony_ci 19538c2ecf20Sopenharmony_ci/* GMAC_IRQ_SRC 8 bit GMAC Interrupt Source Reg (YUKON only) */ 19548c2ecf20Sopenharmony_ci/* GMAC_IRQ_MSK 8 bit GMAC Interrupt Mask Reg (YUKON only) */ 19558c2ecf20Sopenharmony_cienum { 19568c2ecf20Sopenharmony_ci GM_IS_TX_CO_OV = 1<<5, /* Transmit Counter Overflow IRQ */ 19578c2ecf20Sopenharmony_ci GM_IS_RX_CO_OV = 1<<4, /* Receive Counter Overflow IRQ */ 19588c2ecf20Sopenharmony_ci GM_IS_TX_FF_UR = 1<<3, /* Transmit FIFO Underrun */ 19598c2ecf20Sopenharmony_ci GM_IS_TX_COMPL = 1<<2, /* Frame Transmission Complete */ 19608c2ecf20Sopenharmony_ci GM_IS_RX_FF_OR = 1<<1, /* Receive FIFO Overrun */ 19618c2ecf20Sopenharmony_ci GM_IS_RX_COMPL = 1<<0, /* Frame Reception Complete */ 19628c2ecf20Sopenharmony_ci 19638c2ecf20Sopenharmony_ci#define GMAC_DEF_MSK (GM_IS_RX_FF_OR | GM_IS_TX_FF_UR) 19648c2ecf20Sopenharmony_ci 19658c2ecf20Sopenharmony_ci/* GMAC_LINK_CTRL 16 bit GMAC Link Control Reg (YUKON only) */ 19668c2ecf20Sopenharmony_ci /* Bits 15.. 2: reserved */ 19678c2ecf20Sopenharmony_ci GMLC_RST_CLR = 1<<1, /* Clear GMAC Link Reset */ 19688c2ecf20Sopenharmony_ci GMLC_RST_SET = 1<<0, /* Set GMAC Link Reset */ 19698c2ecf20Sopenharmony_ci 19708c2ecf20Sopenharmony_ci 19718c2ecf20Sopenharmony_ci/* WOL_CTRL_STAT 16 bit WOL Control/Status Reg */ 19728c2ecf20Sopenharmony_ci WOL_CTL_LINK_CHG_OCC = 1<<15, 19738c2ecf20Sopenharmony_ci WOL_CTL_MAGIC_PKT_OCC = 1<<14, 19748c2ecf20Sopenharmony_ci WOL_CTL_PATTERN_OCC = 1<<13, 19758c2ecf20Sopenharmony_ci WOL_CTL_CLEAR_RESULT = 1<<12, 19768c2ecf20Sopenharmony_ci WOL_CTL_ENA_PME_ON_LINK_CHG = 1<<11, 19778c2ecf20Sopenharmony_ci WOL_CTL_DIS_PME_ON_LINK_CHG = 1<<10, 19788c2ecf20Sopenharmony_ci WOL_CTL_ENA_PME_ON_MAGIC_PKT = 1<<9, 19798c2ecf20Sopenharmony_ci WOL_CTL_DIS_PME_ON_MAGIC_PKT = 1<<8, 19808c2ecf20Sopenharmony_ci WOL_CTL_ENA_PME_ON_PATTERN = 1<<7, 19818c2ecf20Sopenharmony_ci WOL_CTL_DIS_PME_ON_PATTERN = 1<<6, 19828c2ecf20Sopenharmony_ci WOL_CTL_ENA_LINK_CHG_UNIT = 1<<5, 19838c2ecf20Sopenharmony_ci WOL_CTL_DIS_LINK_CHG_UNIT = 1<<4, 19848c2ecf20Sopenharmony_ci WOL_CTL_ENA_MAGIC_PKT_UNIT = 1<<3, 19858c2ecf20Sopenharmony_ci WOL_CTL_DIS_MAGIC_PKT_UNIT = 1<<2, 19868c2ecf20Sopenharmony_ci WOL_CTL_ENA_PATTERN_UNIT = 1<<1, 19878c2ecf20Sopenharmony_ci WOL_CTL_DIS_PATTERN_UNIT = 1<<0, 19888c2ecf20Sopenharmony_ci}; 19898c2ecf20Sopenharmony_ci 19908c2ecf20Sopenharmony_ci#define WOL_CTL_DEFAULT \ 19918c2ecf20Sopenharmony_ci (WOL_CTL_DIS_PME_ON_LINK_CHG | \ 19928c2ecf20Sopenharmony_ci WOL_CTL_DIS_PME_ON_PATTERN | \ 19938c2ecf20Sopenharmony_ci WOL_CTL_DIS_PME_ON_MAGIC_PKT | \ 19948c2ecf20Sopenharmony_ci WOL_CTL_DIS_LINK_CHG_UNIT | \ 19958c2ecf20Sopenharmony_ci WOL_CTL_DIS_PATTERN_UNIT | \ 19968c2ecf20Sopenharmony_ci WOL_CTL_DIS_MAGIC_PKT_UNIT) 19978c2ecf20Sopenharmony_ci 19988c2ecf20Sopenharmony_ci/* WOL_MATCH_CTL 8 bit WOL Match Control Reg */ 19998c2ecf20Sopenharmony_ci#define WOL_CTL_PATT_ENA(x) (1 << (x)) 20008c2ecf20Sopenharmony_ci 20018c2ecf20Sopenharmony_ci 20028c2ecf20Sopenharmony_ci/* XMAC II registers */ 20038c2ecf20Sopenharmony_cienum { 20048c2ecf20Sopenharmony_ci XM_MMU_CMD = 0x0000, /* 16 bit r/w MMU Command Register */ 20058c2ecf20Sopenharmony_ci XM_POFF = 0x0008, /* 32 bit r/w Packet Offset Register */ 20068c2ecf20Sopenharmony_ci XM_BURST = 0x000c, /* 32 bit r/w Burst Register for half duplex*/ 20078c2ecf20Sopenharmony_ci XM_1L_VLAN_TAG = 0x0010, /* 16 bit r/w One Level VLAN Tag ID */ 20088c2ecf20Sopenharmony_ci XM_2L_VLAN_TAG = 0x0014, /* 16 bit r/w Two Level VLAN Tag ID */ 20098c2ecf20Sopenharmony_ci XM_TX_CMD = 0x0020, /* 16 bit r/w Transmit Command Register */ 20108c2ecf20Sopenharmony_ci XM_TX_RT_LIM = 0x0024, /* 16 bit r/w Transmit Retry Limit Register */ 20118c2ecf20Sopenharmony_ci XM_TX_STIME = 0x0028, /* 16 bit r/w Transmit Slottime Register */ 20128c2ecf20Sopenharmony_ci XM_TX_IPG = 0x002c, /* 16 bit r/w Transmit Inter Packet Gap */ 20138c2ecf20Sopenharmony_ci XM_RX_CMD = 0x0030, /* 16 bit r/w Receive Command Register */ 20148c2ecf20Sopenharmony_ci XM_PHY_ADDR = 0x0034, /* 16 bit r/w PHY Address Register */ 20158c2ecf20Sopenharmony_ci XM_PHY_DATA = 0x0038, /* 16 bit r/w PHY Data Register */ 20168c2ecf20Sopenharmony_ci XM_GP_PORT = 0x0040, /* 32 bit r/w General Purpose Port Register */ 20178c2ecf20Sopenharmony_ci XM_IMSK = 0x0044, /* 16 bit r/w Interrupt Mask Register */ 20188c2ecf20Sopenharmony_ci XM_ISRC = 0x0048, /* 16 bit r/o Interrupt Status Register */ 20198c2ecf20Sopenharmony_ci XM_HW_CFG = 0x004c, /* 16 bit r/w Hardware Config Register */ 20208c2ecf20Sopenharmony_ci XM_TX_LO_WM = 0x0060, /* 16 bit r/w Tx FIFO Low Water Mark */ 20218c2ecf20Sopenharmony_ci XM_TX_HI_WM = 0x0062, /* 16 bit r/w Tx FIFO High Water Mark */ 20228c2ecf20Sopenharmony_ci XM_TX_THR = 0x0064, /* 16 bit r/w Tx Request Threshold */ 20238c2ecf20Sopenharmony_ci XM_HT_THR = 0x0066, /* 16 bit r/w Host Request Threshold */ 20248c2ecf20Sopenharmony_ci XM_PAUSE_DA = 0x0068, /* NA reg r/w Pause Destination Address */ 20258c2ecf20Sopenharmony_ci XM_CTL_PARA = 0x0070, /* 32 bit r/w Control Parameter Register */ 20268c2ecf20Sopenharmony_ci XM_MAC_OPCODE = 0x0074, /* 16 bit r/w Opcode for MAC control frames */ 20278c2ecf20Sopenharmony_ci XM_MAC_PTIME = 0x0076, /* 16 bit r/w Pause time for MAC ctrl frames*/ 20288c2ecf20Sopenharmony_ci XM_TX_STAT = 0x0078, /* 32 bit r/o Tx Status LIFO Register */ 20298c2ecf20Sopenharmony_ci 20308c2ecf20Sopenharmony_ci XM_EXM_START = 0x0080, /* r/w Start Address of the EXM Regs */ 20318c2ecf20Sopenharmony_ci#define XM_EXM(reg) (XM_EXM_START + ((reg) << 3)) 20328c2ecf20Sopenharmony_ci}; 20338c2ecf20Sopenharmony_ci 20348c2ecf20Sopenharmony_cienum { 20358c2ecf20Sopenharmony_ci XM_SRC_CHK = 0x0100, /* NA reg r/w Source Check Address Register */ 20368c2ecf20Sopenharmony_ci XM_SA = 0x0108, /* NA reg r/w Station Address Register */ 20378c2ecf20Sopenharmony_ci XM_HSM = 0x0110, /* 64 bit r/w Hash Match Address Registers */ 20388c2ecf20Sopenharmony_ci XM_RX_LO_WM = 0x0118, /* 16 bit r/w Receive Low Water Mark */ 20398c2ecf20Sopenharmony_ci XM_RX_HI_WM = 0x011a, /* 16 bit r/w Receive High Water Mark */ 20408c2ecf20Sopenharmony_ci XM_RX_THR = 0x011c, /* 32 bit r/w Receive Request Threshold */ 20418c2ecf20Sopenharmony_ci XM_DEV_ID = 0x0120, /* 32 bit r/o Device ID Register */ 20428c2ecf20Sopenharmony_ci XM_MODE = 0x0124, /* 32 bit r/w Mode Register */ 20438c2ecf20Sopenharmony_ci XM_LSA = 0x0128, /* NA reg r/o Last Source Register */ 20448c2ecf20Sopenharmony_ci XM_TS_READ = 0x0130, /* 32 bit r/o Time Stamp Read Register */ 20458c2ecf20Sopenharmony_ci XM_TS_LOAD = 0x0134, /* 32 bit r/o Time Stamp Load Value */ 20468c2ecf20Sopenharmony_ci XM_STAT_CMD = 0x0200, /* 16 bit r/w Statistics Command Register */ 20478c2ecf20Sopenharmony_ci XM_RX_CNT_EV = 0x0204, /* 32 bit r/o Rx Counter Event Register */ 20488c2ecf20Sopenharmony_ci XM_TX_CNT_EV = 0x0208, /* 32 bit r/o Tx Counter Event Register */ 20498c2ecf20Sopenharmony_ci XM_RX_EV_MSK = 0x020c, /* 32 bit r/w Rx Counter Event Mask */ 20508c2ecf20Sopenharmony_ci XM_TX_EV_MSK = 0x0210, /* 32 bit r/w Tx Counter Event Mask */ 20518c2ecf20Sopenharmony_ci XM_TXF_OK = 0x0280, /* 32 bit r/o Frames Transmitted OK Conuter */ 20528c2ecf20Sopenharmony_ci XM_TXO_OK_HI = 0x0284, /* 32 bit r/o Octets Transmitted OK High Cnt*/ 20538c2ecf20Sopenharmony_ci XM_TXO_OK_LO = 0x0288, /* 32 bit r/o Octets Transmitted OK Low Cnt */ 20548c2ecf20Sopenharmony_ci XM_TXF_BC_OK = 0x028c, /* 32 bit r/o Broadcast Frames Xmitted OK */ 20558c2ecf20Sopenharmony_ci XM_TXF_MC_OK = 0x0290, /* 32 bit r/o Multicast Frames Xmitted OK */ 20568c2ecf20Sopenharmony_ci XM_TXF_UC_OK = 0x0294, /* 32 bit r/o Unicast Frames Xmitted OK */ 20578c2ecf20Sopenharmony_ci XM_TXF_LONG = 0x0298, /* 32 bit r/o Tx Long Frame Counter */ 20588c2ecf20Sopenharmony_ci XM_TXE_BURST = 0x029c, /* 32 bit r/o Tx Burst Event Counter */ 20598c2ecf20Sopenharmony_ci XM_TXF_MPAUSE = 0x02a0, /* 32 bit r/o Tx Pause MAC Ctrl Frame Cnt */ 20608c2ecf20Sopenharmony_ci XM_TXF_MCTRL = 0x02a4, /* 32 bit r/o Tx MAC Ctrl Frame Counter */ 20618c2ecf20Sopenharmony_ci XM_TXF_SNG_COL = 0x02a8, /* 32 bit r/o Tx Single Collision Counter */ 20628c2ecf20Sopenharmony_ci XM_TXF_MUL_COL = 0x02ac, /* 32 bit r/o Tx Multiple Collision Counter */ 20638c2ecf20Sopenharmony_ci XM_TXF_ABO_COL = 0x02b0, /* 32 bit r/o Tx aborted due to Exces. Col. */ 20648c2ecf20Sopenharmony_ci XM_TXF_LAT_COL = 0x02b4, /* 32 bit r/o Tx Late Collision Counter */ 20658c2ecf20Sopenharmony_ci XM_TXF_DEF = 0x02b8, /* 32 bit r/o Tx Deferred Frame Counter */ 20668c2ecf20Sopenharmony_ci XM_TXF_EX_DEF = 0x02bc, /* 32 bit r/o Tx Excessive Deferall Counter */ 20678c2ecf20Sopenharmony_ci XM_TXE_FIFO_UR = 0x02c0, /* 32 bit r/o Tx FIFO Underrun Event Cnt */ 20688c2ecf20Sopenharmony_ci XM_TXE_CS_ERR = 0x02c4, /* 32 bit r/o Tx Carrier Sense Error Cnt */ 20698c2ecf20Sopenharmony_ci XM_TXP_UTIL = 0x02c8, /* 32 bit r/o Tx Utilization in % */ 20708c2ecf20Sopenharmony_ci XM_TXF_64B = 0x02d0, /* 32 bit r/o 64 Byte Tx Frame Counter */ 20718c2ecf20Sopenharmony_ci XM_TXF_127B = 0x02d4, /* 32 bit r/o 65-127 Byte Tx Frame Counter */ 20728c2ecf20Sopenharmony_ci XM_TXF_255B = 0x02d8, /* 32 bit r/o 128-255 Byte Tx Frame Counter */ 20738c2ecf20Sopenharmony_ci XM_TXF_511B = 0x02dc, /* 32 bit r/o 256-511 Byte Tx Frame Counter */ 20748c2ecf20Sopenharmony_ci XM_TXF_1023B = 0x02e0, /* 32 bit r/o 512-1023 Byte Tx Frame Counter*/ 20758c2ecf20Sopenharmony_ci XM_TXF_MAX_SZ = 0x02e4, /* 32 bit r/o 1024-MaxSize Byte Tx Frame Cnt*/ 20768c2ecf20Sopenharmony_ci XM_RXF_OK = 0x0300, /* 32 bit r/o Frames Received OK */ 20778c2ecf20Sopenharmony_ci XM_RXO_OK_HI = 0x0304, /* 32 bit r/o Octets Received OK High Cnt */ 20788c2ecf20Sopenharmony_ci XM_RXO_OK_LO = 0x0308, /* 32 bit r/o Octets Received OK Low Counter*/ 20798c2ecf20Sopenharmony_ci XM_RXF_BC_OK = 0x030c, /* 32 bit r/o Broadcast Frames Received OK */ 20808c2ecf20Sopenharmony_ci XM_RXF_MC_OK = 0x0310, /* 32 bit r/o Multicast Frames Received OK */ 20818c2ecf20Sopenharmony_ci XM_RXF_UC_OK = 0x0314, /* 32 bit r/o Unicast Frames Received OK */ 20828c2ecf20Sopenharmony_ci XM_RXF_MPAUSE = 0x0318, /* 32 bit r/o Rx Pause MAC Ctrl Frame Cnt */ 20838c2ecf20Sopenharmony_ci XM_RXF_MCTRL = 0x031c, /* 32 bit r/o Rx MAC Ctrl Frame Counter */ 20848c2ecf20Sopenharmony_ci XM_RXF_INV_MP = 0x0320, /* 32 bit r/o Rx invalid Pause Frame Cnt */ 20858c2ecf20Sopenharmony_ci XM_RXF_INV_MOC = 0x0324, /* 32 bit r/o Rx Frames with inv. MAC Opcode*/ 20868c2ecf20Sopenharmony_ci XM_RXE_BURST = 0x0328, /* 32 bit r/o Rx Burst Event Counter */ 20878c2ecf20Sopenharmony_ci XM_RXE_FMISS = 0x032c, /* 32 bit r/o Rx Missed Frames Event Cnt */ 20888c2ecf20Sopenharmony_ci XM_RXF_FRA_ERR = 0x0330, /* 32 bit r/o Rx Framing Error Counter */ 20898c2ecf20Sopenharmony_ci XM_RXE_FIFO_OV = 0x0334, /* 32 bit r/o Rx FIFO overflow Event Cnt */ 20908c2ecf20Sopenharmony_ci XM_RXF_JAB_PKT = 0x0338, /* 32 bit r/o Rx Jabber Packet Frame Cnt */ 20918c2ecf20Sopenharmony_ci XM_RXE_CAR_ERR = 0x033c, /* 32 bit r/o Rx Carrier Event Error Cnt */ 20928c2ecf20Sopenharmony_ci XM_RXF_LEN_ERR = 0x0340, /* 32 bit r/o Rx in Range Length Error */ 20938c2ecf20Sopenharmony_ci XM_RXE_SYM_ERR = 0x0344, /* 32 bit r/o Rx Symbol Error Counter */ 20948c2ecf20Sopenharmony_ci XM_RXE_SHT_ERR = 0x0348, /* 32 bit r/o Rx Short Event Error Cnt */ 20958c2ecf20Sopenharmony_ci XM_RXE_RUNT = 0x034c, /* 32 bit r/o Rx Runt Event Counter */ 20968c2ecf20Sopenharmony_ci XM_RXF_LNG_ERR = 0x0350, /* 32 bit r/o Rx Frame too Long Error Cnt */ 20978c2ecf20Sopenharmony_ci XM_RXF_FCS_ERR = 0x0354, /* 32 bit r/o Rx Frame Check Seq. Error Cnt */ 20988c2ecf20Sopenharmony_ci XM_RXF_CEX_ERR = 0x035c, /* 32 bit r/o Rx Carrier Ext Error Frame Cnt*/ 20998c2ecf20Sopenharmony_ci XM_RXP_UTIL = 0x0360, /* 32 bit r/o Rx Utilization in % */ 21008c2ecf20Sopenharmony_ci XM_RXF_64B = 0x0368, /* 32 bit r/o 64 Byte Rx Frame Counter */ 21018c2ecf20Sopenharmony_ci XM_RXF_127B = 0x036c, /* 32 bit r/o 65-127 Byte Rx Frame Counter */ 21028c2ecf20Sopenharmony_ci XM_RXF_255B = 0x0370, /* 32 bit r/o 128-255 Byte Rx Frame Counter */ 21038c2ecf20Sopenharmony_ci XM_RXF_511B = 0x0374, /* 32 bit r/o 256-511 Byte Rx Frame Counter */ 21048c2ecf20Sopenharmony_ci XM_RXF_1023B = 0x0378, /* 32 bit r/o 512-1023 Byte Rx Frame Counter*/ 21058c2ecf20Sopenharmony_ci XM_RXF_MAX_SZ = 0x037c, /* 32 bit r/o 1024-MaxSize Byte Rx Frame Cnt*/ 21068c2ecf20Sopenharmony_ci}; 21078c2ecf20Sopenharmony_ci 21088c2ecf20Sopenharmony_ci/* XM_MMU_CMD 16 bit r/w MMU Command Register */ 21098c2ecf20Sopenharmony_cienum { 21108c2ecf20Sopenharmony_ci XM_MMU_PHY_RDY = 1<<12, /* Bit 12: PHY Read Ready */ 21118c2ecf20Sopenharmony_ci XM_MMU_PHY_BUSY = 1<<11, /* Bit 11: PHY Busy */ 21128c2ecf20Sopenharmony_ci XM_MMU_IGN_PF = 1<<10, /* Bit 10: Ignore Pause Frame */ 21138c2ecf20Sopenharmony_ci XM_MMU_MAC_LB = 1<<9, /* Bit 9: Enable MAC Loopback */ 21148c2ecf20Sopenharmony_ci XM_MMU_FRC_COL = 1<<7, /* Bit 7: Force Collision */ 21158c2ecf20Sopenharmony_ci XM_MMU_SIM_COL = 1<<6, /* Bit 6: Simulate Collision */ 21168c2ecf20Sopenharmony_ci XM_MMU_NO_PRE = 1<<5, /* Bit 5: No MDIO Preamble */ 21178c2ecf20Sopenharmony_ci XM_MMU_GMII_FD = 1<<4, /* Bit 4: GMII uses Full Duplex */ 21188c2ecf20Sopenharmony_ci XM_MMU_RAT_CTRL = 1<<3, /* Bit 3: Enable Rate Control */ 21198c2ecf20Sopenharmony_ci XM_MMU_GMII_LOOP= 1<<2, /* Bit 2: PHY is in Loopback Mode */ 21208c2ecf20Sopenharmony_ci XM_MMU_ENA_RX = 1<<1, /* Bit 1: Enable Receiver */ 21218c2ecf20Sopenharmony_ci XM_MMU_ENA_TX = 1<<0, /* Bit 0: Enable Transmitter */ 21228c2ecf20Sopenharmony_ci}; 21238c2ecf20Sopenharmony_ci 21248c2ecf20Sopenharmony_ci 21258c2ecf20Sopenharmony_ci/* XM_TX_CMD 16 bit r/w Transmit Command Register */ 21268c2ecf20Sopenharmony_cienum { 21278c2ecf20Sopenharmony_ci XM_TX_BK2BK = 1<<6, /* Bit 6: Ignor Carrier Sense (Tx Bk2Bk)*/ 21288c2ecf20Sopenharmony_ci XM_TX_ENC_BYP = 1<<5, /* Bit 5: Set Encoder in Bypass Mode */ 21298c2ecf20Sopenharmony_ci XM_TX_SAM_LINE = 1<<4, /* Bit 4: (sc) Start utilization calculation */ 21308c2ecf20Sopenharmony_ci XM_TX_NO_GIG_MD = 1<<3, /* Bit 3: Disable Carrier Extension */ 21318c2ecf20Sopenharmony_ci XM_TX_NO_PRE = 1<<2, /* Bit 2: Disable Preamble Generation */ 21328c2ecf20Sopenharmony_ci XM_TX_NO_CRC = 1<<1, /* Bit 1: Disable CRC Generation */ 21338c2ecf20Sopenharmony_ci XM_TX_AUTO_PAD = 1<<0, /* Bit 0: Enable Automatic Padding */ 21348c2ecf20Sopenharmony_ci}; 21358c2ecf20Sopenharmony_ci 21368c2ecf20Sopenharmony_ci/* XM_TX_RT_LIM 16 bit r/w Transmit Retry Limit Register */ 21378c2ecf20Sopenharmony_ci#define XM_RT_LIM_MSK 0x1f /* Bit 4..0: Tx Retry Limit */ 21388c2ecf20Sopenharmony_ci 21398c2ecf20Sopenharmony_ci 21408c2ecf20Sopenharmony_ci/* XM_TX_STIME 16 bit r/w Transmit Slottime Register */ 21418c2ecf20Sopenharmony_ci#define XM_STIME_MSK 0x7f /* Bit 6..0: Tx Slottime bits */ 21428c2ecf20Sopenharmony_ci 21438c2ecf20Sopenharmony_ci 21448c2ecf20Sopenharmony_ci/* XM_TX_IPG 16 bit r/w Transmit Inter Packet Gap */ 21458c2ecf20Sopenharmony_ci#define XM_IPG_MSK 0xff /* Bit 7..0: IPG value bits */ 21468c2ecf20Sopenharmony_ci 21478c2ecf20Sopenharmony_ci 21488c2ecf20Sopenharmony_ci/* XM_RX_CMD 16 bit r/w Receive Command Register */ 21498c2ecf20Sopenharmony_cienum { 21508c2ecf20Sopenharmony_ci XM_RX_LENERR_OK = 1<<8, /* Bit 8 don't set Rx Err bit for */ 21518c2ecf20Sopenharmony_ci /* inrange error packets */ 21528c2ecf20Sopenharmony_ci XM_RX_BIG_PK_OK = 1<<7, /* Bit 7 don't set Rx Err bit for */ 21538c2ecf20Sopenharmony_ci /* jumbo packets */ 21548c2ecf20Sopenharmony_ci XM_RX_IPG_CAP = 1<<6, /* Bit 6 repl. type field with IPG */ 21558c2ecf20Sopenharmony_ci XM_RX_TP_MD = 1<<5, /* Bit 5: Enable transparent Mode */ 21568c2ecf20Sopenharmony_ci XM_RX_STRIP_FCS = 1<<4, /* Bit 4: Enable FCS Stripping */ 21578c2ecf20Sopenharmony_ci XM_RX_SELF_RX = 1<<3, /* Bit 3: Enable Rx of own packets */ 21588c2ecf20Sopenharmony_ci XM_RX_SAM_LINE = 1<<2, /* Bit 2: (sc) Start utilization calculation */ 21598c2ecf20Sopenharmony_ci XM_RX_STRIP_PAD = 1<<1, /* Bit 1: Strip pad bytes of Rx frames */ 21608c2ecf20Sopenharmony_ci XM_RX_DIS_CEXT = 1<<0, /* Bit 0: Disable carrier ext. check */ 21618c2ecf20Sopenharmony_ci}; 21628c2ecf20Sopenharmony_ci 21638c2ecf20Sopenharmony_ci 21648c2ecf20Sopenharmony_ci/* XM_GP_PORT 32 bit r/w General Purpose Port Register */ 21658c2ecf20Sopenharmony_cienum { 21668c2ecf20Sopenharmony_ci XM_GP_ANIP = 1<<6, /* Bit 6: (ro) Auto-Neg. in progress */ 21678c2ecf20Sopenharmony_ci XM_GP_FRC_INT = 1<<5, /* Bit 5: (sc) Force Interrupt */ 21688c2ecf20Sopenharmony_ci XM_GP_RES_MAC = 1<<3, /* Bit 3: (sc) Reset MAC and FIFOs */ 21698c2ecf20Sopenharmony_ci XM_GP_RES_STAT = 1<<2, /* Bit 2: (sc) Reset the statistics module */ 21708c2ecf20Sopenharmony_ci XM_GP_INP_ASS = 1<<0, /* Bit 0: (ro) GP Input Pin asserted */ 21718c2ecf20Sopenharmony_ci}; 21728c2ecf20Sopenharmony_ci 21738c2ecf20Sopenharmony_ci 21748c2ecf20Sopenharmony_ci/* XM_IMSK 16 bit r/w Interrupt Mask Register */ 21758c2ecf20Sopenharmony_ci/* XM_ISRC 16 bit r/o Interrupt Status Register */ 21768c2ecf20Sopenharmony_cienum { 21778c2ecf20Sopenharmony_ci XM_IS_LNK_AE = 1<<14, /* Bit 14: Link Asynchronous Event */ 21788c2ecf20Sopenharmony_ci XM_IS_TX_ABORT = 1<<13, /* Bit 13: Transmit Abort, late Col. etc */ 21798c2ecf20Sopenharmony_ci XM_IS_FRC_INT = 1<<12, /* Bit 12: Force INT bit set in GP */ 21808c2ecf20Sopenharmony_ci XM_IS_INP_ASS = 1<<11, /* Bit 11: Input Asserted, GP bit 0 set */ 21818c2ecf20Sopenharmony_ci XM_IS_LIPA_RC = 1<<10, /* Bit 10: Link Partner requests config */ 21828c2ecf20Sopenharmony_ci XM_IS_RX_PAGE = 1<<9, /* Bit 9: Page Received */ 21838c2ecf20Sopenharmony_ci XM_IS_TX_PAGE = 1<<8, /* Bit 8: Next Page Loaded for Transmit */ 21848c2ecf20Sopenharmony_ci XM_IS_AND = 1<<7, /* Bit 7: Auto-Negotiation Done */ 21858c2ecf20Sopenharmony_ci XM_IS_TSC_OV = 1<<6, /* Bit 6: Time Stamp Counter Overflow */ 21868c2ecf20Sopenharmony_ci XM_IS_RXC_OV = 1<<5, /* Bit 5: Rx Counter Event Overflow */ 21878c2ecf20Sopenharmony_ci XM_IS_TXC_OV = 1<<4, /* Bit 4: Tx Counter Event Overflow */ 21888c2ecf20Sopenharmony_ci XM_IS_RXF_OV = 1<<3, /* Bit 3: Receive FIFO Overflow */ 21898c2ecf20Sopenharmony_ci XM_IS_TXF_UR = 1<<2, /* Bit 2: Transmit FIFO Underrun */ 21908c2ecf20Sopenharmony_ci XM_IS_TX_COMP = 1<<1, /* Bit 1: Frame Tx Complete */ 21918c2ecf20Sopenharmony_ci XM_IS_RX_COMP = 1<<0, /* Bit 0: Frame Rx Complete */ 21928c2ecf20Sopenharmony_ci 21938c2ecf20Sopenharmony_ci XM_IMSK_DISABLE = 0xffff, 21948c2ecf20Sopenharmony_ci}; 21958c2ecf20Sopenharmony_ci 21968c2ecf20Sopenharmony_ci/* XM_HW_CFG 16 bit r/w Hardware Config Register */ 21978c2ecf20Sopenharmony_cienum { 21988c2ecf20Sopenharmony_ci XM_HW_GEN_EOP = 1<<3, /* Bit 3: generate End of Packet pulse */ 21998c2ecf20Sopenharmony_ci XM_HW_COM4SIG = 1<<2, /* Bit 2: use Comma Detect for Sig. Det.*/ 22008c2ecf20Sopenharmony_ci XM_HW_GMII_MD = 1<<0, /* Bit 0: GMII Interface selected */ 22018c2ecf20Sopenharmony_ci}; 22028c2ecf20Sopenharmony_ci 22038c2ecf20Sopenharmony_ci 22048c2ecf20Sopenharmony_ci/* XM_TX_LO_WM 16 bit r/w Tx FIFO Low Water Mark */ 22058c2ecf20Sopenharmony_ci/* XM_TX_HI_WM 16 bit r/w Tx FIFO High Water Mark */ 22068c2ecf20Sopenharmony_ci#define XM_TX_WM_MSK 0x01ff /* Bit 9.. 0 Tx FIFO Watermark bits */ 22078c2ecf20Sopenharmony_ci 22088c2ecf20Sopenharmony_ci/* XM_TX_THR 16 bit r/w Tx Request Threshold */ 22098c2ecf20Sopenharmony_ci/* XM_HT_THR 16 bit r/w Host Request Threshold */ 22108c2ecf20Sopenharmony_ci/* XM_RX_THR 16 bit r/w Rx Request Threshold */ 22118c2ecf20Sopenharmony_ci#define XM_THR_MSK 0x03ff /* Bit 10.. 0 Rx/Tx Request Threshold bits */ 22128c2ecf20Sopenharmony_ci 22138c2ecf20Sopenharmony_ci 22148c2ecf20Sopenharmony_ci/* XM_TX_STAT 32 bit r/o Tx Status LIFO Register */ 22158c2ecf20Sopenharmony_cienum { 22168c2ecf20Sopenharmony_ci XM_ST_VALID = (1UL<<31), /* Bit 31: Status Valid */ 22178c2ecf20Sopenharmony_ci XM_ST_BYTE_CNT = (0x3fffL<<17), /* Bit 30..17: Tx frame Length */ 22188c2ecf20Sopenharmony_ci XM_ST_RETRY_CNT = (0x1fL<<12), /* Bit 16..12: Retry Count */ 22198c2ecf20Sopenharmony_ci XM_ST_EX_COL = 1<<11, /* Bit 11: Excessive Collisions */ 22208c2ecf20Sopenharmony_ci XM_ST_EX_DEF = 1<<10, /* Bit 10: Excessive Deferral */ 22218c2ecf20Sopenharmony_ci XM_ST_BURST = 1<<9, /* Bit 9: p. xmitted in burst md*/ 22228c2ecf20Sopenharmony_ci XM_ST_DEFER = 1<<8, /* Bit 8: packet was defered */ 22238c2ecf20Sopenharmony_ci XM_ST_BC = 1<<7, /* Bit 7: Broadcast packet */ 22248c2ecf20Sopenharmony_ci XM_ST_MC = 1<<6, /* Bit 6: Multicast packet */ 22258c2ecf20Sopenharmony_ci XM_ST_UC = 1<<5, /* Bit 5: Unicast packet */ 22268c2ecf20Sopenharmony_ci XM_ST_TX_UR = 1<<4, /* Bit 4: FIFO Underrun occurred */ 22278c2ecf20Sopenharmony_ci XM_ST_CS_ERR = 1<<3, /* Bit 3: Carrier Sense Error */ 22288c2ecf20Sopenharmony_ci XM_ST_LAT_COL = 1<<2, /* Bit 2: Late Collision Error */ 22298c2ecf20Sopenharmony_ci XM_ST_MUL_COL = 1<<1, /* Bit 1: Multiple Collisions */ 22308c2ecf20Sopenharmony_ci XM_ST_SGN_COL = 1<<0, /* Bit 0: Single Collision */ 22318c2ecf20Sopenharmony_ci}; 22328c2ecf20Sopenharmony_ci 22338c2ecf20Sopenharmony_ci/* XM_RX_LO_WM 16 bit r/w Receive Low Water Mark */ 22348c2ecf20Sopenharmony_ci/* XM_RX_HI_WM 16 bit r/w Receive High Water Mark */ 22358c2ecf20Sopenharmony_ci#define XM_RX_WM_MSK 0x03ff /* Bit 11.. 0: Rx FIFO Watermark bits */ 22368c2ecf20Sopenharmony_ci 22378c2ecf20Sopenharmony_ci 22388c2ecf20Sopenharmony_ci/* XM_DEV_ID 32 bit r/o Device ID Register */ 22398c2ecf20Sopenharmony_ci#define XM_DEV_OUI (0x00ffffffUL<<8) /* Bit 31..8: Device OUI */ 22408c2ecf20Sopenharmony_ci#define XM_DEV_REV (0x07L << 5) /* Bit 7..5: Chip Rev Num */ 22418c2ecf20Sopenharmony_ci 22428c2ecf20Sopenharmony_ci 22438c2ecf20Sopenharmony_ci/* XM_MODE 32 bit r/w Mode Register */ 22448c2ecf20Sopenharmony_cienum { 22458c2ecf20Sopenharmony_ci XM_MD_ENA_REJ = 1<<26, /* Bit 26: Enable Frame Reject */ 22468c2ecf20Sopenharmony_ci XM_MD_SPOE_E = 1<<25, /* Bit 25: Send Pause on Edge */ 22478c2ecf20Sopenharmony_ci /* extern generated */ 22488c2ecf20Sopenharmony_ci XM_MD_TX_REP = 1<<24, /* Bit 24: Transmit Repeater Mode */ 22498c2ecf20Sopenharmony_ci XM_MD_SPOFF_I = 1<<23, /* Bit 23: Send Pause on FIFO full */ 22508c2ecf20Sopenharmony_ci /* intern generated */ 22518c2ecf20Sopenharmony_ci XM_MD_LE_STW = 1<<22, /* Bit 22: Rx Stat Word in Little Endian */ 22528c2ecf20Sopenharmony_ci XM_MD_TX_CONT = 1<<21, /* Bit 21: Send Continuous */ 22538c2ecf20Sopenharmony_ci XM_MD_TX_PAUSE = 1<<20, /* Bit 20: (sc) Send Pause Frame */ 22548c2ecf20Sopenharmony_ci XM_MD_ATS = 1<<19, /* Bit 19: Append Time Stamp */ 22558c2ecf20Sopenharmony_ci XM_MD_SPOL_I = 1<<18, /* Bit 18: Send Pause on Low */ 22568c2ecf20Sopenharmony_ci /* intern generated */ 22578c2ecf20Sopenharmony_ci XM_MD_SPOH_I = 1<<17, /* Bit 17: Send Pause on High */ 22588c2ecf20Sopenharmony_ci /* intern generated */ 22598c2ecf20Sopenharmony_ci XM_MD_CAP = 1<<16, /* Bit 16: Check Address Pair */ 22608c2ecf20Sopenharmony_ci XM_MD_ENA_HASH = 1<<15, /* Bit 15: Enable Hashing */ 22618c2ecf20Sopenharmony_ci XM_MD_CSA = 1<<14, /* Bit 14: Check Station Address */ 22628c2ecf20Sopenharmony_ci XM_MD_CAA = 1<<13, /* Bit 13: Check Address Array */ 22638c2ecf20Sopenharmony_ci XM_MD_RX_MCTRL = 1<<12, /* Bit 12: Rx MAC Control Frame */ 22648c2ecf20Sopenharmony_ci XM_MD_RX_RUNT = 1<<11, /* Bit 11: Rx Runt Frames */ 22658c2ecf20Sopenharmony_ci XM_MD_RX_IRLE = 1<<10, /* Bit 10: Rx in Range Len Err Frame */ 22668c2ecf20Sopenharmony_ci XM_MD_RX_LONG = 1<<9, /* Bit 9: Rx Long Frame */ 22678c2ecf20Sopenharmony_ci XM_MD_RX_CRCE = 1<<8, /* Bit 8: Rx CRC Error Frame */ 22688c2ecf20Sopenharmony_ci XM_MD_RX_ERR = 1<<7, /* Bit 7: Rx Error Frame */ 22698c2ecf20Sopenharmony_ci XM_MD_DIS_UC = 1<<6, /* Bit 6: Disable Rx Unicast */ 22708c2ecf20Sopenharmony_ci XM_MD_DIS_MC = 1<<5, /* Bit 5: Disable Rx Multicast */ 22718c2ecf20Sopenharmony_ci XM_MD_DIS_BC = 1<<4, /* Bit 4: Disable Rx Broadcast */ 22728c2ecf20Sopenharmony_ci XM_MD_ENA_PROM = 1<<3, /* Bit 3: Enable Promiscuous */ 22738c2ecf20Sopenharmony_ci XM_MD_ENA_BE = 1<<2, /* Bit 2: Enable Big Endian */ 22748c2ecf20Sopenharmony_ci XM_MD_FTF = 1<<1, /* Bit 1: (sc) Flush Tx FIFO */ 22758c2ecf20Sopenharmony_ci XM_MD_FRF = 1<<0, /* Bit 0: (sc) Flush Rx FIFO */ 22768c2ecf20Sopenharmony_ci}; 22778c2ecf20Sopenharmony_ci 22788c2ecf20Sopenharmony_ci#define XM_PAUSE_MODE (XM_MD_SPOE_E | XM_MD_SPOL_I | XM_MD_SPOH_I) 22798c2ecf20Sopenharmony_ci#define XM_DEF_MODE (XM_MD_RX_RUNT | XM_MD_RX_IRLE | XM_MD_RX_LONG |\ 22808c2ecf20Sopenharmony_ci XM_MD_RX_CRCE | XM_MD_RX_ERR | XM_MD_CSA) 22818c2ecf20Sopenharmony_ci 22828c2ecf20Sopenharmony_ci/* XM_STAT_CMD 16 bit r/w Statistics Command Register */ 22838c2ecf20Sopenharmony_cienum { 22848c2ecf20Sopenharmony_ci XM_SC_SNP_RXC = 1<<5, /* Bit 5: (sc) Snap Rx Counters */ 22858c2ecf20Sopenharmony_ci XM_SC_SNP_TXC = 1<<4, /* Bit 4: (sc) Snap Tx Counters */ 22868c2ecf20Sopenharmony_ci XM_SC_CP_RXC = 1<<3, /* Bit 3: Copy Rx Counters Continuously */ 22878c2ecf20Sopenharmony_ci XM_SC_CP_TXC = 1<<2, /* Bit 2: Copy Tx Counters Continuously */ 22888c2ecf20Sopenharmony_ci XM_SC_CLR_RXC = 1<<1, /* Bit 1: (sc) Clear Rx Counters */ 22898c2ecf20Sopenharmony_ci XM_SC_CLR_TXC = 1<<0, /* Bit 0: (sc) Clear Tx Counters */ 22908c2ecf20Sopenharmony_ci}; 22918c2ecf20Sopenharmony_ci 22928c2ecf20Sopenharmony_ci 22938c2ecf20Sopenharmony_ci/* XM_RX_CNT_EV 32 bit r/o Rx Counter Event Register */ 22948c2ecf20Sopenharmony_ci/* XM_RX_EV_MSK 32 bit r/w Rx Counter Event Mask */ 22958c2ecf20Sopenharmony_cienum { 22968c2ecf20Sopenharmony_ci XMR_MAX_SZ_OV = 1<<31, /* Bit 31: 1024-MaxSize Rx Cnt Ov*/ 22978c2ecf20Sopenharmony_ci XMR_1023B_OV = 1<<30, /* Bit 30: 512-1023Byte Rx Cnt Ov*/ 22988c2ecf20Sopenharmony_ci XMR_511B_OV = 1<<29, /* Bit 29: 256-511 Byte Rx Cnt Ov*/ 22998c2ecf20Sopenharmony_ci XMR_255B_OV = 1<<28, /* Bit 28: 128-255 Byte Rx Cnt Ov*/ 23008c2ecf20Sopenharmony_ci XMR_127B_OV = 1<<27, /* Bit 27: 65-127 Byte Rx Cnt Ov */ 23018c2ecf20Sopenharmony_ci XMR_64B_OV = 1<<26, /* Bit 26: 64 Byte Rx Cnt Ov */ 23028c2ecf20Sopenharmony_ci XMR_UTIL_OV = 1<<25, /* Bit 25: Rx Util Cnt Overflow */ 23038c2ecf20Sopenharmony_ci XMR_UTIL_UR = 1<<24, /* Bit 24: Rx Util Cnt Underrun */ 23048c2ecf20Sopenharmony_ci XMR_CEX_ERR_OV = 1<<23, /* Bit 23: CEXT Err Cnt Ov */ 23058c2ecf20Sopenharmony_ci XMR_FCS_ERR_OV = 1<<21, /* Bit 21: Rx FCS Error Cnt Ov */ 23068c2ecf20Sopenharmony_ci XMR_LNG_ERR_OV = 1<<20, /* Bit 20: Rx too Long Err Cnt Ov*/ 23078c2ecf20Sopenharmony_ci XMR_RUNT_OV = 1<<19, /* Bit 19: Runt Event Cnt Ov */ 23088c2ecf20Sopenharmony_ci XMR_SHT_ERR_OV = 1<<18, /* Bit 18: Rx Short Ev Err Cnt Ov*/ 23098c2ecf20Sopenharmony_ci XMR_SYM_ERR_OV = 1<<17, /* Bit 17: Rx Sym Err Cnt Ov */ 23108c2ecf20Sopenharmony_ci XMR_CAR_ERR_OV = 1<<15, /* Bit 15: Rx Carr Ev Err Cnt Ov */ 23118c2ecf20Sopenharmony_ci XMR_JAB_PKT_OV = 1<<14, /* Bit 14: Rx Jabb Packet Cnt Ov */ 23128c2ecf20Sopenharmony_ci XMR_FIFO_OV = 1<<13, /* Bit 13: Rx FIFO Ov Ev Cnt Ov */ 23138c2ecf20Sopenharmony_ci XMR_FRA_ERR_OV = 1<<12, /* Bit 12: Rx Framing Err Cnt Ov */ 23148c2ecf20Sopenharmony_ci XMR_FMISS_OV = 1<<11, /* Bit 11: Rx Missed Ev Cnt Ov */ 23158c2ecf20Sopenharmony_ci XMR_BURST = 1<<10, /* Bit 10: Rx Burst Event Cnt Ov */ 23168c2ecf20Sopenharmony_ci XMR_INV_MOC = 1<<9, /* Bit 9: Rx with inv. MAC OC Ov*/ 23178c2ecf20Sopenharmony_ci XMR_INV_MP = 1<<8, /* Bit 8: Rx inv Pause Frame Ov */ 23188c2ecf20Sopenharmony_ci XMR_MCTRL_OV = 1<<7, /* Bit 7: Rx MAC Ctrl-F Cnt Ov */ 23198c2ecf20Sopenharmony_ci XMR_MPAUSE_OV = 1<<6, /* Bit 6: Rx Pause MAC Ctrl-F Ov*/ 23208c2ecf20Sopenharmony_ci XMR_UC_OK_OV = 1<<5, /* Bit 5: Rx Unicast Frame CntOv*/ 23218c2ecf20Sopenharmony_ci XMR_MC_OK_OV = 1<<4, /* Bit 4: Rx Multicast Cnt Ov */ 23228c2ecf20Sopenharmony_ci XMR_BC_OK_OV = 1<<3, /* Bit 3: Rx Broadcast Cnt Ov */ 23238c2ecf20Sopenharmony_ci XMR_OK_LO_OV = 1<<2, /* Bit 2: Octets Rx OK Low CntOv*/ 23248c2ecf20Sopenharmony_ci XMR_OK_HI_OV = 1<<1, /* Bit 1: Octets Rx OK Hi Cnt Ov*/ 23258c2ecf20Sopenharmony_ci XMR_OK_OV = 1<<0, /* Bit 0: Frames Received Ok Ov */ 23268c2ecf20Sopenharmony_ci}; 23278c2ecf20Sopenharmony_ci 23288c2ecf20Sopenharmony_ci#define XMR_DEF_MSK (XMR_OK_LO_OV | XMR_OK_HI_OV) 23298c2ecf20Sopenharmony_ci 23308c2ecf20Sopenharmony_ci/* XM_TX_CNT_EV 32 bit r/o Tx Counter Event Register */ 23318c2ecf20Sopenharmony_ci/* XM_TX_EV_MSK 32 bit r/w Tx Counter Event Mask */ 23328c2ecf20Sopenharmony_cienum { 23338c2ecf20Sopenharmony_ci XMT_MAX_SZ_OV = 1<<25, /* Bit 25: 1024-MaxSize Tx Cnt Ov*/ 23348c2ecf20Sopenharmony_ci XMT_1023B_OV = 1<<24, /* Bit 24: 512-1023Byte Tx Cnt Ov*/ 23358c2ecf20Sopenharmony_ci XMT_511B_OV = 1<<23, /* Bit 23: 256-511 Byte Tx Cnt Ov*/ 23368c2ecf20Sopenharmony_ci XMT_255B_OV = 1<<22, /* Bit 22: 128-255 Byte Tx Cnt Ov*/ 23378c2ecf20Sopenharmony_ci XMT_127B_OV = 1<<21, /* Bit 21: 65-127 Byte Tx Cnt Ov */ 23388c2ecf20Sopenharmony_ci XMT_64B_OV = 1<<20, /* Bit 20: 64 Byte Tx Cnt Ov */ 23398c2ecf20Sopenharmony_ci XMT_UTIL_OV = 1<<19, /* Bit 19: Tx Util Cnt Overflow */ 23408c2ecf20Sopenharmony_ci XMT_UTIL_UR = 1<<18, /* Bit 18: Tx Util Cnt Underrun */ 23418c2ecf20Sopenharmony_ci XMT_CS_ERR_OV = 1<<17, /* Bit 17: Tx Carr Sen Err Cnt Ov*/ 23428c2ecf20Sopenharmony_ci XMT_FIFO_UR_OV = 1<<16, /* Bit 16: Tx FIFO Ur Ev Cnt Ov */ 23438c2ecf20Sopenharmony_ci XMT_EX_DEF_OV = 1<<15, /* Bit 15: Tx Ex Deferall Cnt Ov */ 23448c2ecf20Sopenharmony_ci XMT_DEF = 1<<14, /* Bit 14: Tx Deferred Cnt Ov */ 23458c2ecf20Sopenharmony_ci XMT_LAT_COL_OV = 1<<13, /* Bit 13: Tx Late Col Cnt Ov */ 23468c2ecf20Sopenharmony_ci XMT_ABO_COL_OV = 1<<12, /* Bit 12: Tx abo dueto Ex Col Ov*/ 23478c2ecf20Sopenharmony_ci XMT_MUL_COL_OV = 1<<11, /* Bit 11: Tx Mult Col Cnt Ov */ 23488c2ecf20Sopenharmony_ci XMT_SNG_COL = 1<<10, /* Bit 10: Tx Single Col Cnt Ov */ 23498c2ecf20Sopenharmony_ci XMT_MCTRL_OV = 1<<9, /* Bit 9: Tx MAC Ctrl Counter Ov*/ 23508c2ecf20Sopenharmony_ci XMT_MPAUSE = 1<<8, /* Bit 8: Tx Pause MAC Ctrl-F Ov*/ 23518c2ecf20Sopenharmony_ci XMT_BURST = 1<<7, /* Bit 7: Tx Burst Event Cnt Ov */ 23528c2ecf20Sopenharmony_ci XMT_LONG = 1<<6, /* Bit 6: Tx Long Frame Cnt Ov */ 23538c2ecf20Sopenharmony_ci XMT_UC_OK_OV = 1<<5, /* Bit 5: Tx Unicast Cnt Ov */ 23548c2ecf20Sopenharmony_ci XMT_MC_OK_OV = 1<<4, /* Bit 4: Tx Multicast Cnt Ov */ 23558c2ecf20Sopenharmony_ci XMT_BC_OK_OV = 1<<3, /* Bit 3: Tx Broadcast Cnt Ov */ 23568c2ecf20Sopenharmony_ci XMT_OK_LO_OV = 1<<2, /* Bit 2: Octets Tx OK Low CntOv*/ 23578c2ecf20Sopenharmony_ci XMT_OK_HI_OV = 1<<1, /* Bit 1: Octets Tx OK Hi Cnt Ov*/ 23588c2ecf20Sopenharmony_ci XMT_OK_OV = 1<<0, /* Bit 0: Frames Tx Ok Ov */ 23598c2ecf20Sopenharmony_ci}; 23608c2ecf20Sopenharmony_ci 23618c2ecf20Sopenharmony_ci#define XMT_DEF_MSK (XMT_OK_LO_OV | XMT_OK_HI_OV) 23628c2ecf20Sopenharmony_ci 23638c2ecf20Sopenharmony_cistruct skge_rx_desc { 23648c2ecf20Sopenharmony_ci u32 control; 23658c2ecf20Sopenharmony_ci u32 next_offset; 23668c2ecf20Sopenharmony_ci u32 dma_lo; 23678c2ecf20Sopenharmony_ci u32 dma_hi; 23688c2ecf20Sopenharmony_ci u32 status; 23698c2ecf20Sopenharmony_ci u32 timestamp; 23708c2ecf20Sopenharmony_ci u16 csum2; 23718c2ecf20Sopenharmony_ci u16 csum1; 23728c2ecf20Sopenharmony_ci u16 csum2_start; 23738c2ecf20Sopenharmony_ci u16 csum1_start; 23748c2ecf20Sopenharmony_ci}; 23758c2ecf20Sopenharmony_ci 23768c2ecf20Sopenharmony_cistruct skge_tx_desc { 23778c2ecf20Sopenharmony_ci u32 control; 23788c2ecf20Sopenharmony_ci u32 next_offset; 23798c2ecf20Sopenharmony_ci u32 dma_lo; 23808c2ecf20Sopenharmony_ci u32 dma_hi; 23818c2ecf20Sopenharmony_ci u32 status; 23828c2ecf20Sopenharmony_ci u32 csum_offs; 23838c2ecf20Sopenharmony_ci u16 csum_write; 23848c2ecf20Sopenharmony_ci u16 csum_start; 23858c2ecf20Sopenharmony_ci u32 rsvd; 23868c2ecf20Sopenharmony_ci}; 23878c2ecf20Sopenharmony_ci 23888c2ecf20Sopenharmony_cistruct skge_element { 23898c2ecf20Sopenharmony_ci struct skge_element *next; 23908c2ecf20Sopenharmony_ci void *desc; 23918c2ecf20Sopenharmony_ci struct sk_buff *skb; 23928c2ecf20Sopenharmony_ci DEFINE_DMA_UNMAP_ADDR(mapaddr); 23938c2ecf20Sopenharmony_ci DEFINE_DMA_UNMAP_LEN(maplen); 23948c2ecf20Sopenharmony_ci}; 23958c2ecf20Sopenharmony_ci 23968c2ecf20Sopenharmony_cistruct skge_ring { 23978c2ecf20Sopenharmony_ci struct skge_element *to_clean; 23988c2ecf20Sopenharmony_ci struct skge_element *to_use; 23998c2ecf20Sopenharmony_ci struct skge_element *start; 24008c2ecf20Sopenharmony_ci unsigned long count; 24018c2ecf20Sopenharmony_ci}; 24028c2ecf20Sopenharmony_ci 24038c2ecf20Sopenharmony_ci 24048c2ecf20Sopenharmony_cistruct skge_hw { 24058c2ecf20Sopenharmony_ci void __iomem *regs; 24068c2ecf20Sopenharmony_ci struct pci_dev *pdev; 24078c2ecf20Sopenharmony_ci spinlock_t hw_lock; 24088c2ecf20Sopenharmony_ci u32 intr_mask; 24098c2ecf20Sopenharmony_ci struct net_device *dev[2]; 24108c2ecf20Sopenharmony_ci 24118c2ecf20Sopenharmony_ci u8 chip_id; 24128c2ecf20Sopenharmony_ci u8 chip_rev; 24138c2ecf20Sopenharmony_ci u8 copper; 24148c2ecf20Sopenharmony_ci u8 ports; 24158c2ecf20Sopenharmony_ci u8 phy_type; 24168c2ecf20Sopenharmony_ci 24178c2ecf20Sopenharmony_ci u32 ram_size; 24188c2ecf20Sopenharmony_ci u32 ram_offset; 24198c2ecf20Sopenharmony_ci u16 phy_addr; 24208c2ecf20Sopenharmony_ci spinlock_t phy_lock; 24218c2ecf20Sopenharmony_ci struct tasklet_struct phy_task; 24228c2ecf20Sopenharmony_ci 24238c2ecf20Sopenharmony_ci char irq_name[]; /* skge@pci:000:04:00.0 */ 24248c2ecf20Sopenharmony_ci}; 24258c2ecf20Sopenharmony_ci 24268c2ecf20Sopenharmony_cienum pause_control { 24278c2ecf20Sopenharmony_ci FLOW_MODE_NONE = 1, /* No Flow-Control */ 24288c2ecf20Sopenharmony_ci FLOW_MODE_LOC_SEND = 2, /* Local station sends PAUSE */ 24298c2ecf20Sopenharmony_ci FLOW_MODE_SYMMETRIC = 3, /* Both stations may send PAUSE */ 24308c2ecf20Sopenharmony_ci FLOW_MODE_SYM_OR_REM = 4, /* Both stations may send PAUSE or 24318c2ecf20Sopenharmony_ci * just the remote station may send PAUSE 24328c2ecf20Sopenharmony_ci */ 24338c2ecf20Sopenharmony_ci}; 24348c2ecf20Sopenharmony_ci 24358c2ecf20Sopenharmony_cienum pause_status { 24368c2ecf20Sopenharmony_ci FLOW_STAT_INDETERMINATED=0, /* indeterminated */ 24378c2ecf20Sopenharmony_ci FLOW_STAT_NONE, /* No Flow Control */ 24388c2ecf20Sopenharmony_ci FLOW_STAT_REM_SEND, /* Remote Station sends PAUSE */ 24398c2ecf20Sopenharmony_ci FLOW_STAT_LOC_SEND, /* Local station sends PAUSE */ 24408c2ecf20Sopenharmony_ci FLOW_STAT_SYMMETRIC, /* Both station may send PAUSE */ 24418c2ecf20Sopenharmony_ci}; 24428c2ecf20Sopenharmony_ci 24438c2ecf20Sopenharmony_ci 24448c2ecf20Sopenharmony_cistruct skge_port { 24458c2ecf20Sopenharmony_ci struct skge_hw *hw; 24468c2ecf20Sopenharmony_ci struct net_device *netdev; 24478c2ecf20Sopenharmony_ci struct napi_struct napi; 24488c2ecf20Sopenharmony_ci int port; 24498c2ecf20Sopenharmony_ci u32 msg_enable; 24508c2ecf20Sopenharmony_ci 24518c2ecf20Sopenharmony_ci struct skge_ring tx_ring; 24528c2ecf20Sopenharmony_ci 24538c2ecf20Sopenharmony_ci struct skge_ring rx_ring ____cacheline_aligned_in_smp; 24548c2ecf20Sopenharmony_ci unsigned int rx_buf_size; 24558c2ecf20Sopenharmony_ci 24568c2ecf20Sopenharmony_ci struct timer_list link_timer; 24578c2ecf20Sopenharmony_ci enum pause_control flow_control; 24588c2ecf20Sopenharmony_ci enum pause_status flow_status; 24598c2ecf20Sopenharmony_ci u8 blink_on; 24608c2ecf20Sopenharmony_ci u8 wol; 24618c2ecf20Sopenharmony_ci u8 autoneg; /* AUTONEG_ENABLE, AUTONEG_DISABLE */ 24628c2ecf20Sopenharmony_ci u8 duplex; /* DUPLEX_HALF, DUPLEX_FULL */ 24638c2ecf20Sopenharmony_ci u16 speed; /* SPEED_1000, SPEED_100, ... */ 24648c2ecf20Sopenharmony_ci u32 advertising; 24658c2ecf20Sopenharmony_ci 24668c2ecf20Sopenharmony_ci void *mem; /* PCI memory for rings */ 24678c2ecf20Sopenharmony_ci dma_addr_t dma; 24688c2ecf20Sopenharmony_ci unsigned long mem_size; 24698c2ecf20Sopenharmony_ci#ifdef CONFIG_SKGE_DEBUG 24708c2ecf20Sopenharmony_ci struct dentry *debugfs; 24718c2ecf20Sopenharmony_ci#endif 24728c2ecf20Sopenharmony_ci}; 24738c2ecf20Sopenharmony_ci 24748c2ecf20Sopenharmony_ci 24758c2ecf20Sopenharmony_ci/* Register accessor for memory mapped device */ 24768c2ecf20Sopenharmony_cistatic inline u32 skge_read32(const struct skge_hw *hw, int reg) 24778c2ecf20Sopenharmony_ci{ 24788c2ecf20Sopenharmony_ci return readl(hw->regs + reg); 24798c2ecf20Sopenharmony_ci} 24808c2ecf20Sopenharmony_ci 24818c2ecf20Sopenharmony_cistatic inline u16 skge_read16(const struct skge_hw *hw, int reg) 24828c2ecf20Sopenharmony_ci{ 24838c2ecf20Sopenharmony_ci return readw(hw->regs + reg); 24848c2ecf20Sopenharmony_ci} 24858c2ecf20Sopenharmony_ci 24868c2ecf20Sopenharmony_cistatic inline u8 skge_read8(const struct skge_hw *hw, int reg) 24878c2ecf20Sopenharmony_ci{ 24888c2ecf20Sopenharmony_ci return readb(hw->regs + reg); 24898c2ecf20Sopenharmony_ci} 24908c2ecf20Sopenharmony_ci 24918c2ecf20Sopenharmony_cistatic inline void skge_write32(const struct skge_hw *hw, int reg, u32 val) 24928c2ecf20Sopenharmony_ci{ 24938c2ecf20Sopenharmony_ci writel(val, hw->regs + reg); 24948c2ecf20Sopenharmony_ci} 24958c2ecf20Sopenharmony_ci 24968c2ecf20Sopenharmony_cistatic inline void skge_write16(const struct skge_hw *hw, int reg, u16 val) 24978c2ecf20Sopenharmony_ci{ 24988c2ecf20Sopenharmony_ci writew(val, hw->regs + reg); 24998c2ecf20Sopenharmony_ci} 25008c2ecf20Sopenharmony_ci 25018c2ecf20Sopenharmony_cistatic inline void skge_write8(const struct skge_hw *hw, int reg, u8 val) 25028c2ecf20Sopenharmony_ci{ 25038c2ecf20Sopenharmony_ci writeb(val, hw->regs + reg); 25048c2ecf20Sopenharmony_ci} 25058c2ecf20Sopenharmony_ci 25068c2ecf20Sopenharmony_ci/* MAC Related Registers inside the device. */ 25078c2ecf20Sopenharmony_ci#define SK_REG(port,reg) (((port)<<7)+(u16)(reg)) 25088c2ecf20Sopenharmony_ci#define SK_XMAC_REG(port, reg) \ 25098c2ecf20Sopenharmony_ci ((BASE_XMAC_1 + (port) * (BASE_XMAC_2 - BASE_XMAC_1)) | (reg) << 1) 25108c2ecf20Sopenharmony_ci 25118c2ecf20Sopenharmony_cistatic inline u32 xm_read32(const struct skge_hw *hw, int port, int reg) 25128c2ecf20Sopenharmony_ci{ 25138c2ecf20Sopenharmony_ci u32 v; 25148c2ecf20Sopenharmony_ci v = skge_read16(hw, SK_XMAC_REG(port, reg)); 25158c2ecf20Sopenharmony_ci v |= (u32)skge_read16(hw, SK_XMAC_REG(port, reg+2)) << 16; 25168c2ecf20Sopenharmony_ci return v; 25178c2ecf20Sopenharmony_ci} 25188c2ecf20Sopenharmony_ci 25198c2ecf20Sopenharmony_cistatic inline u16 xm_read16(const struct skge_hw *hw, int port, int reg) 25208c2ecf20Sopenharmony_ci{ 25218c2ecf20Sopenharmony_ci return skge_read16(hw, SK_XMAC_REG(port,reg)); 25228c2ecf20Sopenharmony_ci} 25238c2ecf20Sopenharmony_ci 25248c2ecf20Sopenharmony_cistatic inline void xm_write32(const struct skge_hw *hw, int port, int r, u32 v) 25258c2ecf20Sopenharmony_ci{ 25268c2ecf20Sopenharmony_ci skge_write16(hw, SK_XMAC_REG(port,r), v & 0xffff); 25278c2ecf20Sopenharmony_ci skge_write16(hw, SK_XMAC_REG(port,r+2), v >> 16); 25288c2ecf20Sopenharmony_ci} 25298c2ecf20Sopenharmony_ci 25308c2ecf20Sopenharmony_cistatic inline void xm_write16(const struct skge_hw *hw, int port, int r, u16 v) 25318c2ecf20Sopenharmony_ci{ 25328c2ecf20Sopenharmony_ci skge_write16(hw, SK_XMAC_REG(port,r), v); 25338c2ecf20Sopenharmony_ci} 25348c2ecf20Sopenharmony_ci 25358c2ecf20Sopenharmony_cistatic inline void xm_outhash(const struct skge_hw *hw, int port, int reg, 25368c2ecf20Sopenharmony_ci const u8 *hash) 25378c2ecf20Sopenharmony_ci{ 25388c2ecf20Sopenharmony_ci xm_write16(hw, port, reg, (u16)hash[0] | ((u16)hash[1] << 8)); 25398c2ecf20Sopenharmony_ci xm_write16(hw, port, reg+2, (u16)hash[2] | ((u16)hash[3] << 8)); 25408c2ecf20Sopenharmony_ci xm_write16(hw, port, reg+4, (u16)hash[4] | ((u16)hash[5] << 8)); 25418c2ecf20Sopenharmony_ci xm_write16(hw, port, reg+6, (u16)hash[6] | ((u16)hash[7] << 8)); 25428c2ecf20Sopenharmony_ci} 25438c2ecf20Sopenharmony_ci 25448c2ecf20Sopenharmony_cistatic inline void xm_outaddr(const struct skge_hw *hw, int port, int reg, 25458c2ecf20Sopenharmony_ci const u8 *addr) 25468c2ecf20Sopenharmony_ci{ 25478c2ecf20Sopenharmony_ci xm_write16(hw, port, reg, (u16)addr[0] | ((u16)addr[1] << 8)); 25488c2ecf20Sopenharmony_ci xm_write16(hw, port, reg+2, (u16)addr[2] | ((u16)addr[3] << 8)); 25498c2ecf20Sopenharmony_ci xm_write16(hw, port, reg+4, (u16)addr[4] | ((u16)addr[5] << 8)); 25508c2ecf20Sopenharmony_ci} 25518c2ecf20Sopenharmony_ci 25528c2ecf20Sopenharmony_ci#define SK_GMAC_REG(port,reg) \ 25538c2ecf20Sopenharmony_ci (BASE_GMAC_1 + (port) * (BASE_GMAC_2-BASE_GMAC_1) + (reg)) 25548c2ecf20Sopenharmony_ci 25558c2ecf20Sopenharmony_cistatic inline u16 gma_read16(const struct skge_hw *hw, int port, int reg) 25568c2ecf20Sopenharmony_ci{ 25578c2ecf20Sopenharmony_ci return skge_read16(hw, SK_GMAC_REG(port,reg)); 25588c2ecf20Sopenharmony_ci} 25598c2ecf20Sopenharmony_ci 25608c2ecf20Sopenharmony_cistatic inline u32 gma_read32(const struct skge_hw *hw, int port, int reg) 25618c2ecf20Sopenharmony_ci{ 25628c2ecf20Sopenharmony_ci return (u32) skge_read16(hw, SK_GMAC_REG(port,reg)) 25638c2ecf20Sopenharmony_ci | ((u32)skge_read16(hw, SK_GMAC_REG(port,reg+4)) << 16); 25648c2ecf20Sopenharmony_ci} 25658c2ecf20Sopenharmony_ci 25668c2ecf20Sopenharmony_cistatic inline void gma_write16(const struct skge_hw *hw, int port, int r, u16 v) 25678c2ecf20Sopenharmony_ci{ 25688c2ecf20Sopenharmony_ci skge_write16(hw, SK_GMAC_REG(port,r), v); 25698c2ecf20Sopenharmony_ci} 25708c2ecf20Sopenharmony_ci 25718c2ecf20Sopenharmony_cistatic inline void gma_set_addr(struct skge_hw *hw, int port, int reg, 25728c2ecf20Sopenharmony_ci const u8 *addr) 25738c2ecf20Sopenharmony_ci{ 25748c2ecf20Sopenharmony_ci gma_write16(hw, port, reg, (u16) addr[0] | ((u16) addr[1] << 8)); 25758c2ecf20Sopenharmony_ci gma_write16(hw, port, reg+4,(u16) addr[2] | ((u16) addr[3] << 8)); 25768c2ecf20Sopenharmony_ci gma_write16(hw, port, reg+8,(u16) addr[4] | ((u16) addr[5] << 8)); 25778c2ecf20Sopenharmony_ci} 25788c2ecf20Sopenharmony_ci 25798c2ecf20Sopenharmony_ci#endif 2580