linux/drivers/net/pcs/pcs-lynx.c

// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
/* Copyright 2020 NXP
 * Lynx PCS MDIO helpers
 */

#include <linux/mdio.h>
#include <linux/phylink.h>
#include <linux/pcs-lynx.h>
#include <linux/property.h>

#define SGMII_CLOCK_PERIOD_NS
#define LINK_TIMER_VAL(ns)

#define LINK_TIMER_LO
#define LINK_TIMER_HI
#define IF_MODE
#define IF_MODE_SGMII_EN
#define IF_MODE_USE_SGMII_AN
#define IF_MODE_SPEED(x)
#define IF_MODE_SPEED_MSK
#define IF_MODE_HALF_DUPLEX

struct lynx_pcs {};

enum sgmii_speed {};

#define phylink_pcs_to_lynx(pl_pcs)
#define lynx_to_phylink_pcs(lynx)

static void lynx_pcs_get_state_usxgmii(struct mdio_device *pcs,
				       struct phylink_link_state *state)
{}

static void lynx_pcs_get_state_2500basex(struct mdio_device *pcs,
					 struct phylink_link_state *state)
{}

static void lynx_pcs_get_state(struct phylink_pcs *pcs,
			       struct phylink_link_state *state)
{}

static int lynx_pcs_config_giga(struct mdio_device *pcs,
				phy_interface_t interface,
				const unsigned long *advertising,
				unsigned int neg_mode)
{}

static int lynx_pcs_config_usxgmii(struct mdio_device *pcs,
				   const unsigned long *advertising,
				   unsigned int neg_mode)
{}

static int lynx_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
			   phy_interface_t ifmode,
			   const unsigned long *advertising, bool permit)
{}

static void lynx_pcs_an_restart(struct phylink_pcs *pcs)
{}

static void lynx_pcs_link_up_sgmii(struct mdio_device *pcs,
				   unsigned int neg_mode,
				   int speed, int duplex)
{}

/* 2500Base-X is SerDes protocol 7 on Felix and 6 on ENETC. It is a SerDes lane
 * clocked at 3.125 GHz which encodes symbols with 8b/10b and does not have
 * auto-negotiation of any link parameters. Electrically it is compatible with
 * a single lane of XAUI.
 * The hardware reference manual wants to call this mode SGMII, but it isn't
 * really, since the fundamental features of SGMII:
 * - Downgrading the link speed by duplicating symbols
 * - Auto-negotiation
 * are not there.
 * The speed is configured at 1000 in the IF_MODE because the clock frequency
 * is actually given by a PLL configured in the Reset Configuration Word (RCW).
 * Since there is no difference between fixed speed SGMII w/o AN and 802.3z w/o
 * AN, we call this PHY interface type 2500Base-X. In case a PHY negotiates a
 * lower link speed on line side, the system-side interface remains fixed at
 * 2500 Mbps and we do rate adaptation through pause frames.
 */
static void lynx_pcs_link_up_2500basex(struct mdio_device *pcs,
				       unsigned int neg_mode,
				       int speed, int duplex)
{}

static void lynx_pcs_link_up(struct phylink_pcs *pcs, unsigned int neg_mode,
			     phy_interface_t interface,
			     int speed, int duplex)
{}

static const struct phylink_pcs_ops lynx_pcs_phylink_ops =;

static struct phylink_pcs *lynx_pcs_create(struct mdio_device *mdio)
{}

struct phylink_pcs *lynx_pcs_create_mdiodev(struct mii_bus *bus, int addr)
{}
EXPORT_SYMBOL();

/*
 * lynx_pcs_create_fwnode() creates a lynx PCS instance from the fwnode
 * device indicated by node.
 *
 * Returns:
 *  -ENODEV if the fwnode is marked unavailable
 *  -EPROBE_DEFER if we fail to find the device
 *  -ENOMEM if we fail to allocate memory
 *  pointer to a phylink_pcs on success
 */
struct phylink_pcs *lynx_pcs_create_fwnode(struct fwnode_handle *node)
{}
EXPORT_SYMBOL_GPL();

void lynx_pcs_destroy(struct phylink_pcs *pcs)
{}
EXPORT_SYMBOL();

MODULE_DESCRIPTION();
MODULE_LICENSE();