linux/drivers/net/ethernet/marvell/mvmdio.c

/*
 * Driver for the MDIO interface of Marvell network interfaces.
 *
 * Since the MDIO interface of Marvell network interfaces is shared
 * between all network interfaces, having a single driver allows to
 * handle concurrent accesses properly (you may have four Ethernet
 * ports, but they in fact share the same SMI interface to access
 * the MDIO bus). This driver is currently used by the mvneta and
 * mv643xx_eth drivers.
 *
 * Copyright (C) 2012 Marvell
 *
 * Thomas Petazzoni <[email protected]>
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2. This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

#include <linux/acpi.h>
#include <linux/acpi_mdio.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/of_mdio.h>
#include <linux/phy.h>
#include <linux/platform_device.h>
#include <linux/sched.h>
#include <linux/wait.h>

#define MVMDIO_SMI_DATA_SHIFT
#define MVMDIO_SMI_PHY_ADDR_SHIFT
#define MVMDIO_SMI_PHY_REG_SHIFT
#define MVMDIO_SMI_READ_OPERATION
#define MVMDIO_SMI_WRITE_OPERATION
#define MVMDIO_SMI_READ_VALID
#define MVMDIO_SMI_BUSY
#define MVMDIO_ERR_INT_CAUSE
#define MVMDIO_ERR_INT_SMI_DONE
#define MVMDIO_ERR_INT_MASK

#define MVMDIO_XSMI_MGNT_REG
#define MVMDIO_XSMI_PHYADDR_SHIFT
#define MVMDIO_XSMI_DEVADDR_SHIFT
#define MVMDIO_XSMI_WRITE_OPERATION
#define MVMDIO_XSMI_READ_OPERATION
#define MVMDIO_XSMI_READ_VALID
#define MVMDIO_XSMI_BUSY
#define MVMDIO_XSMI_ADDR_REG

#define MVMDIO_XSMI_CFG_REG
#define MVMDIO_XSMI_CLKDIV_MASK
#define MVMDIO_XSMI_CLKDIV_256
#define MVMDIO_XSMI_CLKDIV_64
#define MVMDIO_XSMI_CLKDIV_32
#define MVMDIO_XSMI_CLKDIV_8

/*
 * SMI Timeout measurements:
 * - Kirkwood 88F6281 (Globalscale Dreamplug): 45us to 95us (Interrupt)
 * - Armada 370       (Globalscale Mirabox):   41us to 43us (Polled)
 */
#define MVMDIO_SMI_TIMEOUT

struct orion_mdio_dev {};

enum orion_mdio_bus_type {};

struct orion_mdio_ops {};

/* Wait for the SMI unit to be ready for another operation
 */
static int orion_mdio_wait_ready(const struct orion_mdio_ops *ops,
				 struct mii_bus *bus)
{}

static int orion_mdio_smi_is_done(struct orion_mdio_dev *dev)
{}

static const struct orion_mdio_ops orion_mdio_smi_ops =;

static int orion_mdio_smi_read(struct mii_bus *bus, int mii_id,
			       int regnum)
{}

static int orion_mdio_smi_write(struct mii_bus *bus, int mii_id,
				int regnum, u16 value)
{}

static int orion_mdio_xsmi_is_done(struct orion_mdio_dev *dev)
{}

static const struct orion_mdio_ops orion_mdio_xsmi_ops =;

static int orion_mdio_xsmi_read_c45(struct mii_bus *bus, int mii_id,
				    int dev_addr, int regnum)
{}

static int orion_mdio_xsmi_write_c45(struct mii_bus *bus, int mii_id,
				     int dev_addr, int regnum, u16 value)
{}

static void orion_mdio_xsmi_set_mdc_freq(struct mii_bus *bus)
{}

static irqreturn_t orion_mdio_err_irq(int irq, void *dev_id)
{}

static int orion_mdio_probe(struct platform_device *pdev)
{}

static void orion_mdio_remove(struct platform_device *pdev)
{}

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

#ifdef CONFIG_ACPI
static const struct acpi_device_id orion_mdio_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, orion_mdio_acpi_match);
#endif

static struct platform_driver orion_mdio_driver =;

module_platform_driver();

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