linux/drivers/net/phy/marvell-88q2xxx.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Marvell 88Q2XXX automotive 100BASE-T1/1000BASE-T1 PHY driver
 *
 * Derived from Marvell Q222x API
 *
 * Copyright (C) 2024 Liebherr-Electronics and Drives GmbH
 */
#include <linux/ethtool_netlink.h>
#include <linux/marvell_phy.h>
#include <linux/phy.h>
#include <linux/hwmon.h>

#define PHY_ID_88Q2220_REVB0
#define PHY_ID_88Q2220_REVB1
#define PHY_ID_88Q2220_REVB2

#define MDIO_MMD_AN_MV_STAT
#define MDIO_MMD_AN_MV_STAT_ANEG
#define MDIO_MMD_AN_MV_STAT_LOCAL_RX
#define MDIO_MMD_AN_MV_STAT_REMOTE_RX
#define MDIO_MMD_AN_MV_STAT_LOCAL_MASTER
#define MDIO_MMD_AN_MV_STAT_MS_CONF_FAULT

#define MDIO_MMD_AN_MV_STAT2
#define MDIO_MMD_AN_MV_STAT2_AN_RESOLVED
#define MDIO_MMD_AN_MV_STAT2_100BT1
#define MDIO_MMD_AN_MV_STAT2_1000BT1

#define MDIO_MMD_PCS_MV_INT_EN
#define MDIO_MMD_PCS_MV_INT_EN_LINK_UP
#define MDIO_MMD_PCS_MV_INT_EN_LINK_DOWN
#define MDIO_MMD_PCS_MV_INT_EN_100BT1

#define MDIO_MMD_PCS_MV_GPIO_INT_STAT
#define MDIO_MMD_PCS_MV_GPIO_INT_STAT_LINK_UP
#define MDIO_MMD_PCS_MV_GPIO_INT_STAT_LINK_DOWN
#define MDIO_MMD_PCS_MV_GPIO_INT_STAT_100BT1_GEN

#define MDIO_MMD_PCS_MV_GPIO_INT_CTRL
#define MDIO_MMD_PCS_MV_GPIO_INT_CTRL_TRI_DIS

#define MDIO_MMD_PCS_MV_TEMP_SENSOR1
#define MDIO_MMD_PCS_MV_TEMP_SENSOR1_RAW_INT
#define MDIO_MMD_PCS_MV_TEMP_SENSOR1_INT
#define MDIO_MMD_PCS_MV_TEMP_SENSOR1_INT_EN

#define MDIO_MMD_PCS_MV_TEMP_SENSOR2
#define MDIO_MMD_PCS_MV_TEMP_SENSOR2_DIS_MASK

#define MDIO_MMD_PCS_MV_TEMP_SENSOR3
#define MDIO_MMD_PCS_MV_TEMP_SENSOR3_INT_THRESH_MASK
#define MDIO_MMD_PCS_MV_TEMP_SENSOR3_MASK

#define MDIO_MMD_PCS_MV_100BT1_STAT1
#define MDIO_MMD_PCS_MV_100BT1_STAT1_IDLE_ERROR
#define MDIO_MMD_PCS_MV_100BT1_STAT1_JABBER
#define MDIO_MMD_PCS_MV_100BT1_STAT1_LINK
#define MDIO_MMD_PCS_MV_100BT1_STAT1_LOCAL_RX
#define MDIO_MMD_PCS_MV_100BT1_STAT1_REMOTE_RX
#define MDIO_MMD_PCS_MV_100BT1_STAT1_LOCAL_MASTER

#define MDIO_MMD_PCS_MV_100BT1_STAT2
#define MDIO_MMD_PCS_MV_100BT1_STAT2_JABBER
#define MDIO_MMD_PCS_MV_100BT1_STAT2_POL
#define MDIO_MMD_PCS_MV_100BT1_STAT2_LINK
#define MDIO_MMD_PCS_MV_100BT1_STAT2_ANGE

#define MDIO_MMD_PCS_MV_100BT1_INT_EN
#define MDIO_MMD_PCS_MV_100BT1_INT_EN_LINKEVENT

#define MDIO_MMD_PCS_MV_COPPER_INT_STAT
#define MDIO_MMD_PCS_MV_COPPER_INT_STAT_LINKEVENT

#define MDIO_MMD_PCS_MV_RX_STAT

#define MDIO_MMD_PCS_MV_TDR_RESET
#define MDIO_MMD_PCS_MV_TDR_RESET_TDR_RST

#define MDIO_MMD_PCS_MV_TDR_OFF_SHORT_CABLE

#define MDIO_MMD_PCS_MV_TDR_OFF_LONG_CABLE

#define MDIO_MMD_PCS_MV_TDR_STATUS
#define MDIO_MMD_PCS_MV_TDR_STATUS_MASK
#define MDIO_MMD_PCS_MV_TDR_STATUS_OFF
#define MDIO_MMD_PCS_MV_TDR_STATUS_ON
#define MDIO_MMD_PCS_MV_TDR_STATUS_DIST_MASK
#define MDIO_MMD_PCS_MV_TDR_STATUS_VCT_STAT_MASK
#define MDIO_MMD_PCS_MV_TDR_STATUS_VCT_STAT_SHORT
#define MDIO_MMD_PCS_MV_TDR_STATUS_VCT_STAT_OPEN
#define MDIO_MMD_PCS_MV_TDR_STATUS_VCT_STAT_OK
#define MDIO_MMD_PCS_MV_TDR_STATUS_VCT_STAT_IN_PROGR
#define MDIO_MMD_PCS_MV_TDR_STATUS_VCT_STAT_NOISE

#define MDIO_MMD_PCS_MV_TDR_OFF_CUTOFF

struct mmd_val {};

static const struct mmd_val mv88q222x_revb0_init_seq0[] =;

static const struct mmd_val mv88q222x_revb0_init_seq1[] =;

static const struct mmd_val mv88q222x_revb1_init_seq0[] =;

static const struct mmd_val mv88q222x_revb2_init_seq0[] =;

static const struct mmd_val mv88q222x_revb1_revb2_init_seq1[] =;

static int mv88q2xxx_soft_reset(struct phy_device *phydev)
{}

static int mv88q2xxx_read_link_gbit(struct phy_device *phydev)
{}

static int mv88q2xxx_read_link_100m(struct phy_device *phydev)
{}

static int mv88q2xxx_read_link(struct phy_device *phydev)
{}

static int mv88q2xxx_read_master_slave_state(struct phy_device *phydev)
{}

static int mv88q2xxx_read_aneg_speed(struct phy_device *phydev)
{}

static int mv88q2xxx_read_status(struct phy_device *phydev)
{}

static int mv88q2xxx_get_features(struct phy_device *phydev)
{}

static int mv88q2xxx_config_aneg(struct phy_device *phydev)
{}

static int mv88q2xxx_config_init(struct phy_device *phydev)
{}

static int mv88q2xxx_get_sqi(struct phy_device *phydev)
{}

static int mv88q2xxx_get_sqi_max(struct phy_device *phydev)
{}

static int mv88q2xxx_config_intr(struct phy_device *phydev)
{}

static irqreturn_t mv88q2xxx_handle_interrupt(struct phy_device *phydev)
{}

static int mv88q2xxx_suspend(struct phy_device *phydev)
{}

static int mv88q2xxx_resume(struct phy_device *phydev)
{}

#if IS_ENABLED(CONFIG_HWMON)
static const struct hwmon_channel_info * const mv88q2xxx_hwmon_info[] =;

static umode_t mv88q2xxx_hwmon_is_visible(const void *data,
					  enum hwmon_sensor_types type,
					  u32 attr, int channel)
{}

static int mv88q2xxx_hwmon_read(struct device *dev,
				enum hwmon_sensor_types type,
				u32 attr, int channel, long *val)
{}

static int mv88q2xxx_hwmon_write(struct device *dev,
				 enum hwmon_sensor_types type, u32 attr,
				 int channel, long val)
{}

static const struct hwmon_ops mv88q2xxx_hwmon_hwmon_ops =;

static const struct hwmon_chip_info mv88q2xxx_hwmon_chip_info =;

static int mv88q2xxx_hwmon_probe(struct phy_device *phydev)
{}

#else
static int mv88q2xxx_hwmon_probe(struct phy_device *phydev)
{
	return 0;
}
#endif

static int mv88q2xxx_probe(struct phy_device *phydev)
{}

static int mv88q222x_soft_reset(struct phy_device *phydev)
{}

static int mv88q222x_write_mmd_vals(struct phy_device *phydev,
				    const struct mmd_val *vals, size_t len)
{}

static int mv88q222x_revb0_config_init(struct phy_device *phydev)
{}

static int mv88q222x_revb1_revb2_config_init(struct phy_device *phydev)
{}

static int mv88q222x_config_init(struct phy_device *phydev)
{}

static int mv88q222x_cable_test_start(struct phy_device *phydev)
{}

static int mv88q222x_cable_test_get_status(struct phy_device *phydev,
					   bool *finished)
{}

static struct phy_driver mv88q2xxx_driver[] =;

module_phy_driver(mv88q2xxx_driver);

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

MODULE_DESCRIPTION();
MODULE_LICENSE();