Merge branch 'linus' into cont_syslog
[safe/jmp/linux-2.6] / drivers / net / sky2.h
index fd12c28..084eff2 100644 (file)
@@ -4,24 +4,42 @@
 #ifndef _SKY2_H
 #define _SKY2_H
 
+#define ETH_JUMBO_MTU          9000    /* Maximum MTU supported */
+
 /* PCI config registers */
-#define PCI_DEV_REG1   0x40
-#define PCI_DEV_REG2   0x44
-#define PCI_DEV_STATUS  0x7c
-#define PCI_OS_PCI_X    (1<<26)
+enum {
+       PCI_DEV_REG1    = 0x40,
+       PCI_DEV_REG2    = 0x44,
+       PCI_DEV_STATUS  = 0x7c,
+       PCI_DEV_REG3    = 0x80,
+       PCI_DEV_REG4    = 0x84,
+       PCI_DEV_REG5    = 0x88,
+       PCI_CFG_REG_0   = 0x90,
+       PCI_CFG_REG_1   = 0x94,
 
-#define PEX_LNK_STAT   0xf2
-#define PEX_UNC_ERR_STAT 0x104
-#define PEX_DEV_CTRL   0xe8
+       PSM_CONFIG_REG0  = 0x98,
+       PSM_CONFIG_REG1  = 0x9C,
+       PSM_CONFIG_REG2  = 0x160,
+       PSM_CONFIG_REG3  = 0x164,
+       PSM_CONFIG_REG4  = 0x168,
+
+};
 
 /* Yukon-2 */
 enum pci_dev_reg_1 {
        PCI_Y2_PIG_ENA   = 1<<31, /* Enable Plug-in-Go (YUKON-2) */
        PCI_Y2_DLL_DIS   = 1<<30, /* Disable PCI DLL (YUKON-2) */
+       PCI_SW_PWR_ON_RST= 1<<30, /* SW Power on Reset (Yukon-EX) */
        PCI_Y2_PHY2_COMA = 1<<29, /* Set PHY 2 to Coma Mode (YUKON-2) */
        PCI_Y2_PHY1_COMA = 1<<28, /* Set PHY 1 to Coma Mode (YUKON-2) */
        PCI_Y2_PHY2_POWD = 1<<27, /* Set PHY 2 to Power Down (YUKON-2) */
        PCI_Y2_PHY1_POWD = 1<<26, /* Set PHY 1 to Power Down (YUKON-2) */
+       PCI_Y2_PME_LEGACY= 1<<15, /* PCI Express legacy power management mode */
+
+       PCI_PHY_LNK_TIM_MSK= 3L<<8,/* Bit  9.. 8:       GPHY Link Trigger Timer */
+       PCI_ENA_L1_EVENT = 1<<7, /* Enable PEX L1 Event */
+       PCI_ENA_GPHY_LNK = 1<<6, /* Enable PEX L1 on GPHY Link down */
+       PCI_FORCE_PEX_L1 = 1<<5, /* Force to PEX L1 */
 };
 
 enum pci_dev_reg_2 {
@@ -37,6 +55,200 @@ enum pci_dev_reg_2 {
        PCI_USEDATA64   = 1<<0,         /* Use 64Bit Data bus ext */
 };
 
+/*     PCI_OUR_REG_3           32 bit  Our Register 3 (Yukon-ECU only) */
+enum pci_dev_reg_3 {
+       P_CLK_ASF_REGS_DIS      = 1<<18,/* Disable Clock ASF (Yukon-Ext.) */
+       P_CLK_COR_REGS_D0_DIS   = 1<<17,/* Disable Clock Core Regs D0 */
+       P_CLK_MACSEC_DIS        = 1<<17,/* Disable Clock MACSec (Yukon-Ext.) */
+       P_CLK_PCI_REGS_D0_DIS   = 1<<16,/* Disable Clock PCI  Regs D0 */
+       P_CLK_COR_YTB_ARB_DIS   = 1<<15,/* Disable Clock YTB  Arbiter */
+       P_CLK_MAC_LNK1_D3_DIS   = 1<<14,/* Disable Clock MAC  Link1 D3 */
+       P_CLK_COR_LNK1_D0_DIS   = 1<<13,/* Disable Clock Core Link1 D0 */
+       P_CLK_MAC_LNK1_D0_DIS   = 1<<12,/* Disable Clock MAC  Link1 D0 */
+       P_CLK_COR_LNK1_D3_DIS   = 1<<11,/* Disable Clock Core Link1 D3 */
+       P_CLK_PCI_MST_ARB_DIS   = 1<<10,/* Disable Clock PCI  Master Arb. */
+       P_CLK_COR_REGS_D3_DIS   = 1<<9, /* Disable Clock Core Regs D3 */
+       P_CLK_PCI_REGS_D3_DIS   = 1<<8, /* Disable Clock PCI  Regs D3 */
+       P_CLK_REF_LNK1_GM_DIS   = 1<<7, /* Disable Clock Ref. Link1 GMAC */
+       P_CLK_COR_LNK1_GM_DIS   = 1<<6, /* Disable Clock Core Link1 GMAC */
+       P_CLK_PCI_COMMON_DIS    = 1<<5, /* Disable Clock PCI  Common */
+       P_CLK_COR_COMMON_DIS    = 1<<4, /* Disable Clock Core Common */
+       P_CLK_PCI_LNK1_BMU_DIS  = 1<<3, /* Disable Clock PCI  Link1 BMU */
+       P_CLK_COR_LNK1_BMU_DIS  = 1<<2, /* Disable Clock Core Link1 BMU */
+       P_CLK_PCI_LNK1_BIU_DIS  = 1<<1, /* Disable Clock PCI  Link1 BIU */
+       P_CLK_COR_LNK1_BIU_DIS  = 1<<0, /* Disable Clock Core Link1 BIU */
+       PCIE_OUR3_WOL_D3_COLD_SET = P_CLK_ASF_REGS_DIS |
+                                   P_CLK_COR_REGS_D0_DIS |
+                                   P_CLK_COR_LNK1_D0_DIS |
+                                   P_CLK_MAC_LNK1_D0_DIS |
+                                   P_CLK_PCI_MST_ARB_DIS |
+                                   P_CLK_COR_COMMON_DIS |
+                                   P_CLK_COR_LNK1_BMU_DIS,
+};
+
+/*     PCI_OUR_REG_4           32 bit  Our Register 4 (Yukon-ECU only) */
+enum pci_dev_reg_4 {
+                               /* (Link Training & Status State Machine) */
+       P_PEX_LTSSM_STAT_MSK    = 0x7fL<<25,    /* Bit 31..25:  PEX LTSSM Mask */
+#define P_PEX_LTSSM_STAT(x)    ((x << 25) & P_PEX_LTSSM_STAT_MSK)
+       P_PEX_LTSSM_L1_STAT     = 0x34,
+       P_PEX_LTSSM_DET_STAT    = 0x01,
+       P_TIMER_VALUE_MSK       = 0xffL<<16,    /* Bit 23..16:  Timer Value Mask */
+                                       /* (Active State Power Management) */
+       P_FORCE_ASPM_REQUEST    = 1<<15, /* Force ASPM Request (A1 only) */
+       P_ASPM_GPHY_LINK_DOWN   = 1<<14, /* GPHY Link Down (A1 only) */
+       P_ASPM_INT_FIFO_EMPTY   = 1<<13, /* Internal FIFO Empty (A1 only) */
+       P_ASPM_CLKRUN_REQUEST   = 1<<12, /* CLKRUN Request (A1 only) */
+
+       P_ASPM_FORCE_CLKREQ_ENA = 1<<4, /* Force CLKREQ Enable (A1b only) */
+       P_ASPM_CLKREQ_PAD_CTL   = 1<<3, /* CLKREQ PAD Control (A1 only) */
+       P_ASPM_A1_MODE_SELECT   = 1<<2, /* A1 Mode Select (A1 only) */
+       P_CLK_GATE_PEX_UNIT_ENA = 1<<1, /* Enable Gate PEX Unit Clock */
+       P_CLK_GATE_ROOT_COR_ENA = 1<<0, /* Enable Gate Root Core Clock */
+       P_ASPM_CONTROL_MSK      = P_FORCE_ASPM_REQUEST | P_ASPM_GPHY_LINK_DOWN
+                                 | P_ASPM_CLKRUN_REQUEST | P_ASPM_INT_FIFO_EMPTY,
+};
+
+/*     PCI_OUR_REG_5           32 bit  Our Register 5 (Yukon-ECU only) */
+enum pci_dev_reg_5 {
+                                       /* Bit 31..27:  for A3 & later */
+       P_CTL_DIV_CORE_CLK_ENA  = 1<<31, /* Divide Core Clock Enable */
+       P_CTL_SRESET_VMAIN_AV   = 1<<30, /* Soft Reset for Vmain_av De-Glitch */
+       P_CTL_BYPASS_VMAIN_AV   = 1<<29, /* Bypass En. for Vmain_av De-Glitch */
+       P_CTL_TIM_VMAIN_AV_MSK  = 3<<27, /* Bit 28..27: Timer Vmain_av Mask */
+                                        /* Bit 26..16: Release Clock on Event */
+       P_REL_PCIE_RST_DE_ASS   = 1<<26, /* PCIe Reset De-Asserted */
+       P_REL_GPHY_REC_PACKET   = 1<<25, /* GPHY Received Packet */
+       P_REL_INT_FIFO_N_EMPTY  = 1<<24, /* Internal FIFO Not Empty */
+       P_REL_MAIN_PWR_AVAIL    = 1<<23, /* Main Power Available */
+       P_REL_CLKRUN_REQ_REL    = 1<<22, /* CLKRUN Request Release */
+       P_REL_PCIE_RESET_ASS    = 1<<21, /* PCIe Reset Asserted */
+       P_REL_PME_ASSERTED      = 1<<20, /* PME Asserted */
+       P_REL_PCIE_EXIT_L1_ST   = 1<<19, /* PCIe Exit L1 State */
+       P_REL_LOADER_NOT_FIN    = 1<<18, /* EPROM Loader Not Finished */
+       P_REL_PCIE_RX_EX_IDLE   = 1<<17, /* PCIe Rx Exit Electrical Idle State */
+       P_REL_GPHY_LINK_UP      = 1<<16, /* GPHY Link Up */
+
+                                       /* Bit 10.. 0: Mask for Gate Clock */
+       P_GAT_PCIE_RST_ASSERTED = 1<<10,/* PCIe Reset Asserted */
+       P_GAT_GPHY_N_REC_PACKET = 1<<9, /* GPHY Not Received Packet */
+       P_GAT_INT_FIFO_EMPTY    = 1<<8, /* Internal FIFO Empty */
+       P_GAT_MAIN_PWR_N_AVAIL  = 1<<7, /* Main Power Not Available */
+       P_GAT_CLKRUN_REQ_REL    = 1<<6, /* CLKRUN Not Requested */
+       P_GAT_PCIE_RESET_ASS    = 1<<5, /* PCIe Reset Asserted */
+       P_GAT_PME_DE_ASSERTED   = 1<<4, /* PME De-Asserted */
+       P_GAT_PCIE_ENTER_L1_ST  = 1<<3, /* PCIe Enter L1 State */
+       P_GAT_LOADER_FINISHED   = 1<<2, /* EPROM Loader Finished */
+       P_GAT_PCIE_RX_EL_IDLE   = 1<<1, /* PCIe Rx Electrical Idle State */
+       P_GAT_GPHY_LINK_DOWN    = 1<<0, /* GPHY Link Down */
+
+       PCIE_OUR5_EVENT_CLK_D3_SET = P_REL_GPHY_REC_PACKET |
+                                    P_REL_INT_FIFO_N_EMPTY |
+                                    P_REL_PCIE_EXIT_L1_ST |
+                                    P_REL_PCIE_RX_EX_IDLE |
+                                    P_GAT_GPHY_N_REC_PACKET |
+                                    P_GAT_INT_FIFO_EMPTY |
+                                    P_GAT_PCIE_ENTER_L1_ST |
+                                    P_GAT_PCIE_RX_EL_IDLE,
+};
+
+/*     PCI_CFG_REG_1                   32 bit  Config Register 1 (Yukon-Ext only) */
+enum pci_cfg_reg1 {
+       P_CF1_DIS_REL_EVT_RST   = 1<<24, /* Dis. Rel. Event during PCIE reset */
+                                                                               /* Bit 23..21: Release Clock on Event */
+       P_CF1_REL_LDR_NOT_FIN   = 1<<23, /* EEPROM Loader Not Finished */
+       P_CF1_REL_VMAIN_AVLBL   = 1<<22, /* Vmain available */
+       P_CF1_REL_PCIE_RESET    = 1<<21, /* PCI-E reset */
+                                                                               /* Bit 20..18: Gate Clock on Event */
+       P_CF1_GAT_LDR_NOT_FIN   = 1<<20, /* EEPROM Loader Finished */
+       P_CF1_GAT_PCIE_RX_IDLE  = 1<<19, /* PCI-E Rx Electrical idle */
+       P_CF1_GAT_PCIE_RESET    = 1<<18, /* PCI-E Reset */
+       P_CF1_PRST_PHY_CLKREQ   = 1<<17, /* Enable PCI-E rst & PM2PHY gen. CLKREQ */
+       P_CF1_PCIE_RST_CLKREQ   = 1<<16, /* Enable PCI-E rst generate CLKREQ */
+
+       P_CF1_ENA_CFG_LDR_DONE  = 1<<8, /* Enable core level Config loader done */
+
+       P_CF1_ENA_TXBMU_RD_IDLE = 1<<1, /* Enable TX BMU Read  IDLE for ASPM */
+       P_CF1_ENA_TXBMU_WR_IDLE = 1<<0, /* Enable TX BMU Write IDLE for ASPM */
+
+       PCIE_CFG1_EVENT_CLK_D3_SET = P_CF1_DIS_REL_EVT_RST |
+                                       P_CF1_REL_LDR_NOT_FIN |
+                                       P_CF1_REL_VMAIN_AVLBL |
+                                       P_CF1_REL_PCIE_RESET |
+                                       P_CF1_GAT_LDR_NOT_FIN |
+                                       P_CF1_GAT_PCIE_RESET |
+                                       P_CF1_PRST_PHY_CLKREQ |
+                                       P_CF1_ENA_CFG_LDR_DONE |
+                                       P_CF1_ENA_TXBMU_RD_IDLE |
+                                       P_CF1_ENA_TXBMU_WR_IDLE,
+};
+
+/* Yukon-Optima */
+enum {
+       PSM_CONFIG_REG1_AC_PRESENT_STATUS = 1<<31,   /* AC Present Status */
+
+       PSM_CONFIG_REG1_PTP_CLK_SEL       = 1<<29,   /* PTP Clock Select */
+       PSM_CONFIG_REG1_PTP_MODE          = 1<<28,   /* PTP Mode */
+
+       PSM_CONFIG_REG1_MUX_PHY_LINK      = 1<<27,   /* PHY Energy Detect Event */
+
+       PSM_CONFIG_REG1_EN_PIN63_AC_PRESENT = 1<<26,  /* Enable LED_DUPLEX for ac_present */
+       PSM_CONFIG_REG1_EN_PCIE_TIMER     = 1<<25,    /* Enable PCIe Timer */
+       PSM_CONFIG_REG1_EN_SPU_TIMER      = 1<<24,    /* Enable SPU Timer */
+       PSM_CONFIG_REG1_POLARITY_AC_PRESENT = 1<<23,  /* AC Present Polarity */
+
+       PSM_CONFIG_REG1_EN_AC_PRESENT     = 1<<21,    /* Enable AC Present */
+
+       PSM_CONFIG_REG1_EN_GPHY_INT_PSM = 1<<20,      /* Enable GPHY INT for PSM */
+       PSM_CONFIG_REG1_DIS_PSM_TIMER   = 1<<19,      /* Disable PSM Timer */
+};
+
+/* Yukon-Supreme */
+enum {
+       PSM_CONFIG_REG1_GPHY_ENERGY_STS = 1<<31, /* GPHY Energy Detect Status */
+
+       PSM_CONFIG_REG1_UART_MODE_MSK   = 3<<29, /* UART_Mode */
+       PSM_CONFIG_REG1_CLK_RUN_ASF     = 1<<28, /* Enable Clock Free Running for ASF Subsystem */
+       PSM_CONFIG_REG1_UART_CLK_DISABLE= 1<<27, /* Disable UART clock */
+       PSM_CONFIG_REG1_VAUX_ONE        = 1<<26, /* Tie internal Vaux to 1'b1 */
+       PSM_CONFIG_REG1_UART_FC_RI_VAL  = 1<<25, /* Default value for UART_RI_n */
+       PSM_CONFIG_REG1_UART_FC_DCD_VAL = 1<<24, /* Default value for UART_DCD_n */
+       PSM_CONFIG_REG1_UART_FC_DSR_VAL = 1<<23, /* Default value for UART_DSR_n */
+       PSM_CONFIG_REG1_UART_FC_CTS_VAL = 1<<22, /* Default value for UART_CTS_n */
+       PSM_CONFIG_REG1_LATCH_VAUX      = 1<<21, /* Enable Latch current Vaux_avlbl */
+       PSM_CONFIG_REG1_FORCE_TESTMODE_INPUT= 1<<20, /* Force Testmode pin as input PAD */
+       PSM_CONFIG_REG1_UART_RST        = 1<<19, /* UART_RST */
+       PSM_CONFIG_REG1_PSM_PCIE_L1_POL = 1<<18, /* PCIE L1 Event Polarity for PSM */
+       PSM_CONFIG_REG1_TIMER_STAT      = 1<<17, /* PSM Timer Status */
+       PSM_CONFIG_REG1_GPHY_INT        = 1<<16, /* GPHY INT Status */
+       PSM_CONFIG_REG1_FORCE_TESTMODE_ZERO= 1<<15, /* Force internal Testmode as 1'b0 */
+       PSM_CONFIG_REG1_EN_INT_ASPM_CLKREQ = 1<<14, /* ENABLE INT for CLKRUN on ASPM and CLKREQ */
+       PSM_CONFIG_REG1_EN_SND_TASK_ASPM_CLKREQ = 1<<13, /* ENABLE Snd_task for CLKRUN on ASPM and CLKREQ */
+       PSM_CONFIG_REG1_DIS_CLK_GATE_SND_TASK   = 1<<12, /* Disable CLK_GATE control snd_task */
+       PSM_CONFIG_REG1_DIS_FF_CHIAN_SND_INTA   = 1<<11, /* Disable flip-flop chain for sndmsg_inta */
+
+       PSM_CONFIG_REG1_DIS_LOADER      = 1<<9, /* Disable Loader SM after PSM Goes back to IDLE */
+       PSM_CONFIG_REG1_DO_PWDN         = 1<<8, /* Do Power Down, Start PSM Scheme */
+       PSM_CONFIG_REG1_DIS_PIG         = 1<<7, /* Disable Plug-in-Go SM after PSM Goes back to IDLE */
+       PSM_CONFIG_REG1_DIS_PERST       = 1<<6, /* Disable Internal PCIe Reset after PSM Goes back to IDLE */
+       PSM_CONFIG_REG1_EN_REG18_PD     = 1<<5, /* Enable REG18 Power Down for PSM */
+       PSM_CONFIG_REG1_EN_PSM_LOAD     = 1<<4, /* Disable EEPROM Loader after PSM Goes back to IDLE */
+       PSM_CONFIG_REG1_EN_PSM_HOT_RST  = 1<<3, /* Enable PCIe Hot Reset for PSM */
+       PSM_CONFIG_REG1_EN_PSM_PERST    = 1<<2, /* Enable PCIe Reset Event for PSM */
+       PSM_CONFIG_REG1_EN_PSM_PCIE_L1  = 1<<1, /* Enable PCIe L1 Event for PSM */
+       PSM_CONFIG_REG1_EN_PSM          = 1<<0, /* Enable PSM Scheme */
+};
+
+/*     PSM_CONFIG_REG4                         0x0168  PSM Config Register 4 */
+enum {
+                                               /* PHY Link Detect Timer */
+       PSM_CONFIG_REG4_TIMER_PHY_LINK_DETECT_MSK = 0xf<<4,
+       PSM_CONFIG_REG4_TIMER_PHY_LINK_DETECT_BASE = 4,
+
+       PSM_CONFIG_REG4_DEBUG_TIMER         = 1<<1, /* Debug Timer */
+       PSM_CONFIG_REG4_RST_PHY_LINK_DETECT = 1<<0, /* Reset GPHY Link Detect */
+};
+
 
 #define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \
                               PCI_STATUS_SIG_SYSTEM_ERROR | \
@@ -44,42 +256,10 @@ enum pci_dev_reg_2 {
                               PCI_STATUS_REC_TARGET_ABORT | \
                               PCI_STATUS_PARITY)
 
-enum pex_dev_ctrl {
-       PEX_DC_MAX_RRS_MSK      = 7<<12, /* Bit 14..12: Max. Read Request Size */
-       PEX_DC_EN_NO_SNOOP      = 1<<11,/* Enable No Snoop */
-       PEX_DC_EN_AUX_POW       = 1<<10,/* Enable AUX Power */
-       PEX_DC_EN_PHANTOM       = 1<<9, /* Enable Phantom Functions */
-       PEX_DC_EN_EXT_TAG       = 1<<8, /* Enable Extended Tag Field */
-       PEX_DC_MAX_PLS_MSK      = 7<<5, /* Bit  7.. 5:  Max. Payload Size Mask */
-       PEX_DC_EN_REL_ORD       = 1<<4, /* Enable Relaxed Ordering */
-       PEX_DC_EN_UNS_RQ_RP     = 1<<3, /* Enable Unsupported Request Reporting */
-       PEX_DC_EN_FAT_ER_RP     = 1<<2, /* Enable Fatal Error Reporting */
-       PEX_DC_EN_NFA_ER_RP     = 1<<1, /* Enable Non-Fatal Error Reporting */
-       PEX_DC_EN_COR_ER_RP     = 1<<0, /* Enable Correctable Error Reporting */
-};
-#define  PEX_DC_MAX_RD_RQ_SIZE(x) (((x)<<12) & PEX_DC_MAX_RRS_MSK)
-
-/* PEX_UNC_ERR_STAT     PEX Uncorrectable Errors Status Register (Yukon-2) */
-enum pex_err {
-       PEX_UNSUP_REQ   = 1<<20, /* Unsupported Request Error */
-
-       PEX_MALFOR_TLP  = 1<<18, /* Malformed TLP */
-
-       PEX_UNEXP_COMP  = 1<<16, /* Unexpected Completion */
-
-       PEX_COMP_TO     = 1<<14, /* Completion Timeout */
-       PEX_FLOW_CTRL_P = 1<<13, /* Flow Control Protocol Error */
-       PEX_POIS_TLP    = 1<<12, /* Poisoned TLP */
-
-       PEX_DATA_LINK_P = 1<<4, /* Data Link Protocol Error */
-       PEX_FATAL_ERRORS= (PEX_MALFOR_TLP | PEX_FLOW_CTRL_P | PEX_DATA_LINK_P),
-};
-
-
 enum csr_regs {
        B0_RAP          = 0x0000,
        B0_CTST         = 0x0004,
-       B0_Y2LED        = 0x0005,
+
        B0_POWER_CTRL   = 0x0007,
        B0_ISRC         = 0x0008,
        B0_IMSK         = 0x000c,
@@ -121,6 +301,9 @@ enum csr_regs {
        B2_I2C_IRQ      = 0x0168,
        B2_I2C_SW       = 0x016c,
 
+       Y2_PEX_PHY_DATA = 0x0170,
+       Y2_PEX_PHY_ADDR = 0x0172,
+
        B3_RAM_ADDR     = 0x0180,
        B3_RAM_DATA_LO  = 0x0184,
        B3_RAM_DATA_HI  = 0x0188,
@@ -180,13 +363,16 @@ enum csr_regs {
        B3_PA_CTRL      = 0x01f0,
        B3_PA_TEST      = 0x01f2,
 
-       Y2_CFG_SPC      = 0x1c00,
+       Y2_CFG_SPC      = 0x1c00,       /* PCI config space region */
+       Y2_CFG_AER      = 0x1d00,       /* PCI Advanced Error Report region */
 };
 
-/*     B0_CTST                 16 bit  Control/Status register */
+/*     B0_CTST                 24 bit  Control/Status register */
 enum {
        Y2_VMAIN_AVAIL  = 1<<17,/* VMAIN available (YUKON-2 only) */
        Y2_VAUX_AVAIL   = 1<<16,/* VAUX available (YUKON-2 only) */
+       Y2_HW_WOL_ON    = 1<<15,/* HW WOL On  (Yukon-EC Ultra A1 only) */
+       Y2_HW_WOL_OFF   = 1<<14,/* HW WOL On  (Yukon-EC Ultra A1 only) */
        Y2_ASF_ENABLE   = 1<<13,/* ASF Unit Enable (YUKON-2 only) */
        Y2_ASF_DISABLE  = 1<<12,/* ASF Unit Disable (YUKON-2 only) */
        Y2_CLK_RUN_ENA  = 1<<11,/* CLK_RUN Enable  (YUKON-2 only) */
@@ -204,13 +390,6 @@ enum {
        CS_RST_SET      = 1,    /* Set   Software reset */
 };
 
-/*     B0_LED                   8 Bit  LED register */
-enum {
-/* Bit  7.. 2: reserved */
-       LED_STAT_ON     = 1<<1, /* Status LED on        */
-       LED_STAT_OFF    = 1,    /* Status LED off       */
-};
-
 /*     B0_POWER_CTRL    8 Bit  Power Control reg (YUKON only) */
 enum {
        PC_VAUX_ENA     = 1<<7, /* Switch VAUX Enable  */
@@ -245,19 +424,24 @@ enum {
        Y2_IS_CHK_TXS2  = 1<<9,         /* Descriptor error TXS 2 */
        Y2_IS_CHK_TXA2  = 1<<8,         /* Descriptor error TXA 2 */
 
+       Y2_IS_PSM_ACK   = 1<<7,         /* PSM Acknowledge (Yukon-Optima only) */
+       Y2_IS_PTP_TIST  = 1<<6,         /* PTP Time Stamp (Yukon-Optima only) */
+       Y2_IS_PHY_QLNK  = 1<<5,         /* PHY Quick Link (Yukon-Optima only) */
+
        Y2_IS_IRQ_PHY1  = 1<<4,         /* Interrupt from PHY 1 */
        Y2_IS_IRQ_MAC1  = 1<<3,         /* Interrupt from MAC 1 */
        Y2_IS_CHK_RX1   = 1<<2,         /* Descriptor error Rx 1 */
        Y2_IS_CHK_TXS1  = 1<<1,         /* Descriptor error TXS 1 */
        Y2_IS_CHK_TXA1  = 1<<0,         /* Descriptor error TXA 1 */
 
-       Y2_IS_BASE      = Y2_IS_HW_ERR | Y2_IS_STAT_BMU |
-                         Y2_IS_POLL_CHK | Y2_IS_TWSI_RDY |
-                         Y2_IS_IRQ_SW | Y2_IS_TIMINT,
-       Y2_IS_PORT_1    = Y2_IS_IRQ_PHY1 | Y2_IS_IRQ_MAC1 |
-                         Y2_IS_CHK_RX1 | Y2_IS_CHK_TXA1 | Y2_IS_CHK_TXS1,
-       Y2_IS_PORT_2    = Y2_IS_IRQ_PHY2 | Y2_IS_IRQ_MAC2 |
-                         Y2_IS_CHK_RX2 | Y2_IS_CHK_TXA2 | Y2_IS_CHK_TXS2,
+       Y2_IS_BASE      = Y2_IS_HW_ERR | Y2_IS_STAT_BMU,
+       Y2_IS_PORT_1    = Y2_IS_IRQ_PHY1 | Y2_IS_IRQ_MAC1
+                         | Y2_IS_CHK_TXA1 | Y2_IS_CHK_RX1,
+       Y2_IS_PORT_2    = Y2_IS_IRQ_PHY2 | Y2_IS_IRQ_MAC2
+                         | Y2_IS_CHK_TXA2 | Y2_IS_CHK_RX2,
+       Y2_IS_ERROR     = Y2_IS_HW_ERR |
+                         Y2_IS_IRQ_MAC1 | Y2_IS_CHK_TXA1 | Y2_IS_CHK_RX1 |
+                         Y2_IS_IRQ_MAC2 | Y2_IS_CHK_TXA2 | Y2_IS_CHK_RX2,
 };
 
 /*     B2_IRQM_HWE_MSK 32 bit  IRQ Moderation HW Error Mask */
@@ -309,7 +493,6 @@ enum {
                          Y2_IS_PAR_RX2 | Y2_IS_TCP_TXS2| Y2_IS_TCP_TXA2,
 
        Y2_HWE_ALL_MASK = Y2_IS_TIST_OV | Y2_IS_MST_ERR | Y2_IS_IRQ_STAT |
-                         Y2_IS_PCI_EXP |
                          Y2_HWE_L1_MASK | Y2_HWE_L2_MASK,
 };
 
@@ -331,6 +514,20 @@ enum {
        TST_CFG_WRITE_OFF= 1<<0, /* Disable Config Reg WR */
 };
 
+/*     B2_GPIO */
+enum {
+       GLB_GPIO_CLK_DEB_ENA = 1<<31,   /* Clock Debug Enable */
+       GLB_GPIO_CLK_DBG_MSK = 0xf<<26, /* Clock Debug */
+
+       GLB_GPIO_INT_RST_D3_DIS = 1<<15, /* Disable Internal Reset After D3 to D0 */
+       GLB_GPIO_LED_PAD_SPEED_UP = 1<<14, /* LED PAD Speed Up */
+       GLB_GPIO_STAT_RACE_DIS  = 1<<13, /* Status Race Disable */
+       GLB_GPIO_TEST_SEL_MSK   = 3<<11, /* Testmode Select */
+       GLB_GPIO_TEST_SEL_BASE  = 1<<11,
+       GLB_GPIO_RAND_ENA       = 1<<10, /* Random Enable */
+       GLB_GPIO_RAND_BIT_1     = 1<<9,  /* Random Bit 1 */
+};
+
 /*     B2_MAC_CFG               8 bit  MAC Configuration / Chip Revision */
 enum {
        CFG_CHIP_R_MSK    = 0xf<<4,     /* Bit 7.. 4: Chip Revision */
@@ -341,19 +538,52 @@ enum {
 
 /*     B2_CHIP_ID               8 bit  Chip Identification Number */
 enum {
-       CHIP_ID_GENESIS    = 0x0a, /* Chip ID for GENESIS */
-       CHIP_ID_YUKON      = 0xb0, /* Chip ID for YUKON */
-       CHIP_ID_YUKON_LITE = 0xb1, /* Chip ID for YUKON-Lite (Rev. A1-A3) */
-       CHIP_ID_YUKON_LP   = 0xb2, /* Chip ID for YUKON-LP */
-       CHIP_ID_YUKON_XL   = 0xb3, /* Chip ID for YUKON-2 XL */
-       CHIP_ID_YUKON_EC_U = 0xb4, /* Chip ID for YUKON-2 EC Ultra */
-       CHIP_ID_YUKON_EC   = 0xb6, /* Chip ID for YUKON-2 EC */
-       CHIP_ID_YUKON_FE   = 0xb7, /* Chip ID for YUKON-2 FE */
+       CHIP_ID_YUKON_XL   = 0xb3, /* YUKON-2 XL */
+       CHIP_ID_YUKON_EC_U = 0xb4, /* YUKON-2 EC Ultra */
+       CHIP_ID_YUKON_EX   = 0xb5, /* YUKON-2 Extreme */
+       CHIP_ID_YUKON_EC   = 0xb6, /* YUKON-2 EC */
+       CHIP_ID_YUKON_FE   = 0xb7, /* YUKON-2 FE */
+       CHIP_ID_YUKON_FE_P = 0xb8, /* YUKON-2 FE+ */
+       CHIP_ID_YUKON_SUPR = 0xb9, /* YUKON-2 Supreme */
+       CHIP_ID_YUKON_UL_2 = 0xba, /* YUKON-2 Ultra 2 */
+       CHIP_ID_YUKON_OPT  = 0xbc, /* YUKON-2 Optima */
+};
 
+enum yukon_xl_rev {
+       CHIP_REV_YU_XL_A0  = 0,
+       CHIP_REV_YU_XL_A1  = 1,
+       CHIP_REV_YU_XL_A2  = 2,
+       CHIP_REV_YU_XL_A3  = 3,
+};
+
+enum yukon_ec_rev {
        CHIP_REV_YU_EC_A1    = 0,  /* Chip Rev. for Yukon-EC A1/A0 */
        CHIP_REV_YU_EC_A2    = 1,  /* Chip Rev. for Yukon-EC A2 */
        CHIP_REV_YU_EC_A3    = 2,  /* Chip Rev. for Yukon-EC A3 */
 };
+enum yukon_ec_u_rev {
+       CHIP_REV_YU_EC_U_A0  = 1,
+       CHIP_REV_YU_EC_U_A1  = 2,
+       CHIP_REV_YU_EC_U_B0  = 3,
+       CHIP_REV_YU_EC_U_B1  = 5,
+};
+enum yukon_fe_rev {
+       CHIP_REV_YU_FE_A1    = 1,
+       CHIP_REV_YU_FE_A2    = 2,
+};
+enum yukon_fe_p_rev {
+       CHIP_REV_YU_FE2_A0   = 0,
+};
+enum yukon_ex_rev {
+       CHIP_REV_YU_EX_A0    = 1,
+       CHIP_REV_YU_EX_B0    = 2,
+};
+enum yukon_supr_rev {
+       CHIP_REV_YU_SU_A0    = 0,
+       CHIP_REV_YU_SU_B0    = 1,
+       CHIP_REV_YU_SU_B1    = 3,
+};
+
 
 /*     B2_Y2_CLK_GATE   8 bit  Clock Gating (Yukon-2 only) */
 enum {
@@ -406,6 +636,12 @@ enum {
        TIM_T_STEP      = 1<<0, /* Test step */
 };
 
+/*     Y2_PEX_PHY_ADDR/DATA            PEX PHY address and data reg  (Yukon-2 only) */
+enum {
+       PEX_RD_ACCESS   = 1<<31, /* Access Mode Read = 1, Write = 0 */
+       PEX_DB_ACCESS   = 1<<30, /* Access to debug register */
+};
+
 /*     B3_RAM_ADDR             32 bit  RAM Address, to read or write */
                                        /* Bit 31..19:  reserved */
 #define RAM_ADR_RAN    0x0007ffffL     /* Bit 18.. 0:  RAM Address Range */
@@ -458,8 +694,21 @@ enum {
        TXA_CTRL        = 0x0210,/*  8 bit      Tx Arbiter Control Register */
        TXA_TEST        = 0x0211,/*  8 bit      Tx Arbiter Test Register */
        TXA_STAT        = 0x0212,/*  8 bit      Tx Arbiter Status Register */
+
+       RSS_KEY         = 0x0220, /* RSS Key setup */
+       RSS_CFG         = 0x0248, /* RSS Configuration */
 };
 
+enum {
+       HASH_TCP_IPV6_EX_CTRL   = 1<<5,
+       HASH_IPV6_EX_CTRL       = 1<<4,
+       HASH_TCP_IPV6_CTRL      = 1<<3,
+       HASH_IPV6_CTRL          = 1<<2,
+       HASH_TCP_IPV4_CTRL      = 1<<1,
+       HASH_IPV4_CTRL          = 1<<0,
+
+       HASH_ALL                = 0x3f,
+};
 
 enum {
        B6_EXT_REG      = 0x0300,/* External registers (GENESIS only) */
@@ -477,23 +726,15 @@ enum {
 enum {
        B8_Q_REGS = 0x0400, /* base of Queue registers */
        Q_D     = 0x00, /* 8*32 bit     Current Descriptor */
-       Q_DA_L  = 0x20, /* 32 bit       Current Descriptor Address Low dWord */
-       Q_DA_H  = 0x24, /* 32 bit       Current Descriptor Address High dWord */
+       Q_VLAN  = 0x20, /* 16 bit       Current VLAN Tag */
+       Q_DONE  = 0x24, /* 16 bit       Done Index */
        Q_AC_L  = 0x28, /* 32 bit       Current Address Counter Low dWord */
        Q_AC_H  = 0x2c, /* 32 bit       Current Address Counter High dWord */
        Q_BC    = 0x30, /* 32 bit       Current Byte Counter */
        Q_CSR   = 0x34, /* 32 bit       BMU Control/Status Register */
-       Q_F     = 0x38, /* 32 bit       Flag Register */
-       Q_T1    = 0x3c, /* 32 bit       Test Register 1 */
-       Q_T1_TR = 0x3c, /*  8 bit       Test Register 1 Transfer SM */
-       Q_T1_WR = 0x3d, /*  8 bit       Test Register 1 Write Descriptor SM */
-       Q_T1_RD = 0x3e, /*  8 bit       Test Register 1 Read Descriptor SM */
-       Q_T1_SV = 0x3f, /*  8 bit       Test Register 1 Supervisor SM */
-       Q_T2    = 0x40, /* 32 bit       Test Register 2 */
-       Q_T3    = 0x44, /* 32 bit       Test Register 3 */
+       Q_TEST  = 0x38, /* 32 bit       Test/Control Register */
 
 /* Yukon-2 */
-       Q_DONE  = 0x24, /* 16 bit       Done Index              (Yukon-2 only) */
        Q_WM    = 0x40, /* 16 bit       FIFO Watermark */
        Q_AL    = 0x42, /*  8 bit       FIFO Alignment */
        Q_RSP   = 0x44, /* 16 bit       FIFO Read Shadow Pointer */
@@ -507,6 +748,17 @@ enum {
 };
 #define Q_ADDR(reg, offs) (B8_Q_REGS + (reg) + (offs))
 
+/*     Q_TEST                          32 bit  Test Register */
+enum {
+       /* Transmit */
+       F_TX_CHK_AUTO_OFF = 1<<31, /* Tx checksum auto calc off (Yukon EX) */
+       F_TX_CHK_AUTO_ON  = 1<<30, /* Tx checksum auto calc off (Yukon EX) */
+
+       /* Receive */
+       F_M_RX_RAM_DIS  = 1<<24, /* MAC Rx RAM Read Port disable */
+
+       /* Hardware testbits not used */
+};
 
 /* Queue Prefetch Unit Offsets, use Y2_QADDR() to address (Yukon-2 only)*/
 enum {
@@ -561,7 +813,7 @@ enum {
        PHY_ADDR_MARV   = 0,
 };
 
-#define RB_ADDR(offs, queue) (B16_RAM_REGS + (queue) + (offs))
+#define RB_ADDR(offs, queue) ((u16) B16_RAM_REGS + (queue) + (offs))
 
 
 enum {
@@ -578,10 +830,11 @@ enum {
        RX_GMF_AF_THR   = 0x0c44,/* 32 bit      Rx GMAC FIFO Almost Full Thresh. */
        RX_GMF_CTRL_T   = 0x0c48,/* 32 bit      Rx GMAC FIFO Control/Test */
        RX_GMF_FL_MSK   = 0x0c4c,/* 32 bit      Rx GMAC FIFO Flush Mask */
-       RX_GMF_FL_THR   = 0x0c50,/* 32 bit      Rx GMAC FIFO Flush Threshold */
+       RX_GMF_FL_THR   = 0x0c50,/* 16 bit      Rx GMAC FIFO Flush Threshold */
+       RX_GMF_FL_CTRL  = 0x0c52,/* 16 bit      Rx GMAC FIFO Flush Control */
        RX_GMF_TR_THR   = 0x0c54,/* 32 bit      Rx Truncation Threshold (Yukon-2) */
-       RX_GMF_UP_THR   = 0x0c58,/*  8 bit      Rx Upper Pause Thr (Yukon-EC_U) */
-       RX_GMF_LP_THR   = 0x0c5a,/*  8 bit      Rx Lower Pause Thr (Yukon-EC_U) */
+       RX_GMF_UP_THR   = 0x0c58,/* 16 bit      Rx Upper Pause Thr (Yukon-EC_U) */
+       RX_GMF_LP_THR   = 0x0c5a,/* 16 bit      Rx Lower Pause Thr (Yukon-EC_U) */
        RX_GMF_VLAN     = 0x0c5c,/* 32 bit      Rx VLAN Type Register (Yukon-2) */
        RX_GMF_WP       = 0x0c60,/* 32 bit      Rx GMAC FIFO Write Pointer */
 
@@ -633,6 +886,7 @@ enum {
                          BMU_FIFO_ENA | BMU_OP_ON,
 
        BMU_WM_DEFAULT = 0x600,
+       BMU_WM_PEX     = 0x80,
 };
 
 /* Tx BMU Control / Status Registers (Yukon-2) */
@@ -643,6 +897,42 @@ enum {
        BMU_TX_CLR_IRQ_TCP      = 1<<11, /* Clear IRQ on TCP segment length mismatch */
 };
 
+/*     TBMU_TEST                       0x06B8  Transmit BMU Test Register */
+enum {
+       TBMU_TEST_BMU_TX_CHK_AUTO_OFF           = 1<<31, /* BMU Tx Checksum Auto Calculation Disable */
+       TBMU_TEST_BMU_TX_CHK_AUTO_ON            = 1<<30, /* BMU Tx Checksum Auto Calculation Enable */
+       TBMU_TEST_HOME_ADD_PAD_FIX1_EN          = 1<<29, /* Home Address Paddiing FIX1 Enable */
+       TBMU_TEST_HOME_ADD_PAD_FIX1_DIS         = 1<<28, /* Home Address Paddiing FIX1 Disable */
+       TBMU_TEST_ROUTING_ADD_FIX_EN            = 1<<27, /* Routing Address Fix Enable */
+       TBMU_TEST_ROUTING_ADD_FIX_DIS           = 1<<26, /* Routing Address Fix Disable */
+       TBMU_TEST_HOME_ADD_FIX_EN               = 1<<25, /* Home address checksum fix enable */
+       TBMU_TEST_HOME_ADD_FIX_DIS              = 1<<24, /* Home address checksum fix disable */
+
+       TBMU_TEST_TEST_RSPTR_ON                 = 1<<22, /* Testmode Shadow Read Ptr On */
+       TBMU_TEST_TEST_RSPTR_OFF                = 1<<21, /* Testmode Shadow Read Ptr Off */
+       TBMU_TEST_TESTSTEP_RSPTR                = 1<<20, /* Teststep Shadow Read Ptr */
+
+       TBMU_TEST_TEST_RPTR_ON                  = 1<<18, /* Testmode Read Ptr On */
+       TBMU_TEST_TEST_RPTR_OFF                 = 1<<17, /* Testmode Read Ptr Off */
+       TBMU_TEST_TESTSTEP_RPTR                 = 1<<16, /* Teststep Read Ptr */
+
+       TBMU_TEST_TEST_WSPTR_ON                 = 1<<14, /* Testmode Shadow Write Ptr On */
+       TBMU_TEST_TEST_WSPTR_OFF                = 1<<13, /* Testmode Shadow Write Ptr Off */
+       TBMU_TEST_TESTSTEP_WSPTR                = 1<<12, /* Teststep Shadow Write Ptr */
+
+       TBMU_TEST_TEST_WPTR_ON                  = 1<<10, /* Testmode Write Ptr On */
+       TBMU_TEST_TEST_WPTR_OFF                 = 1<<9, /* Testmode Write Ptr Off */
+       TBMU_TEST_TESTSTEP_WPTR                 = 1<<8,                 /* Teststep Write Ptr */
+
+       TBMU_TEST_TEST_REQ_NB_ON                = 1<<6, /* Testmode Req Nbytes/Addr On */
+       TBMU_TEST_TEST_REQ_NB_OFF               = 1<<5, /* Testmode Req Nbytes/Addr Off */
+       TBMU_TEST_TESTSTEP_REQ_NB               = 1<<4, /* Teststep Req Nbytes/Addr */
+
+       TBMU_TEST_TEST_DONE_IDX_ON              = 1<<2, /* Testmode Done Index On */
+       TBMU_TEST_TEST_DONE_IDX_OFF             = 1<<1, /* Testmode Done Index Off */
+       TBMU_TEST_TESTSTEP_DONE_IDX             = 1<<0, /* Teststep Done Index */
+};
+
 /* Queue Prefetch Unit Offsets, use Y2_QADDR() to address (Yukon-2 only)*/
 /* PREF_UNIT_CTRL      32 bit  Prefetch Control register */
 enum {
@@ -692,6 +982,11 @@ enum {
        TX_GMF_RP       = 0x0d70,/* 32 bit      Tx GMAC FIFO Read Pointer */
        TX_GMF_RSTP     = 0x0d74,/* 32 bit      Tx GMAC FIFO Restart Pointer */
        TX_GMF_RLEV     = 0x0d78,/* 32 bit      Tx GMAC FIFO Read Level */
+
+       /* Threshold values for Yukon-EC Ultra and Extreme */
+       ECU_AE_THR      = 0x0070, /* Almost Empty Threshold */
+       ECU_TXFF_LEV    = 0x01a0, /* Tx BMU FIFO Level */
+       ECU_JUMBO_WM    = 0x0080, /* Jumbo Mode Watermark */
 };
 
 /* Descriptor Poll Timer Registers */
@@ -719,6 +1014,24 @@ enum {
        POLL_LIST_ADDR_HI= 0x0e2c,/* 32 bit     Poll. List Start Addr (high) */
 };
 
+enum {
+       SMB_CFG          = 0x0e40, /* 32 bit    SMBus Config Register */
+       SMB_CSR          = 0x0e44, /* 32 bit    SMBus Control/Status Register */
+};
+
+enum {
+       CPU_WDOG         = 0x0e48, /* 32 bit    Watchdog Register  */
+       CPU_CNTR         = 0x0e4C, /* 32 bit    Counter Register  */
+       CPU_TIM          = 0x0e50,/* 32 bit     Timer Compare Register  */
+       CPU_AHB_ADDR     = 0x0e54, /* 32 bit    CPU AHB Debug  Register  */
+       CPU_AHB_WDATA    = 0x0e58, /* 32 bit    CPU AHB Debug  Register  */
+       CPU_AHB_RDATA    = 0x0e5C, /* 32 bit    CPU AHB Debug  Register  */
+       HCU_MAP_BASE     = 0x0e60, /* 32 bit    Reset Mapping Base */
+       CPU_AHB_CTRL     = 0x0e64, /* 32 bit    CPU AHB Debug  Register  */
+       HCU_CCSR         = 0x0e68, /* 32 bit    CPU Control and Status Register */
+       HCU_HCSR         = 0x0e6C, /* 32 bit    Host Control and Status Register */
+};
+
 /* ASF Subsystem Registers (Yukon-2 only) */
 enum {
        B28_Y2_SMB_CONFIG  = 0x0e40,/* 32 bit   ASF SMBus Config Register */
@@ -789,33 +1102,27 @@ enum {
        GMAC_LINK_CTRL  = 0x0f10,/* 16 bit      Link Control Reg */
 
 /* Wake-up Frame Pattern Match Control Registers (YUKON only) */
-
-       WOL_REG_OFFS    = 0x20,/* HW-Bug: Address is + 0x20 against spec. */
-
        WOL_CTRL_STAT   = 0x0f20,/* 16 bit      WOL Control/Status Reg */
        WOL_MATCH_CTL   = 0x0f22,/*  8 bit      WOL Match Control Reg */
        WOL_MATCH_RES   = 0x0f23,/*  8 bit      WOL Match Result Reg */
        WOL_MAC_ADDR    = 0x0f24,/* 32 bit      WOL MAC Address */
-       WOL_PATT_PME    = 0x0f2a,/*  8 bit      WOL PME Match Enable (Yukon-2) */
-       WOL_PATT_ASFM   = 0x0f2b,/*  8 bit      WOL ASF Match Enable (Yukon-2) */
        WOL_PATT_RPTR   = 0x0f2c,/*  8 bit      WOL Pattern Read Pointer */
 
 /* WOL Pattern Length Registers (YUKON only) */
-
        WOL_PATT_LEN_LO = 0x0f30,/* 32 bit      WOL Pattern Length 3..0 */
        WOL_PATT_LEN_HI = 0x0f34,/* 24 bit      WOL Pattern Length 6..4 */
 
 /* WOL Pattern Counter Registers (YUKON only) */
-
-
        WOL_PATT_CNT_0  = 0x0f38,/* 32 bit      WOL Pattern Counter 3..0 */
        WOL_PATT_CNT_4  = 0x0f3c,/* 24 bit      WOL Pattern Counter 6..4 */
 };
+#define WOL_REGS(port, x)      (x + (port)*0x80)
 
 enum {
        WOL_PATT_RAM_1  = 0x1000,/*  WOL Pattern RAM Link 1 */
        WOL_PATT_RAM_2  = 0x1400,/*  WOL Pattern RAM Link 2 */
 };
+#define WOL_PATT_RAM_BASE(port)        (WOL_PATT_RAM_1 + (port)*0x400)
 
 enum {
        BASE_GMAC_1     = 0x2800,/* GMAC 1 registers */
@@ -909,10 +1216,12 @@ enum {
        PHY_BCOM_ID1_C0 = 0x6044,
        PHY_BCOM_ID1_C5 = 0x6047,
 
-       PHY_MARV_ID1_B0 = 0x0C23, /* Yukon (PHY 88E1011) */
+       PHY_MARV_ID1_B0 = 0x0C23, /* Yukon      (PHY 88E1011) */
        PHY_MARV_ID1_B2 = 0x0C25, /* Yukon-Plus (PHY 88E1011) */
-       PHY_MARV_ID1_C2 = 0x0CC2, /* Yukon-EC (PHY 88E1111) */
-       PHY_MARV_ID1_Y2 = 0x0C91, /* Yukon-2 (PHY 88E1112) */
+       PHY_MARV_ID1_C2 = 0x0CC2, /* Yukon-EC   (PHY 88E1111) */
+       PHY_MARV_ID1_Y2 = 0x0C91, /* Yukon-2    (PHY 88E1112) */
+       PHY_MARV_ID1_FE = 0x0C83, /* Yukon-FE   (PHY 88E3082 Rev.A1) */
+       PHY_MARV_ID1_ECU= 0x0CB0, /* Yukon-ECU  (PHY 88E1149 Rev.B2?) */
 };
 
 /* Advertisement register bits */
@@ -1011,7 +1320,7 @@ enum {
        PHY_M_PC_EN_DET_PLUS    = 3<<8, /* Energy Detect Plus (Mode 2) */
 };
 
-#define PHY_M_PC_MDI_XMODE(x)  (((x)<<5) & PHY_M_PC_MDIX_MSK)
+#define PHY_M_PC_MDI_XMODE(x)  (((u16)(x)<<5) & PHY_M_PC_MDIX_MSK)
 
 enum {
        PHY_M_PC_MAN_MDI        = 0, /* 00 = Manual MDI configuration */
@@ -1019,6 +1328,12 @@ enum {
        PHY_M_PC_ENA_AUTO       = 3, /* 11 = Enable Automatic Crossover */
 };
 
+/* for Yukon-EC Ultra Gigabit Ethernet PHY (88E1149 only) */
+enum {
+       PHY_M_PC_COP_TX_DIS     = 1<<3, /* Copper Transmitter Disable */
+       PHY_M_PC_POW_D_ENA      = 1<<2, /* Power Down Enable */
+};
+
 /* for 10/100 Fast Ethernet PHY (88E3082 only) */
 enum {
        PHY_M_PC_ENA_DTE_DT     = 1<<15, /* Enable Data Terminal Equ. (DTE) Detect */
@@ -1081,7 +1396,7 @@ enum {
        PHY_M_IS_JABBER         = 1<<0, /* Jabber */
 
        PHY_M_DEF_MSK           = PHY_M_IS_LSP_CHANGE | PHY_M_IS_LST_CHANGE
-                                | PHY_M_IS_FIFO_ERROR,
+                                | PHY_M_IS_DUP_CHANGE,
        PHY_M_AN_MSK           = PHY_M_IS_AN_ERROR | PHY_M_IS_AN_COMPL,
 };
 
@@ -1107,13 +1422,13 @@ enum {
        PHY_M_EC_TX_TIM_CT  = 1<<1, /* RGMII Tx Timing Control */
        PHY_M_EC_TRANS_DIS  = 1<<0, /* Transmitter Disable (88E1111 only) */};
 
-#define PHY_M_EC_M_DSC(x)      ((x)<<10 & PHY_M_EC_M_DSC_MSK)
+#define PHY_M_EC_M_DSC(x)      ((u16)(x)<<10 & PHY_M_EC_M_DSC_MSK)
                                        /* 00=1x; 01=2x; 10=3x; 11=4x */
-#define PHY_M_EC_S_DSC(x)      ((x)<<8 & PHY_M_EC_S_DSC_MSK)
+#define PHY_M_EC_S_DSC(x)      ((u16)(x)<<8 & PHY_M_EC_S_DSC_MSK)
                                        /* 00=dis; 01=1x; 10=2x; 11=3x */
-#define PHY_M_EC_DSC_2(x)      ((x)<<9 & PHY_M_EC_M_DSC_MSK2)
+#define PHY_M_EC_DSC_2(x)      ((u16)(x)<<9 & PHY_M_EC_M_DSC_MSK2)
                                        /* 000=1x; 001=2x; 010=3x; 011=4x */
-#define PHY_M_EC_MAC_S(x)      ((x)<<4 & PHY_M_EC_MAC_S_MSK)
+#define PHY_M_EC_MAC_S(x)      ((u16)(x)<<4 & PHY_M_EC_MAC_S_MSK)
                                        /* 01X=0; 110=2.5; 111=25 (MHz) */
 
 /* for Yukon-2 Gigabit Ethernet PHY (88E1112 only) */
@@ -1124,7 +1439,7 @@ enum {
 };
 /* !!! Errata in spec. (1 = disable) */
 
-#define PHY_M_PC_DSC(x)                        (((x)<<12) & PHY_M_PC_DSC_MSK)
+#define PHY_M_PC_DSC(x)                        (((u16)(x)<<12) & PHY_M_PC_DSC_MSK)
                                                                                        /* 100=5x; 101=6x; 110=7x; 111=8x */
 enum {
        MAC_TX_CLK_0_MHZ        = 2,
@@ -1154,7 +1469,7 @@ enum {
        PHY_M_LEDC_TX_C_MSB     = 1<<0, /* Tx Control (MSB, 88E1111 only) */
 };
 
-#define PHY_M_LED_PULS_DUR(x)  (((x)<<12) & PHY_M_LEDC_PULS_MSK)
+#define PHY_M_LED_PULS_DUR(x)  (((u16)(x)<<12) & PHY_M_LEDC_PULS_MSK)
 
 /*****  PHY_MARV_PHY_STAT (page 3)16 bit r/w   Polarity Control Reg. *****/
 enum {
@@ -1184,7 +1499,7 @@ enum {
        PULS_1300MS     = 7,/* 1.3 s to 2.7 s */
 };
 
-#define PHY_M_LED_BLINK_RT(x)  (((x)<<8) & PHY_M_LEDC_BL_R_MSK)
+#define PHY_M_LED_BLINK_RT(x)  (((u16)(x)<<8) & PHY_M_LEDC_BL_R_MSK)
 
 enum {
        BLINK_42MS      = 0,/* 42 ms */
@@ -1195,20 +1510,20 @@ enum {
 };
 
 /*****  PHY_MARV_LED_OVER      16 bit r/w      Manual LED Override Reg *****/
-#define PHY_M_LED_MO_SGMII(x)  ((x)<<14) /* Bit 15..14:  SGMII AN Timer */
-                                                                               /* Bit 13..12:  reserved */
-#define PHY_M_LED_MO_DUP(x)    ((x)<<10) /* Bit 11..10:  Duplex */
-#define PHY_M_LED_MO_10(x)     ((x)<<8) /* Bit  9.. 8:  Link 10 */
-#define PHY_M_LED_MO_100(x)    ((x)<<6) /* Bit  7.. 6:  Link 100 */
-#define PHY_M_LED_MO_1000(x)   ((x)<<4) /* Bit  5.. 4:  Link 1000 */
-#define PHY_M_LED_MO_RX(x)     ((x)<<2) /* Bit  3.. 2:  Rx */
-#define PHY_M_LED_MO_TX(x)     ((x)<<0) /* Bit  1.. 0:  Tx */
+#define PHY_M_LED_MO_SGMII(x)  ((x)<<14)       /* Bit 15..14:  SGMII AN Timer */
 
-enum {
-       MO_LED_NORM     = 0,
-       MO_LED_BLINK    = 1,
-       MO_LED_OFF      = 2,
-       MO_LED_ON       = 3,
+#define PHY_M_LED_MO_DUP(x)    ((x)<<10)       /* Bit 11..10:  Duplex */
+#define PHY_M_LED_MO_10(x)     ((x)<<8)        /* Bit  9.. 8:  Link 10 */
+#define PHY_M_LED_MO_100(x)    ((x)<<6)        /* Bit  7.. 6:  Link 100 */
+#define PHY_M_LED_MO_1000(x)   ((x)<<4)        /* Bit  5.. 4:  Link 1000 */
+#define PHY_M_LED_MO_RX(x)     ((x)<<2)        /* Bit  3.. 2:  Rx */
+#define PHY_M_LED_MO_TX(x)     ((x)<<0)        /* Bit  1.. 0:  Tx */
+
+enum led_mode {
+       MO_LED_NORM  = 0,
+       MO_LED_BLINK = 1,
+       MO_LED_OFF   = 2,
+       MO_LED_ON    = 3,
 };
 
 /*****  PHY_MARV_EXT_CTRL_2    16 bit r/w      Ext. PHY Specific Ctrl 2 *****/
@@ -1245,9 +1560,9 @@ enum {
        PHY_M_FELP_LED0_MSK = 0xf, /* Bit  3.. 0: LED0 Mask (SPEED) */
 };
 
-#define PHY_M_FELP_LED2_CTRL(x)        (((x)<<8) & PHY_M_FELP_LED2_MSK)
-#define PHY_M_FELP_LED1_CTRL(x)        (((x)<<4) & PHY_M_FELP_LED1_MSK)
-#define PHY_M_FELP_LED0_CTRL(x)        (((x)<<0) & PHY_M_FELP_LED0_MSK)
+#define PHY_M_FELP_LED2_CTRL(x)        (((u16)(x)<<8) & PHY_M_FELP_LED2_MSK)
+#define PHY_M_FELP_LED1_CTRL(x)        (((u16)(x)<<4) & PHY_M_FELP_LED1_MSK)
+#define PHY_M_FELP_LED0_CTRL(x)        (((u16)(x)<<0) & PHY_M_FELP_LED0_MSK)
 
 enum {
        LED_PAR_CTRL_COLX       = 0x00,
@@ -1276,9 +1591,18 @@ enum {
 };
 
 /* for Yukon-2 Gigabit Ethernet PHY (88E1112 only) */
+/*****  PHY_MARV_PHY_CTRL (page 1)             16 bit r/w      Fiber Specific Ctrl *****/
+enum {
+       PHY_M_FIB_FORCE_LNK     = 1<<10,/* Force Link Good */
+       PHY_M_FIB_SIGD_POL      = 1<<9, /* SIGDET Polarity */
+       PHY_M_FIB_TX_DIS        = 1<<3, /* Transmitter Disable */
+};
+
+/* for Yukon-2 Gigabit Ethernet PHY (88E1112 only) */
 /*****  PHY_MARV_PHY_CTRL (page 2)             16 bit r/w      MAC Specific Ctrl *****/
 enum {
        PHY_M_MAC_MD_MSK        = 7<<7, /* Bit  9.. 7: Mode Select Mask */
+       PHY_M_MAC_GMIF_PUP      = 1<<3, /* GMII Power Up (88E1149 only) */
        PHY_M_MAC_MD_AUTO       = 3,/* Auto Copper/1000Base-X */
        PHY_M_MAC_MD_COPPER     = 5,/* Copper only */
        PHY_M_MAC_MD_1000BX     = 7,/* 1000Base-X only */
@@ -1336,23 +1660,23 @@ enum {
        GM_SMI_CTRL     = 0x0080,       /* 16 bit r/w   SMI Control Register */
        GM_SMI_DATA     = 0x0084,       /* 16 bit r/w   SMI Data Register */
        GM_PHY_ADDR     = 0x0088,       /* 16 bit r/w   GPHY Address Register */
+/* MIB Counters */
+       GM_MIB_CNT_BASE = 0x0100,       /* Base Address of MIB Counters */
+       GM_MIB_CNT_END  = 0x025C,       /* Last MIB counter */
 };
 
-/* MIB Counters */
-#define GM_MIB_CNT_BASE        0x0100          /* Base Address of MIB Counters */
-#define GM_MIB_CNT_SIZE        44              /* Number of MIB Counters */
 
 /*
  * MIB Counters base address definitions (low word) -
  * use offset 4 for access to high word        (32 bit r/o)
  */
 enum {
-       GM_RXF_UC_OK  = GM_MIB_CNT_BASE + 0,    /* Unicast Frames Received OK */
+       GM_RXF_UC_OK    = GM_MIB_CNT_BASE + 0,  /* Unicast Frames Received OK */
        GM_RXF_BC_OK    = GM_MIB_CNT_BASE + 8,  /* Broadcast Frames Received OK */
        GM_RXF_MPAUSE   = GM_MIB_CNT_BASE + 16, /* Pause MAC Ctrl Frames Received */
        GM_RXF_MC_OK    = GM_MIB_CNT_BASE + 24, /* Multicast Frames Received OK */
        GM_RXF_FCS_ERR  = GM_MIB_CNT_BASE + 32, /* Rx Frame Check Seq. Error */
-       /* GM_MIB_CNT_BASE + 40:        reserved */
+
        GM_RXO_OK_LO    = GM_MIB_CNT_BASE + 48, /* Octets Received OK Low */
        GM_RXO_OK_HI    = GM_MIB_CNT_BASE + 56, /* Octets Received OK High */
        GM_RXO_ERR_LO   = GM_MIB_CNT_BASE + 64, /* Octets Received Invalid Low */
@@ -1360,37 +1684,36 @@ enum {
        GM_RXF_SHT      = GM_MIB_CNT_BASE + 80, /* Frames <64 Byte Received OK */
        GM_RXE_FRAG     = GM_MIB_CNT_BASE + 88, /* Frames <64 Byte Received with FCS Err */
        GM_RXF_64B      = GM_MIB_CNT_BASE + 96, /* 64 Byte Rx Frame */
-       GM_RXF_127B     = GM_MIB_CNT_BASE + 104,        /* 65-127 Byte Rx Frame */
-       GM_RXF_255B     = GM_MIB_CNT_BASE + 112,        /* 128-255 Byte Rx Frame */
-       GM_RXF_511B     = GM_MIB_CNT_BASE + 120,        /* 256-511 Byte Rx Frame */
-       GM_RXF_1023B    = GM_MIB_CNT_BASE + 128,        /* 512-1023 Byte Rx Frame */
-       GM_RXF_1518B    = GM_MIB_CNT_BASE + 136,        /* 1024-1518 Byte Rx Frame */
-       GM_RXF_MAX_SZ   = GM_MIB_CNT_BASE + 144,        /* 1519-MaxSize Byte Rx Frame */
-       GM_RXF_LNG_ERR  = GM_MIB_CNT_BASE + 152,        /* Rx Frame too Long Error */
-       GM_RXF_JAB_PKT  = GM_MIB_CNT_BASE + 160,        /* Rx Jabber Packet Frame */
-       /* GM_MIB_CNT_BASE + 168:       reserved */
-       GM_RXE_FIFO_OV  = GM_MIB_CNT_BASE + 176,        /* Rx FIFO overflow Event */
-       /* GM_MIB_CNT_BASE + 184:       reserved */
-       GM_TXF_UC_OK    = GM_MIB_CNT_BASE + 192,        /* Unicast Frames Xmitted OK */
-       GM_TXF_BC_OK    = GM_MIB_CNT_BASE + 200,        /* Broadcast Frames Xmitted OK */
-       GM_TXF_MPAUSE   = GM_MIB_CNT_BASE + 208,        /* Pause MAC Ctrl Frames Xmitted */
-       GM_TXF_MC_OK    = GM_MIB_CNT_BASE + 216,        /* Multicast Frames Xmitted OK */
-       GM_TXO_OK_LO    = GM_MIB_CNT_BASE + 224,        /* Octets Transmitted OK Low */
-       GM_TXO_OK_HI    = GM_MIB_CNT_BASE + 232,        /* Octets Transmitted OK High */
-       GM_TXF_64B      = GM_MIB_CNT_BASE + 240,        /* 64 Byte Tx Frame */
-       GM_TXF_127B     = GM_MIB_CNT_BASE + 248,        /* 65-127 Byte Tx Frame */
-       GM_TXF_255B     = GM_MIB_CNT_BASE + 256,        /* 128-255 Byte Tx Frame */
-       GM_TXF_511B     = GM_MIB_CNT_BASE + 264,        /* 256-511 Byte Tx Frame */
-       GM_TXF_1023B    = GM_MIB_CNT_BASE + 272,        /* 512-1023 Byte Tx Frame */
-       GM_TXF_1518B    = GM_MIB_CNT_BASE + 280,        /* 1024-1518 Byte Tx Frame */
-       GM_TXF_MAX_SZ   = GM_MIB_CNT_BASE + 288,        /* 1519-MaxSize Byte Tx Frame */
-
-       GM_TXF_COL      = GM_MIB_CNT_BASE + 304,        /* Tx Collision */
-       GM_TXF_LAT_COL  = GM_MIB_CNT_BASE + 312,        /* Tx Late Collision */
-       GM_TXF_ABO_COL  = GM_MIB_CNT_BASE + 320,        /* Tx aborted due to Exces. Col. */
-       GM_TXF_MUL_COL  = GM_MIB_CNT_BASE + 328,        /* Tx Multiple Collision */
-       GM_TXF_SNG_COL  = GM_MIB_CNT_BASE + 336,        /* Tx Single Collision */
-       GM_TXE_FIFO_UR  = GM_MIB_CNT_BASE + 344,        /* Tx FIFO Underrun Event */
+       GM_RXF_127B     = GM_MIB_CNT_BASE + 104,/* 65-127 Byte Rx Frame */
+       GM_RXF_255B     = GM_MIB_CNT_BASE + 112,/* 128-255 Byte Rx Frame */
+       GM_RXF_511B     = GM_MIB_CNT_BASE + 120,/* 256-511 Byte Rx Frame */
+       GM_RXF_1023B    = GM_MIB_CNT_BASE + 128,/* 512-1023 Byte Rx Frame */
+       GM_RXF_1518B    = GM_MIB_CNT_BASE + 136,/* 1024-1518 Byte Rx Frame */
+       GM_RXF_MAX_SZ   = GM_MIB_CNT_BASE + 144,/* 1519-MaxSize Byte Rx Frame */
+       GM_RXF_LNG_ERR  = GM_MIB_CNT_BASE + 152,/* Rx Frame too Long Error */
+       GM_RXF_JAB_PKT  = GM_MIB_CNT_BASE + 160,/* Rx Jabber Packet Frame */
+
+       GM_RXE_FIFO_OV  = GM_MIB_CNT_BASE + 176,/* Rx FIFO overflow Event */
+       GM_TXF_UC_OK    = GM_MIB_CNT_BASE + 192,/* Unicast Frames Xmitted OK */
+       GM_TXF_BC_OK    = GM_MIB_CNT_BASE + 200,/* Broadcast Frames Xmitted OK */
+       GM_TXF_MPAUSE   = GM_MIB_CNT_BASE + 208,/* Pause MAC Ctrl Frames Xmitted */
+       GM_TXF_MC_OK    = GM_MIB_CNT_BASE + 216,/* Multicast Frames Xmitted OK */
+       GM_TXO_OK_LO    = GM_MIB_CNT_BASE + 224,/* Octets Transmitted OK Low */
+       GM_TXO_OK_HI    = GM_MIB_CNT_BASE + 232,/* Octets Transmitted OK High */
+       GM_TXF_64B      = GM_MIB_CNT_BASE + 240,/* 64 Byte Tx Frame */
+       GM_TXF_127B     = GM_MIB_CNT_BASE + 248,/* 65-127 Byte Tx Frame */
+       GM_TXF_255B     = GM_MIB_CNT_BASE + 256,/* 128-255 Byte Tx Frame */
+       GM_TXF_511B     = GM_MIB_CNT_BASE + 264,/* 256-511 Byte Tx Frame */
+       GM_TXF_1023B    = GM_MIB_CNT_BASE + 272,/* 512-1023 Byte Tx Frame */
+       GM_TXF_1518B    = GM_MIB_CNT_BASE + 280,/* 1024-1518 Byte Tx Frame */
+       GM_TXF_MAX_SZ   = GM_MIB_CNT_BASE + 288,/* 1519-MaxSize Byte Tx Frame */
+
+       GM_TXF_COL      = GM_MIB_CNT_BASE + 304,/* Tx Collision */
+       GM_TXF_LAT_COL  = GM_MIB_CNT_BASE + 312,/* Tx Late Collision */
+       GM_TXF_ABO_COL  = GM_MIB_CNT_BASE + 320,/* Tx aborted due to Exces. Col. */
+       GM_TXF_MUL_COL  = GM_MIB_CNT_BASE + 328,/* Tx Multiple Collision */
+       GM_TXF_SNG_COL  = GM_MIB_CNT_BASE + 336,/* Tx Single Collision */
+       GM_TXE_FIFO_UR  = GM_MIB_CNT_BASE + 344,/* Tx FIFO Underrun Event */
 };
 
 /* GMAC Bit Definitions */
@@ -1432,14 +1755,13 @@ enum {
 };
 
 #define GM_GPCR_SPEED_1000     (GM_GPCR_GIGS_ENA | GM_GPCR_SPEED_100)
-#define GM_GPCR_AU_ALL_DIS     (GM_GPCR_AU_DUP_DIS | GM_GPCR_AU_FCT_DIS|GM_GPCR_AU_SPD_DIS)
 
 /*     GM_TX_CTRL                      16 bit r/w      Transmit Control Register */
 enum {
        GM_TXCR_FORCE_JAM       = 1<<15, /* Bit 15:     Force Jam / Flow-Control */
        GM_TXCR_CRC_DIS         = 1<<14, /* Bit 14:     Disable insertion of CRC */
        GM_TXCR_PAD_DIS         = 1<<13, /* Bit 13:     Disable padding of packets */
-       GM_TXCR_COL_THR_MSK     = 1<<10, /* Bit 12..10: Collision Threshold */
+       GM_TXCR_COL_THR_MSK     = 7<<10, /* Bit 12..10: Collision Threshold */
 };
 
 #define TX_COL_THR(x)          (((x)<<10) & GM_TXCR_COL_THR_MSK)
@@ -1475,10 +1797,13 @@ enum {
 /*     GM_SERIAL_MODE                  16 bit r/w      Serial Mode Register */
 enum {
        GM_SMOD_DATABL_MSK      = 0x1f<<11, /* Bit 15..11:      Data Blinder (r/o) */
-       GM_SMOD_LIMIT_4         = 1<<10, /* Bit 10:     4 consecutive Tx trials */
-       GM_SMOD_VLAN_ENA        = 1<<9, /* Bit  9:      Enable VLAN  (Max. Frame Len) */
-       GM_SMOD_JUMBO_ENA       = 1<<8, /* Bit  8:      Enable Jumbo (Max. Frame Len) */
-        GM_SMOD_IPG_MSK        = 0x1f  /* Bit 4..0:    Inter-Packet Gap (IPG) */
+       GM_SMOD_LIMIT_4         = 1<<10, /* 4 consecutive Tx trials */
+       GM_SMOD_VLAN_ENA        = 1<<9,  /* Enable VLAN  (Max. Frame Len) */
+       GM_SMOD_JUMBO_ENA       = 1<<8,  /* Enable Jumbo (Max. Frame Len) */
+
+       GM_NEW_FLOW_CTRL        = 1<<6,  /* Enable New Flow-Control */
+
+       GM_SMOD_IPG_MSK         = 0x1f   /* Bit 4..0:   Inter-Packet Gap (IPG) */
 };
 
 #define DATA_BLIND_VAL(x)      (((x)<<11) & GM_SMOD_DATABL_MSK)
@@ -1496,8 +1821,8 @@ enum {
        GM_SMI_CT_BUSY          = 1<<3, /* Bit  3:      Busy (Operation in progress) */
 };
 
-#define GM_SMI_CT_PHY_AD(x)    (((x)<<11) & GM_SMI_CT_PHY_A_MSK)
-#define GM_SMI_CT_REG_AD(x)    (((x)<<6) & GM_SMI_CT_REG_A_MSK)
+#define GM_SMI_CT_PHY_AD(x)    (((u16)(x)<<11) & GM_SMI_CT_PHY_A_MSK)
+#define GM_SMI_CT_REG_AD(x)    (((u16)(x)<<6) & GM_SMI_CT_REG_A_MSK)
 
 /*     GM_PHY_ADDR                             16 bit r/w      GPHY Address Register */
 enum {
@@ -1507,7 +1832,7 @@ enum {
 
 /* Receive Frame Status Encoding */
 enum {
-       GMR_FS_LEN      = 0xffff<<16, /* Bit 31..16:    Rx Frame Length */
+       GMR_FS_LEN      = 0x7fff<<16, /* Bit 30..16:    Rx Frame Length */
        GMR_FS_VLAN     = 1<<13, /* VLAN Packet */
        GMR_FS_JABBER   = 1<<12, /* Jabber Packet */
        GMR_FS_UN_SIZE  = 1<<11, /* Undersize Packet */
@@ -1525,17 +1850,33 @@ enum {
 
        GMR_FS_ANY_ERR  = GMR_FS_RX_FF_OV | GMR_FS_CRC_ERR |
                          GMR_FS_FRAGMENT | GMR_FS_LONG_ERR |
-                         GMR_FS_MII_ERR | GMR_FS_BAD_FC | GMR_FS_GOOD_FC |
+                         GMR_FS_MII_ERR | GMR_FS_BAD_FC |
                          GMR_FS_UN_SIZE | GMR_FS_JABBER,
 };
 
 /*     RX_GMF_CTRL_T   32 bit  Rx GMAC FIFO Control/Test */
 enum {
+       RX_GCLKMAC_ENA  = 1<<31,        /* RX MAC Clock Gating Enable */
+       RX_GCLKMAC_OFF  = 1<<30,
+
+       RX_STFW_DIS     = 1<<29,        /* RX Store and Forward Enable */
+       RX_STFW_ENA     = 1<<28,
+
        RX_TRUNC_ON     = 1<<27,        /* enable  packet truncation */
        RX_TRUNC_OFF    = 1<<26,        /* disable packet truncation */
        RX_VLAN_STRIP_ON = 1<<25,       /* enable  VLAN stripping */
        RX_VLAN_STRIP_OFF = 1<<24,      /* disable VLAN stripping */
 
+       RX_MACSEC_FLUSH_ON  = 1<<23,
+       RX_MACSEC_FLUSH_OFF = 1<<22,
+       RX_MACSEC_ASF_FLUSH_ON = 1<<21,
+       RX_MACSEC_ASF_FLUSH_OFF = 1<<20,
+
+       GMF_RX_OVER_ON      = 1<<19,    /* enable flushing on receive overrun */
+       GMF_RX_OVER_OFF     = 1<<18,    /* disable flushing on receive overrun */
+       GMF_ASF_RX_OVER_ON  = 1<<17,    /* enable flushing of ASF when overrun */
+       GMF_ASF_RX_OVER_OFF = 1<<16,    /* disable flushing of ASF when overrun */
+
        GMF_WP_TST_ON   = 1<<14,        /* Write Pointer Test On */
        GMF_WP_TST_OFF  = 1<<13,        /* Write Pointer Test Off */
        GMF_WP_STEP     = 1<<12,        /* Write Pointer Step/Increment */
@@ -1558,15 +1899,36 @@ enum {
        GMF_RX_CTRL_DEF = GMF_OPER_ON | GMF_RX_F_FL_ON,
 };
 
+/*     RX_GMF_FL_CTRL  16 bit  Rx GMAC FIFO Flush Control (Yukon-Supreme) */
+enum {
+       RX_IPV6_SA_MOB_ENA      = 1<<9, /* IPv6 SA Mobility Support Enable */
+       RX_IPV6_SA_MOB_DIS      = 1<<8, /* IPv6 SA Mobility Support Disable */
+       RX_IPV6_DA_MOB_ENA      = 1<<7, /* IPv6 DA Mobility Support Enable */
+       RX_IPV6_DA_MOB_DIS      = 1<<6, /* IPv6 DA Mobility Support Disable */
+       RX_PTR_SYNCDLY_ENA      = 1<<5, /* Pointers Delay Synch Enable */
+       RX_PTR_SYNCDLY_DIS      = 1<<4, /* Pointers Delay Synch Disable */
+       RX_ASF_NEWFLAG_ENA      = 1<<3, /* RX ASF Flag New Logic Enable */
+       RX_ASF_NEWFLAG_DIS      = 1<<2, /* RX ASF Flag New Logic Disable */
+       RX_FLSH_MISSPKT_ENA     = 1<<1, /* RX Flush Miss-Packet Enable */
+       RX_FLSH_MISSPKT_DIS     = 1<<0, /* RX Flush Miss-Packet Disable */
+};
+
+/*     TX_GMF_EA               32 bit  Tx GMAC FIFO End Address */
+enum {
+       TX_DYN_WM_ENA   = 3,    /* Yukon-FE+ specific */
+};
 
 /*     TX_GMF_CTRL_T   32 bit  Tx GMAC FIFO Control/Test */
 enum {
-       TX_STFW_DIS     = 1<<31,/* Disable Store & Forward (Yukon-EC Ultra) */
-       TX_STFW_ENA     = 1<<30,/* Enable  Store & Forward (Yukon-EC Ultra) */
+       TX_STFW_DIS     = 1<<31,/* Disable Store & Forward */
+       TX_STFW_ENA     = 1<<30,/* Enable  Store & Forward */
 
        TX_VLAN_TAG_ON  = 1<<25,/* enable  VLAN tagging */
        TX_VLAN_TAG_OFF = 1<<24,/* disable VLAN tagging */
 
+       TX_PCI_JUM_ENA  = 1<<23,/* PCI Jumbo Mode enable */
+       TX_PCI_JUM_DIS  = 1<<22,/* PCI Jumbo Mode enable */
+
        GMF_WSP_TST_ON  = 1<<18,/* Write Shadow Pointer Test On */
        GMF_WSP_TST_OFF = 1<<17,/* Write Shadow Pointer Test Off */
        GMF_WSP_STEP    = 1<<16,/* Write Shadow Pointer Step/Increment */
@@ -1600,6 +1962,39 @@ enum {
        Y2_ASF_CLR_ASFI = 1<<1, /* Clear host IRQ */
        Y2_ASF_HOST_IRQ = 1<<0, /* Issue an IRQ to HOST system */
 };
+/*     HCU_CCSR        CPU Control and Status Register */
+enum {
+       HCU_CCSR_SMBALERT_MONITOR= 1<<27, /* SMBALERT pin monitor */
+       HCU_CCSR_CPU_SLEEP      = 1<<26, /* CPU sleep status */
+       /* Clock Stretching Timeout */
+       HCU_CCSR_CS_TO          = 1<<25,
+       HCU_CCSR_WDOG           = 1<<24, /* Watchdog Reset */
+
+       HCU_CCSR_CLR_IRQ_HOST   = 1<<17, /* Clear IRQ_HOST */
+       HCU_CCSR_SET_IRQ_HCU    = 1<<16, /* Set IRQ_HCU */
+
+       HCU_CCSR_AHB_RST        = 1<<9, /* Reset AHB bridge */
+       HCU_CCSR_CPU_RST_MODE   = 1<<8, /* CPU Reset Mode */
+
+       HCU_CCSR_SET_SYNC_CPU   = 1<<5,
+       HCU_CCSR_CPU_CLK_DIVIDE_MSK = 3<<3,/* CPU Clock Divide */
+       HCU_CCSR_CPU_CLK_DIVIDE_BASE= 1<<3,
+       HCU_CCSR_OS_PRSNT       = 1<<2, /* ASF OS Present */
+/* Microcontroller State */
+       HCU_CCSR_UC_STATE_MSK   = 3,
+       HCU_CCSR_UC_STATE_BASE  = 1<<0,
+       HCU_CCSR_ASF_RESET      = 0,
+       HCU_CCSR_ASF_HALTED     = 1<<1,
+       HCU_CCSR_ASF_RUNNING    = 1<<0,
+};
+
+/*     HCU_HCSR        Host Control and Status Register */
+enum {
+       HCU_HCSR_SET_IRQ_CPU    = 1<<16, /* Set IRQ_CPU */
+
+       HCU_HCSR_CLR_IRQ_HCU    = 1<<1, /* Clear IRQ_HCU */
+       HCU_HCSR_SET_IRQ_HOST   = 1<<0, /* Set IRQ_HOST */
+};
 
 /*     STAT_CTRL               32 bit  Status BMU control register (Yukon-2 only) */
 enum {
@@ -1612,6 +2007,15 @@ enum {
 
 /*     GMAC_CTRL               32 bit  GMAC Control Reg (YUKON only) */
 enum {
+       GMC_SET_RST         = 1<<15,/* MAC SEC RST */
+       GMC_SEC_RST_OFF     = 1<<14,/* MAC SEC RSt OFF */
+       GMC_BYP_MACSECRX_ON = 1<<13,/* Bypass macsec RX */
+       GMC_BYP_MACSECRX_OFF= 1<<12,/* Bypass macsec RX off */
+       GMC_BYP_MACSECTX_ON = 1<<11,/* Bypass macsec TX */
+       GMC_BYP_MACSECTX_OFF= 1<<10,/* Bypass macsec TX  off*/
+       GMC_BYP_RETR_ON = 1<<9, /* Bypass retransmit FIFO On */
+       GMC_BYP_RETR_OFF= 1<<8, /* Bypass retransmit FIFO Off */
+
        GMC_H_BURST_ON  = 1<<7, /* Half Duplex Burst Mode On */
        GMC_H_BURST_OFF = 1<<6, /* Half Duplex Burst Mode Off */
        GMC_F_LOOPB_ON  = 1<<5, /* FIFO Loopback On */
@@ -1624,28 +2028,28 @@ enum {
 
 /*     GPHY_CTRL               32 bit  GPHY Control Reg (YUKON only) */
 enum {
-       GPC_SEL_BDT     = 1<<28, /* Select Bi-Dir. Transfer for MDC/MDIO */
-       GPC_INT_POL_HI  = 1<<27, /* IRQ Polarity is Active HIGH */
-       GPC_75_OHM      = 1<<26, /* Use 75 Ohm Termination instead of 50 */
-       GPC_DIS_FC      = 1<<25, /* Disable Automatic Fiber/Copper Detection */
-       GPC_DIS_SLEEP   = 1<<24, /* Disable Energy Detect */
-       GPC_HWCFG_M_3   = 1<<23, /* HWCFG_MODE[3] */
-       GPC_HWCFG_M_2   = 1<<22, /* HWCFG_MODE[2] */
-       GPC_HWCFG_M_1   = 1<<21, /* HWCFG_MODE[1] */
-       GPC_HWCFG_M_0   = 1<<20, /* HWCFG_MODE[0] */
-       GPC_ANEG_0      = 1<<19, /* ANEG[0] */
-       GPC_ENA_XC      = 1<<18, /* Enable MDI crossover */
-       GPC_DIS_125     = 1<<17, /* Disable 125 MHz clock */
-       GPC_ANEG_3      = 1<<16, /* ANEG[3] */
-       GPC_ANEG_2      = 1<<15, /* ANEG[2] */
-       GPC_ANEG_1      = 1<<14, /* ANEG[1] */
-       GPC_ENA_PAUSE   = 1<<13, /* Enable Pause (SYM_OR_REM) */
-       GPC_PHYADDR_4   = 1<<12, /* Bit 4 of Phy Addr */
-       GPC_PHYADDR_3   = 1<<11, /* Bit 3 of Phy Addr */
-       GPC_PHYADDR_2   = 1<<10, /* Bit 2 of Phy Addr */
-       GPC_PHYADDR_1   = 1<<9,  /* Bit 1 of Phy Addr */
-       GPC_PHYADDR_0   = 1<<8,  /* Bit 0 of Phy Addr */
-                                               /* Bits  7..2:  reserved */
+       GPC_TX_PAUSE    = 1<<30, /* Tx pause enabled (ro) */
+       GPC_RX_PAUSE    = 1<<29, /* Rx pause enabled (ro) */
+       GPC_SPEED       = 3<<27, /* PHY speed (ro) */
+       GPC_LINK        = 1<<26, /* Link up (ro) */
+       GPC_DUPLEX      = 1<<25, /* Duplex (ro) */
+       GPC_CLOCK       = 1<<24, /* 125Mhz clock stable (ro) */
+
+       GPC_PDOWN       = 1<<23, /* Internal regulator 2.5 power down */
+       GPC_TSTMODE     = 1<<22, /* Test mode */
+       GPC_REG18       = 1<<21, /* Reg18 Power down */
+       GPC_REG12SEL    = 3<<19, /* Reg12 power setting */
+       GPC_REG18SEL    = 3<<17, /* Reg18 power setting */
+       GPC_SPILOCK     = 1<<16, /* SPI lock (ASF) */
+
+       GPC_LEDMUX      = 3<<14, /* LED Mux */
+       GPC_INTPOL      = 1<<13, /* Interrupt polarity */
+       GPC_DETECT      = 1<<12, /* Energy detect */
+       GPC_1000HD      = 1<<11, /* Enable 1000Mbit HD */
+       GPC_SLAVE       = 1<<10, /* Slave mode */
+       GPC_PAUSE       = 1<<9, /* Pause enable */
+       GPC_LEDCTL      = 3<<6, /* GPHY Leds */
+
        GPC_RST_CLR     = 1<<1, /* Clear GPHY Reset */
        GPC_RST_SET     = 1<<0, /* Set   GPHY Reset */
 };
@@ -1661,14 +2065,17 @@ enum {
        GM_IS_RX_COMPL  = 1<<0, /* Frame Reception Complete */
 
 #define GMAC_DEF_MSK     GM_IS_TX_FF_UR
+};
 
 /*     GMAC_LINK_CTRL  16 bit  GMAC Link Control Reg (YUKON only) */
-                                               /* Bits 15.. 2: reserved */
+enum {                                         /* Bits 15.. 2: reserved */
        GMLC_RST_CLR    = 1<<1, /* Clear GMAC Link Reset */
        GMLC_RST_SET    = 1<<0, /* Set   GMAC Link Reset */
+};
 
 
 /*     WOL_CTRL_STAT   16 bit  WOL Control/Status Reg */
+enum {
        WOL_CTL_LINK_CHG_OCC            = 1<<15,
        WOL_CTL_MAGIC_PKT_OCC           = 1<<14,
        WOL_CTL_PATTERN_OCC             = 1<<13,
@@ -1687,17 +2094,6 @@ enum {
        WOL_CTL_DIS_PATTERN_UNIT        = 1<<0,
 };
 
-#define WOL_CTL_DEFAULT                                \
-       (WOL_CTL_DIS_PME_ON_LINK_CHG |  \
-       WOL_CTL_DIS_PME_ON_PATTERN |    \
-       WOL_CTL_DIS_PME_ON_MAGIC_PKT |  \
-       WOL_CTL_DIS_LINK_CHG_UNIT |             \
-       WOL_CTL_DIS_PATTERN_UNIT |              \
-       WOL_CTL_DIS_MAGIC_PKT_UNIT)
-
-/*     WOL_MATCH_CTL    8 bit  WOL Match Control Reg */
-#define WOL_CTL_PATT_ENA(x)    (1 << (x))
-
 
 /* Control flags */
 enum {
@@ -1707,7 +2103,6 @@ enum {
        INIT_SUM= 1<<3,
        LOCK_SUM= 1<<4,
        INS_VLAN= 1<<5,
-       FRC_STAT= 1<<6,
        EOP     = 1<<7,
 };
 
@@ -1728,9 +2123,13 @@ enum {
        OP_ADDR64VLAN   = OP_ADDR64 | OP_VLAN,
        OP_LRGLEN       = 0x24,
        OP_LRGLENVLAN   = OP_LRGLEN | OP_VLAN,
+       OP_MSS          = 0x28,
+       OP_MSSVLAN      = OP_MSS | OP_VLAN,
+
        OP_BUFFER       = 0x40,
        OP_PACKET       = 0x41,
        OP_LARGESEND    = 0x43,
+       OP_LSOV2        = 0x45,
 
 /* YUKON-2 STATUS opcodes defines */
        OP_RXSTAT       = 0x60,
@@ -1741,23 +2140,24 @@ enum {
        OP_RXTIMEVLAN   = OP_RXTIMESTAMP | OP_RXVLAN,
        OP_RSS_HASH     = 0x65,
        OP_TXINDEXLE    = 0x68,
+       OP_MACSEC       = 0x6c,
+       OP_PUTIDX       = 0x70,
 };
 
-/* Yukon 2 hardware interface
- * Not tested on big endian
- */
+enum status_css {
+       CSS_TCPUDPCSOK  = 1<<7, /* TCP / UDP checksum is ok */
+       CSS_ISUDP       = 1<<6, /* packet is a UDP packet */
+       CSS_ISTCP       = 1<<5, /* packet is a TCP packet */
+       CSS_ISIPFRAG    = 1<<4, /* packet is a TCP/UDP frag, CS calc not done */
+       CSS_ISIPV6      = 1<<3, /* packet is a IPv6 packet */
+       CSS_IPV4CSUMOK  = 1<<2, /* IP v4: TCP header checksum is ok */
+       CSS_ISIPV4      = 1<<1, /* packet is a IPv4 packet */
+       CSS_LINK_BIT    = 1<<0, /* port number (legacy) */
+};
+
+/* Yukon 2 hardware interface */
 struct sky2_tx_le {
-       union {
-               __le32  addr;
-               struct {
-                       __le16  offset;
-                       __le16  start;
-               } csum  __attribute((packed));
-               struct {
-                       __le16  size;
-                       __le16  rsvd;
-               } tso  __attribute((packed));
-       } tx;
+       __le32  addr;
        __le16  length; /* also vlan tag or checksum start */
        u8      ctrl;
        u8      opcode;
@@ -1768,24 +2168,36 @@ struct sky2_rx_le {
        __le16  length;
        u8      ctrl;
        u8      opcode;
-} __attribute((packed));;
+} __attribute((packed));
 
 struct sky2_status_le {
        __le32  status; /* also checksum */
        __le16  length; /* also vlan tag */
-       u8      link;
+       u8      css;
        u8      opcode;
 } __attribute((packed));
 
 struct tx_ring_info {
        struct sk_buff  *skb;
-       DECLARE_PCI_UNMAP_ADDR(mapaddr);
-       u16             idx;
+       unsigned long flags;
+#define TX_MAP_SINGLE   0x0001
+#define TX_MAP_PAGE     0x0002
+       DEFINE_DMA_UNMAP_ADDR(mapaddr);
+       DEFINE_DMA_UNMAP_LEN(maplen);
 };
 
-struct ring_info {
+struct rx_ring_info {
        struct sk_buff  *skb;
-       dma_addr_t      mapaddr;
+       dma_addr_t      data_addr;
+       DEFINE_DMA_UNMAP_LEN(data_size);
+       dma_addr_t      frag_addr[ETH_JUMBO_MTU >> PAGE_SHIFT];
+};
+
+enum flow_control {
+       FC_NONE = 0,
+       FC_TX   = 1,
+       FC_RX   = 2,
+       FC_BOTH = 3,
 };
 
 struct sky2_port {
@@ -1793,65 +2205,99 @@ struct sky2_port {
        struct net_device    *netdev;
        unsigned             port;
        u32                  msg_enable;
+       spinlock_t           phy_lock;
 
-       spinlock_t           tx_lock  ____cacheline_aligned_in_smp;
        struct tx_ring_info  *tx_ring;
        struct sky2_tx_le    *tx_le;
+       u16                  tx_ring_size;
        u16                  tx_cons;           /* next le to check */
        u16                  tx_prod;           /* next le to use */
-       u32                  tx_addr64;
+       u16                  tx_next;           /* debug only */
+
        u16                  tx_pending;
-       u16                  tx_last_put;
        u16                  tx_last_mss;
+       u32                  tx_last_upper;
+       u32                  tx_tcpsum;
 
-       struct ring_info     *rx_ring ____cacheline_aligned_in_smp;
+       struct rx_ring_info  *rx_ring ____cacheline_aligned_in_smp;
        struct sky2_rx_le    *rx_le;
-       u32                  rx_addr64;
+
        u16                  rx_next;           /* next re to check */
        u16                  rx_put;            /* next le index to use */
        u16                  rx_pending;
-       u16                  rx_last_put;
-       u16                  rx_bufsize;
+       u16                  rx_data_size;
+       u16                  rx_nfrags;
+
 #ifdef SKY2_VLAN_TAG_USED
        u16                  rx_tag;
        struct vlan_group    *vlgrp;
 #endif
+       struct {
+               unsigned long last;
+               u32     mac_rp;
+               u8      mac_lev;
+               u8      fifo_rp;
+               u8      fifo_lev;
+       } check;
 
        dma_addr_t           rx_le_map;
        dma_addr_t           tx_le_map;
-       u32                  advertising;       /* ADVERTISED_ bits */
-       u16                  speed;     /* SPEED_1000, SPEED_100, ... */
-       u8                   autoneg;   /* AUTONEG_ENABLE, AUTONEG_DISABLE */
-       u8                   duplex;    /* DUPLEX_HALF, DUPLEX_FULL */
-       u8                   rx_pause;
-       u8                   tx_pause;
-       u8                   rx_csum;
-       u8                   wol;
 
-       struct net_device_stats net_stats;
+       u16                  advertising;       /* ADVERTISED_ bits */
+       u16                  speed;             /* SPEED_1000, SPEED_100, ... */
+       u8                   wol;               /* WAKE_ bits */
+       u8                   duplex;            /* DUPLEX_HALF, DUPLEX_FULL */
+       u16                  flags;
+#define SKY2_FLAG_RX_CHECKSUM          0x0001
+#define SKY2_FLAG_AUTO_SPEED           0x0002
+#define SKY2_FLAG_AUTO_PAUSE           0x0004
 
-       struct work_struct   phy_task;
-       struct semaphore     phy_sema;
+       enum flow_control    flow_mode;
+       enum flow_control    flow_status;
+
+#ifdef CONFIG_SKY2_DEBUG
+       struct dentry        *debugfs;
+#endif
 };
 
 struct sky2_hw {
        void __iomem         *regs;
        struct pci_dev       *pdev;
-       u32                  intr_mask;
+       struct napi_struct   napi;
        struct net_device    *dev[2];
+       unsigned long        flags;
+#define SKY2_HW_USE_MSI                0x00000001
+#define SKY2_HW_FIBRE_PHY      0x00000002
+#define SKY2_HW_GIGABIT                0x00000004
+#define SKY2_HW_NEWER_PHY      0x00000008
+#define SKY2_HW_RAM_BUFFER     0x00000010
+#define SKY2_HW_NEW_LE         0x00000020      /* new LSOv2 format */
+#define SKY2_HW_AUTO_TX_SUM    0x00000040      /* new IP decode for Tx */
+#define SKY2_HW_ADV_POWER_CTL  0x00000080      /* additional PHY power regs */
+#define SKY2_HW_RSS_BROKEN     0x00000100
 
-       int                  pm_cap;
-       int                  msi;
        u8                   chip_id;
        u8                   chip_rev;
-       u8                   copper;
+       u8                   pmd_type;
        u8                   ports;
 
        struct sky2_status_le *st_le;
+       u32                  st_size;
        u32                  st_idx;
        dma_addr_t           st_dma;
+
+       struct timer_list    watchdog_timer;
+       struct work_struct   restart_work;
+       wait_queue_head_t    msi_wait;
+
+       char                 irq_name[0];
 };
 
+static inline int sky2_is_copper(const struct sky2_hw *hw)
+{
+       return !(hw->flags & SKY2_HW_FIBRE_PHY);
+}
+
 /* Register accessor for memory mapped device */
 static inline u32 sky2_read32(const struct sky2_hw *hw, unsigned reg)
 {
@@ -1912,4 +2358,25 @@ static inline void gma_set_addr(struct sky2_hw *hw, unsigned port, unsigned reg,
        gma_write16(hw, port, reg+4,(u16) addr[2] | ((u16) addr[3] << 8));
        gma_write16(hw, port, reg+8,(u16) addr[4] | ((u16) addr[5] << 8));
 }
+
+/* PCI config space access */
+static inline u32 sky2_pci_read32(const struct sky2_hw *hw, unsigned reg)
+{
+       return sky2_read32(hw, Y2_CFG_SPC + reg);
+}
+
+static inline u16 sky2_pci_read16(const struct sky2_hw *hw, unsigned reg)
+{
+       return sky2_read16(hw, Y2_CFG_SPC + reg);
+}
+
+static inline void sky2_pci_write32(struct sky2_hw *hw, unsigned reg, u32 val)
+{
+       sky2_write32(hw, Y2_CFG_SPC + reg, val);
+}
+
+static inline void sky2_pci_write16(struct sky2_hw *hw, unsigned reg, u16 val)
+{
+       sky2_write16(hw, Y2_CFG_SPC + reg, val);
+}
 #endif