linux/drivers/net/phy/dp83tg720.c

// SPDX-License-Identifier: GPL-2.0
/* Driver for the Texas Instruments DP83TG720 PHY
 * Copyright (c) 2023 Pengutronix, Oleksij Rempel <[email protected]>
 */
#include <linux/bitfield.h>
#include <linux/ethtool_netlink.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/phy.h>

#include "open_alliance_helpers.h"

#define DP83TG720S_PHY_ID

/* MDIO_MMD_VEND2 registers */
#define DP83TG720S_MII_REG_10
#define DP83TG720S_STS_MII_INT
#define DP83TG720S_LINK_STATUS

/* TDR Configuration Register (0x1E) */
#define DP83TG720S_TDR_CFG
/* 1b = TDR start, 0b = No TDR */
#define DP83TG720S_TDR_START
/* 1b = TDR auto on link down, 0b = Manual TDR start */
#define DP83TG720S_CFG_TDR_AUTO_RUN
/* 1b = TDR done, 0b = TDR in progress */
#define DP83TG720S_TDR_DONE
/* 1b = TDR fail, 0b = TDR success */
#define DP83TG720S_TDR_FAIL

#define DP83TG720S_PHY_RESET
#define DP83TG720S_HW_RESET

#define DP83TG720S_LPS_CFG3
/* Power modes are documented as bit fields but used as values */
/* Power Mode 0 is Normal mode */
#define DP83TG720S_LPS_CFG3_PWR_MODE_0

/* Open Aliance 1000BaseT1 compatible HDD.TDR Fault Status Register */
#define DP83TG720S_TDR_FAULT_STATUS

/* Register 0x0301: TDR Configuration 2 */
#define DP83TG720S_TDR_CFG2

/* Register 0x0303: TDR Configuration 3 */
#define DP83TG720S_TDR_CFG3

/* Register 0x0304: TDR Configuration 4 */
#define DP83TG720S_TDR_CFG4

/* Register 0x0405: Unknown Register */
#define DP83TG720S_UNKNOWN_0405

/* Register 0x0576: TDR Master Link Down Control */
#define DP83TG720S_TDR_MASTER_LINK_DOWN

#define DP83TG720S_RGMII_DELAY_CTRL
/* In RGMII mode, Enable or disable the internal delay for RXD */
#define DP83TG720S_RGMII_RX_CLK_SEL
/* In RGMII mode, Enable or disable the internal delay for TXD */
#define DP83TG720S_RGMII_TX_CLK_SEL

/* Register 0x083F: Unknown Register */
#define DP83TG720S_UNKNOWN_083F

#define DP83TG720S_SQI_REG_1
#define DP83TG720S_SQI_OUT_WORST
#define DP83TG720S_SQI_OUT

#define DP83TG720_SQI_MAX

/**
 * dp83tg720_cable_test_start - Start the cable test for the DP83TG720 PHY.
 * @phydev: Pointer to the phy_device structure.
 *
 * This sequence is based on the documented procedure for the DP83TG720 PHY.
 *
 * Returns: 0 on success, a negative error code on failure.
 */
static int dp83tg720_cable_test_start(struct phy_device *phydev)
{}

/**
 * dp83tg720_cable_test_get_status - Get the status of the cable test for the
 *                                   DP83TG720 PHY.
 * @phydev: Pointer to the phy_device structure.
 * @finished: Pointer to a boolean that indicates whether the test is finished.
 *
 * The function sets the @finished flag to true if the test is complete.
 *
 * Returns: 0 on success or a negative error code on failure.
 */
static int dp83tg720_cable_test_get_status(struct phy_device *phydev,
					   bool *finished)
{}

static int dp83tg720_config_aneg(struct phy_device *phydev)
{}

static int dp83tg720_read_status(struct phy_device *phydev)
{}

static int dp83tg720_get_sqi(struct phy_device *phydev)
{}

static int dp83tg720_get_sqi_max(struct phy_device *phydev)
{}

static int dp83tg720_config_rgmii_delay(struct phy_device *phydev)
{}

static int dp83tg720_config_init(struct phy_device *phydev)
{}

static struct phy_driver dp83tg720_driver[] =;
module_phy_driver(dp83tg720_driver);

static struct mdio_device_id __maybe_unused dp83tg720_tbl[] =;
MODULE_DEVICE_TABLE(mdio, dp83tg720_tbl);

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