Skip to content

Commit

Permalink
Merge branch 'fec-ptp'
Browse files Browse the repository at this point in the history
Luwei Zhou says:

====================
Enable FEC pps feather

Change from v2 to v3:
	-Using the default channel 0 to be PPS channel not PTP_PIN_SET/GETFUNC interface.
	-Using the linux definition of NSEC_PER_SEC.

Change from v1 to v2:
	- Fix the potential 32-bit multiplication overflow issue.
	- Optimize the hareware adjustment code to improve efficiency as Richard suggested
	- Use ptp PTP_PIN_SET/GETFUNC interface to set PPS channel not device tree
	and add PTP_PF_PPS enumeration
	- Modify comments style
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Oct 14, 2014
2 parents 02ea807 + 278d240 commit f787d6c
Show file tree
Hide file tree
Showing 3 changed files with 267 additions and 17 deletions.
10 changes: 10 additions & 0 deletions drivers/net/ethernet/freescale/fec.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,12 +484,22 @@ struct fec_enet_private {
unsigned int itr_clk_rate;

u32 rx_copybreak;

/* ptp clock period in ns*/
unsigned int ptp_inc;

/* pps */
int pps_channel;
unsigned int reload_period;
int pps_enable;
unsigned int next_counter;
};

void fec_ptp_init(struct platform_device *pdev);
void fec_ptp_start_cyclecounter(struct net_device *ndev);
int fec_ptp_set(struct net_device *ndev, struct ifreq *ifr);
int fec_ptp_get(struct net_device *ndev, struct ifreq *ifr);
uint fec_ptp_check_pps_event(struct fec_enet_private *fep);

/****************************************************************************/
#endif /* FEC_H */
2 changes: 2 additions & 0 deletions drivers/net/ethernet/freescale/fec_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,8 @@ fec_enet_interrupt(int irq, void *dev_id)
complete(&fep->mdio_done);
}

fec_ptp_check_pps_event(fep);

return ret;
}

Expand Down
Loading

0 comments on commit f787d6c

Please sign in to comment.