diff options
author | Huang, Xiong <xiong@qca.qualcomm.com> | 2012-04-25 16:27:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-26 05:03:32 -0400 |
commit | ce5b972bc840d024289c73a096d61cfdf57eff2e (patch) | |
tree | 6d51dab262288aa3ac1d33b8cfce5e224d4112b0 /drivers/net/ethernet/atheros/atl1c | |
parent | 7c6c44f064adf11628c8815cab02f3bdf95ef8bc (diff) |
atl1c: update PHY reset related routine
Many magic data are re-configured for PHY during its reset operation
based on chip type to get better compability and stability.
REG_PHY_CTRL register may be configured by BIOS before enter OS.
so, the driver can't directly write to it without any Read-Op.
this change also affect suspend and phy_disable routines.
PHY debug ports and extension registers are refined as well.
Signed-off-by: xiong <xiong@qca.qualcomm.com>
Tested-by: Liu David <dwliu@qca.qualcomm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/atheros/atl1c')
-rw-r--r-- | drivers/net/ethernet/atheros/atl1c/atl1c_hw.c | 188 | ||||
-rw-r--r-- | drivers/net/ethernet/atheros/atl1c/atl1c_hw.h | 335 | ||||
-rw-r--r-- | drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 23 |
3 files changed, 346 insertions, 200 deletions
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c index a17b5311dcec..9a5b0f398f78 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c | |||
@@ -457,6 +457,32 @@ int atl1c_write_phy_ext(struct atl1c_hw *hw, u8 dev_addr, | |||
457 | return atl1c_write_phy_core(hw, true, dev_addr, reg_addr, phy_data); | 457 | return atl1c_write_phy_core(hw, true, dev_addr, reg_addr, phy_data); |
458 | } | 458 | } |
459 | 459 | ||
460 | int atl1c_read_phy_dbg(struct atl1c_hw *hw, u16 reg_addr, u16 *phy_data) | ||
461 | { | ||
462 | int err; | ||
463 | |||
464 | err = atl1c_write_phy_reg(hw, MII_DBG_ADDR, reg_addr); | ||
465 | if (unlikely(err)) | ||
466 | return err; | ||
467 | else | ||
468 | err = atl1c_read_phy_reg(hw, MII_DBG_DATA, phy_data); | ||
469 | |||
470 | return err; | ||
471 | } | ||
472 | |||
473 | int atl1c_write_phy_dbg(struct atl1c_hw *hw, u16 reg_addr, u16 phy_data) | ||
474 | { | ||
475 | int err; | ||
476 | |||
477 | err = atl1c_write_phy_reg(hw, MII_DBG_ADDR, reg_addr); | ||
478 | if (unlikely(err)) | ||
479 | return err; | ||
480 | else | ||
481 | err = atl1c_write_phy_reg(hw, MII_DBG_DATA, phy_data); | ||
482 | |||
483 | return err; | ||
484 | } | ||
485 | |||
460 | /* | 486 | /* |
461 | * Configures PHY autoneg and flow control advertisement settings | 487 | * Configures PHY autoneg and flow control advertisement settings |
462 | * | 488 | * |
@@ -499,119 +525,107 @@ static int atl1c_phy_setup_adv(struct atl1c_hw *hw) | |||
499 | 525 | ||
500 | void atl1c_phy_disable(struct atl1c_hw *hw) | 526 | void atl1c_phy_disable(struct atl1c_hw *hw) |
501 | { | 527 | { |
502 | AT_WRITE_REGW(hw, REG_GPHY_CTRL, | 528 | u32 phy_ctrl_data; |
503 | GPHY_CTRL_PW_WOL_DIS | GPHY_CTRL_EXT_RESET); | 529 | |
530 | AT_READ_REG(hw, REG_GPHY_CTRL, &phy_ctrl_data); | ||
531 | phy_ctrl_data &= ~(GPHY_CTRL_EXT_RESET | GPHY_CTRL_CLS); | ||
532 | phy_ctrl_data |= GPHY_CTRL_SEL_ANA_RST | GPHY_CTRL_HIB_PULSE | | ||
533 | GPHY_CTRL_HIB_EN | GPHY_CTRL_PHY_IDDQ | | ||
534 | GPHY_CTRL_PWDOWN_HW; | ||
535 | AT_WRITE_REGW(hw, REG_GPHY_CTRL, phy_ctrl_data); | ||
504 | } | 536 | } |
505 | 537 | ||
506 | static void atl1c_phy_magic_data(struct atl1c_hw *hw) | ||
507 | { | ||
508 | u16 data; | ||
509 | |||
510 | data = ANA_LOOP_SEL_10BT | ANA_EN_MASK_TB | ANA_EN_10BT_IDLE | | ||
511 | ((1 & ANA_INTERVAL_SEL_TIMER_MASK) << | ||
512 | ANA_INTERVAL_SEL_TIMER_SHIFT); | ||
513 | |||
514 | atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_18); | ||
515 | atl1c_write_phy_reg(hw, MII_DBG_DATA, data); | ||
516 | |||
517 | data = (2 & ANA_SERDES_CDR_BW_MASK) | ANA_MS_PAD_DBG | | ||
518 | ANA_SERDES_EN_DEEM | ANA_SERDES_SEL_HSP | ANA_SERDES_EN_PLL | | ||
519 | ANA_SERDES_EN_LCKDT; | ||
520 | |||
521 | atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_5); | ||
522 | atl1c_write_phy_reg(hw, MII_DBG_DATA, data); | ||
523 | |||
524 | data = (44 & ANA_LONG_CABLE_TH_100_MASK) | | ||
525 | ((33 & ANA_SHORT_CABLE_TH_100_MASK) << | ||
526 | ANA_SHORT_CABLE_TH_100_SHIFT) | ANA_BP_BAD_LINK_ACCUM | | ||
527 | ANA_BP_SMALL_BW; | ||
528 | |||
529 | atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_54); | ||
530 | atl1c_write_phy_reg(hw, MII_DBG_DATA, data); | ||
531 | |||
532 | data = (11 & ANA_IECHO_ADJ_MASK) | ((11 & ANA_IECHO_ADJ_MASK) << | ||
533 | ANA_IECHO_ADJ_2_SHIFT) | ((8 & ANA_IECHO_ADJ_MASK) << | ||
534 | ANA_IECHO_ADJ_1_SHIFT) | ((8 & ANA_IECHO_ADJ_MASK) << | ||
535 | ANA_IECHO_ADJ_0_SHIFT); | ||
536 | |||
537 | atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_4); | ||
538 | atl1c_write_phy_reg(hw, MII_DBG_DATA, data); | ||
539 | |||
540 | data = ANA_RESTART_CAL | ((7 & ANA_MANUL_SWICH_ON_MASK) << | ||
541 | ANA_MANUL_SWICH_ON_SHIFT) | ANA_MAN_ENABLE | | ||
542 | ANA_SEL_HSP | ANA_EN_HB | ANA_OEN_125M; | ||
543 | |||
544 | atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_0); | ||
545 | atl1c_write_phy_reg(hw, MII_DBG_DATA, data); | ||
546 | |||
547 | if (hw->ctrl_flags & ATL1C_HIB_DISABLE) { | ||
548 | atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_41); | ||
549 | if (atl1c_read_phy_reg(hw, MII_DBG_DATA, &data) != 0) | ||
550 | return; | ||
551 | data &= ~ANA_TOP_PS_EN; | ||
552 | atl1c_write_phy_reg(hw, MII_DBG_DATA, data); | ||
553 | |||
554 | atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_11); | ||
555 | if (atl1c_read_phy_reg(hw, MII_DBG_DATA, &data) != 0) | ||
556 | return; | ||
557 | data &= ~ANA_PS_HIB_EN; | ||
558 | atl1c_write_phy_reg(hw, MII_DBG_DATA, data); | ||
559 | } | ||
560 | } | ||
561 | 538 | ||
562 | int atl1c_phy_reset(struct atl1c_hw *hw) | 539 | int atl1c_phy_reset(struct atl1c_hw *hw) |
563 | { | 540 | { |
564 | struct atl1c_adapter *adapter = hw->adapter; | 541 | struct atl1c_adapter *adapter = hw->adapter; |
565 | struct pci_dev *pdev = adapter->pdev; | 542 | struct pci_dev *pdev = adapter->pdev; |
566 | u16 phy_data; | 543 | u16 phy_data; |
567 | u32 phy_ctrl_data = GPHY_CTRL_DEFAULT; | 544 | u32 phy_ctrl_data, lpi_ctrl; |
568 | u32 mii_ier_data = IER_LINK_UP | IER_LINK_DOWN; | ||
569 | int err; | 545 | int err; |
570 | 546 | ||
571 | if (hw->ctrl_flags & ATL1C_HIB_DISABLE) | 547 | /* reset PHY core */ |
572 | phy_ctrl_data &= ~GPHY_CTRL_HIB_EN; | 548 | AT_READ_REG(hw, REG_GPHY_CTRL, &phy_ctrl_data); |
573 | 549 | phy_ctrl_data &= ~(GPHY_CTRL_EXT_RESET | GPHY_CTRL_PHY_IDDQ | | |
550 | GPHY_CTRL_GATE_25M_EN | GPHY_CTRL_PWDOWN_HW | GPHY_CTRL_CLS); | ||
551 | phy_ctrl_data |= GPHY_CTRL_SEL_ANA_RST; | ||
552 | if (!(hw->ctrl_flags & ATL1C_HIB_DISABLE)) | ||
553 | phy_ctrl_data |= (GPHY_CTRL_HIB_EN | GPHY_CTRL_HIB_PULSE); | ||
554 | else | ||
555 | phy_ctrl_data &= ~(GPHY_CTRL_HIB_EN | GPHY_CTRL_HIB_PULSE); | ||
574 | AT_WRITE_REG(hw, REG_GPHY_CTRL, phy_ctrl_data); | 556 | AT_WRITE_REG(hw, REG_GPHY_CTRL, phy_ctrl_data); |
575 | AT_WRITE_FLUSH(hw); | 557 | AT_WRITE_FLUSH(hw); |
576 | msleep(40); | 558 | udelay(10); |
577 | phy_ctrl_data |= GPHY_CTRL_EXT_RESET; | 559 | AT_WRITE_REG(hw, REG_GPHY_CTRL, phy_ctrl_data | GPHY_CTRL_EXT_RESET); |
578 | AT_WRITE_REG(hw, REG_GPHY_CTRL, phy_ctrl_data); | ||
579 | AT_WRITE_FLUSH(hw); | 560 | AT_WRITE_FLUSH(hw); |
580 | msleep(10); | 561 | udelay(10 * GPHY_CTRL_EXT_RST_TO); /* delay 800us */ |
581 | 562 | ||
563 | /* switch clock */ | ||
582 | if (hw->nic_type == athr_l2c_b) { | 564 | if (hw->nic_type == athr_l2c_b) { |
583 | atl1c_write_phy_reg(hw, MII_DBG_ADDR, 0x0A); | 565 | atl1c_read_phy_dbg(hw, MIIDBG_CFGLPSPD, &phy_data); |
584 | atl1c_read_phy_reg(hw, MII_DBG_DATA, &phy_data); | 566 | atl1c_write_phy_dbg(hw, MIIDBG_CFGLPSPD, |
585 | atl1c_write_phy_reg(hw, MII_DBG_DATA, phy_data & 0xDFFF); | 567 | phy_data & ~CFGLPSPD_RSTCNT_CLK125SW); |
586 | } | 568 | } |
587 | 569 | ||
588 | if (hw->nic_type == athr_l2c_b || | 570 | /* tx-half amplitude issue fix */ |
589 | hw->nic_type == athr_l2c_b2 || | 571 | if (hw->nic_type == athr_l2c_b || hw->nic_type == athr_l2c_b2) { |
590 | hw->nic_type == athr_l1d || | 572 | atl1c_read_phy_dbg(hw, MIIDBG_CABLE1TH_DET, &phy_data); |
591 | hw->nic_type == athr_l1d_2) { | 573 | phy_data |= CABLE1TH_DET_EN; |
592 | atl1c_write_phy_reg(hw, MII_DBG_ADDR, 0x3B); | 574 | atl1c_write_phy_dbg(hw, MIIDBG_CABLE1TH_DET, phy_data); |
593 | atl1c_read_phy_reg(hw, MII_DBG_DATA, &phy_data); | ||
594 | atl1c_write_phy_reg(hw, MII_DBG_DATA, phy_data & 0xFFF7); | ||
595 | msleep(20); | ||
596 | } | 575 | } |
597 | if (hw->nic_type == athr_l1d) { | 576 | |
598 | atl1c_write_phy_reg(hw, MII_DBG_ADDR, 0x29); | 577 | /* clear bit3 of dbgport 3B to lower voltage */ |
599 | atl1c_write_phy_reg(hw, MII_DBG_DATA, 0x929D); | 578 | if (!(hw->ctrl_flags & ATL1C_HIB_DISABLE)) { |
579 | if (hw->nic_type == athr_l2c_b || hw->nic_type == athr_l2c_b2) { | ||
580 | atl1c_read_phy_dbg(hw, MIIDBG_VOLT_CTRL, &phy_data); | ||
581 | phy_data &= ~VOLT_CTRL_SWLOWEST; | ||
582 | atl1c_write_phy_dbg(hw, MIIDBG_VOLT_CTRL, phy_data); | ||
583 | } | ||
584 | /* power saving config */ | ||
585 | phy_data = | ||
586 | hw->nic_type == athr_l1d || hw->nic_type == athr_l1d_2 ? | ||
587 | L1D_LEGCYPS_DEF : L1C_LEGCYPS_DEF; | ||
588 | atl1c_write_phy_dbg(hw, MIIDBG_LEGCYPS, phy_data); | ||
589 | /* hib */ | ||
590 | atl1c_write_phy_dbg(hw, MIIDBG_SYSMODCTRL, | ||
591 | SYSMODCTRL_IECHOADJ_DEF); | ||
592 | } else { | ||
593 | /* disable pws */ | ||
594 | atl1c_read_phy_dbg(hw, MIIDBG_LEGCYPS, &phy_data); | ||
595 | atl1c_write_phy_dbg(hw, MIIDBG_LEGCYPS, | ||
596 | phy_data & ~LEGCYPS_EN); | ||
597 | /* disable hibernate */ | ||
598 | atl1c_read_phy_dbg(hw, MIIDBG_HIBNEG, &phy_data); | ||
599 | atl1c_write_phy_dbg(hw, MIIDBG_HIBNEG, | ||
600 | phy_data & HIBNEG_PSHIB_EN); | ||
600 | } | 601 | } |
601 | if (hw->nic_type == athr_l1c || hw->nic_type == athr_l2c_b2 | 602 | /* disable AZ(EEE) by default */ |
602 | || hw->nic_type == athr_l2c) { | 603 | if (hw->nic_type == athr_l1d || hw->nic_type == athr_l1d_2 || |
603 | atl1c_write_phy_reg(hw, MII_DBG_ADDR, 0x29); | 604 | hw->nic_type == athr_l2c_b2) { |
604 | atl1c_write_phy_reg(hw, MII_DBG_DATA, 0xB6DD); | 605 | AT_READ_REG(hw, REG_LPI_CTRL, &lpi_ctrl); |
606 | AT_WRITE_REG(hw, REG_LPI_CTRL, lpi_ctrl & ~LPI_CTRL_EN); | ||
607 | atl1c_write_phy_ext(hw, MIIEXT_ANEG, MIIEXT_LOCAL_EEEADV, 0); | ||
608 | atl1c_write_phy_ext(hw, MIIEXT_PCS, MIIEXT_CLDCTRL3, | ||
609 | L2CB_CLDCTRL3); | ||
605 | } | 610 | } |
606 | err = atl1c_write_phy_reg(hw, MII_IER, mii_ier_data); | 611 | |
612 | /* other debug port to set */ | ||
613 | atl1c_write_phy_dbg(hw, MIIDBG_ANACTRL, ANACTRL_DEF); | ||
614 | atl1c_write_phy_dbg(hw, MIIDBG_SRDSYSMOD, SRDSYSMOD_DEF); | ||
615 | atl1c_write_phy_dbg(hw, MIIDBG_TST10BTCFG, TST10BTCFG_DEF); | ||
616 | /* UNH-IOL test issue, set bit7 */ | ||
617 | atl1c_write_phy_dbg(hw, MIIDBG_TST100BTCFG, | ||
618 | TST100BTCFG_DEF | TST100BTCFG_LITCH_EN); | ||
619 | |||
620 | /* set phy interrupt mask */ | ||
621 | phy_data = IER_LINK_UP | IER_LINK_DOWN; | ||
622 | err = atl1c_write_phy_reg(hw, MII_IER, phy_data); | ||
607 | if (err) { | 623 | if (err) { |
608 | if (netif_msg_hw(adapter)) | 624 | if (netif_msg_hw(adapter)) |
609 | dev_err(&pdev->dev, | 625 | dev_err(&pdev->dev, |
610 | "Error enable PHY linkChange Interrupt\n"); | 626 | "Error enable PHY linkChange Interrupt\n"); |
611 | return err; | 627 | return err; |
612 | } | 628 | } |
613 | if (!(hw->ctrl_flags & ATL1C_FPGA_VERSION)) | ||
614 | atl1c_phy_magic_data(hw); | ||
615 | return 0; | 629 | return 0; |
616 | } | 630 | } |
617 | 631 | ||
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h index 113e67bf179b..fba7eb5db2ed 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h | |||
@@ -60,6 +60,9 @@ int atl1c_read_phy_ext(struct atl1c_hw *hw, u8 dev_addr, | |||
60 | u16 reg_addr, u16 *phy_data); | 60 | u16 reg_addr, u16 *phy_data); |
61 | int atl1c_write_phy_ext(struct atl1c_hw *hw, u8 dev_addr, | 61 | int atl1c_write_phy_ext(struct atl1c_hw *hw, u8 dev_addr, |
62 | u16 reg_addr, u16 phy_data); | 62 | u16 reg_addr, u16 phy_data); |
63 | int atl1c_read_phy_dbg(struct atl1c_hw *hw, u16 reg_addr, u16 *phy_data); | ||
64 | int atl1c_write_phy_dbg(struct atl1c_hw *hw, u16 reg_addr, u16 phy_data); | ||
65 | |||
63 | /* register definition */ | 66 | /* register definition */ |
64 | #define REG_DEVICE_CAP 0x5C | 67 | #define REG_DEVICE_CAP 0x5C |
65 | #define DEVICE_CAP_MAX_PAYLOAD_MASK 0x7 | 68 | #define DEVICE_CAP_MAX_PAYLOAD_MASK 0x7 |
@@ -222,41 +225,32 @@ int atl1c_write_phy_ext(struct atl1c_hw *hw, u8 dev_addr, | |||
222 | #define IRQ_MODRT_RX_TIMER_SHIFT 16 | 225 | #define IRQ_MODRT_RX_TIMER_SHIFT 16 |
223 | 226 | ||
224 | #define REG_GPHY_CTRL 0x140C | 227 | #define REG_GPHY_CTRL 0x140C |
225 | #define GPHY_CTRL_EXT_RESET 0x1 | 228 | #define GPHY_CTRL_ADDR_MASK 0x1FUL |
226 | #define GPHY_CTRL_RTL_MODE 0x2 | 229 | #define GPHY_CTRL_ADDR_SHIFT 19 |
227 | #define GPHY_CTRL_LED_MODE 0x4 | 230 | #define GPHY_CTRL_BP_VLTGSW BIT(18) |
228 | #define GPHY_CTRL_ANEG_NOW 0x8 | 231 | #define GPHY_CTRL_100AB_EN BIT(17) |
229 | #define GPHY_CTRL_REV_ANEG 0x10 | 232 | #define GPHY_CTRL_10AB_EN BIT(16) |
230 | #define GPHY_CTRL_GATE_25M_EN 0x20 | 233 | #define GPHY_CTRL_PHY_PLL_BYPASS BIT(15) |
231 | #define GPHY_CTRL_LPW_EXIT 0x40 | 234 | #define GPHY_CTRL_PWDOWN_HW BIT(14) /* affect MAC&PHY, to low pw */ |
232 | #define GPHY_CTRL_PHY_IDDQ 0x80 | 235 | #define GPHY_CTRL_PHY_PLL_ON BIT(13) /* 1:pll always on, 0:can sw */ |
233 | #define GPHY_CTRL_PHY_IDDQ_DIS 0x100 | 236 | #define GPHY_CTRL_SEL_ANA_RST BIT(12) |
234 | #define GPHY_CTRL_GIGA_DIS 0x200 | 237 | #define GPHY_CTRL_HIB_PULSE BIT(11) |
235 | #define GPHY_CTRL_HIB_EN 0x400 | 238 | #define GPHY_CTRL_HIB_EN BIT(10) |
236 | #define GPHY_CTRL_HIB_PULSE 0x800 | 239 | #define GPHY_CTRL_GIGA_DIS BIT(9) |
237 | #define GPHY_CTRL_SEL_ANA_RST 0x1000 | 240 | #define GPHY_CTRL_PHY_IDDQ_DIS BIT(8) /* pw on RST */ |
238 | #define GPHY_CTRL_PHY_PLL_ON 0x2000 | 241 | #define GPHY_CTRL_PHY_IDDQ BIT(7) /* bit8 affect bit7 while rb */ |
239 | #define GPHY_CTRL_PWDOWN_HW 0x4000 | 242 | #define GPHY_CTRL_LPW_EXIT BIT(6) |
240 | #define GPHY_CTRL_PHY_PLL_BYPASS 0x8000 | 243 | #define GPHY_CTRL_GATE_25M_EN BIT(5) |
241 | 244 | #define GPHY_CTRL_REV_ANEG BIT(4) | |
242 | #define GPHY_CTRL_DEFAULT ( \ | 245 | #define GPHY_CTRL_ANEG_NOW BIT(3) |
243 | GPHY_CTRL_SEL_ANA_RST |\ | 246 | #define GPHY_CTRL_LED_MODE BIT(2) |
244 | GPHY_CTRL_HIB_PULSE |\ | 247 | #define GPHY_CTRL_RTL_MODE BIT(1) |
245 | GPHY_CTRL_HIB_EN) | 248 | #define GPHY_CTRL_EXT_RESET BIT(0) /* 1:out of DSP RST status */ |
246 | 249 | #define GPHY_CTRL_EXT_RST_TO 80 /* 800us atmost */ | |
247 | #define GPHY_CTRL_PW_WOL_DIS ( \ | 250 | #define GPHY_CTRL_CLS (\ |
248 | GPHY_CTRL_SEL_ANA_RST |\ | 251 | GPHY_CTRL_LED_MODE |\ |
249 | GPHY_CTRL_HIB_PULSE |\ | 252 | GPHY_CTRL_100AB_EN |\ |
250 | GPHY_CTRL_HIB_EN |\ | 253 | GPHY_CTRL_PHY_PLL_ON) |
251 | GPHY_CTRL_PWDOWN_HW |\ | ||
252 | GPHY_CTRL_PHY_IDDQ) | ||
253 | |||
254 | #define GPHY_CTRL_POWER_SAVING ( \ | ||
255 | GPHY_CTRL_SEL_ANA_RST |\ | ||
256 | GPHY_CTRL_HIB_EN |\ | ||
257 | GPHY_CTRL_HIB_PULSE |\ | ||
258 | GPHY_CTRL_PWDOWN_HW |\ | ||
259 | GPHY_CTRL_PHY_IDDQ) | ||
260 | 254 | ||
261 | /* Block IDLE Status Register */ | 255 | /* Block IDLE Status Register */ |
262 | #define REG_IDLE_STATUS 0x1410 | 256 | #define REG_IDLE_STATUS 0x1410 |
@@ -350,6 +344,26 @@ int atl1c_write_phy_ext(struct atl1c_hw *hw, u8 dev_addr, | |||
350 | #define SERDES_LOCK_DETECT_EN BIT(1) | 344 | #define SERDES_LOCK_DETECT_EN BIT(1) |
351 | #define SERDES_LOCK_DETECT BIT(0) | 345 | #define SERDES_LOCK_DETECT BIT(0) |
352 | 346 | ||
347 | #define REG_LPI_DECISN_TIMER 0x143C | ||
348 | #define L2CB_LPI_DESISN_TIMER 0x7D00 | ||
349 | |||
350 | #define REG_LPI_CTRL 0x1440 | ||
351 | #define LPI_CTRL_CHK_DA BIT(31) | ||
352 | #define LPI_CTRL_ENH_TO_MASK 0x1FFFUL | ||
353 | #define LPI_CTRL_ENH_TO_SHIFT 12 | ||
354 | #define LPI_CTRL_ENH_TH_MASK 0x1FUL | ||
355 | #define LPI_CTRL_ENH_TH_SHIFT 6 | ||
356 | #define LPI_CTRL_ENH_EN BIT(5) | ||
357 | #define LPI_CTRL_CHK_RX BIT(4) | ||
358 | #define LPI_CTRL_CHK_STATE BIT(3) | ||
359 | #define LPI_CTRL_GMII BIT(2) | ||
360 | #define LPI_CTRL_TO_PHY BIT(1) | ||
361 | #define LPI_CTRL_EN BIT(0) | ||
362 | |||
363 | #define REG_LPI_WAIT 0x1444 | ||
364 | #define LPI_WAIT_TIMER_MASK 0xFFFFUL | ||
365 | #define LPI_WAIT_TIMER_SHIFT 0 | ||
366 | |||
353 | /* MAC Control Register */ | 367 | /* MAC Control Register */ |
354 | #define REG_MAC_CTRL 0x1480 | 368 | #define REG_MAC_CTRL 0x1480 |
355 | #define MAC_CTRL_TX_EN 0x1 | 369 | #define MAC_CTRL_TX_EN 0x1 |
@@ -813,73 +827,188 @@ int atl1c_write_phy_ext(struct atl1c_hw *hw, u8 dev_addr, | |||
813 | #define MII_DBG_ADDR 0x1D | 827 | #define MII_DBG_ADDR 0x1D |
814 | #define MII_DBG_DATA 0x1E | 828 | #define MII_DBG_DATA 0x1E |
815 | 829 | ||
816 | #define MII_ANA_CTRL_0 0x0 | 830 | /***************************** debug port *************************************/ |
817 | #define ANA_RESTART_CAL 0x0001 | 831 | |
818 | #define ANA_MANUL_SWICH_ON_SHIFT 0x1 | 832 | #define MIIDBG_ANACTRL 0x00 |
819 | #define ANA_MANUL_SWICH_ON_MASK 0xF | 833 | #define ANACTRL_CLK125M_DELAY_EN 0x8000 |
820 | #define ANA_MAN_ENABLE 0x0020 | 834 | #define ANACTRL_VCO_FAST 0x4000 |
821 | #define ANA_SEL_HSP 0x0040 | 835 | #define ANACTRL_VCO_SLOW 0x2000 |
822 | #define ANA_EN_HB 0x0080 | 836 | #define ANACTRL_AFE_MODE_EN 0x1000 |
823 | #define ANA_EN_HBIAS 0x0100 | 837 | #define ANACTRL_LCKDET_PHY 0x800 |
824 | #define ANA_OEN_125M 0x0200 | 838 | #define ANACTRL_LCKDET_EN 0x400 |
825 | #define ANA_EN_LCKDT 0x0400 | 839 | #define ANACTRL_OEN_125M 0x200 |
826 | #define ANA_LCKDT_PHY 0x0800 | 840 | #define ANACTRL_HBIAS_EN 0x100 |
827 | #define ANA_AFE_MODE 0x1000 | 841 | #define ANACTRL_HB_EN 0x80 |
828 | #define ANA_VCO_SLOW 0x2000 | 842 | #define ANACTRL_SEL_HSP 0x40 |
829 | #define ANA_VCO_FAST 0x4000 | 843 | #define ANACTRL_CLASSA_EN 0x20 |
830 | #define ANA_SEL_CLK125M_DSP 0x8000 | 844 | #define ANACTRL_MANUSWON_SWR_MASK 3U |
831 | 845 | #define ANACTRL_MANUSWON_SWR_SHIFT 2 | |
832 | #define MII_ANA_CTRL_4 0x4 | 846 | #define ANACTRL_MANUSWON_SWR_2V 0 |
833 | #define ANA_IECHO_ADJ_MASK 0xF | 847 | #define ANACTRL_MANUSWON_SWR_1P9V 1 |
834 | #define ANA_IECHO_ADJ_3_SHIFT 0 | 848 | #define ANACTRL_MANUSWON_SWR_1P8V 2 |
835 | #define ANA_IECHO_ADJ_2_SHIFT 4 | 849 | #define ANACTRL_MANUSWON_SWR_1P7V 3 |
836 | #define ANA_IECHO_ADJ_1_SHIFT 8 | 850 | #define ANACTRL_MANUSWON_BW3_4M 0x2 |
837 | #define ANA_IECHO_ADJ_0_SHIFT 12 | 851 | #define ANACTRL_RESTART_CAL 0x1 |
838 | 852 | #define ANACTRL_DEF 0x02EF | |
839 | #define MII_ANA_CTRL_5 0x5 | 853 | |
840 | #define ANA_SERDES_CDR_BW_SHIFT 0 | 854 | #define MIIDBG_SYSMODCTRL 0x04 |
841 | #define ANA_SERDES_CDR_BW_MASK 0x3 | 855 | #define SYSMODCTRL_IECHOADJ_PFMH_PHY 0x8000 |
842 | #define ANA_MS_PAD_DBG 0x0004 | 856 | #define SYSMODCTRL_IECHOADJ_BIASGEN 0x4000 |
843 | #define ANA_SPEEDUP_DBG 0x0008 | 857 | #define SYSMODCTRL_IECHOADJ_PFML_PHY 0x2000 |
844 | #define ANA_SERDES_TH_LOS_SHIFT 4 | 858 | #define SYSMODCTRL_IECHOADJ_PS_MASK 3U |
845 | #define ANA_SERDES_TH_LOS_MASK 0x3 | 859 | #define SYSMODCTRL_IECHOADJ_PS_SHIFT 10 |
846 | #define ANA_SERDES_EN_DEEM 0x0040 | 860 | #define SYSMODCTRL_IECHOADJ_PS_40 3 |
847 | #define ANA_SERDES_TXELECIDLE 0x0080 | 861 | #define SYSMODCTRL_IECHOADJ_PS_20 2 |
848 | #define ANA_SERDES_BEACON 0x0100 | 862 | #define SYSMODCTRL_IECHOADJ_PS_0 1 |
849 | #define ANA_SERDES_HALFTXDR 0x0200 | 863 | #define SYSMODCTRL_IECHOADJ_10BT_100MV 0x40 /* 1:100mv, 0:200mv */ |
850 | #define ANA_SERDES_SEL_HSP 0x0400 | 864 | #define SYSMODCTRL_IECHOADJ_HLFAP_MASK 3U |
851 | #define ANA_SERDES_EN_PLL 0x0800 | 865 | #define SYSMODCTRL_IECHOADJ_HLFAP_SHIFT 4 |
852 | #define ANA_SERDES_EN 0x1000 | 866 | #define SYSMODCTRL_IECHOADJ_VDFULBW 0x8 |
853 | #define ANA_SERDES_EN_LCKDT 0x2000 | 867 | #define SYSMODCTRL_IECHOADJ_VDBIASHLF 0x4 |
854 | 868 | #define SYSMODCTRL_IECHOADJ_VDAMPHLF 0x2 | |
855 | #define MII_ANA_CTRL_11 0xB | 869 | #define SYSMODCTRL_IECHOADJ_VDLANSW 0x1 |
856 | #define ANA_PS_HIB_EN 0x8000 | 870 | #define SYSMODCTRL_IECHOADJ_DEF 0x88BB /* ???? */ |
857 | 871 | ||
858 | #define MII_ANA_CTRL_18 0x12 | 872 | /* for l1d & l2cb */ |
859 | #define ANA_TEST_MODE_10BT_01SHIFT 0 | 873 | #define SYSMODCTRL_IECHOADJ_CUR_ADD 0x8000 |
860 | #define ANA_TEST_MODE_10BT_01MASK 0x3 | 874 | #define SYSMODCTRL_IECHOADJ_CUR_MASK 7U |
861 | #define ANA_LOOP_SEL_10BT 0x0004 | 875 | #define SYSMODCTRL_IECHOADJ_CUR_SHIFT 12 |
862 | #define ANA_RGMII_MODE_SW 0x0008 | 876 | #define SYSMODCTRL_IECHOADJ_VOL_MASK 0xFU |
863 | #define ANA_EN_LONGECABLE 0x0010 | 877 | #define SYSMODCTRL_IECHOADJ_VOL_SHIFT 8 |
864 | #define ANA_TEST_MODE_10BT_2 0x0020 | 878 | #define SYSMODCTRL_IECHOADJ_VOL_17ALL 3 |
865 | #define ANA_EN_10BT_IDLE 0x0400 | 879 | #define SYSMODCTRL_IECHOADJ_VOL_100M15 1 |
866 | #define ANA_EN_MASK_TB 0x0800 | 880 | #define SYSMODCTRL_IECHOADJ_VOL_10M17 0 |
867 | #define ANA_TRIGGER_SEL_TIMER_SHIFT 12 | 881 | #define SYSMODCTRL_IECHOADJ_BIAS1_MASK 0xFU |
868 | #define ANA_TRIGGER_SEL_TIMER_MASK 0x3 | 882 | #define SYSMODCTRL_IECHOADJ_BIAS1_SHIFT 4 |
869 | #define ANA_INTERVAL_SEL_TIMER_SHIFT 14 | 883 | #define SYSMODCTRL_IECHOADJ_BIAS2_MASK 0xFU |
870 | #define ANA_INTERVAL_SEL_TIMER_MASK 0x3 | 884 | #define SYSMODCTRL_IECHOADJ_BIAS2_SHIFT 0 |
871 | 885 | #define L1D_SYSMODCTRL_IECHOADJ_DEF 0x4FBB | |
872 | #define MII_ANA_CTRL_41 0x29 | 886 | |
873 | #define ANA_TOP_PS_EN 0x8000 | 887 | #define MIIDBG_SRDSYSMOD 0x05 |
874 | 888 | #define SRDSYSMOD_LCKDET_EN 0x2000 | |
875 | #define MII_ANA_CTRL_54 0x36 | 889 | #define SRDSYSMOD_PLL_EN 0x800 |
876 | #define ANA_LONG_CABLE_TH_100_SHIFT 0 | 890 | #define SRDSYSMOD_SEL_HSP 0x400 |
877 | #define ANA_LONG_CABLE_TH_100_MASK 0x3F | 891 | #define SRDSYSMOD_HLFTXDR 0x200 |
878 | #define ANA_DESERVED 0x0040 | 892 | #define SRDSYSMOD_TXCLK_DELAY_EN 0x100 |
879 | #define ANA_EN_LIT_CH 0x0080 | 893 | #define SRDSYSMOD_TXELECIDLE 0x80 |
880 | #define ANA_SHORT_CABLE_TH_100_SHIFT 8 | 894 | #define SRDSYSMOD_DEEMP_EN 0x40 |
881 | #define ANA_SHORT_CABLE_TH_100_MASK 0x3F | 895 | #define SRDSYSMOD_MS_PAD 0x4 |
882 | #define ANA_BP_BAD_LINK_ACCUM 0x4000 | 896 | #define SRDSYSMOD_CDR_ADC_VLTG 0x2 |
883 | #define ANA_BP_SMALL_BW 0x8000 | 897 | #define SRDSYSMOD_CDR_DAC_1MA 0x1 |
898 | #define SRDSYSMOD_DEF 0x2C46 | ||
899 | |||
900 | #define MIIDBG_CFGLPSPD 0x0A | ||
901 | #define CFGLPSPD_RSTCNT_MASK 3U | ||
902 | #define CFGLPSPD_RSTCNT_SHIFT 14 | ||
903 | #define CFGLPSPD_RSTCNT_CLK125SW 0x2000 | ||
904 | |||
905 | #define MIIDBG_HIBNEG 0x0B | ||
906 | #define HIBNEG_PSHIB_EN 0x8000 | ||
907 | #define HIBNEG_WAKE_BOTH 0x4000 | ||
908 | #define HIBNEG_ONOFF_ANACHG_SUDEN 0x2000 | ||
909 | #define HIBNEG_HIB_PULSE 0x1000 | ||
910 | #define HIBNEG_GATE_25M_EN 0x800 | ||
911 | #define HIBNEG_RST_80U 0x400 | ||
912 | #define HIBNEG_RST_TIMER_MASK 3U | ||
913 | #define HIBNEG_RST_TIMER_SHIFT 8 | ||
914 | #define HIBNEG_GTX_CLK_DELAY_MASK 3U | ||
915 | #define HIBNEG_GTX_CLK_DELAY_SHIFT 5 | ||
916 | #define HIBNEG_BYPSS_BRKTIMER 0x10 | ||
917 | #define HIBNEG_DEF 0xBC40 | ||
918 | |||
919 | #define MIIDBG_TST10BTCFG 0x12 | ||
920 | #define TST10BTCFG_INTV_TIMER_MASK 3U | ||
921 | #define TST10BTCFG_INTV_TIMER_SHIFT 14 | ||
922 | #define TST10BTCFG_TRIGER_TIMER_MASK 3U | ||
923 | #define TST10BTCFG_TRIGER_TIMER_SHIFT 12 | ||
924 | #define TST10BTCFG_DIV_MAN_MLT3_EN 0x800 | ||
925 | #define TST10BTCFG_OFF_DAC_IDLE 0x400 | ||
926 | #define TST10BTCFG_LPBK_DEEP 0x4 /* 1:deep,0:shallow */ | ||
927 | #define TST10BTCFG_DEF 0x4C04 | ||
928 | |||
929 | #define MIIDBG_AZ_ANADECT 0x15 | ||
930 | #define AZ_ANADECT_10BTRX_TH 0x8000 | ||
931 | #define AZ_ANADECT_BOTH_01CHNL 0x4000 | ||
932 | #define AZ_ANADECT_INTV_MASK 0x3FU | ||
933 | #define AZ_ANADECT_INTV_SHIFT 8 | ||
934 | #define AZ_ANADECT_THRESH_MASK 0xFU | ||
935 | #define AZ_ANADECT_THRESH_SHIFT 4 | ||
936 | #define AZ_ANADECT_CHNL_MASK 0xFU | ||
937 | #define AZ_ANADECT_CHNL_SHIFT 0 | ||
938 | #define AZ_ANADECT_DEF 0x3220 | ||
939 | #define AZ_ANADECT_LONG 0xb210 | ||
940 | |||
941 | #define MIIDBG_MSE16DB 0x18 /* l1d */ | ||
942 | #define L1D_MSE16DB_UP 0x05EA | ||
943 | #define L1D_MSE16DB_DOWN 0x02EA | ||
944 | |||
945 | #define MIIDBG_LEGCYPS 0x29 | ||
946 | #define LEGCYPS_EN 0x8000 | ||
947 | #define LEGCYPS_DAC_AMP1000_MASK 7U | ||
948 | #define LEGCYPS_DAC_AMP1000_SHIFT 12 | ||
949 | #define LEGCYPS_DAC_AMP100_MASK 7U | ||
950 | #define LEGCYPS_DAC_AMP100_SHIFT 9 | ||
951 | #define LEGCYPS_DAC_AMP10_MASK 7U | ||
952 | #define LEGCYPS_DAC_AMP10_SHIFT 6 | ||
953 | #define LEGCYPS_UNPLUG_TIMER_MASK 7U | ||
954 | #define LEGCYPS_UNPLUG_TIMER_SHIFT 3 | ||
955 | #define LEGCYPS_UNPLUG_DECT_EN 0x4 | ||
956 | #define LEGCYPS_ECNC_PS_EN 0x1 | ||
957 | #define L1D_LEGCYPS_DEF 0x129D | ||
958 | #define L1C_LEGCYPS_DEF 0x36DD | ||
959 | |||
960 | #define MIIDBG_TST100BTCFG 0x36 | ||
961 | #define TST100BTCFG_NORMAL_BW_EN 0x8000 | ||
962 | #define TST100BTCFG_BADLNK_BYPASS 0x4000 | ||
963 | #define TST100BTCFG_SHORTCABL_TH_MASK 0x3FU | ||
964 | #define TST100BTCFG_SHORTCABL_TH_SHIFT 8 | ||
965 | #define TST100BTCFG_LITCH_EN 0x80 | ||
966 | #define TST100BTCFG_VLT_SW 0x40 | ||
967 | #define TST100BTCFG_LONGCABL_TH_MASK 0x3FU | ||
968 | #define TST100BTCFG_LONGCABL_TH_SHIFT 0 | ||
969 | #define TST100BTCFG_DEF 0xE12C | ||
970 | |||
971 | #define MIIDBG_VOLT_CTRL 0x3B /* only for l2cb 1 & 2 */ | ||
972 | #define VOLT_CTRL_CABLE1TH_MASK 0x1FFU | ||
973 | #define VOLT_CTRL_CABLE1TH_SHIFT 7 | ||
974 | #define VOLT_CTRL_AMPCTRL_MASK 3U | ||
975 | #define VOLT_CTRL_AMPCTRL_SHIFT 5 | ||
976 | #define VOLT_CTRL_SW_BYPASS 0x10 | ||
977 | #define VOLT_CTRL_SWLOWEST 0x8 | ||
978 | #define VOLT_CTRL_DACAMP10_MASK 7U | ||
979 | #define VOLT_CTRL_DACAMP10_SHIFT 0 | ||
980 | |||
981 | #define MIIDBG_CABLE1TH_DET 0x3E | ||
982 | #define CABLE1TH_DET_EN 0x8000 | ||
983 | |||
984 | |||
985 | /******* dev 3 *********/ | ||
986 | #define MIIEXT_PCS 3 | ||
987 | |||
988 | #define MIIEXT_CLDCTRL3 0x8003 | ||
989 | #define CLDCTRL3_BP_CABLE1TH_DET_GT 0x8000 | ||
990 | #define CLDCTRL3_AZ_DISAMP 0x1000 | ||
991 | #define L2CB_CLDCTRL3 0x4D19 | ||
992 | #define L1D_CLDCTRL3 0xDD19 | ||
993 | |||
994 | #define MIIEXT_CLDCTRL6 0x8006 | ||
995 | #define CLDCTRL6_CAB_LEN_MASK 0x1FFU | ||
996 | #define CLDCTRL6_CAB_LEN_SHIFT 0 | ||
997 | #define CLDCTRL6_CAB_LEN_SHORT 0x50 | ||
998 | |||
999 | /********* dev 7 **********/ | ||
1000 | #define MIIEXT_ANEG 7 | ||
1001 | |||
1002 | #define MIIEXT_LOCAL_EEEADV 0x3C | ||
1003 | #define LOCAL_EEEADV_1000BT 0x4 | ||
1004 | #define LOCAL_EEEADV_100BT 0x2 | ||
1005 | |||
1006 | #define MIIEXT_REMOTE_EEEADV 0x3D | ||
1007 | #define REMOTE_EEEADV_1000BT 0x4 | ||
1008 | #define REMOTE_EEEADV_100BT 0x2 | ||
1009 | |||
1010 | #define MIIEXT_EEE_ANEG 0x8000 | ||
1011 | #define EEE_ANEG_1000M 0x4 | ||
1012 | #define EEE_ANEG_100M 0x2 | ||
884 | 1013 | ||
885 | #endif /*_ATL1C_HW_H_*/ | 1014 | #endif /*_ATL1C_HW_H_*/ |
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c index 8a1d2f90eb1a..995da221fc5a 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c | |||
@@ -2314,6 +2314,7 @@ static int atl1c_suspend(struct device *dev) | |||
2314 | u32 wol_ctrl_data = 0; | 2314 | u32 wol_ctrl_data = 0; |
2315 | u16 mii_intr_status_data = 0; | 2315 | u16 mii_intr_status_data = 0; |
2316 | u32 wufc = adapter->wol; | 2316 | u32 wufc = adapter->wol; |
2317 | u32 phy_ctrl_data; | ||
2317 | 2318 | ||
2318 | atl1c_disable_l0s_l1(hw); | 2319 | atl1c_disable_l0s_l1(hw); |
2319 | if (netif_running(netdev)) { | 2320 | if (netif_running(netdev)) { |
@@ -2328,6 +2329,7 @@ static int atl1c_suspend(struct device *dev) | |||
2328 | 2329 | ||
2329 | AT_READ_REG(hw, REG_MASTER_CTRL, &master_ctrl_data); | 2330 | AT_READ_REG(hw, REG_MASTER_CTRL, &master_ctrl_data); |
2330 | AT_READ_REG(hw, REG_MAC_CTRL, &mac_ctrl_data); | 2331 | AT_READ_REG(hw, REG_MAC_CTRL, &mac_ctrl_data); |
2332 | AT_READ_REG(hw, REG_GPHY_CTRL, &phy_ctrl_data); | ||
2331 | 2333 | ||
2332 | master_ctrl_data &= ~MASTER_CTRL_CLK_SEL_DIS; | 2334 | master_ctrl_data &= ~MASTER_CTRL_CLK_SEL_DIS; |
2333 | mac_ctrl_data &= ~(MAC_CTRL_PRMLEN_MASK << MAC_CTRL_PRMLEN_SHIFT); | 2335 | mac_ctrl_data &= ~(MAC_CTRL_PRMLEN_MASK << MAC_CTRL_PRMLEN_SHIFT); |
@@ -2336,9 +2338,13 @@ static int atl1c_suspend(struct device *dev) | |||
2336 | MAC_CTRL_PRMLEN_SHIFT); | 2338 | MAC_CTRL_PRMLEN_SHIFT); |
2337 | mac_ctrl_data &= ~(MAC_CTRL_SPEED_MASK << MAC_CTRL_SPEED_SHIFT); | 2339 | mac_ctrl_data &= ~(MAC_CTRL_SPEED_MASK << MAC_CTRL_SPEED_SHIFT); |
2338 | mac_ctrl_data &= ~MAC_CTRL_DUPLX; | 2340 | mac_ctrl_data &= ~MAC_CTRL_DUPLX; |
2341 | phy_ctrl_data &= ~(GPHY_CTRL_EXT_RESET | GPHY_CTRL_CLS); | ||
2342 | phy_ctrl_data |= GPHY_CTRL_SEL_ANA_RST | GPHY_CTRL_HIB_PULSE | | ||
2343 | GPHY_CTRL_HIB_EN; | ||
2339 | 2344 | ||
2340 | if (wufc) { | 2345 | if (wufc) { |
2341 | mac_ctrl_data |= MAC_CTRL_RX_EN; | 2346 | mac_ctrl_data |= MAC_CTRL_RX_EN; |
2347 | phy_ctrl_data |= GPHY_CTRL_EXT_RESET; | ||
2342 | if (adapter->link_speed == SPEED_1000 || | 2348 | if (adapter->link_speed == SPEED_1000 || |
2343 | adapter->link_speed == SPEED_0) { | 2349 | adapter->link_speed == SPEED_0) { |
2344 | mac_ctrl_data |= atl1c_mac_speed_1000 << | 2350 | mac_ctrl_data |= atl1c_mac_speed_1000 << |
@@ -2381,23 +2387,20 @@ static int atl1c_suspend(struct device *dev) | |||
2381 | dev_dbg(&pdev->dev, | 2387 | dev_dbg(&pdev->dev, |
2382 | "%s: suspend MAC=0x%x\n", | 2388 | "%s: suspend MAC=0x%x\n", |
2383 | atl1c_driver_name, mac_ctrl_data); | 2389 | atl1c_driver_name, mac_ctrl_data); |
2384 | AT_WRITE_REG(hw, REG_MASTER_CTRL, master_ctrl_data); | ||
2385 | AT_WRITE_REG(hw, REG_WOL_CTRL, wol_ctrl_data); | ||
2386 | AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data); | ||
2387 | |||
2388 | AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_DEFAULT | | ||
2389 | GPHY_CTRL_EXT_RESET); | ||
2390 | } else { | 2390 | } else { |
2391 | AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_POWER_SAVING); | ||
2392 | master_ctrl_data |= MASTER_CTRL_CLK_SEL_DIS; | 2391 | master_ctrl_data |= MASTER_CTRL_CLK_SEL_DIS; |
2393 | mac_ctrl_data |= atl1c_mac_speed_10_100 << MAC_CTRL_SPEED_SHIFT; | 2392 | mac_ctrl_data |= atl1c_mac_speed_10_100 << MAC_CTRL_SPEED_SHIFT; |
2394 | mac_ctrl_data |= MAC_CTRL_DUPLX; | 2393 | mac_ctrl_data |= MAC_CTRL_DUPLX; |
2395 | AT_WRITE_REG(hw, REG_MASTER_CTRL, master_ctrl_data); | 2394 | phy_ctrl_data |= GPHY_CTRL_PHY_IDDQ | GPHY_CTRL_PWDOWN_HW; |
2396 | AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data); | 2395 | wol_ctrl_data = 0; |
2397 | AT_WRITE_REG(hw, REG_WOL_CTRL, 0); | ||
2398 | hw->phy_configured = false; /* re-init PHY when resume */ | 2396 | hw->phy_configured = false; /* re-init PHY when resume */ |
2399 | } | 2397 | } |
2400 | 2398 | ||
2399 | AT_WRITE_REG(hw, REG_MASTER_CTRL, master_ctrl_data); | ||
2400 | AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data); | ||
2401 | AT_WRITE_REG(hw, REG_GPHY_CTRL, phy_ctrl_data); | ||
2402 | AT_WRITE_REG(hw, REG_WOL_CTRL, wol_ctrl_data); | ||
2403 | |||
2401 | return 0; | 2404 | return 0; |
2402 | } | 2405 | } |
2403 | 2406 | ||