Skip to content

Commit

Permalink
some fixes for last commit (ethernet wasn't working)
Browse files Browse the repository at this point in the history
debug-printk for sgmii-mode:
[    5.263354] DEBUG: Passed mtk_sgmii_setup_mode_force 87 val:0x31120019

mtk_mac_an_restart isn't called
  • Loading branch information
frank-w committed Jul 23, 2019
1 parent 4bfa613 commit c1c9982
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/net/ethernet/mediatek/mtk_eth_soc.c
Expand Up @@ -430,6 +430,7 @@ static void mtk_mac_an_restart(struct phylink_config *config)
{
struct mtk_mac *mac = container_of(config, struct mtk_mac,
phylink_config);
printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);

mtk_sgmii_restart_an(mac->hw, mac->id);
}
Expand Down
8 changes: 7 additions & 1 deletion drivers/net/ethernet/mediatek/mtk_sgmii.c
Expand Up @@ -78,7 +78,13 @@ int mtk_sgmii_setup_mode_force(struct mtk_sgmii *ss, int id, int speed)
regmap_write(ss->regmap[id], SGMSYS_PCS_CONTROL_1, val);

/* SGMII force mode setting */
val = SGMII_FIXED_LINK;
//val = SGMII_FIXED_LINK; //don't work
//val = 0x31120019; //original-value
//val = SGMII_FIXED_LINK | BIT(17) | BIT(20) | BIT(24) | BIT(28) | BIT(29);
regmap_read(ss->regmap[id], SGMSYS_SGMII_MODE, &val);
val &= ~(BIT(1) | BIT(2) | BIT(3) | BIT(4));
val |= SGMII_FIXED_LINK;
printk(KERN_ALERT "DEBUG: Passed %s %d val:0x%x\n",__FUNCTION__,__LINE__,val);
regmap_write(ss->regmap[id], SGMSYS_SGMII_MODE, val);

/* Release PHYA power down state */
Expand Down

0 comments on commit c1c9982

Please sign in to comment.