Path: blob/master/arch/arm/mach-ixp4xx/include/mach/ixp46x_ts.h
17882 views
/*1* PTP 1588 clock using the IXP46X2*3* Copyright (C) 2010 OMICRON electronics GmbH4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License as published by7* the Free Software Foundation; either version 2 of the License, or8* (at your option) any later version.9*10* This program is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13* GNU General Public License for more details.14*15* You should have received a copy of the GNU General Public License16* along with this program; if not, write to the Free Software17* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18*/1920#ifndef _IXP46X_TS_H_21#define _IXP46X_TS_H_2223#define DEFAULT_ADDEND 0xF000002924#define TICKS_NS_SHIFT 42526struct ixp46x_channel_ctl {27u32 ch_control; /* 0x40 Time Synchronization Channel Control */28u32 ch_event; /* 0x44 Time Synchronization Channel Event */29u32 tx_snap_lo; /* 0x48 Transmit Snapshot Low Register */30u32 tx_snap_hi; /* 0x4C Transmit Snapshot High Register */31u32 rx_snap_lo; /* 0x50 Receive Snapshot Low Register */32u32 rx_snap_hi; /* 0x54 Receive Snapshot High Register */33u32 src_uuid_lo; /* 0x58 Source UUID0 Low Register */34u32 src_uuid_hi; /* 0x5C Sequence Identifier/Source UUID0 High */35};3637struct ixp46x_ts_regs {38u32 control; /* 0x00 Time Sync Control Register */39u32 event; /* 0x04 Time Sync Event Register */40u32 addend; /* 0x08 Time Sync Addend Register */41u32 accum; /* 0x0C Time Sync Accumulator Register */42u32 test; /* 0x10 Time Sync Test Register */43u32 unused; /* 0x14 */44u32 rsystime_lo; /* 0x18 RawSystemTime_Low Register */45u32 rsystime_hi; /* 0x1C RawSystemTime_High Register */46u32 systime_lo; /* 0x20 SystemTime_Low Register */47u32 systime_hi; /* 0x24 SystemTime_High Register */48u32 trgt_lo; /* 0x28 TargetTime_Low Register */49u32 trgt_hi; /* 0x2C TargetTime_High Register */50u32 asms_lo; /* 0x30 Auxiliary Slave Mode Snapshot Low */51u32 asms_hi; /* 0x34 Auxiliary Slave Mode Snapshot High */52u32 amms_lo; /* 0x38 Auxiliary Master Mode Snapshot Low */53u32 amms_hi; /* 0x3C Auxiliary Master Mode Snapshot High */5455struct ixp46x_channel_ctl channel[3];56};5758/* 0x00 Time Sync Control Register Bits */59#define TSCR_AMM (1<<3)60#define TSCR_ASM (1<<2)61#define TSCR_TTM (1<<1)62#define TSCR_RST (1<<0)6364/* 0x04 Time Sync Event Register Bits */65#define TSER_SNM (1<<3)66#define TSER_SNS (1<<2)67#define TTIPEND (1<<1)6869/* 0x40 Time Synchronization Channel Control Register Bits */70#define MASTER_MODE (1<<0)71#define TIMESTAMP_ALL (1<<1)7273/* 0x44 Time Synchronization Channel Event Register Bits */74#define TX_SNAPSHOT_LOCKED (1<<0)75#define RX_SNAPSHOT_LOCKED (1<<1)7677#endif787980