xref: /linux-6.15/include/linux/microchipphy.h (revision 1ccea77e)
1*1ccea77eSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
2792aec47S[email protected] /*
3792aec47S[email protected]  * Copyright (C) 2015 Microchip Technology
4792aec47S[email protected]  */
5792aec47S[email protected] 
6792aec47S[email protected] #ifndef _MICROCHIPPHY_H
7792aec47S[email protected] #define _MICROCHIPPHY_H
8792aec47S[email protected] 
9792aec47S[email protected] #define LAN88XX_INT_MASK			(0x19)
10792aec47S[email protected] #define LAN88XX_INT_MASK_MDINTPIN_EN_		(0x8000)
11792aec47S[email protected] #define LAN88XX_INT_MASK_SPEED_CHANGE_		(0x4000)
12792aec47S[email protected] #define LAN88XX_INT_MASK_LINK_CHANGE_		(0x2000)
13792aec47S[email protected] #define LAN88XX_INT_MASK_FDX_CHANGE_		(0x1000)
14792aec47S[email protected] #define LAN88XX_INT_MASK_AUTONEG_ERR_		(0x0800)
15792aec47S[email protected] #define LAN88XX_INT_MASK_AUTONEG_DONE_		(0x0400)
16792aec47S[email protected] #define LAN88XX_INT_MASK_POE_DETECT_		(0x0200)
17792aec47S[email protected] #define LAN88XX_INT_MASK_SYMBOL_ERR_		(0x0100)
18792aec47S[email protected] #define LAN88XX_INT_MASK_FAST_LINK_FAIL_	(0x0080)
19792aec47S[email protected] #define LAN88XX_INT_MASK_WOL_EVENT_		(0x0040)
20792aec47S[email protected] #define LAN88XX_INT_MASK_EXTENDED_INT_		(0x0020)
21792aec47S[email protected] #define LAN88XX_INT_MASK_RESERVED_		(0x0010)
22792aec47S[email protected] #define LAN88XX_INT_MASK_FALSE_CARRIER_		(0x0008)
23792aec47S[email protected] #define LAN88XX_INT_MASK_LINK_SPEED_DS_		(0x0004)
24792aec47S[email protected] #define LAN88XX_INT_MASK_MASTER_SLAVE_DONE_	(0x0002)
25792aec47S[email protected] #define LAN88XX_INT_MASK_RX__ER_		(0x0001)
26792aec47S[email protected] 
27792aec47S[email protected] #define LAN88XX_INT_STS				(0x1A)
28792aec47S[email protected] #define LAN88XX_INT_STS_INT_ACTIVE_		(0x8000)
29792aec47S[email protected] #define LAN88XX_INT_STS_SPEED_CHANGE_		(0x4000)
30792aec47S[email protected] #define LAN88XX_INT_STS_LINK_CHANGE_		(0x2000)
31792aec47S[email protected] #define LAN88XX_INT_STS_FDX_CHANGE_		(0x1000)
32792aec47S[email protected] #define LAN88XX_INT_STS_AUTONEG_ERR_		(0x0800)
33792aec47S[email protected] #define LAN88XX_INT_STS_AUTONEG_DONE_		(0x0400)
34792aec47S[email protected] #define LAN88XX_INT_STS_POE_DETECT_		(0x0200)
35792aec47S[email protected] #define LAN88XX_INT_STS_SYMBOL_ERR_		(0x0100)
36792aec47S[email protected] #define LAN88XX_INT_STS_FAST_LINK_FAIL_		(0x0080)
37792aec47S[email protected] #define LAN88XX_INT_STS_WOL_EVENT_		(0x0040)
38792aec47S[email protected] #define LAN88XX_INT_STS_EXTENDED_INT_		(0x0020)
39792aec47S[email protected] #define LAN88XX_INT_STS_RESERVED_		(0x0010)
40792aec47S[email protected] #define LAN88XX_INT_STS_FALSE_CARRIER_		(0x0008)
41792aec47S[email protected] #define LAN88XX_INT_STS_LINK_SPEED_DS_		(0x0004)
42792aec47S[email protected] #define LAN88XX_INT_STS_MASTER_SLAVE_DONE_	(0x0002)
43792aec47S[email protected] #define LAN88XX_INT_STS_RX_ER_			(0x0001)
44792aec47S[email protected] 
45792aec47S[email protected] #define LAN88XX_EXT_PAGE_ACCESS			(0x1F)
46792aec47S[email protected] #define LAN88XX_EXT_PAGE_SPACE_0		(0x0000)
47792aec47S[email protected] #define LAN88XX_EXT_PAGE_SPACE_1		(0x0001)
48792aec47S[email protected] #define LAN88XX_EXT_PAGE_SPACE_2		(0x0002)
49792aec47S[email protected] 
50792aec47S[email protected] /* Extended Register Page 1 space */
51792aec47S[email protected] #define LAN88XX_EXT_MODE_CTRL			(0x13)
52792aec47S[email protected] #define LAN88XX_EXT_MODE_CTRL_MDIX_MASK_	(0x000C)
53792aec47S[email protected] #define LAN88XX_EXT_MODE_CTRL_AUTO_MDIX_	(0x0000)
54792aec47S[email protected] #define LAN88XX_EXT_MODE_CTRL_MDI_		(0x0008)
55792aec47S[email protected] #define LAN88XX_EXT_MODE_CTRL_MDI_X_		(0x000C)
56792aec47S[email protected] 
57792aec47S[email protected] /* MMD 3 Registers */
58792aec47S[email protected] #define	LAN88XX_MMD3_CHIP_ID			(32877)
59792aec47S[email protected] #define	LAN88XX_MMD3_CHIP_REV			(32878)
60792aec47S[email protected] 
611827b067SPhil Elwell /* Registers specific to the LAN7800/LAN7850 embedded phy */
621827b067SPhil Elwell #define LAN78XX_PHY_LED_MODE_SELECT		(0x1D)
631827b067SPhil Elwell 
641c2734b3SRaghuram Chary J /* DSP registers */
651c2734b3SRaghuram Chary J #define PHY_ARDENNES_MMD_DEV_3_PHY_CFG		(0x806A)
661c2734b3SRaghuram Chary J #define PHY_ARDENNES_MMD_DEV_3_PHY_CFG_ZD_DLY_EN_	(0x2000)
671c2734b3SRaghuram Chary J #define LAN88XX_EXT_PAGE_ACCESS_TR		(0x52B5)
681c2734b3SRaghuram Chary J #define LAN88XX_EXT_PAGE_TR_CR			16
691c2734b3SRaghuram Chary J #define LAN88XX_EXT_PAGE_TR_LOW_DATA		17
701c2734b3SRaghuram Chary J #define LAN88XX_EXT_PAGE_TR_HIGH_DATA		18
711c2734b3SRaghuram Chary J 
72792aec47S[email protected] #endif /* _MICROCHIPPHY_H */
73