Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
ptp_pch.c File Reference
#include <linux/device.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.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/slab.h>

Go to the source code of this file.

Data Structures

struct  pch_ts_regs
 
struct  pch_dev
 
struct  pch_params
 

Macros

#define STATION_ADDR_LEN   20
 
#define PCI_DEVICE_ID_PCH_1588   0x8819
 
#define IO_MEM_BAR   1
 
#define DEFAULT_ADDEND   0xA0000000
 
#define TICKS_NS_SHIFT   5
 
#define N_EXT_TS   2
 
#define PCH_TSC_RESET   (1 << 0)
 
#define PCH_TSC_TTM_MASK   (1 << 1)
 
#define PCH_TSC_ASMS_MASK   (1 << 2)
 
#define PCH_TSC_AMMS_MASK   (1 << 3)
 
#define PCH_TSC_PPSM_MASK   (1 << 4)
 
#define PCH_TSE_TTIPEND   (1 << 1)
 
#define PCH_TSE_SNS   (1 << 2)
 
#define PCH_TSE_SNM   (1 << 3)
 
#define PCH_TSE_PPS   (1 << 4)
 
#define PCH_CC_MM   (1 << 0)
 
#define PCH_CC_TA   (1 << 1)
 
#define PCH_CC_MODE_SHIFT   16
 
#define PCH_CC_MODE_MASK   0x001F0000
 
#define PCH_CC_VERSION   (1 << 31)
 
#define PCH_CE_TXS   (1 << 0)
 
#define PCH_CE_RXS   (1 << 1)
 
#define PCH_CE_OVR   (1 << 0)
 
#define PCH_CE_VAL   (1 << 1)
 
#define PCH_ECS_ETH   (1 << 0)
 
#define PCH_ECS_CAN   (1 << 1)
 
#define PCH_STATION_BYTES   6
 
#define PCH_IEEE1588_ETH   (1 << 0)
 
#define PCH_IEEE1588_CAN   (1 << 1)
 
#define pch_suspend   NULL
 
#define pch_resume   NULL
 

Enumerations

enum  pch_status {
  PCH_SUCCESS, PCH_INVALIDPARAM, PCH_NOTIMESTAMP, PCH_INTERRUPTMODEINUSE,
  PCH_FAILED, PCH_UNSUPPORTED
}
 

Functions

u32 pch_ch_control_read (struct pci_dev *pdev)
 
 EXPORT_SYMBOL (pch_ch_control_read)
 
void pch_ch_control_write (struct pci_dev *pdev, u32 val)
 
 EXPORT_SYMBOL (pch_ch_control_write)
 
u32 pch_ch_event_read (struct pci_dev *pdev)
 
 EXPORT_SYMBOL (pch_ch_event_read)
 
void pch_ch_event_write (struct pci_dev *pdev, u32 val)
 
 EXPORT_SYMBOL (pch_ch_event_write)
 
u32 pch_src_uuid_lo_read (struct pci_dev *pdev)
 
 EXPORT_SYMBOL (pch_src_uuid_lo_read)
 
u32 pch_src_uuid_hi_read (struct pci_dev *pdev)
 
 EXPORT_SYMBOL (pch_src_uuid_hi_read)
 
u64 pch_rx_snap_read (struct pci_dev *pdev)
 
 EXPORT_SYMBOL (pch_rx_snap_read)
 
u64 pch_tx_snap_read (struct pci_dev *pdev)
 
 EXPORT_SYMBOL (pch_tx_snap_read)
 
int pch_set_station_address (u8 *addr, struct pci_dev *pdev)
 
 EXPORT_SYMBOL (pch_set_station_address)
 
 module_init (ptp_pch_init)
 
 module_exit (ptp_pch_exit)
 
 module_param_string (station, pch_param.station, sizeof pch_param.station, 0444)
 
 MODULE_PARM_DESC (station,"IEEE 1588 station address to use - column separated hex values")
 
 MODULE_AUTHOR ("LAPIS SEMICONDUCTOR, <[email protected]>")
 
 MODULE_DESCRIPTION ("PTP clock using the EG20T timer")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define DEFAULT_ADDEND   0xA0000000

Definition at line 39 of file ptp_pch.c.

#define IO_MEM_BAR   1

Definition at line 37 of file ptp_pch.c.

#define N_EXT_TS   2

Definition at line 41 of file ptp_pch.c.

#define PCH_CC_MM   (1 << 0)

Definition at line 100 of file ptp_pch.c.

#define PCH_CC_MODE_MASK   0x001F0000

Definition at line 104 of file ptp_pch.c.

#define PCH_CC_MODE_SHIFT   16

Definition at line 103 of file ptp_pch.c.

#define PCH_CC_TA   (1 << 1)

Definition at line 101 of file ptp_pch.c.

#define PCH_CC_VERSION   (1 << 31)

Definition at line 105 of file ptp_pch.c.

#define PCH_CE_OVR   (1 << 0)

Definition at line 108 of file ptp_pch.c.

#define PCH_CE_RXS   (1 << 1)

Definition at line 107 of file ptp_pch.c.

#define PCH_CE_TXS   (1 << 0)

Definition at line 106 of file ptp_pch.c.

#define PCH_CE_VAL   (1 << 1)

Definition at line 109 of file ptp_pch.c.

#define PCH_ECS_CAN   (1 << 1)

Definition at line 112 of file ptp_pch.c.

#define PCH_ECS_ETH   (1 << 0)

Definition at line 110 of file ptp_pch.c.

#define PCH_IEEE1588_CAN   (1 << 1)

Definition at line 116 of file ptp_pch.c.

#define PCH_IEEE1588_ETH   (1 << 0)

Definition at line 115 of file ptp_pch.c.

#define pch_resume   NULL

Definition at line 557 of file ptp_pch.c.

#define PCH_STATION_BYTES   6

Definition at line 113 of file ptp_pch.c.

#define pch_suspend   NULL

Definition at line 556 of file ptp_pch.c.

#define PCH_TSC_AMMS_MASK   (1 << 3)

Definition at line 94 of file ptp_pch.c.

#define PCH_TSC_ASMS_MASK   (1 << 2)

Definition at line 93 of file ptp_pch.c.

#define PCH_TSC_PPSM_MASK   (1 << 4)

Definition at line 95 of file ptp_pch.c.

#define PCH_TSC_RESET   (1 << 0)

Definition at line 91 of file ptp_pch.c.

#define PCH_TSC_TTM_MASK   (1 << 1)

Definition at line 92 of file ptp_pch.c.

#define PCH_TSE_PPS   (1 << 4)

Definition at line 99 of file ptp_pch.c.

#define PCH_TSE_SNM   (1 << 3)

Definition at line 98 of file ptp_pch.c.

#define PCH_TSE_SNS   (1 << 2)

Definition at line 97 of file ptp_pch.c.

#define PCH_TSE_TTIPEND   (1 << 1)

Definition at line 96 of file ptp_pch.c.

#define PCI_DEVICE_ID_PCH_1588   0x8819

Definition at line 36 of file ptp_pch.c.

#define STATION_ADDR_LEN   20

Definition at line 35 of file ptp_pch.c.

#define TICKS_NS_SHIFT   5

Definition at line 40 of file ptp_pch.c.

Enumeration Type Documentation

enum pch_status
Enumerator:
PCH_SUCCESS 
PCH_INVALIDPARAM 
PCH_NOTIMESTAMP 
PCH_INTERRUPTMODEINUSE 
PCH_FAILED 
PCH_UNSUPPORTED 

Definition at line 43 of file ptp_pch.c.

Function Documentation

EXPORT_SYMBOL ( pch_ch_control_read  )
EXPORT_SYMBOL ( pch_ch_control_write  )
EXPORT_SYMBOL ( pch_ch_event_read  )
EXPORT_SYMBOL ( pch_ch_event_write  )
EXPORT_SYMBOL ( pch_src_uuid_lo_read  )
EXPORT_SYMBOL ( pch_src_uuid_hi_read  )
EXPORT_SYMBOL ( pch_rx_snap_read  )
EXPORT_SYMBOL ( pch_tx_snap_read  )
EXPORT_SYMBOL ( pch_set_station_address  )
MODULE_AUTHOR ( "LAPIS  SEMICONDUCTOR,
< tshimizu818 @gmail.com >"   
)
MODULE_DESCRIPTION ( "PTP clock using the EG20T timer )
module_exit ( ptp_pch_exit  )
module_init ( ptp_pch_init  )
MODULE_LICENSE ( "GPL"  )
module_param_string ( station  ,
pch_param.  station,
sizeof pch_param.  station,
0444   
)
MODULE_PARM_DESC ( station  ,
"IEEE 1588 station address to use - column separated hex values  
)
u32 pch_ch_control_read ( struct pci_dev pdev)

Definition at line 194 of file ptp_pch.c.

void pch_ch_control_write ( struct pci_dev pdev,
u32  val 
)

Definition at line 205 of file ptp_pch.c.

u32 pch_ch_event_read ( struct pci_dev pdev)

Definition at line 213 of file ptp_pch.c.

void pch_ch_event_write ( struct pci_dev pdev,
u32  val 
)

Definition at line 224 of file ptp_pch.c.

u64 pch_rx_snap_read ( struct pci_dev pdev)

Definition at line 254 of file ptp_pch.c.

int pch_set_station_address ( u8 addr,
struct pci_dev pdev 
)

pch_set_station_address() - This API sets the station address used by IEEE 1588 hardware when looking at PTP traffic on the ethernet interface : dress which contain the column separated address to be used.

Definition at line 312 of file ptp_pch.c.

u32 pch_src_uuid_hi_read ( struct pci_dev pdev)

Definition at line 243 of file ptp_pch.c.

u32 pch_src_uuid_lo_read ( struct pci_dev pdev)

Definition at line 232 of file ptp_pch.c.

u64 pch_tx_snap_read ( struct pci_dev pdev)

Definition at line 271 of file ptp_pch.c.