Commit 85e97f0b authored by Bjarni Jonasson's avatar Bjarni Jonasson Committed by David S. Miller

net: phy: mscc: improved serdes calibration applied to VSC8514

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: e4f9ba64 ("net: phy: mscc: add support for VSC8514 PHY.")
Signed-off-by: default avatarSteen Hegelund <steen.hegelund@microchip.com>
Signed-off-by: default avatarBjarni Jonasson <bjarni.jonasson@microchip.com>
Tested-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3cc2c646
......@@ -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
......
......@@ -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;
......@@ -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);
......
This diff is collapsed.
This diff is collapsed.
/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
/*
* Driver for Microsemi VSC85xx PHYs
*
* Copyright (c) 2021 Microsemi Corporation
*/
#ifndef _MSCC_SERDES_PHY_H_
#define _MSCC_SERDES_PHY_H_
#define PHY_S6G_PLL5G_CFG2_GAIN_MASK GENMASK(9, 5)
#define PHY_S6G_PLL5G_CFG2_ENA_GAIN 1
#define PHY_S6G_DES_PHY_CTRL_POS 13
#define PHY_S6G_DES_MBTR_CTRL_POS 10
#define PHY_S6G_DES_CPMD_SEL_POS 8
#define PHY_S6G_DES_BW_HYST_POS 5
#define PHY_S6G_DES_BW_ANA_POS 1
#define PHY_S6G_DES_CFG 0x21
#define PHY_S6G_IB_CFG0 0x22
#define PHY_S6G_IB_CFG1 0x23
#define PHY_S6G_IB_CFG2 0x24
#define PHY_S6G_IB_CFG3 0x25
#define PHY_S6G_IB_CFG4 0x26
#define PHY_S6G_GP_CFG 0x2E
#define PHY_S6G_DFT_CFG0 0x35
#define PHY_S6G_IB_DFT_CFG2 0x37
int vsc85xx_sd6g_config_v2(struct phy_device *phydev);
#endif /* _MSCC_PHY_SERDES_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment