7 #define ETH_JUMBO_MTU 9000
94 #define P_PEX_LTSSM_STAT(x) ((x << 25) & P_PEX_LTSSM_STAT_MSK)
254 #define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \
255 PCI_STATUS_SIG_SYSTEM_ERROR | \
256 PCI_STATUS_REC_MASTER_ABORT | \
257 PCI_STATUS_REC_TARGET_ABORT | \
319 #define RAM_BUFFER(port, reg) (reg | (port <<6))
613 #define CFG_LED_MODE(x) (((x) & CFG_LED_MODE_MSK) >> 2)
614 #define CFG_DUAL_MAC_MSK (CFG_LINK_2_AVAIL | CFG_LINK_1_AVAIL)
620 #define Y2_CLK_DIV_VAL(x) (((x)<<16) & Y2_CLK_DIV_VAL_MSK)
623 #define Y2_CLK_DIV_VAL_2(x) (((x)<<21) & Y2_CLK_DIV_VAL2_MSK)
624 #define Y2_CLK_SEL_VAL_2(x) (((x)<<16) & Y2_CLK_SELECT2_MSK)
654 #define RAM_ADR_RAN 0x0007ffffL
666 #define SK_RI_TO_53 36
670 #define SK_REG(port,reg) (((port)<<7)+(reg))
678 #define TXA_MAX_VAL 0x00ffffffUL
756 #define Q_ADDR(reg, offs) (B8_Q_REGS + (reg) + (offs))
787 #define Y2_QADDR(q,reg) (Y2_B8_PREF_REGS + (q) + (reg))
823 #define RB_ADDR(offs, queue) ((u16) B16_RAM_REGS + (queue) + (offs))
964 #define RB_MSK 0x0007ffff
1126 #define WOL_REGS(port, x) (x + (port)*0x80)
1132 #define WOL_PATT_RAM_BASE(port) (WOL_PATT_RAM_1 + (port)*0x400)
1330 #define PHY_M_PC_MDI_XMODE(x) (((u16)(x)<<5) & PHY_M_PC_MDIX_MSK)
1379 #define PHY_M_PS_PAUSE_MSK (PHY_M_PS_TX_P_EN | PHY_M_PS_RX_P_EN)
1434 #define PHY_M_EC_M_DSC(x) ((u16)(x)<<10 & PHY_M_EC_M_DSC_MSK)
1436 #define PHY_M_EC_S_DSC(x) ((u16)(x)<<8 & PHY_M_EC_S_DSC_MSK)
1438 #define PHY_M_EC_DSC_2(x) ((u16)(x)<<9 & PHY_M_EC_M_DSC_MSK2)
1440 #define PHY_M_EC_MAC_S(x) ((u16)(x)<<4 & PHY_M_EC_MAC_S_MSK)
1451 #define PHY_M_PC_DSC(x) (((u16)(x)<<12) & PHY_M_PC_DSC_MSK)
1481 #define PHY_M_LED_PULS_DUR(x) (((u16)(x)<<12) & PHY_M_LEDC_PULS_MSK)
1493 #define PHY_M_POLC_LS1_P_MIX(x) (((x)<<12) & PHY_M_POLC_LS1M_MSK)
1494 #define PHY_M_POLC_IS0_P_MIX(x) (((x)<<8) & PHY_M_POLC_IS0M_MSK)
1495 #define PHY_M_POLC_LOS_CTRL(x) (((x)<<6) & PHY_M_POLC_LOS_MSK)
1496 #define PHY_M_POLC_INIT_CTRL(x) (((x)<<4) & PHY_M_POLC_INIT_MSK)
1497 #define PHY_M_POLC_STA1_CTRL(x) (((x)<<2) & PHY_M_POLC_STA1_MSK)
1498 #define PHY_M_POLC_STA0_CTRL(x) (((x)<<0) & PHY_M_POLC_STA0_MSK)
1511 #define PHY_M_LED_BLINK_RT(x) (((u16)(x)<<8) & PHY_M_LEDC_BL_R_MSK)
1522 #define PHY_M_LED_MO_SGMII(x) ((x)<<14)
1524 #define PHY_M_LED_MO_DUP(x) ((x)<<10)
1525 #define PHY_M_LED_MO_10(x) ((x)<<8)
1526 #define PHY_M_LED_MO_100(x) ((x)<<6)
1527 #define PHY_M_LED_MO_1000(x) ((x)<<4)
1528 #define PHY_M_LED_MO_RX(x) ((x)<<2)
1529 #define PHY_M_LED_MO_TX(x) ((x)<<0)
1572 #define PHY_M_FELP_LED2_CTRL(x) (((u16)(x)<<8) & PHY_M_FELP_LED2_MSK)
1573 #define PHY_M_FELP_LED1_CTRL(x) (((u16)(x)<<4) & PHY_M_FELP_LED1_MSK)
1574 #define PHY_M_FELP_LED0_CTRL(x) (((u16)(x)<<0) & PHY_M_FELP_LED0_MSK)
1619 #define PHY_M_MAC_MODE_SEL(x) (((x)<<7) & PHY_M_MAC_MD_MSK)
1629 #define PHY_M_LEDC_LOS_CTRL(x) (((x)<<12) & PHY_M_LEDC_LOS_MSK)
1630 #define PHY_M_LEDC_INIT_CTRL(x) (((x)<<8) & PHY_M_LEDC_INIT_MSK)
1631 #define PHY_M_LEDC_STA1_CTRL(x) (((x)<<4) & PHY_M_LEDC_STA1_MSK)
1632 #define PHY_M_LEDC_STA0_CTRL(x) (((x)<<0) & PHY_M_LEDC_STA0_MSK)
1766 #define GM_GPCR_SPEED_1000 (GM_GPCR_GIGS_ENA | GM_GPCR_SPEED_100)
1776 #define TX_COL_THR(x) (((x)<<10) & GM_TXCR_COL_THR_MSK)
1777 #define TX_COL_DEF 0x04
1800 #define TX_JAM_LEN_VAL(x) (((x)<<14) & GM_TXPA_JAMLEN_MSK)
1801 #define TX_JAM_IPG_VAL(x) (((x)<<9) & GM_TXPA_JAMIPG_MSK)
1802 #define TX_IPG_JAM_DATA(x) (((x)<<4) & GM_TXPA_JAMDAT_MSK)
1803 #define TX_BACK_OFF_LIM(x) ((x) & GM_TXPA_BO_LIM_MSK)
1818 #define DATA_BLIND_VAL(x) (((x)<<11) & GM_SMOD_DATABL_MSK)
1819 #define IPG_DATA_VAL(x) (x & GM_SMOD_IPG_MSK)
1821 #define DATA_BLIND_DEF 0x04
1822 #define IPG_DATA_DEF_1000 0x1e
1823 #define IPG_DATA_DEF_10_100 0x18
1834 #define GM_SMI_CT_PHY_AD(x) (((u16)(x)<<11) & GM_SMI_CT_PHY_A_MSK)
1835 #define GM_SMI_CT_REG_AD(x) (((u16)(x)<<6) & GM_SMI_CT_REG_A_MSK)
2077 #define GMAC_DEF_MSK GM_IS_TX_FF_UR
2193 #define TX_MAP_SINGLE 0x0001
2194 #define TX_MAP_PAGE 0x0002
2266 #define SKY2_FLAG_AUTO_SPEED 0x0002
2267 #define SKY2_FLAG_AUTO_PAUSE 0x0004
2272 #ifdef CONFIG_SKY2_DEBUG
2283 #define SKY2_HW_USE_MSI 0x00000001
2284 #define SKY2_HW_FIBRE_PHY 0x00000002
2285 #define SKY2_HW_GIGABIT 0x00000004
2286 #define SKY2_HW_NEWER_PHY 0x00000008
2287 #define SKY2_HW_RAM_BUFFER 0x00000010
2288 #define SKY2_HW_NEW_LE 0x00000020
2289 #define SKY2_HW_AUTO_TX_SUM 0x00000040
2290 #define SKY2_HW_ADV_POWER_CTL 0x00000080
2291 #define SKY2_HW_RSS_BROKEN 0x00000100
2292 #define SKY2_HW_VLAN_BROKEN 0x00000200
2293 #define SKY2_HW_RSS_CHKSUM 0x00000400
2294 #define SKY2_HW_IRQ_SETUP 0x00000800
2313 static inline int sky2_is_copper(
const struct sky2_hw *
hw)
2329 static inline u8 sky2_read8(
const struct sky2_hw *
hw,
unsigned reg)
2350 #define SK_GMAC_REG(port,reg) \
2351 (BASE_GMAC_1 + (port) * (BASE_GMAC_2-BASE_GMAC_1) + (reg))
2352 #define GM_PHY_RETRIES 100
2362 return (
u32) sky2_read16(hw, base)
2363 | (
u32) sky2_read16(hw, base+4) << 16;
2366 static inline u64 gma_read64(
struct sky2_hw *hw,
unsigned port,
unsigned reg)
2370 return (
u64) sky2_read16(hw, base)
2371 | (
u64) sky2_read16(hw, base+4) << 16
2372 | (
u64) sky2_read16(hw, base+8) << 32
2373 | (
u64) sky2_read16(hw, base+12) << 48;
2377 static inline u32 get_stats32(
struct sky2_hw *hw,
unsigned port,
unsigned reg)
2382 val = gma_read32(hw, port, reg);
2383 }
while (gma_read32(hw, port, reg) != val);
2388 static inline u64 get_stats64(
struct sky2_hw *hw,
unsigned port,
unsigned reg)
2393 val = gma_read64(hw, port, reg);
2394 }
while (gma_read64(hw, port, reg) != val);
2399 static inline void gma_write16(
const struct sky2_hw *hw,
unsigned port,
int r,
u16 v)
2404 static inline void gma_set_addr(
struct sky2_hw *hw,
unsigned port,
unsigned reg,
2407 gma_write16(hw, port, reg, (
u16) addr[0] | ((
u16) addr[1] << 8));
2408 gma_write16(hw, port, reg+4,(
u16) addr[2] | ((
u16) addr[3] << 8));
2409 gma_write16(hw, port, reg+8,(
u16) addr[4] | ((
u16) addr[5] << 8));
2413 static inline u32 sky2_pci_read32(
const struct sky2_hw *hw,
unsigned reg)
2418 static inline u16 sky2_pci_read16(
const struct sky2_hw *hw,
unsigned reg)
2423 static inline void sky2_pci_write32(
struct sky2_hw *hw,
unsigned reg,
u32 val)
2428 static inline void sky2_pci_write16(
struct sky2_hw *hw,
unsigned reg,
u16 val)