 |
AM62D FreeRTOS SDK
11.02.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)
181 #define PHY_LINK_ADV_HD10 PHY_BIT(1)
183 #define PHY_LINK_ADV_FD10 PHY_BIT(2)
185 #define PHY_LINK_ADV_HD100 PHY_BIT(3)
187 #define PHY_LINK_ADV_FD100 PHY_BIT(4)
189 #define PHY_LINK_ADV_HD1000 PHY_BIT(5)
191 #define PHY_LINK_ADV_FD1000 PHY_BIT(6)
194 #define PHY_FAST_LINK_DOWN_ENERGY_LOST PHY_BIT(0)
196 #define PHY_FAST_LINK_DOWN_MSE PHY_BIT(1)
198 #define PHY_FAST_LINK_DOWN_MLT3_ERRORS PHY_BIT(2)
200 #define PHY_FAST_LINK_DOWN_RX_ERR PHY_BIT(3)
202 #define PHY_FAST_LINK_DOWN_DESCRAMBLER_SYNC_LOSS PHY_BIT(4)
209 typedef struct Phy_Version_s
219 typedef enum Phy_Mii_e
240 typedef enum Phy_Link_SpeedDuplex_e
267 typedef enum Phy_AutoNegCtrl_e
333 const void *pVersion);
379 const uint32_t extCfgSize,
649 uint32_t srcMacStatusFrameType);
677 bool falling,
bool on);
696 uint64_t start, uint64_t period,
bool repeat);
711 uint32_t *seqId, uint64_t *ts64);
725 uint8_t *streamIDMatchValue,
bool enTrigOut);
1087 uint32_t advertisement);
1090 uint32_t advertisement);
Phy_DrvObj_t * EthPhyDrv_If
Definition: phy_common.h:1042
@ PHY_MAC_MII_RGMII
RGMII interface.
Definition: phy_common.h:231
struct tisci_boardcfg_control control
Definition: tisci_boardcfg.h:1
int32_t GenericPhy_readReg(EthPhyDrv_Handle hPhy, uint32_t reg, uint16_t *val)
int32_t EnetPhy_writeExtReg(void *pArgs, uint32_t reg, uint16_t val)
Write PHY extended register.
Phy_RegAccessCb_t regAccessApi
Definition: phy_common.h:1049
uint16_t size
Definition: tisci_boardcfg.h:1
int32_t EnetPhy_readExtReg(void *pArgs, uint32_t reg, uint16_t *val)
Read PHY extended register.
int32_t GenericPhy_disableAdvertisement(EthPhyDrv_Handle hPhy, uint32_t advertisement)
@ PHY_LINK_FD100
full-duplex, 100Mbps
Definition: phy_common.h:249
Definition: phy_common.h:283
int32_t GenericPhy_isAutoNegotiationComplete(EthPhyDrv_Handle hPhy, bool *completed)
@ PHY_AUTO_NEGOTIATION_CTRL_ENABLE
Enable Auto Negotiation.
Definition: phy_common.h:273
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:302
Definition: phy_common.h:305
Phy_Mii
Definition: phy_common.h:220
Definition: phy_common.h:210
@ PHY_LINK_HD100
half-duplex, 100Mbps
Definition: phy_common.h:258
@ PHY_LINK_AUTONEG
Auto-Negotiation.
Definition: phy_common.h:243
@ PHY_MAC_MII_GMII
GMII interface.
Definition: phy_common.h:228
@ PHY_MAC_MII_QSGMII
QSGMII interface.
Definition: phy_common.h:237
@ PHY_LINK_FD1000
full-duplex, 1000Mbps
Definition: phy_common.h:252
int32_t GenericPhy_enableAdvertisement(EthPhyDrv_Handle hPhy, uint32_t advertisement)
int32_t GenericPhy_isAutoNegotiationRestartComplete(EthPhyDrv_Handle hPhy, bool *completed)
int32_t GenericPhy_readExtReg(EthPhyDrv_Handle hPhy, uint32_t reg, uint16_t *val)
int32_t GenericPhy_setSpeedDuplex(EthPhyDrv_Handle hPhy, uint32_t settings)
@ PHY_MAC_MII_SGMII
SGMII interface.
Definition: phy_common.h:234
uint8_t phyAddr
Definition: phy_common.h:1048
int32_t GenericPhy_writeReg(EthPhyDrv_Handle hPhy, uint32_t reg, uint16_t val)
void GenericPhy_reset(EthPhyDrv_Handle hPhy)
@ PHY_LINK_HD10
half-duplex, 10Mbps
Definition: phy_common.h:255
@ PHY_AUTO_NEGOTIATION_CTRL_RESTART
Restart Auto Negotiation.
Definition: phy_common.h:276
uint32_t model
Definition: phy_common.h:214
uint32_t revision
Definition: phy_common.h:216
int32_t GenericPhy_ctrlPowerDown(EthPhyDrv_Handle hPhy, bool control)
int32_t GenericPhy_isPowerDownActive(EthPhyDrv_Handle hPhy, bool *active)
@ PHY_AUTO_NEGOTIATION_CTRL_ENABLE_AND_RESTART
Enable and Restart Auto Negotiation.
Definition: phy_common.h:279
@ PHY_LINK_FD10
full-duplex, 10Mbps
Definition: phy_common.h:246
int32_t GenericPhy_isAutoNegotiationEnabled(EthPhyDrv_Handle hPhy, bool *enabled)
int32_t EnetPhy_rmwReg(void *pArgs, uint32_t reg, uint16_t mask, uint16_t val)
Read-modify-write PHY register.
int32_t GenericPhy_ctrlAutoNegotiation(EthPhyDrv_Handle hPhy, uint32_t control)
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
Phy_AutoNegCtrl
Definition: phy_common.h:268
void * pArgs
Definition: phy_common.h:298
bool GenericPhy_isResetComplete(EthPhyDrv_Handle hPhy)
int32_t GenericPhy_isLinkPartnerAutoNegotiationAble(EthPhyDrv_Handle hPhy, bool *pAble)
uint32_t oui
Definition: phy_common.h:212
Phy_Link_SpeedDuplex
Definition: phy_common.h:241
const char * name
Driver name.
Definition: phy_common.h:315
domgrp_t domain
Definition: tisci_pm_core.h:1
@ PHY_AUTO_NEGOTIATION_CTRL_DISABLE
Disable Auto Negotiation.
Definition: phy_common.h:270
int32_t GenericPhy_writeExtReg(EthPhyDrv_Handle hPhy, uint32_t reg, uint16_t val)
@ PHY_LINK_INVALID
Invalid Speed Duplex.
Definition: phy_common.h:264
Definition: phy_common.h:1047
@ PHY_MAC_MII_MII
MII interface.
Definition: phy_common.h:222
int32_t GenericPhy_getId(EthPhyDrv_Handle hPhy, uint32_t *id)
EthPhyDrv_Handle hDrv
Definition: phy_common.h:1039
@ PHY_LINK_HD1000
half-duplex, 1000Mbps
Definition: phy_common.h:261
int32_t GenericPhy_isLinkUp(EthPhyDrv_Handle hPhy, bool *linkUp)
@ PHY_MAC_MII_RMII
RMII interface.
Definition: phy_common.h:225