This file contains the type definitions and helper macros for the Enet SoC interface.
Go to the source code of this file.
Macros | |
#define | EnetSoc_assert(cond, ...) (void)(cond) |
Assertion. Note - We use '!(cond) before calling PDK OSAL as PDK OSAL_Assert is opposite of normal C assert. It asserts when condition is true. More... | |
Functions | |
int32_t | EnetSoc_init (void) |
Initialize SoC layer. More... | |
void | EnetSoc_deinit (void) |
Deinitialize SoC layer. More... | |
EnetDma_Handle | EnetSoc_getDmaHandle (Enet_Type enetType, uint32_t instId) |
Get handle of the DMA driver for a given Ethernet peripheral. More... | |
Enet_Handle | EnetSoc_getEnetHandleByIdx (uint32_t idx) |
Get handle of the Enet driver by its index. More... | |
Enet_Handle | EnetSoc_getEnetHandle (Enet_Type enetType, uint32_t instId) |
Get handle of the Enet driver for a given Ethernet peripheral. More... | |
uint32_t | EnetSoc_getCoreId (void) |
Get core id of caller. More... | |
bool | EnetSoc_isCoreAllowed (Enet_Type enetType, uint32_t instId, uint32_t coreId) |
Check if core is enable to use an Ethernet peripheral. More... | |
uint32_t | EnetSoc_getEnetNum (void) |
Get number of present Ethernet peripherals. More... | |
uint32_t | EnetSoc_getMacPortMax (Enet_Type enetType, uint32_t instId) |
Get number of MAC ports in a peripheral. More... | |
uint32_t | EnetSoc_getClkFreq (Enet_Type enetType, uint32_t instId, uint32_t clkId) |
Get SoC clock frequency. More... | |
int32_t | EnetSoc_setupIntrCfg (Enet_Type enetType, uint32_t instId, uint32_t intrId) |
Configure SoC connection of an interrupt. More... | |
int32_t | EnetSoc_releaseIntrCfg (Enet_Type enetType, uint32_t instId, uint32_t intrId) |
Release SoC connection of an interrupt. More... | |
uint32_t | EnetSoc_getIntrNum (Enet_Type enetType, uint32_t instId, uint32_t intrId) |
Get the interrupt number of a peripheral interrupt signal. More... | |
uint32_t | EnetSoc_getIntrTriggerType (Enet_Type enetType, uint32_t instId, uint32_t intrId) |
Get the interrupt trigger type of a peripheral interrupt signal. More... | |
int32_t | EnetSoc_getEFusedMacAddrs (uint8_t macAddr[][ENET_MAC_ADDR_LEN], uint32_t *num) |
Get EFused MAC addresses. More... | |
uint32_t | EnetSoc_getMacPortCaps (Enet_Type enetType, uint32_t instId, Enet_MacPort macPort) |
Get MAC port capability mask. More... | |
int32_t | EnetSoc_getMacPortMii (Enet_Type enetType, uint32_t instId, Enet_MacPort macPort, EnetMacPort_Interface *mii) |
Get MAC port MII mode. More... | |
uint32_t | EnetSoc_isIpSupported (Enet_Type enetType, uint32_t instId) |
Validate IP support in SOC. More... | |
#define EnetSoc_assert | ( | cond, | |
... | |||
) | (void)(cond) |
Assertion. Note - We use '!(cond) before calling PDK OSAL as PDK OSAL_Assert is opposite of normal C assert. It asserts when condition is true.
int32_t EnetSoc_init | ( | void | ) |
void EnetSoc_deinit | ( | void | ) |
Deinitialize SoC layer.
Deinitializes the Enet SoC layer.
EnetDma_Handle EnetSoc_getDmaHandle | ( | Enet_Type | enetType, |
uint32_t | instId | ||
) |
Get handle of the DMA driver for a given Ethernet peripheral.
Gets the handle to the DMA driver corresponding to the Ethernet peripheral identified by its type and instance id.
enetType | Enet Peripheral type |
instId | Instance Id |
Enet_Handle EnetSoc_getEnetHandleByIdx | ( | uint32_t | idx | ) |
Get handle of the Enet driver by its index.
Gets the handle to the Enet driver by its index. The index definition itself it SoC specific and not meaningful outside SoC internal implementation.
This function is mainly used by the Enet top-layer to iterate over all peripherals supported by the SoC. It's used along with EnetSoc_getEnetNum() to query the number of available peripherals.
idx | Ethernet peripheral index |
Enet_Handle EnetSoc_getEnetHandle | ( | Enet_Type | enetType, |
uint32_t | instId | ||
) |
Get handle of the Enet driver for a given Ethernet peripheral.
Gets the handle to the Enet driver corresponding to the Ethernet peripheral identified by its type and instance id.
enetType | Enet Peripheral type |
instId | Instance Id |
uint32_t EnetSoc_getCoreId | ( | void | ) |
Get core id of caller.
Gets id of the core where this function is called from.
bool EnetSoc_isCoreAllowed | ( | Enet_Type | enetType, |
uint32_t | instId, | ||
uint32_t | coreId | ||
) |
Check if core is enable to use an Ethernet peripheral.
Checks if a given core is allowed to use the Ethernet peripheral identified by its type and instance id.
enetType | Enet Peripheral type |
instId | Enet Peripheral instance id |
coreId | Core id |
uint32_t EnetSoc_getEnetNum | ( | void | ) |
Get number of present Ethernet peripherals.
Gets the number of Ethernet peripheral present in this SoC.
uint32_t EnetSoc_getMacPortMax | ( | Enet_Type | enetType, |
uint32_t | instId | ||
) |
Get number of MAC ports in a peripheral.
Gets the number of MAC ports in a peripheral identified by its type and instance id.
enetType | Enet Peripheral type |
instId | Enet Peripheral instance id |
uint32_t EnetSoc_getClkFreq | ( | Enet_Type | enetType, |
uint32_t | instId, | ||
uint32_t | clkId | ||
) |
Get SoC clock frequency.
Gets the frequency (in Hz) of an SoC clock identified by clkId
.
enetType | Enet Peripheral type |
instId | Enet Peripheral instance id |
clkId | Clock id |
int32_t EnetSoc_setupIntrCfg | ( | Enet_Type | enetType, |
uint32_t | instId, | ||
uint32_t | intrId | ||
) |
Configure SoC connection of an interrupt.
Perform the "SoC connection" configuration of a peripheral interrupt identified by intrId
.
enetType | Enet Peripheral type |
instId | Enet Peripheral instance id |
intrId | Interrupt id |
int32_t EnetSoc_releaseIntrCfg | ( | Enet_Type | enetType, |
uint32_t | instId, | ||
uint32_t | intrId | ||
) |
Release SoC connection of an interrupt.
Releases the "SoC connection" configuration of a peripheral interrupt identified by intrId
previuosly done via EnetSoc_setupIntrCfg().
enetType | Enet Peripheral type |
instId | Enet Peripheral instance id |
intrId | Interrupt id |
uint32_t EnetSoc_getIntrNum | ( | Enet_Type | enetType, |
uint32_t | instId, | ||
uint32_t | intrId | ||
) |
Get the interrupt number of a peripheral interrupt signal.
Gets the interrupt number that can be used to register/unregister an ISR which corresponds to a peripheral interrupt signal. The interrupt number could be routed at runtime via configurable interrupt routes, which makes the interrupt number a dynamic parameter from the driver's perspective.
enetType | Enet Peripheral type |
instId | Enet Peripheral instance id |
intrId | Interrupt id |
uint32_t EnetSoc_getIntrTriggerType | ( | Enet_Type | enetType, |
uint32_t | instId, | ||
uint32_t | intrId | ||
) |
Get the interrupt trigger type of a peripheral interrupt signal.
Gets the interrupt trigger type that can be used to register/unregister an ISR which corresponds to a peripheral interrupt signal. The interrupt trigger type could be routed at runtime via configurable interrupt routes, which makes the interrupt number a dynamic parameter from the driver's perspective.
enetType | Enet Peripheral type |
instId | Enet Peripheral instance id |
intrId | Interrupt id |
int32_t EnetSoc_getEFusedMacAddrs | ( | uint8_t | macAddr[][ENET_MAC_ADDR_LEN], |
uint32_t * | num | ||
) |
Get EFused MAC addresses.
Get a list of EFused MAC addresses.
macAddr | MAC address array |
num | Max number of addresses to populate in macAddr array. It's updated with actual number of addresses filled. |
uint32_t EnetSoc_getMacPortCaps | ( | Enet_Type | enetType, |
uint32_t | instId, | ||
Enet_MacPort | macPort | ||
) |
Get MAC port capability mask.
Gets the capability mask of a MAC port.
enetType | Enet Peripheral type |
instId | Enet Peripheral instance id |
macPort | MAC port number |
int32_t EnetSoc_getMacPortMii | ( | Enet_Type | enetType, |
uint32_t | instId, | ||
Enet_MacPort | macPort, | ||
EnetMacPort_Interface * | mii | ||
) |
Get MAC port MII mode.
Gets the SoC-level MII mode of a given MAC port. The MII mode could be configurable or fixed. If there is no SoC-level MII mode configuration, then return ENET_ENOTSUPPORTED.
enetType | Enet Peripheral type |
instId | Enet Peripheral instance id |
macPort | MAC port number |
mii | MII interface |
uint32_t EnetSoc_isIpSupported | ( | Enet_Type | enetType, |
uint32_t | instId | ||
) |
Validate IP support in SOC.
Validates IP support in given SOC.
enetType | Enet Peripheral type |
instId | Enet Peripheral instance id |