|
AM263x MCU+ SDK
10.01.00
|
|
Go to the documentation of this file.
59 #define ETHPHYDRV_MAX_OBJ_SIZE (64)
62 #define PHY_DIV_ROUNDUP(val, div) (((val) + (div) - 1) / (div))
65 #define PHY_BIT(n) (1U << (n))
72 #define PHY_CFG_IS_ON(name) ((PHY_CFG_ ## name) == PHY_ON)
74 #define PHY_CFG_IS_OFF(name) ((PHY_CFG_ ## name) == PHY_OFF)
86 #define PHY_SOK ( (int32_t) (0))
88 #define PHY_EFAIL (-(int32_t) (1))
90 #define PHY_EBADARGS (-(int32_t) (2)) (-(int32_t) (2))
92 #define PHY_EINVALIDPARAMS (-(int32_t) (3))
94 #define PHY_ETIMEOUT (-(int32_t) (4))
96 #define PHY_EALLOC (-(int32_t) (8))
98 #define PHY_EPERM (PHY_EALLOC - 4)
100 #define PHY_ENOTSUPPORTED (PHY_EALLOC - 5)
107 #define PHY_BMCR (0x00U)
109 #define PHY_BMSR (0x01U)
111 #define PHY_PHYIDR1 (0x02U)
113 #define PHY_PHYIDR2 (0x03U)
115 #define PHY_ANAR (0x04U)
117 #define PHY_ANLPAR (0x05U)
119 #define PHY_ANER (0x06U)
121 #define PHY_ANNPTR (0x07U)
123 #define PHY_ANNPRR (0x08U)
125 #define PHY_GIGCR (0x09U)
127 #define PHY_GIGSR (0x0AU)
129 #define PHY_MMD_CR (0x0DU)
131 #define PHY_MMD_DR (0x0EU)
133 #define PHY_GIGESR (0x0FU)
136 #define MMD_CR_ADDR (0x0000U)
137 #define MMD_CR_DATA_NOPOSTINC (0x4000U)
138 #define MMD_CR_DATA_POSTINC_RW (0x8000U)
139 #define MMD_CR_DATA_POSTINC_W (0xC000U)
140 #define MMD_CR_DEVADDR (0x001FU)
143 #define PHY_BMCR_RESET PHY_BIT(15)
144 #define PHY_BMCR_LOOPBACK PHY_BIT(14)
145 #define PHY_BMCR_SPEED100 PHY_BIT(13)
146 #define PHY_BMCR_ANEN PHY_BIT(12)
147 #define PHY_BMCR_PWRDOWN PHY_BIT(11)
148 #define PHY_BMCR_ISOLATE PHY_BIT(10)
149 #define PHY_BMCR_ANRESTART PHY_BIT(9)
150 #define PHY_BMCR_FD PHY_BIT(8)
151 #define PHY_BMCR_SPEED1000 PHY_BIT(6)
154 #define PHY_EXTENDED_CFG_SIZE_MAX (128U)
158 #define PHY_LINK_CAP_HD10 PHY_BIT(1)
160 #define PHY_LINK_CAP_FD10 PHY_BIT(2)
162 #define PHY_LINK_CAP_HD100 PHY_BIT(3)
164 #define PHY_LINK_CAP_FD100 PHY_BIT(4)
166 #define PHY_LINK_CAP_HD1000 PHY_BIT(5)
168 #define PHY_LINK_CAP_FD1000 PHY_BIT(6)
170 #define PHY_LINK_CAP_10 (PHY_LINK_CAP_HD10 | PHY_LINK_CAP_FD10)
172 #define PHY_LINK_CAP_100 (PHY_LINK_CAP_HD100 | PHY_LINK_CAP_FD100)
174 #define PHY_LINK_CAP_1000 (PHY_LINK_CAP_HD1000 | PHY_LINK_CAP_FD1000)
176 #define PHY_LINK_CAP_ALL (PHY_LINK_CAP_HD10 | PHY_LINK_CAP_FD10 | \
177 PHY_LINK_CAP_HD100 | PHY_LINK_CAP_FD100 | \
178 PHY_LINK_CAP_HD1000 | PHY_LINK_CAP_FD1000)
185 typedef struct Phy_Version_s
195 typedef enum Phy_Mii_e
267 const void *pVersion);
313 const uint32_t extCfgSize,
552 uint32_t srcMacStatusFrameType);
580 bool falling,
bool on);
599 uint64_t start, uint64_t period,
bool repeat);
614 uint32_t *seqId, uint64_t *ts64);
Phy_DrvObj_t * EthPhyDrv_If
Definition: phy_common.h:620
@ PHY_MAC_MII_RGMII
RGMII interface.
Definition: phy_common.h:207
int32_t EnetPhy_writeExtReg(void *pArgs, uint32_t reg, uint16_t val)
Write PHY extended register.
Phy_RegAccessCb_t regAccessApi
Definition: phy_common.h:627
int32_t EnetPhy_readExtReg(void *pArgs, uint32_t reg, uint16_t *val)
Read PHY extended register.
Definition: phy_common.h:217
int32_t EnetPhy_writeReg(void *pArgs, uint32_t reg, uint16_t val)
Write PHY register.
uint8_t EthPhyDrv_Handle[ETHPHYDRV_MAX_OBJ_SIZE]
Definition: phy_common.h:236
Definition: phy_common.h:239
Phy_Mii
Definition: phy_common.h:196
Definition: phy_common.h:186
@ PHY_MAC_MII_GMII
GMII interface.
Definition: phy_common.h:204
@ PHY_MAC_MII_QSGMII
QSGMII interface.
Definition: phy_common.h:213
int32_t GenericPhy_readExtReg(EthPhyDrv_Handle hPhy, uint32_t reg, uint16_t *val)
@ PHY_MAC_MII_SGMII
SGMII interface.
Definition: phy_common.h:210
uint8_t phyAddr
Definition: phy_common.h:626
void GenericPhy_reset(EthPhyDrv_Handle hPhy)
uint32_t model
Definition: phy_common.h:190
uint32_t revision
Definition: phy_common.h:192
int32_t EnetPhy_rmwReg(void *pArgs, uint32_t reg, uint16_t mask, uint16_t val)
Read-modify-write PHY register.
int32_t EnetPhy_readReg(void *pArgs, uint32_t reg, uint16_t *val)
Read PHY register.
#define ETHPHYDRV_MAX_OBJ_SIZE
Definition: phy_common.h:59
void * pArgs
Definition: phy_common.h:232
bool GenericPhy_isResetComplete(EthPhyDrv_Handle hPhy)
uint32_t oui
Definition: phy_common.h:188
const char * name
Driver name.
Definition: phy_common.h:249
int32_t GenericPhy_writeExtReg(EthPhyDrv_Handle hPhy, uint32_t reg, uint16_t val)
Definition: phy_common.h:625
@ PHY_MAC_MII_MII
MII interface.
Definition: phy_common.h:198
EthPhyDrv_Handle hDrv
Definition: phy_common.h:617
@ PHY_MAC_MII_RMII
RMII interface.
Definition: phy_common.h:201