Skip to content

Commit 0360c04

Browse files
hkallweitdavem330
authored andcommitted
r8169: move setting OCP base to generic init code
Move setting the ocp_base to rtl_init_one(). Where supported the value is always the same, and if not supported it doesn't hurt. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7070eea commit 0360c04

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@
7575
#define R8169_TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc))
7676
#define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc))
7777

78+
#define OCP_STD_PHY_BASE 0xa400
79+
7880
#define RTL_CFG_NO_GBIT 1
7981

8082
/* write/read MMIO register */
@@ -847,8 +849,6 @@ static void r8168_mac_ocp_modify(struct rtl8169_private *tp, u32 reg, u16 mask,
847849
r8168_mac_ocp_write(tp, reg, (data & ~mask) | set);
848850
}
849851

850-
#define OCP_STD_PHY_BASE 0xa400
851-
852852
static void r8168g_mdio_write(struct rtl8169_private *tp, int reg, int value)
853853
{
854854
if (reg == 0x1f) {
@@ -5189,8 +5189,6 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
51895189

51905190
static void rtl_hw_init_8168g(struct rtl8169_private *tp)
51915191
{
5192-
tp->ocp_base = OCP_STD_PHY_BASE;
5193-
51945192
RTL_W32(tp, MISC, RTL_R32(tp, MISC) | RXDV_GATED_EN);
51955193

51965194
if (!rtl_udelay_loop_wait_high(tp, &rtl_txcfg_empty_cond, 100, 42))
@@ -5215,8 +5213,6 @@ static void rtl_hw_init_8168g(struct rtl8169_private *tp)
52155213

52165214
static void rtl_hw_init_8125(struct rtl8169_private *tp)
52175215
{
5218-
tp->ocp_base = OCP_STD_PHY_BASE;
5219-
52205216
RTL_W32(tp, MISC, RTL_R32(tp, MISC) | RXDV_GATED_EN);
52215217

52225218
if (!rtl_udelay_loop_wait_high(tp, &rtl_rxtx_empty_cond, 100, 42))
@@ -5353,6 +5349,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
53535349
tp->msg_enable = netif_msg_init(debug.msg_enable, R8169_MSG_DEFAULT);
53545350
tp->supports_gmii = ent->driver_data == RTL_CFG_NO_GBIT ? 0 : 1;
53555351
tp->eee_adv = -1;
5352+
tp->ocp_base = OCP_STD_PHY_BASE;
53565353

53575354
/* Get the *optional* external "ether_clk" used on some boards */
53585355
rc = rtl_get_ether_clk(tp);

0 commit comments

Comments
 (0)