Commit d24e9aaf authored by Hayes Wang's avatar Hayes Wang Committed by Francois Romieu

r8169: correct settings of rtl8102e.

Adjust and remove certain settings of RTL8102E which are for previous chips.
Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
Acked-off-by: default avatarFrancois Romieu <romieu@fr.zoreil.com>
parent fac5b3ca
...@@ -3043,7 +3043,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -3043,7 +3043,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_out_mwi_2; goto err_out_mwi_2;
} }
tp->cp_cmd = PCIMulRW | RxChkSum; tp->cp_cmd = RxChkSum;
if ((sizeof(dma_addr_t) > 4) && if ((sizeof(dma_addr_t) > 4) &&
!pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && use_dac) { !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && use_dac) {
...@@ -3848,8 +3848,7 @@ static void rtl_hw_start_8168(struct net_device *dev) ...@@ -3848,8 +3848,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
Cxpl_dbg_sel | \ Cxpl_dbg_sel | \
ASF | \ ASF | \
PktCntrDisable | \ PktCntrDisable | \
PCIDAC | \ Mac_dbgo_sel)
PCIMulRW)
static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev) static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev)
{ {
...@@ -3879,8 +3878,6 @@ static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev) ...@@ -3879,8 +3878,6 @@ static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev)
if ((cfg1 & LEDS0) && (cfg1 & LEDS1)) if ((cfg1 & LEDS0) && (cfg1 & LEDS1))
RTL_W8(Config1, cfg1 & ~LEDS0); RTL_W8(Config1, cfg1 & ~LEDS0);
RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R810X_CPCMD_QUIRK_MASK);
rtl_ephy_init(ioaddr, e_info_8102e_1, ARRAY_SIZE(e_info_8102e_1)); rtl_ephy_init(ioaddr, e_info_8102e_1, ARRAY_SIZE(e_info_8102e_1));
} }
...@@ -3892,8 +3889,6 @@ static void rtl_hw_start_8102e_2(void __iomem *ioaddr, struct pci_dev *pdev) ...@@ -3892,8 +3889,6 @@ static void rtl_hw_start_8102e_2(void __iomem *ioaddr, struct pci_dev *pdev)
RTL_W8(Config1, MEMMAP | IOMAP | VPD | PMEnable); RTL_W8(Config1, MEMMAP | IOMAP | VPD | PMEnable);
RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en); RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en);
RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R810X_CPCMD_QUIRK_MASK);
} }
static void rtl_hw_start_8102e_3(void __iomem *ioaddr, struct pci_dev *pdev) static void rtl_hw_start_8102e_3(void __iomem *ioaddr, struct pci_dev *pdev)
...@@ -3919,6 +3914,8 @@ static void rtl_hw_start_8101(struct net_device *dev) ...@@ -3919,6 +3914,8 @@ static void rtl_hw_start_8101(struct net_device *dev)
} }
} }
RTL_W8(Cfg9346, Cfg9346_Unlock);
switch (tp->mac_version) { switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_07: case RTL_GIGA_MAC_VER_07:
rtl_hw_start_8102e_1(ioaddr, pdev); rtl_hw_start_8102e_1(ioaddr, pdev);
...@@ -3933,14 +3930,13 @@ static void rtl_hw_start_8101(struct net_device *dev) ...@@ -3933,14 +3930,13 @@ static void rtl_hw_start_8101(struct net_device *dev)
break; break;
} }
RTL_W8(Cfg9346, Cfg9346_Unlock); RTL_W8(Cfg9346, Cfg9346_Lock);
RTL_W8(MaxTxPacketSize, TxPacketMax); RTL_W8(MaxTxPacketSize, TxPacketMax);
rtl_set_rx_max_size(ioaddr, rx_buf_sz); rtl_set_rx_max_size(ioaddr, rx_buf_sz);
tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW; tp->cp_cmd &= ~R810X_CPCMD_QUIRK_MASK;
RTL_W16(CPlusCmd, tp->cp_cmd); RTL_W16(CPlusCmd, tp->cp_cmd);
RTL_W16(IntrMitigate, 0x0000); RTL_W16(IntrMitigate, 0x0000);
...@@ -3950,14 +3946,10 @@ static void rtl_hw_start_8101(struct net_device *dev) ...@@ -3950,14 +3946,10 @@ static void rtl_hw_start_8101(struct net_device *dev)
RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
rtl_set_rx_tx_config_registers(tp); rtl_set_rx_tx_config_registers(tp);
RTL_W8(Cfg9346, Cfg9346_Lock);
RTL_R8(IntrMask); RTL_R8(IntrMask);
rtl_set_rx_mode(dev); rtl_set_rx_mode(dev);
RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xf000); RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xf000);
RTL_W16(IntrMask, tp->intr_event); RTL_W16(IntrMask, tp->intr_event);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment