 |
AM261x MCU+ SDK
10.00.01
|
|
Go to the documentation of this file.
67 #define ETHPHYDRV_MAX_OBJ_SIZE ((6*4) + 1 + 3)
70 #define PHY_DIV_ROUNDUP(val, div) (((val) + (div) - 1) / (div))
73 #define PHY_BIT(n) (1U << (n))
80 #define PHY_CFG_IS_ON(name) ((PHY_CFG_ ## name) == PHY_ON)
82 #define PHY_CFG_IS_OFF(name) ((PHY_CFG_ ## name) == PHY_OFF)
94 #define PHY_SOK ( (int32_t) (0))
96 #define PHY_EFAIL (-(int32_t) (1))
98 #define PHY_EBADARGS (-(int32_t) (2)) (-(int32_t) (2))
100 #define PHY_EINVALIDPARAMS (-(int32_t) (3))
102 #define PHY_ETIMEOUT (-(int32_t) (4))
104 #define PHY_EALLOC (-(int32_t) (8))
106 #define PHY_EPERM (PHY_EALLOC - 4)
108 #define PHY_ENOTSUPPORTED (PHY_EALLOC - 5)
115 #define PHY_BMCR (0x00U)
117 #define PHY_BMSR (0x01U)
119 #define PHY_PHYIDR1 (0x02U)
121 #define PHY_PHYIDR2 (0x03U)
123 #define PHY_ANAR (0x04U)
125 #define PHY_ANLPAR (0x05U)
127 #define PHY_ANER (0x06U)
129 #define PHY_ANNPTR (0x07U)
131 #define PHY_ANNPRR (0x08U)
133 #define PHY_GIGCR (0x09U)
135 #define PHY_GIGSR (0x0AU)
137 #define PHY_MMD_CR (0x0DU)
139 #define PHY_MMD_DR (0x0EU)
141 #define PHY_GIGESR (0x0FU)
144 #define MMD_CR_ADDR (0x0000U)
145 #define MMD_CR_DATA_NOPOSTINC (0x4000U)
146 #define MMD_CR_DATA_POSTINC_RW (0x8000U)
147 #define MMD_CR_DATA_POSTINC_W (0xC000U)
148 #define MMD_CR_DEVADDR (0x001FU)
151 #define PHY_BMCR_RESET PHY_BIT(15)
152 #define PHY_BMCR_LOOPBACK PHY_BIT(14)
153 #define PHY_BMCR_SPEED100 PHY_BIT(13)
154 #define PHY_BMCR_ANEN PHY_BIT(12)
155 #define PHY_BMCR_PWRDOWN PHY_BIT(11)
156 #define PHY_BMCR_ISOLATE PHY_BIT(10)
157 #define PHY_BMCR_ANRESTART PHY_BIT(9)
158 #define PHY_BMCR_FD PHY_BIT(8)
159 #define PHY_BMCR_SPEED1000 PHY_BIT(6)
162 #define PHY_EXTENDED_CFG_SIZE_MAX (128U)
166 #define PHY_LINK_CAP_HD10 PHY_BIT(1)
168 #define PHY_LINK_CAP_FD10 PHY_BIT(2)
170 #define PHY_LINK_CAP_HD100 PHY_BIT(3)
172 #define PHY_LINK_CAP_FD100 PHY_BIT(4)
174 #define PHY_LINK_CAP_HD1000 PHY_BIT(5)
176 #define PHY_LINK_CAP_FD1000 PHY_BIT(6)
178 #define PHY_LINK_CAP_10 (PHY_LINK_CAP_HD10 | PHY_LINK_CAP_FD10)
180 #define PHY_LINK_CAP_100 (PHY_LINK_CAP_HD100 | PHY_LINK_CAP_FD100)
182 #define PHY_LINK_CAP_1000 (PHY_LINK_CAP_HD1000 | PHY_LINK_CAP_FD1000)
184 #define PHY_LINK_CAP_ALL (PHY_LINK_CAP_HD10 | PHY_LINK_CAP_FD10 | \
185 PHY_LINK_CAP_HD100 | PHY_LINK_CAP_FD100 | \
186 PHY_LINK_CAP_HD1000 | PHY_LINK_CAP_FD1000)
193 typedef struct Phy_Version_s
203 typedef enum Phy_Mii_e
275 const void *pVersion);
321 const uint32_t extCfgSize,
560 uint32_t srcMacStatusFrameType);
588 bool falling,
bool on);
607 uint64_t start, uint64_t period,
bool repeat);
622 uint32_t *seqId, uint64_t *ts64);
Phy_DrvObj_t * EthPhyDrv_If
Definition: phy_common.h:628
@ PHY_MAC_MII_RGMII
RGMII interface.
Definition: phy_common.h:215
int32_t EnetPhy_writeExtReg(void *pArgs, uint32_t reg, uint16_t val)
Write PHY extended register.
Phy_RegAccessCb_t regAccessApi
Definition: phy_common.h:635
int32_t EnetPhy_readExtReg(void *pArgs, uint32_t reg, uint16_t *val)
Read PHY extended register.
Definition: phy_common.h:225
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:244
Definition: phy_common.h:247
Phy_Mii
Definition: phy_common.h:204
Definition: phy_common.h:194
@ PHY_MAC_MII_GMII
GMII interface.
Definition: phy_common.h:212
@ PHY_MAC_MII_QSGMII
QSGMII interface.
Definition: phy_common.h:221
int32_t GenericPhy_readExtReg(EthPhyDrv_Handle hPhy, uint32_t reg, uint16_t *val)
@ PHY_MAC_MII_SGMII
SGMII interface.
Definition: phy_common.h:218
uint8_t phyAddr
Definition: phy_common.h:634
void GenericPhy_reset(EthPhyDrv_Handle hPhy)
uint32_t model
Definition: phy_common.h:198
uint32_t revision
Definition: phy_common.h:200
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:67
void * pArgs
Definition: phy_common.h:240
bool GenericPhy_isResetComplete(EthPhyDrv_Handle hPhy)
uint32_t oui
Definition: phy_common.h:196
const char * name
Driver name.
Definition: phy_common.h:257
int32_t GenericPhy_writeExtReg(EthPhyDrv_Handle hPhy, uint32_t reg, uint16_t val)
Definition: phy_common.h:633
@ PHY_MAC_MII_MII
MII interface.
Definition: phy_common.h:206
EthPhyDrv_Handle hDrv
Definition: phy_common.h:625
@ PHY_MAC_MII_RMII
RMII interface.
Definition: phy_common.h:209