-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: mscc: describe the PTP register range
This patch adds support for using the PTP register range, and adds a description of its registers. This bank is used when configuring PTP. Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Antoine Tenart
authored and
David S. Miller
committed
Aug 15, 2019
1 parent
744350b
commit 45bce17
Showing
4 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */ | ||
/* | ||
* Microsemi Ocelot Switch driver | ||
* | ||
* License: Dual MIT/GPL | ||
* Copyright (c) 2017 Microsemi Corporation | ||
*/ | ||
|
||
#ifndef _MSCC_OCELOT_PTP_H_ | ||
#define _MSCC_OCELOT_PTP_H_ | ||
|
||
#define PTP_PIN_CFG_RSZ 0x20 | ||
#define PTP_PIN_TOD_SEC_MSB_RSZ PTP_PIN_CFG_RSZ | ||
#define PTP_PIN_TOD_SEC_LSB_RSZ PTP_PIN_CFG_RSZ | ||
#define PTP_PIN_TOD_NSEC_RSZ PTP_PIN_CFG_RSZ | ||
|
||
#define PTP_PIN_CFG_DOM BIT(0) | ||
#define PTP_PIN_CFG_SYNC BIT(2) | ||
#define PTP_PIN_CFG_ACTION(x) ((x) << 3) | ||
#define PTP_PIN_CFG_ACTION_MASK PTP_PIN_CFG_ACTION(0x7) | ||
|
||
enum { | ||
PTP_PIN_ACTION_IDLE = 0, | ||
PTP_PIN_ACTION_LOAD, | ||
PTP_PIN_ACTION_SAVE, | ||
PTP_PIN_ACTION_CLOCK, | ||
PTP_PIN_ACTION_DELTA, | ||
PTP_PIN_ACTION_NOSYNC, | ||
PTP_PIN_ACTION_SYNC, | ||
}; | ||
|
||
#define PTP_CFG_MISC_PTP_EN BIT(2) | ||
|
||
#define PSEC_PER_SEC 1000000000000LL | ||
|
||
#define PTP_CFG_CLK_ADJ_CFG_ENA BIT(0) | ||
#define PTP_CFG_CLK_ADJ_CFG_DIR BIT(1) | ||
|
||
#define PTP_CFG_CLK_ADJ_FREQ_NS BIT(30) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters