linux/drivers/net/phy/broadcom.c

// SPDX-License-Identifier: GPL-2.0+
/*
 *	drivers/net/phy/broadcom.c
 *
 *	Broadcom BCM5411, BCM5421 and BCM5461 Gigabit Ethernet
 *	transceivers.
 *
 *	Broadcom BCM54810, BCM54811 BroadR-Reach transceivers.
 *
 *	Copyright (c) 2006  Maciej W. Rozycki
 *
 *	Inspired by code written by Amy Fong.
 */

#include "bcm-phy-lib.h"
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/phy.h>
#include <linux/pm_wakeup.h>
#include <linux/brcmphy.h>
#include <linux/of.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/gpio/consumer.h>

#define BRCM_PHY_MODEL(phydev)

#define BRCM_PHY_REV(phydev)

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

struct bcm54xx_phy_priv {};

/* Link modes for BCM58411 PHY */
static const int bcm54811_linkmodes[] =;

/* Long-Distance Signaling (BroadR-Reach mode aneg) relevant linkmode bits */
static const int lds_br_bits[] =;

static bool bcm54xx_phy_can_wakeup(struct phy_device *phydev)
{}

static int bcm54xx_config_clock_delay(struct phy_device *phydev)
{}

static int bcm54210e_config_init(struct phy_device *phydev)
{}

static int bcm54612e_config_init(struct phy_device *phydev)
{}

static int bcm54616s_config_init(struct phy_device *phydev)
{}

/* Needs SMDSP clock enabled via bcm54xx_phydsp_config() */
static int bcm50610_a0_workaround(struct phy_device *phydev)
{}

static int bcm54xx_phydsp_config(struct phy_device *phydev)
{}

static void bcm54xx_adjust_rxrefclk(struct phy_device *phydev)
{}

static void bcm54xx_ptp_stop(struct phy_device *phydev)
{}

static void bcm54xx_ptp_config_init(struct phy_device *phydev)
{}

static int bcm5481x_set_brrmode(struct phy_device *phydev, bool on)
{}

static int bcm54811_config_init(struct phy_device *phydev)
{}

static int bcm54xx_config_init(struct phy_device *phydev)
{}

static int bcm54xx_iddq_set(struct phy_device *phydev, bool enable)
{}

static int bcm54xx_set_wakeup_irq(struct phy_device *phydev, bool state)
{}

static int bcm54xx_suspend(struct phy_device *phydev)
{}

static int bcm54xx_resume(struct phy_device *phydev)
{}

static int bcm54810_read_mmd(struct phy_device *phydev, int devnum, u16 regnum)
{}

static int bcm54810_write_mmd(struct phy_device *phydev, int devnum, u16 regnum,
			      u16 val)
{}


/**
 * bcm5481x_read_abilities - read PHY abilities from LRESR or Clause 22
 * (BMSR) registers, based on whether the PHY is in BroadR-Reach or IEEE mode
 * @phydev: target phy_device struct
 *
 * Description: Reads the PHY's abilities and populates phydev->supported
 * accordingly. The register to read the abilities from is determined by
 * the brr mode setting of the PHY as read from the device tree.
 * Note that the LRE and IEEE sets of abilities are disjunct, in other words,
 * not only the link modes differ, but also the auto-negotiation and
 * master-slave setup is controlled differently.
 *
 * Returns: 0 on success, < 0 on failure
 */
static int bcm5481x_read_abilities(struct phy_device *phydev)
{}

static int bcm5481x_config_delay_swap(struct phy_device *phydev)
{}

static int bcm5481_config_aneg(struct phy_device *phydev)
{}

static int bcm54811_config_aneg(struct phy_device *phydev)
{}

struct bcm54616s_phy_priv {};

static int bcm54616s_probe(struct phy_device *phydev)
{}

static int bcm54616s_config_aneg(struct phy_device *phydev)
{}

static int bcm54616s_read_status(struct phy_device *phydev)
{}

static int brcm_fet_config_init(struct phy_device *phydev)
{}

static int brcm_fet_ack_interrupt(struct phy_device *phydev)
{}

static int brcm_fet_config_intr(struct phy_device *phydev)
{}

static irqreturn_t brcm_fet_handle_interrupt(struct phy_device *phydev)
{}

static int brcm_fet_suspend(struct phy_device *phydev)
{}

static int bcm5221_config_aneg(struct phy_device *phydev)
{}

static int bcm5221_read_status(struct phy_device *phydev)
{}

static void bcm54xx_phy_get_wol(struct phy_device *phydev,
				struct ethtool_wolinfo *wol)
{}

static int bcm54xx_phy_set_wol(struct phy_device *phydev,
			       struct ethtool_wolinfo *wol)
{}

static int bcm54xx_phy_probe(struct phy_device *phydev)
{}

static void bcm54xx_get_stats(struct phy_device *phydev,
			      struct ethtool_stats *stats, u64 *data)
{}

static void bcm54xx_link_change_notify(struct phy_device *phydev)
{}

static int lre_read_master_slave(struct phy_device *phydev)
{}

/* Read LDS Link Partner Ability in BroadR-Reach mode */
static int lre_read_lpa(struct phy_device *phydev)
{}

static int lre_read_status_fixed(struct phy_device *phydev)
{}

/**
 * lre_update_link - update link status in @phydev
 * @phydev: target phy_device struct
 * Return:  0 on success, < 0 on error
 *
 * Description: Update the value in phydev->link to reflect the
 *   current link value.  In order to do this, we need to read
 *   the status register twice, keeping the second value.
 *   This is a genphy_update_link modified to work on LRE registers
 *   of BroadR-Reach PHY
 */
static int lre_update_link(struct phy_device *phydev)
{}

/* Get the status in BroadRReach mode just like genphy_read_status does
*   in normal mode
*/
static int bcm54811_lre_read_status(struct phy_device *phydev)
{}

static int bcm54811_read_status(struct phy_device *phydev)
{}

static struct phy_driver broadcom_drivers[] =;

module_phy_driver(broadcom_drivers);

static struct mdio_device_id __maybe_unused broadcom_tbl[] =;

MODULE_DEVICE_TABLE(mdio, broadcom_tbl);