linux/drivers/phy/freescale/phy-fsl-lynx-28g.c

// SPDX-License-Identifier: GPL-2.0+
/* Copyright (c) 2021-2022 NXP. */

#include <linux/module.h>
#include <linux/of.h>
#include <linux/phy.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/workqueue.h>

#define LYNX_28G_NUM_LANE
#define LYNX_28G_NUM_PLL

/* General registers per SerDes block */
#define LYNX_28G_PCC8
#define LYNX_28G_PCC8_SGMII
#define LYNX_28G_PCC8_SGMII_DIS

#define LYNX_28G_PCCC
#define LYNX_28G_PCCC_10GBASER
#define LYNX_28G_PCCC_USXGMII
#define LYNX_28G_PCCC_SXGMII_DIS

#define LYNX_28G_LNa_PCC_OFFSET(lane)

/* Per PLL registers */
#define LYNX_28G_PLLnRSTCTL(pll)
#define LYNX_28G_PLLnRSTCTL_DIS(rstctl)
#define LYNX_28G_PLLnRSTCTL_LOCK(rstctl)

#define LYNX_28G_PLLnCR0(pll)
#define LYNX_28G_PLLnCR0_REFCLK_SEL(cr0)
#define LYNX_28G_PLLnCR0_REFCLK_SEL_100MHZ
#define LYNX_28G_PLLnCR0_REFCLK_SEL_125MHZ
#define LYNX_28G_PLLnCR0_REFCLK_SEL_156MHZ
#define LYNX_28G_PLLnCR0_REFCLK_SEL_150MHZ
#define LYNX_28G_PLLnCR0_REFCLK_SEL_161MHZ

#define LYNX_28G_PLLnCR1(pll)
#define LYNX_28G_PLLnCR1_FRATE_SEL(cr1)
#define LYNX_28G_PLLnCR1_FRATE_5G_10GVCO
#define LYNX_28G_PLLnCR1_FRATE_5G_25GVCO
#define LYNX_28G_PLLnCR1_FRATE_10G_20GVCO

/* Per SerDes lane registers */
/* Lane a General Control Register */
#define LYNX_28G_LNaGCR0(lane)
#define LYNX_28G_LNaGCR0_PROTO_SEL_MSK
#define LYNX_28G_LNaGCR0_PROTO_SEL_SGMII
#define LYNX_28G_LNaGCR0_PROTO_SEL_XFI
#define LYNX_28G_LNaGCR0_IF_WIDTH_MSK
#define LYNX_28G_LNaGCR0_IF_WIDTH_10_BIT
#define LYNX_28G_LNaGCR0_IF_WIDTH_20_BIT

/* Lane a Tx Reset Control Register */
#define LYNX_28G_LNaTRSTCTL(lane)
#define LYNX_28G_LNaTRSTCTL_HLT_REQ
#define LYNX_28G_LNaTRSTCTL_RST_DONE
#define LYNX_28G_LNaTRSTCTL_RST_REQ

/* Lane a Tx General Control Register */
#define LYNX_28G_LNaTGCR0(lane)
#define LYNX_28G_LNaTGCR0_USE_PLLF
#define LYNX_28G_LNaTGCR0_USE_PLLS
#define LYNX_28G_LNaTGCR0_USE_PLL_MSK
#define LYNX_28G_LNaTGCR0_N_RATE_FULL
#define LYNX_28G_LNaTGCR0_N_RATE_HALF
#define LYNX_28G_LNaTGCR0_N_RATE_QUARTER
#define LYNX_28G_LNaTGCR0_N_RATE_MSK

#define LYNX_28G_LNaTECR0(lane)

/* Lane a Rx Reset Control Register */
#define LYNX_28G_LNaRRSTCTL(lane)
#define LYNX_28G_LNaRRSTCTL_HLT_REQ
#define LYNX_28G_LNaRRSTCTL_RST_DONE
#define LYNX_28G_LNaRRSTCTL_RST_REQ
#define LYNX_28G_LNaRRSTCTL_CDR_LOCK

/* Lane a Rx General Control Register */
#define LYNX_28G_LNaRGCR0(lane)
#define LYNX_28G_LNaRGCR0_USE_PLLF
#define LYNX_28G_LNaRGCR0_USE_PLLS
#define LYNX_28G_LNaRGCR0_USE_PLL_MSK
#define LYNX_28G_LNaRGCR0_N_RATE_MSK
#define LYNX_28G_LNaRGCR0_N_RATE_FULL
#define LYNX_28G_LNaRGCR0_N_RATE_HALF
#define LYNX_28G_LNaRGCR0_N_RATE_QUARTER
#define LYNX_28G_LNaRGCR0_N_RATE_MSK

#define LYNX_28G_LNaRGCR1(lane)

#define LYNX_28G_LNaRECR0(lane)
#define LYNX_28G_LNaRECR1(lane)
#define LYNX_28G_LNaRECR2(lane)

#define LYNX_28G_LNaRSCCR0(lane)

#define LYNX_28G_LNaPSS(lane)
#define LYNX_28G_LNaPSS_TYPE(pss)
#define LYNX_28G_LNaPSS_TYPE_SGMII
#define LYNX_28G_LNaPSS_TYPE_XFI

#define LYNX_28G_SGMIIaCR1(lane)
#define LYNX_28G_SGMIIaCR1_SGPCS_EN
#define LYNX_28G_SGMIIaCR1_SGPCS_DIS
#define LYNX_28G_SGMIIaCR1_SGPCS_MSK

struct lynx_28g_priv;

struct lynx_28g_pll {};

struct lynx_28g_lane {};

struct lynx_28g_priv {};

static void lynx_28g_rmw(struct lynx_28g_priv *priv, unsigned long off,
			 u32 val, u32 mask)
{}

#define lynx_28g_lane_rmw(lane, reg, val, mask)
#define lynx_28g_lane_read(lane, reg)
#define lynx_28g_pll_read(pll, reg)

static bool lynx_28g_supports_interface(struct lynx_28g_priv *priv, int intf)
{}

static struct lynx_28g_pll *lynx_28g_pll_get(struct lynx_28g_priv *priv,
					     phy_interface_t intf)
{}

static void lynx_28g_lane_set_nrate(struct lynx_28g_lane *lane,
				    struct lynx_28g_pll *pll,
				    phy_interface_t intf)
{}

static void lynx_28g_lane_set_pll(struct lynx_28g_lane *lane,
				  struct lynx_28g_pll *pll)
{}

static void lynx_28g_cleanup_lane(struct lynx_28g_lane *lane)
{}

static void lynx_28g_lane_set_sgmii(struct lynx_28g_lane *lane)
{}

static void lynx_28g_lane_set_10gbaser(struct lynx_28g_lane *lane)
{}

static int lynx_28g_power_off(struct phy *phy)
{}

static int lynx_28g_power_on(struct phy *phy)
{}

static int lynx_28g_set_mode(struct phy *phy, enum phy_mode mode, int submode)
{}

static int lynx_28g_validate(struct phy *phy, enum phy_mode mode, int submode,
			     union phy_configure_opts *opts __always_unused)
{}

static int lynx_28g_init(struct phy *phy)
{}

static const struct phy_ops lynx_28g_ops =;

static void lynx_28g_pll_read_configuration(struct lynx_28g_priv *priv)
{}

#define work_to_lynx(w)

static void lynx_28g_cdr_lock_check(struct work_struct *work)
{}

static void lynx_28g_lane_read_configuration(struct lynx_28g_lane *lane)
{}

static struct phy *lynx_28g_xlate(struct device *dev,
				  const struct of_phandle_args *args)
{}

static int lynx_28g_probe(struct platform_device *pdev)
{}

static void lynx_28g_remove(struct platform_device *pdev)
{}

static const struct of_device_id lynx_28g_of_match_table[] =;
MODULE_DEVICE_TABLE(of, lynx_28g_of_match_table);

static struct platform_driver lynx_28g_driver =;
module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();