int i;
struct mii_bus *bus;
+ pr_err("%s\n", __PRETTY_FUNCTION__);
+
bus = priv->sw_mii_bus ?: priv->mii_bus;
for (i = 0; i < AR8XXX_NUM_PHYS; i++) {
if (priv->chip->phy_fixup)
}
ar8xxx_phy_poll_reset(bus);
+
+ pr_err("ar8xxx_phy_init: setting custom registers\n");
+
+ ar8xxx_write(priv, 0x002c, 0x7e3f003f);
+ ar8xxx_write(priv, 0x0004, 0x00000500);
}
u32
static int
ar8216_hw_init(struct ar8xxx_priv *priv)
{
+ pr_err("%s\n", __PRETTY_FUNCTION__);
+
if (priv->initialized)
return 0;
__ar8216_init_port(struct ar8xxx_priv *priv, int port,
bool cpu_ge, bool flow_en)
{
+ pr_err("%s\n", __PRETTY_FUNCTION__);
+
/* Enable port learning and tx */
ar8xxx_write(priv, AR8216_REG_PORT_CTRL(port),
AR8216_PORT_CTRL_LEARN |
AR8216_PORT_STATUS_DUPLEX);
} else {
ar8xxx_write(priv, AR8216_REG_PORT_STATUS(port),
- AR8216_PORT_STATUS_LINK_AUTO);
+ AR8216_PORT_STATUS_LINK_AUTO |
+ AR8216_PORT_STATUS_FLOW_CONTROL);
}
}
static void
ar8216_init_port(struct ar8xxx_priv *priv, int port)
{
+ pr_err("%s\n", __PRETTY_FUNCTION__);
+
__ar8216_init_port(priv, port, ar8xxx_has_gige(priv),
chip_is_ar8316(priv));
}
{
u32 egress, ingress;
u32 pvid;
+ u32 t;
+
+ pr_err("%s\n", __PRETTY_FUNCTION__);
if (priv->vlan) {
pvid = priv->vlan_id[priv->pvid[port]];
AR8236_PORT_VLAN2_MEMBER,
(ingress << AR8236_PORT_VLAN2_VLAN_MODE_S) |
(members << AR8236_PORT_VLAN2_MEMBER_S));
+
+ t = ar8xxx_read(priv, AR8216_REG_PORT_CTRL(port));
+ pr_err("Port %i control register: %llx\n", port, t);
+
+ t = ar8xxx_read(priv, AR8216_REG_PORT_STATUS(port));
+ pr_err("Port %i status register: %llx\n", port, t);
}
static void
ar8236_init_globals(struct ar8xxx_priv *priv)
{
+ pr_err("%s\n", __PRETTY_FUNCTION__);
+
/* enable jumbo frames */
ar8xxx_rmw(priv, AR8216_REG_GLOBAL_CTRL,
AR8316_GCTRL_MTU, 9018 + 8 + 2);
const struct ar8xxx_chip *chip = priv->chip;
u8 portmask[AR8X16_MAX_PORTS];
int i, j;
+ u32 t;
+
+ pr_err("%s\n", __PRETTY_FUNCTION__);
mutex_lock(&priv->reg_mutex);
/* flush all vlan translation unit entries */
ar8xxx_set_age_time(priv, chip->reg_arl_ctrl);
mutex_unlock(&priv->reg_mutex);
+
+ t = ar8xxx_read(priv, 0x002c);
+ pr_err("ar8xxx_phy_init: 0x002c: %llx\n", t);
+
+ t = ar8xxx_read(priv, 0x0004);
+ pr_err("ar8xxx_phy_init: 0x0004: %llx\n", t);
+
return 0;
}
--- /dev/null
+diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
+index ccb2abd18d6c..3d1849c2ed24 100644
+--- a/drivers/net/ethernet/marvell/mvneta.c
++++ b/drivers/net/ethernet/marvell/mvneta.c
+@@ -3534,7 +3534,7 @@ static void mvneta_mac_config(struct phylink_config *config, unsigned int mode,
+ /* Even though it might look weird, when we're configured in
+ * SGMII or QSGMII mode, the RGMII bit needs to be set.
+ */
+- new_ctrl2 |= MVNETA_GMAC2_PORT_RGMII;
++ new_ctrl2 &= ~MVNETA_GMAC2_PORT_RGMII;
+
+ if (state->interface == PHY_INTERFACE_MODE_QSGMII ||
+ state->interface == PHY_INTERFACE_MODE_SGMII ||
+@@ -4498,6 +4498,8 @@ static void mvneta_conf_mbus_windows(struct mvneta_port *pp,
+ /* Power up the port */
+ static int mvneta_port_power_up(struct mvneta_port *pp, int phy_mode)
+ {
++ u32 val;
++
+ /* MAC Cause register should be cleared */
+ mvreg_write(pp, MVNETA_UNIT_INTR_CAUSE, 0);
+
+@@ -4507,6 +4509,14 @@ static int mvneta_port_power_up(struct mvneta_port *pp, int phy_mode)
+ !phy_interface_mode_is_rgmii(phy_mode))
+ return -EINVAL;
+
++ val = mvreg_read(pp, 0x243c);
++ pr_err("mvneta: register 0x243c original value: %llx\n", val);
++
++ val |= BIT(28)|BIT(29)|BIT(30);
++ pr_err("mvneta: register 0x243c modified value: %llx\n", val);
++
++ mvreg_write(pp, 0x243c, val);
++
+ return 0;
+ }
+