Skip to content

Commit

Permalink
net: phy: mscc: improved serdes calibration applied to VSC8514
Browse files Browse the repository at this point in the history
The current IB serdes calibration algorithm (performed by the onboard 8051)
has proven to be unstable for the VSC8514 QSGMII phy.
A new algorithm has been developed based on
'Frequency-offset Jittered-Injection' or 'FoJi' method which solves
all known issues.  This patch disables the 8051 algorithm and
replaces it with the new FoJi algorithm.
The calibration is now performed in a new file (mscc_serdes.c),
which can act as an placeholder for future serdes configurations.

Fixes: e4f9ba6 ("net: phy: mscc: add support for VSC8514 PHY.")
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com>
Signed-off-by: Bjarni Jonasson <bjarni.jonasson@microchip.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Bjarni Jonasson authored and David S. Miller committed Feb 16, 2021
1 parent 3cc2c64 commit 85e97f0
Show file tree
Hide file tree
Showing 5 changed files with 840 additions and 166 deletions.
1 change: 1 addition & 0 deletions drivers/net/phy/mscc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

obj-$(CONFIG_MICROSEMI_PHY) := mscc.o
mscc-objs := mscc_main.o
mscc-objs += mscc_serdes.o

ifdef CONFIG_MACSEC
mscc-objs += mscc_macsec.o
Expand Down
16 changes: 16 additions & 0 deletions drivers/net/phy/mscc/mscc.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ enum rgmii_clock_delay {
#define VSC8584_REVB 0x0001
#define MSCC_DEV_REV_MASK GENMASK(3, 0)

#define MSCC_ROM_TRAP_SERDES_6G_CFG 0x1E48
#define MSCC_RAM_TRAP_SERDES_6G_CFG 0x1E4F
#define PATCH_VEC_ZERO_EN 0x0100

struct reg_val {
u16 reg;
u32 val;
Expand Down Expand Up @@ -420,6 +424,18 @@ enum csr_target {
MACRO_CTRL = 0x07,
};

u32 vsc85xx_csr_read(struct phy_device *phydev,
enum csr_target target, u32 reg);

int vsc85xx_csr_write(struct phy_device *phydev,
enum csr_target target, u32 reg, u32 val);

int phy_base_write(struct phy_device *phydev, u32 regnum, u16 val);
int phy_base_read(struct phy_device *phydev, u32 regnum);
int phy_update_mcb_s6g(struct phy_device *phydev, u32 reg, u8 mcb);
int phy_commit_mcb_s6g(struct phy_device *phydev, u32 reg, u8 mcb);
int vsc8584_cmd(struct phy_device *phydev, u16 val);

#if IS_ENABLED(CONFIG_MACSEC)
int vsc8584_macsec_init(struct phy_device *phydev);
void vsc8584_handle_macsec_interrupt(struct phy_device *phydev);
Expand Down
Loading

0 comments on commit 85e97f0

Please sign in to comment.