linux/drivers/net/ethernet/hisilicon/hns_mdio.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (c) 2014-2015 Hisilicon Limited.
 */

#include <linux/acpi.h>
#include <linux/errno.h>
#include <linux/etherdevice.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/netdevice.h>
#include <linux/of_address.h>
#include <linux/of.h>
#include <linux/of_mdio.h>
#include <linux/of_platform.h>
#include <linux/phy.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>

#define MDIO_DRV_NAME
#define MDIO_BUS_NAME

#define MDIO_TIMEOUT

struct hns_mdio_sc_reg {};

struct hns_mdio_device {};

/* mdio reg */
#define MDIO_COMMAND_REG
#define MDIO_ADDR_REG
#define MDIO_WDATA_REG
#define MDIO_RDATA_REG
#define MDIO_STA_REG

/* cfg phy bit map */
#define MDIO_CMD_DEVAD_M
#define MDIO_CMD_DEVAD_S
#define MDIO_CMD_PRTAD_M
#define MDIO_CMD_PRTAD_S
#define MDIO_CMD_OP_S
#define MDIO_CMD_ST_S
#define MDIO_CMD_START_B

#define MDIO_ADDR_DATA_M
#define MDIO_ADDR_DATA_S

#define MDIO_WDATA_DATA_M
#define MDIO_WDATA_DATA_S

#define MDIO_RDATA_DATA_M
#define MDIO_RDATA_DATA_S

#define MDIO_STATE_STA_B

enum mdio_st_clause {};

enum mdio_c22_op_seq {};

enum mdio_c45_op_seq {};

/* peri subctrl reg */
#define MDIO_SC_CLK_EN
#define MDIO_SC_CLK_DIS
#define MDIO_SC_RESET_REQ
#define MDIO_SC_RESET_DREQ
#define MDIO_SC_CLK_ST
#define MDIO_SC_RESET_ST

static void mdio_write_reg(u8 __iomem *base, u32 reg, u32 value)
{}

#define MDIO_WRITE_REG(a, reg, value)

static u32 mdio_read_reg(u8 __iomem *base, u32 reg)
{}

#define mdio_set_field(origin, mask, shift, val)

#define mdio_get_field(origin, mask, shift)

static void mdio_set_reg_field(u8 __iomem *base, u32 reg, u32 mask, u32 shift,
			       u32 val)
{}

#define MDIO_SET_REG_FIELD(dev, reg, mask, shift, val)

static u32 mdio_get_reg_field(u8 __iomem *base, u32 reg, u32 mask, u32 shift)
{}

#define MDIO_GET_REG_FIELD(dev, reg, mask, shift)

#define MDIO_GET_REG_BIT(dev, reg, bit)

#define MDIO_CHECK_SET_ST
#define MDIO_CHECK_CLR_ST

static int mdio_sc_cfg_reg_write(struct hns_mdio_device *mdio_dev,
				 u32 cfg_reg, u32 set_val,
				 u32 st_reg, u32 st_msk, u8 check_st)
{}

static int hns_mdio_wait_ready(struct mii_bus *bus)
{}

static void hns_mdio_cmd_write(struct hns_mdio_device *mdio_dev,
			       u8 is_c45, u8 op, u8 phy_id, u16 cmd)
{}

/**
 * hns_mdio_write_c22 - access phy register
 * @bus: mdio bus
 * @phy_id: phy id
 * @regnum: register num
 * @data: register value
 *
 * Return 0 on success, negative on failure
 */
static int hns_mdio_write_c22(struct mii_bus *bus,
			      int phy_id, int regnum, u16 data)
{}

/**
 * hns_mdio_write_c45 - access phy register
 * @bus: mdio bus
 * @phy_id: phy id
 * @devad: device address to read
 * @regnum: register num
 * @data: register value
 *
 * Return 0 on success, negative on failure
 */
static int hns_mdio_write_c45(struct mii_bus *bus, int phy_id, int devad,
			      int regnum, u16 data)
{}

/**
 * hns_mdio_read_c22 - access phy register
 * @bus: mdio bus
 * @phy_id: phy id
 * @regnum: register num
 *
 * Return phy register value
 */
static int hns_mdio_read_c22(struct mii_bus *bus, int phy_id, int regnum)
{}

/**
 * hns_mdio_read_c45 - access phy register
 * @bus: mdio bus
 * @phy_id: phy id
 * @devad: device address to read
 * @regnum: register num
 *
 * Return phy register value
 */
static int hns_mdio_read_c45(struct mii_bus *bus, int phy_id, int devad,
			     int regnum)
{}

/**
 * hns_mdio_reset - reset mdio bus
 * @bus: mdio bus
 *
 * Return 0 on success, negative on failure
 */
static int hns_mdio_reset(struct mii_bus *bus)
{}

/**
 * hns_mdio_probe - probe mdio device
 * @pdev: mdio platform device
 *
 * Return 0 on success, negative on failure
 */
static int hns_mdio_probe(struct platform_device *pdev)
{}

/**
 * hns_mdio_remove - remove mdio device
 * @pdev: mdio platform device
 *
 * Return 0 on success, negative on failure
 */
static void hns_mdio_remove(struct platform_device *pdev)
{}

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

static const struct acpi_device_id hns_mdio_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, hns_mdio_acpi_match);

static struct platform_driver hns_mdio_driver =;

module_platform_driver();

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