linux/drivers/ptp/ptp_ines.c

// SPDX-License-Identifier: GPL-2.0
//
// Copyright (C) 2018 MOSER-BAER AG
//

#define pr_fmt(fmt)

#include <linux/ethtool.h>
#include <linux/export.h>
#include <linux/if_vlan.h>
#include <linux/mii_timestamper.h>
#include <linux/module.h>
#include <linux/net_tstamp.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/phy.h>
#include <linux/platform_device.h>
#include <linux/ptp_classify.h>
#include <linux/ptp_clock_kernel.h>
#include <linux/stddef.h>

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

/* GLOBAL register */
#define MCAST_MAC_SELECT_SHIFT
#define MCAST_MAC_SELECT_MASK
#define IO_RESET
#define PTP_RESET

/* VERSION register */
#define IF_MAJOR_VER_SHIFT
#define IF_MAJOR_VER_MASK
#define IF_MINOR_VER_SHIFT
#define IF_MINOR_VER_MASK
#define FPGA_MAJOR_VER_SHIFT
#define FPGA_MAJOR_VER_MASK
#define FPGA_MINOR_VER_SHIFT
#define FPGA_MINOR_VER_MASK

/* INT_STAT register */
#define RX_INTR_STATUS_3
#define RX_INTR_STATUS_2
#define RX_INTR_STATUS_1
#define TX_INTR_STATUS_3
#define TX_INTR_STATUS_2
#define TX_INTR_STATUS_1

/* INT_MSK register */
#define RX_INTR_MASK_3
#define RX_INTR_MASK_2
#define RX_INTR_MASK_1
#define TX_INTR_MASK_3
#define TX_INTR_MASK_2
#define TX_INTR_MASK_1

/* BUF_STAT register */
#define RX_FIFO_NE_3
#define RX_FIFO_NE_2
#define RX_FIFO_NE_1
#define TX_FIFO_NE_3
#define TX_FIFO_NE_2
#define TX_FIFO_NE_1

/* PORT_CONF register */
#define CM_ONE_STEP
#define PHY_SPEED_SHIFT
#define PHY_SPEED_MASK
#define P2P_DELAY_WR_POS_SHIFT
#define P2P_DELAY_WR_POS_MASK
#define PTP_MODE_SHIFT
#define PTP_MODE_MASK

/* TS_STAT_TX register */
#define TS_ENABLE
#define DATA_READ_POS_SHIFT
#define DATA_READ_POS_MASK
#define DISCARDED_EVENTS_SHIFT
#define DISCARDED_EVENTS_MASK

#define INES_N_PORTS
#define INES_REGISTER_SIZE
#define INES_PORT_OFFSET
#define INES_PORT_SIZE
#define INES_FIFO_DEPTH
#define INES_MAX_EVENTS

#define BC_PTP_V1
#define BC_PTP_V2
#define TC_E2E_PTP_V2
#define TC_P2P_PTP_V2

#define PHY_SPEED_10
#define PHY_SPEED_100
#define PHY_SPEED_1000

#define PORT_CONF

#define ines_read32(s, r)
#define ines_write32(s, v, r)

#define MESSAGE_TYPE_SYNC
#define MESSAGE_TYPE_P_DELAY_REQ
#define MESSAGE_TYPE_P_DELAY_RESP
#define MESSAGE_TYPE_DELAY_REQ

static LIST_HEAD(ines_clocks);
static DEFINE_MUTEX(ines_clocks_lock);

struct ines_global_regs {};

struct ines_port_registers {};

struct ines_timestamp {};

struct ines_port {};

struct ines_clock {};

static bool ines_match(struct sk_buff *skb, unsigned int ptp_class,
		       struct ines_timestamp *ts, struct device *dev);
static int ines_rxfifo_read(struct ines_port *port);
static u64 ines_rxts64(struct ines_port *port, unsigned int words);
static bool ines_timestamp_expired(struct ines_timestamp *ts);
static u64 ines_txts64(struct ines_port *port, unsigned int words);
static void ines_txtstamp_work(struct work_struct *work);
static bool is_sync_pdelay_resp(struct sk_buff *skb, int type);
static u8 tag_to_msgtype(u8 tag);

static void ines_clock_cleanup(struct ines_clock *clock)
{}

static int ines_clock_init(struct ines_clock *clock, struct device *device,
			   void __iomem *addr)
{}

static struct ines_port *ines_find_port(struct device_node *node, u32 index)
{}

static u64 ines_find_rxts(struct ines_port *port, struct sk_buff *skb, int type)
{}

static u64 ines_find_txts(struct ines_port *port, struct sk_buff *skb)
{}

static int ines_hwtstamp(struct mii_timestamper *mii_ts,
			 struct kernel_hwtstamp_config *cfg,
			 struct netlink_ext_ack *extack)
{}

static void ines_link_state(struct mii_timestamper *mii_ts,
			    struct phy_device *phydev)
{}

static bool ines_match(struct sk_buff *skb, unsigned int ptp_class,
		       struct ines_timestamp *ts, struct device *dev)
{}

static bool ines_rxtstamp(struct mii_timestamper *mii_ts,
			  struct sk_buff *skb, int type)
{}

static int ines_rxfifo_read(struct ines_port *port)
{}

static u64 ines_rxts64(struct ines_port *port, unsigned int words)
{}

static bool ines_timestamp_expired(struct ines_timestamp *ts)
{}

static int ines_ts_info(struct mii_timestamper *mii_ts,
			struct kernel_ethtool_ts_info *info)
{}

static u64 ines_txts64(struct ines_port *port, unsigned int words)
{}

static bool ines_txts_onestep(struct ines_port *port, struct sk_buff *skb, int type)
{}

static void ines_txtstamp(struct mii_timestamper *mii_ts,
			  struct sk_buff *skb, int type)
{}

static void ines_txtstamp_work(struct work_struct *work)
{}

static bool is_sync_pdelay_resp(struct sk_buff *skb, int type)
{}

static u8 tag_to_msgtype(u8 tag)
{}

static struct mii_timestamper *ines_ptp_probe_channel(struct device *device,
						      unsigned int index)
{}

static void ines_ptp_release_channel(struct device *device,
				     struct mii_timestamper *mii_ts)
{}

static struct mii_timestamping_ctrl ines_ctrl =;

static int ines_ptp_ctrl_probe(struct platform_device *pld)
{}

static void ines_ptp_ctrl_remove(struct platform_device *pld)
{}

static const struct of_device_id ines_ptp_ctrl_of_match[] =;

MODULE_DEVICE_TABLE(of, ines_ptp_ctrl_of_match);

static struct platform_driver ines_ptp_ctrl_driver =;
module_platform_driver();