 |
AM64x MCU+ SDK
12.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))
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)
193 #define PHY_LINK_ADV_10 (PHY_LINK_ADV_HD10 | PHY_LINK_ADV_FD10)
195 #define PHY_LINK_ADV_100 (PHY_LINK_ADV_HD100 | PHY_LINK_ADV_FD100)
197 #define PHY_LINK_ADV_1000 (PHY_LINK_ADV_HD1000 | PHY_LINK_ADV_FD1000)
199 #define PHY_LINK_ADV_ALL (PHY_LINK_ADV_HD10 | PHY_LINK_ADV_FD10 | \
200 PHY_LINK_ADV_HD100 | PHY_LINK_ADV_FD100 | \
201 PHY_LINK_ADV_HD1000 | PHY_LINK_ADV_FD1000)
204 #define PHY_FAST_LINK_DOWN_ENERGY_LOST PHY_BIT(0)
206 #define PHY_FAST_LINK_DOWN_MSE PHY_BIT(1)
208 #define PHY_FAST_LINK_DOWN_MLT3_ERRORS PHY_BIT(2)
210 #define PHY_FAST_LINK_DOWN_RX_ERR PHY_BIT(3)
212 #define PHY_FAST_LINK_DOWN_DESCRAMBLER_SYNC_LOSS PHY_BIT(4)
219 typedef struct Phy_Version_s
229 typedef enum Phy_Mii_e
250 typedef enum Phy_Link_SpeedDuplex_e
277 typedef enum Phy_AutoNegCtrl_e
292 typedef enum Phy_Mdi_e
358 const void *pVersion);
404 const uint32_t extCfgSize,
677 uint32_t srcMacStatusFrameType);
705 bool falling,
bool on);
724 uint64_t start, uint64_t period,
bool repeat);
739 uint32_t *seqId, uint64_t *ts64);
753 uint8_t *streamIDMatchValue,
bool enTrigOut);
865 int32_t (*setAdvertisement)(
EthPhyDrv_Handle hPhy, uint32_t capabilities, uint32_t advertisement);
894 int32_t (*enableAdvertisement)(
EthPhyDrv_Handle hPhy, uint32_t capabilities, uint32_t advertisement);
923 int32_t (*disableAdvertisement)(
EthPhyDrv_Handle hPhy, uint32_t capabilities, uint32_t advertisement);
1135 uint32_t *pCapabilities);
1138 uint32_t capabilities,
1139 uint32_t advertisement);
1142 uint32_t capabilities,
1143 uint32_t advertisement);
1146 uint32_t capabilities,
1147 uint32_t advertisement);
1168 uint32_t capabilities,
Phy_DrvObj_t * EthPhyDrv_If
Definition: phy_common.h:1089
Phy_Mdi
Definition: phy_common.h:293
@ PHY_MAC_MII_RGMII
RGMII interface.
Definition: phy_common.h:241
struct tisci_boardcfg_control control
Definition: tisci_boardcfg.h:1
int32_t GenericPhy_disableAdvertisement(EthPhyDrv_Handle hPhy, uint32_t capabilities, uint32_t advertisement)
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:1096
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_reset(EthPhyDrv_Handle hPhy)
@ PHY_LINK_FD100
full-duplex, 100Mbps
Definition: phy_common.h:259
Definition: phy_common.h:305
int32_t GenericPhy_setAdvertisement(EthPhyDrv_Handle hPhy, uint32_t capabilities, uint32_t advertisement)
int32_t GenericPhy_isAutoNegotiationComplete(EthPhyDrv_Handle hPhy, bool *completed)
@ PHY_AUTO_NEGOTIATION_CTRL_ENABLE
Enable Auto Negotiation.
Definition: phy_common.h:283
int32_t EnetPhy_rmwExtReg(EnetPhy_Handle hPhy, uint32_t reg, uint16_t mask, uint16_t val)
Read-modify-write PHY extended register.
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:327
Definition: phy_common.h:330
uint8_t enable
Definition: tisci_pm_clock.h:6
Phy_Mii
Definition: phy_common.h:230
int32_t GenericPhy_ctrlPowerDown(EthPhyDrv_Handle hPhy, bool enable)
Definition: phy_common.h:220
@ PHY_LINK_HD100
half-duplex, 100Mbps
Definition: phy_common.h:268
@ PHY_LINK_AUTONEG
Auto-Negotiation.
Definition: phy_common.h:253
@ PHY_MAC_MII_GMII
GMII interface.
Definition: phy_common.h:238
int32_t GenericPhy_setSpeedDuplex(EthPhyDrv_Handle hPhy, uint32_t capabilities, uint32_t settings)
@ PHY_MAC_MII_QSGMII
QSGMII interface.
Definition: phy_common.h:247
int32_t GenericPhy_getLocalCaps(EthPhyDrv_Handle hPhy, uint32_t *pCapabilities)
int32_t GenericPhy_isPowerDownActive(EthPhyDrv_Handle hPhy, bool *pActive)
@ PHY_LINK_FD1000
full-duplex, 1000Mbps
Definition: phy_common.h:262
int32_t GenericPhy_isAutoNegotiationRestartComplete(EthPhyDrv_Handle hPhy, bool *completed)
int32_t GenericPhy_readExtReg(EthPhyDrv_Handle hPhy, uint32_t reg, uint16_t *val)
@ PHY_MAC_MII_SGMII
SGMII interface.
Definition: phy_common.h:244
uint8_t phyAddr
Definition: phy_common.h:1095
int32_t GenericPhy_writeReg(EthPhyDrv_Handle hPhy, uint32_t reg, uint16_t val)
@ PHY_LINK_HD10
half-duplex, 10Mbps
Definition: phy_common.h:265
@ PHY_AUTO_NEGOTIATION_CTRL_RESTART
Restart Auto Negotiation.
Definition: phy_common.h:286
uint32_t model
Definition: phy_common.h:224
uint32_t revision
Definition: phy_common.h:226
@ PHY_AUTO_NEGOTIATION_CTRL_ENABLE_AND_RESTART
Enable and Restart Auto Negotiation.
Definition: phy_common.h:289
@ PHY_LINK_FD10
full-duplex, 10Mbps
Definition: phy_common.h:256
int32_t GenericPhy_isResetComplete(EthPhyDrv_Handle hPhy, bool *pCompleted)
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:278
void * pArgs
Definition: phy_common.h:323
int32_t GenericPhy_isLinkPartnerAutoNegotiationAble(EthPhyDrv_Handle hPhy, bool *pAble)
uint32_t oui
Definition: phy_common.h:222
int32_t GenericPhy_isGigabitSupported(EthPhyDrv_Handle hPhy, bool *pSupported)
Phy_Link_SpeedDuplex
Definition: phy_common.h:251
const char * name
Driver name.
Definition: phy_common.h:340
@ PHY_AUTO_CROSSOVER
Enable automatic crossover.
Definition: phy_common.h:301
domgrp_t domain
Definition: tisci_pm_core.h:1
@ PHY_AUTO_NEGOTIATION_CTRL_DISABLE
Disable Auto Negotiation.
Definition: phy_common.h:280
int32_t GenericPhy_writeExtReg(EthPhyDrv_Handle hPhy, uint32_t reg, uint16_t val)
@ PHY_LINK_INVALID
Invalid Speed Duplex.
Definition: phy_common.h:274
@ PHY_MDI_MANUAL_CONFIG
Manual MDI configuration.
Definition: phy_common.h:295
@ PHY_MDIX_MANUAL_CONFIG
Manual MDI-X configuration.
Definition: phy_common.h:298
Definition: phy_common.h:1094
@ PHY_MAC_MII_MII
MII interface.
Definition: phy_common.h:232
int32_t GenericPhy_getId(EthPhyDrv_Handle hPhy, uint32_t *id)
EthPhyDrv_Handle hDrv
Definition: phy_common.h:1086
@ PHY_LINK_HD1000
half-duplex, 1000Mbps
Definition: phy_common.h:271
int32_t GenericPhy_isLinkUp(EthPhyDrv_Handle hPhy, bool *linkUp)
int32_t GenericPhy_enableAdvertisement(EthPhyDrv_Handle hPhy, uint32_t capabilities, uint32_t advertisement)
@ PHY_MAC_MII_RMII
RMII interface.
Definition: phy_common.h:235