net: mvpp2: Enable proper PHY polling and fix port functionality
authorMarcin Wojtas <mw@semihalf.com>
Mon, 21 Jul 2014 16:48:12 +0000 (13:48 -0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Jul 2014 02:50:30 +0000 (19:50 -0700)
commit08a23755080f590c577ecedb5a444e55daeb258c
tree0a1eca64b56a8ce9ec59e2eda782cc2be13c0ffd
parentb5c0a8009094d37c73649867c6d7d332a0d4fb4c
net: mvpp2: Enable proper PHY polling and fix port functionality

Currently, the network interfaces that are not configured by the bootloader
(using e.g. tftp or ping) can detect the link status but are unable to
transmit data.

The network controller has a functionality that allows the hardware to
continuously poll the PHY and directly update the MAC configuration accordingly
(speed, duplex, etc.). However, this doesn't work well with phylib's
software-based polling and updating MAC configuration in the driver's callback.

This commit fixes this issue by:

  1. Setting MVPP2_PHY_AN_STOP_SMI0_MASK in MVPP2_PHY_AN_CFG0_REG in
     mvpp2_init(), which disables the harware polling feature.

  2. Disabling MVPP2_GMAC_PCS_ENABLE_MASK bit in MVPP2_GMAC_CTRL_2_REG in
     mvpp2_port_mii_set() for port types other than SGMII.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2.c