linux/drivers/ptp/ptp_pch.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * PTP 1588 clock using the EG20T PCH
 *
 * Copyright (C) 2010 OMICRON electronics GmbH
 * Copyright (C) 2011-2012 LAPIS SEMICONDUCTOR Co., LTD.
 *
 * This code was derived from the IXP46X driver.
 */

#include <linux/device.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/io-64-nonatomic-lo-hi.h>
#include <linux/io-64-nonatomic-hi-lo.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/ptp_clock_kernel.h>
#include <linux/ptp_pch.h>
#include <linux/slab.h>

#define STATION_ADDR_LEN
#define PCI_DEVICE_ID_PCH_1588
#define IO_MEM_BAR

#define DEFAULT_ADDEND
#define TICKS_NS_SHIFT
#define N_EXT_TS

enum pch_status {};

/*
 * struct pch_ts_regs - IEEE 1588 registers
 */
struct pch_ts_regs {};

#define PCH_TSC_RESET
#define PCH_TSC_TTM_MASK
#define PCH_TSC_ASMS_MASK
#define PCH_TSC_AMMS_MASK
#define PCH_TSC_PPSM_MASK
#define PCH_TSE_TTIPEND
#define PCH_TSE_SNS
#define PCH_TSE_SNM
#define PCH_TSE_PPS
#define PCH_CC_MM
#define PCH_CC_TA

#define PCH_CC_MODE_SHIFT
#define PCH_CC_MODE_MASK
#define PCH_CC_VERSION
#define PCH_CE_TXS
#define PCH_CE_RXS
#define PCH_CE_OVR
#define PCH_CE_VAL
#define PCH_ECS_ETH

#define PCH_ECS_CAN

#define PCH_IEEE1588_ETH
#define PCH_IEEE1588_CAN

/*
 * struct pch_dev - Driver private data
 */
struct pch_dev {};

/*
 * struct pch_params - 1588 module parameter
 */
struct pch_params {};

/* structure to hold the module parameters */
static struct pch_params pch_param =;

/*
 * Register access functions
 */
static inline void pch_eth_enable_set(struct pch_dev *chip)
{}

static u64 pch_systime_read(struct pch_ts_regs __iomem *regs)
{}

static void pch_systime_write(struct pch_ts_regs __iomem *regs, u64 ns)
{}

static inline void pch_block_reset(struct pch_dev *chip)
{}

void pch_ch_control_write(struct pci_dev *pdev, u32 val)
{}
EXPORT_SYMBOL();

u32 pch_ch_event_read(struct pci_dev *pdev)
{}
EXPORT_SYMBOL();

void pch_ch_event_write(struct pci_dev *pdev, u32 val)
{}
EXPORT_SYMBOL();

u32 pch_src_uuid_lo_read(struct pci_dev *pdev)
{}
EXPORT_SYMBOL();

u32 pch_src_uuid_hi_read(struct pci_dev *pdev)
{}
EXPORT_SYMBOL();

u64 pch_rx_snap_read(struct pci_dev *pdev)
{}
EXPORT_SYMBOL();

u64 pch_tx_snap_read(struct pci_dev *pdev)
{}
EXPORT_SYMBOL();

/* This function enables all 64 bits in system time registers [high & low].
This is a work-around for non continuous value in the SystemTime Register*/
static void pch_set_system_time_count(struct pch_dev *chip)
{}

static void pch_reset(struct pch_dev *chip)
{}

/**
 * pch_set_station_address() - This API sets the station address used by
 *				    IEEE 1588 hardware when looking at PTP
 *				    traffic on the  ethernet interface
 * @addr:	dress which contain the column separated address to be used.
 * @pdev:	PCI device.
 */
int pch_set_station_address(u8 *addr, struct pci_dev *pdev)
{}
EXPORT_SYMBOL();

/*
 * Interrupt service routine
 */
static irqreturn_t isr(int irq, void *priv)
{}

/*
 * PTP clock operations
 */

static int ptp_pch_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
{}

static int ptp_pch_adjtime(struct ptp_clock_info *ptp, s64 delta)
{}

static int ptp_pch_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
{}

static int ptp_pch_settime(struct ptp_clock_info *ptp,
			   const struct timespec64 *ts)
{}

static int ptp_pch_enable(struct ptp_clock_info *ptp,
			  struct ptp_clock_request *rq, int on)
{}

static const struct ptp_clock_info ptp_pch_caps =;

static void pch_remove(struct pci_dev *pdev)
{}

static s32
pch_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{}

static const struct pci_device_id pch_ieee1588_pcidev_id[] =;
MODULE_DEVICE_TABLE(pci, pch_ieee1588_pcidev_id);

static struct pci_driver pch_driver =;
module_pci_driver();

module_param_string();
MODULE_PARM_DESC();

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