1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright Altera Corporation (C) 2016. All rights reserved.
3  *
4  * Author: Tien Hock Loh <thloh@altera.com>
5  */
6 
7 #ifndef __TSE_PCS_H__
8 #define __TSE_PCS_H__
9 
10 #include <linux/phy.h>
11 #include <linux/timer.h>
12 
13 #define SGMII_ADAPTER_CTRL_REG		0x00
14 #define SGMII_ADAPTER_ENABLE		0x0000
15 #define SGMII_ADAPTER_DISABLE		0x0001
16 
17 struct tse_pcs {
18 	struct device *dev;
19 	void __iomem *tse_pcs_base;
20 	void __iomem *sgmii_adapter_base;
21 	struct timer_list aneg_link_timer;
22 	int autoneg;
23 };
24 
25 int tse_pcs_init(void __iomem *base, struct tse_pcs *pcs);
26 void tse_pcs_fix_mac_speed(struct tse_pcs *pcs, struct phy_device *phy_dev,
27 			   unsigned int speed);
28 
29 #endif /* __TSE_PCS_H__ */
30