summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale/fman/inc
diff options
context:
space:
mode:
authorMandy Lavi <mandy.lavi@freescale.com>2013-04-24 07:56:04 (GMT)
committerFleming Andrew-AFLEMING <AFLEMING@freescale.com>2013-04-29 20:22:02 (GMT)
commit5045184a0cc3283bcd30d3bbebff6188d30e9fce (patch)
treef47057a56b74a822fe8329767802f4ff59711e3f /drivers/net/ethernet/freescale/fman/inc
parent56206bd9f58df8e2a1640c523d6f7fa392e580d1 (diff)
downloadlinux-fsl-qoriq-5045184a0cc3283bcd30d3bbebff6188d30e9fce.tar.xz
fmd21 integration
Signed-off-by: Mandy Lavi <mandy.lavi@freescale.com> Prev fmd integration was fmd19 Diffs from fmd19 to fmd21: Added kgHashShift to t_FmPcdHashTableParams Added nonConsistentSp to t_FmPcdManipReassemIpStats sp - 2 layers separation - for future flib integration rtc - 2 layers separation - for future flib integration PFC enhancement (B4 Rev2 FMAN) API addition (for B4 rev 2): FM_PORT_SetPfcPrioritiesMappingToQmanWQ File fsl_fman.h renamed to lnxwrp_fsl_fman.h The name fsl_fman.h has been applied to other fman internal header file In dpaa_eth: Due to renaming of fsl_fman.h to lnxwrp_fsl_fman.h The relevant include lines in some of the files had to change accordingly Change-Id: I8f25c758963a44a75ca8676aad45f7f96767b0b5 Reviewed-on: http://git.am.freescale.net:8181/2069 Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/fman/inc')
-rw-r--r--drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_ext.h89
-rw-r--r--drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_mac_ext.h50
-rw-r--r--drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_pcd_ext.h27
-rw-r--r--drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_port_ext.h87
-rw-r--r--drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_rtc_ext.h32
-rw-r--r--drivers/net/ethernet/freescale/fman/inc/core_ext.h1
-rw-r--r--drivers/net/ethernet/freescale/fman/inc/cores/e500v2_ext.h2
-rw-r--r--drivers/net/ethernet/freescale/fman/inc/debug_ext.h1
-rw-r--r--drivers/net/ethernet/freescale/fman/inc/endian_ext.h1
-rw-r--r--drivers/net/ethernet/freescale/fman/inc/error_ext.h2
-rwxr-xr-xdrivers/net/ethernet/freescale/fman/inc/flib/fsl_fman.h117
-rw-r--r--drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_dtsec.h269
-rw-r--r--drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_memac.h119
-rwxr-xr-xdrivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_rtc.h429
-rwxr-xr-xdrivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_sp.h138
-rw-r--r--drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_tgec.h115
-rw-r--r--drivers/net/ethernet/freescale/fman/inc/integrations/P1023/dpaa_integration_ext.h21
-rw-r--r--drivers/net/ethernet/freescale/fman/inc/integrations/P3040_P4080_P5020/dpaa_integration_ext.h12
-rw-r--r--drivers/net/ethernet/freescale/fman/inc/integrations/T4240/dpaa_integration_ext.h3
19 files changed, 1122 insertions, 393 deletions
diff --git a/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_ext.h b/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_ext.h
index 6acf50b..a45682f 100644
--- a/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_ext.h
+++ b/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_ext.h
@@ -42,7 +42,7 @@
#include "error_ext.h"
#include "std_ext.h"
#include "dpaa_ext.h"
-
+#include "fsl_fman_sp.h"
/**************************************************************************//**
@Group FM_grp Frame Manager API
@@ -55,7 +55,7 @@
/**************************************************************************//**
@Group FM_lib_grp FM library
- @Description FM API functions, definitions and enums
+ @Description FM API functions, definitions and enums.
The FM module is the main driver module and is a mandatory module
for FM driver users. This module must be initialized first prior
@@ -235,6 +235,7 @@ typedef uint32_t fmSpecialOperations_t; /**< typedef for definin
#define FM_SP_OP_RPD 0x10000000 /**< Set the RPD bit */
#define FM_SP_OP_DCL4C 0x08000000 /**< Set the DCL4C bit */
#define FM_SP_OP_CHECK_SEC_ERRORS 0x04000000 /**< Check SEC errors */
+#define FM_SP_OP_CLEAR_RPD 0x02000000 /**< Clear the RPD bit */
/* @} */
/**************************************************************************//**
@@ -309,19 +310,19 @@ typedef enum e_FmExceptions {
@Description Enum for defining port DMA swap mode
*//***************************************************************************/
typedef enum e_FmDmaSwapOption {
- e_FM_DMA_NO_SWP, /**< No swap, transfer data as is.*/
- e_FM_DMA_SWP_PPC_LE, /**< The transferred data should be swapped
- in PowerPc Little Endian mode. */
- e_FM_DMA_SWP_BE /**< The transferred data should be swapped
- in Big Endian mode */
+ e_FM_DMA_NO_SWP = FMAN_DMA_NO_SWP, /**< No swap, transfer data as is.*/
+ e_FM_DMA_SWP_PPC_LE = FMAN_DMA_SWP_PPC_LE, /**< The transferred data should be swapped
+ in PowerPc Little Endian mode. */
+ e_FM_DMA_SWP_BE = FMAN_DMA_SWP_BE /**< The transferred data should be swapped
+ in Big Endian mode */
} e_FmDmaSwapOption;
/**************************************************************************//**
@Description Enum for defining port DMA cache attributes
*//***************************************************************************/
typedef enum e_FmDmaCacheOption {
- e_FM_DMA_NO_STASH = 0, /**< Cacheable, no Allocate (No Stashing) */
- e_FM_DMA_STASH = 1 /**< Cacheable and Allocate (Stashing on) */
+ e_FM_DMA_NO_STASH = FMAN_DMA_NO_STASH, /**< Cacheable, no Allocate (No Stashing) */
+ e_FM_DMA_STASH = FMAN_DMA_STASH /**< Cacheable and Allocate (Stashing on) */
} e_FmDmaCacheOption;
@@ -391,7 +392,7 @@ typedef struct t_FmBufferPrefixContent {
get the parser-result from a buffer. */
bool passAllOtherPCDInfo;/**< Add all other Internal-Context information:
AD, hash-result, key, etc. */
- uint16_t dataAlign; /**< 0 to use driver's default alignment [64],
+ uint16_t dataAlign; /**< 0 to use driver's default alignment [DEFAULT_FM_SP_bufferPrefixContent_dataAlign],
other value for selecting a data alignment (must be a power of 2);
if write optimization is used, must be >= 16. */
uint8_t manipExtraSpace; /**< Maximum extra size needed (insertion-size minus removal-size);
@@ -684,7 +685,7 @@ typedef struct t_FmDmaThresholds {
@Function FM_ConfigResetOnInit
@Description Define whether to reset the FM before initialization.
- Change the default configuration [FALSE].
+ Change the default configuration [DEFAULT_resetOnInit].
@Param[in] h_Fm A handle to an FM Module.
@Param[in] enable When TRUE, FM will be reset before any initialization.
@@ -702,7 +703,7 @@ t_Error FM_ConfigResetOnInit(t_Handle h_Fm, bool enable);
@Description Define Total FIFO size for the whole FM.
Calling this routine changes the total Fifo size in the internal driver
- data base from its default configuration [major]
+ data base from its default configuration [DEFAULT_totalFifoSize]
@Param[in] h_Fm A handle to an FM Module.
@Param[in] totalFifoSize The selected new value.
@@ -720,7 +721,7 @@ t_Error FM_ConfigTotalFifoSize(t_Handle h_Fm, uint32_t totalFifoSize);
@Description Define cache override mode.
Calling this routine changes the cache override mode
- in the internal driver data base from its default configuration [e_FM_DMA_NO_CACHE_OR]
+ in the internal driver data base from its default configuration [DEFAULT_cacheOverride]
@Param[in] h_Fm A handle to an FM Module.
@Param[in] cacheOverride The selected new value.
@@ -738,7 +739,7 @@ t_Error FM_ConfigDmaCacheOverride(t_Handle h_Fm, e_FmDmaCacheOverride cacheOverr
@Description Define DMA AID override mode.
Calling this routine changes the AID override mode
- in the internal driver data base from its default configuration [TRUE]
+ in the internal driver data base from its default configuration [DEFAULT_aidOverride]
@Param[in] h_Fm A handle to an FM Module.
@Param[in] aidOverride The selected new value.
@@ -756,7 +757,7 @@ t_Error FM_ConfigDmaAidOverride(t_Handle h_Fm, bool aidOverride);
@Description Define DMA AID mode.
Calling this routine changes the AID mode in the internal
- driver data base from its default configuration [e_FM_DMA_AID_OUT_TNUM]
+ driver data base from its default configuration [DEFAULT_aidMode]
@Param[in] h_Fm A handle to an FM Module.
@Param[in] aidMode The selected new value.
@@ -774,7 +775,7 @@ t_Error FM_ConfigDmaAidMode(t_Handle h_Fm, e_FmDmaAidMode aidMode);
@Description Define DMA AXI number of beats.
Calling this routine changes the AXI number of beats in the internal
- driver data base from its default configuration [1]
+ driver data base from its default configuration [DEFAULT_axiDbgNumOfBeats]
@Param[in] h_Fm A handle to an FM Module.
@Param[in] axiDbgNumOfBeats The selected new value.
@@ -792,7 +793,7 @@ t_Error FM_ConfigDmaAxiDbgNumOfBeats(t_Handle h_Fm, uint8_t axiDbgNumOfBeats);
@Description Define number of CAM entries.
Calling this routine changes the number of CAM entries in the internal
- driver data base from its default configuration [32].
+ driver data base from its default configuration [DEFAULT_dmaCamNumOfEntries].
@Param[in] h_Fm A handle to an FM Module.
@Param[in] numOfEntries The selected new value.
@@ -821,7 +822,7 @@ t_Error FM_ConfigEnableCounters(t_Handle h_Fm);
@Description Define DMA debug counter.
Calling this routine changes the number of the DMA debug counter in the internal
- driver data base from its default configuration [e_FM_DMA_DBG_NO_CNT].
+ driver data base from its default configuration [DEFAULT_dmaDbgCntMode].
@Param[in] h_Fm A handle to an FM Module.
@Param[in] fmDmaDbgCntMode An enum selecting the debug counter mode.
@@ -840,7 +841,7 @@ t_Error FM_ConfigDmaDbgCounter(t_Handle h_Fm, e_FmDmaDbgCntMode fmDmaDbgCntMode)
@Description Define bus error behavior.
Calling this routine changes the bus error behavior definition
in the internal driver data base from its default
- configuration [FALSE].
+ configuration [DEFAULT_dmaStopOnBusError].
@Param[in] h_Fm A handle to an FM Module.
@Param[in] stop TRUE to stop on bus error, FALSE to continue.
@@ -879,7 +880,7 @@ t_Error FM_ConfigDmaEmergency(t_Handle h_Fm, t_FmDmaEmergency *p_Emergency);
@Description DMA error treatment.
Calling this routine changes the DMA error treatment
in the internal driver data base from its default
- configuration [e_FM_DMA_ERR_CATASTROPHIC].
+ configuration [DEFAULT_dmaErr].
@Param[in] h_Fm A handle to an FM Module.
@Param[in] dmaErr The selected new choice.
@@ -898,7 +899,7 @@ t_Error FM_ConfigDmaErr(t_Handle h_Fm, e_FmDmaErr dmaErr);
@Description Define FM behavior on catastrophic error.
Calling this routine changes the FM behavior on catastrophic
error in the internal driver data base from its default
- [e_FM_CATASTROPHIC_ERR_STALL_PORT].
+ [DEFAULT_catastrophicErr].
@Param[in] h_Fm A handle to an FM Module.
@Param[in] catastrophicErr The selected new choice.
@@ -953,7 +954,7 @@ t_Error FM_ConfigEnableIramTestMode(t_Handle h_Fm);
@Description Define FM behavior on external halt activation.
Calling this routine changes the FM behavior on external halt
activation in the internal driver data base from its default
- [FALSE].
+ [DEFAULT_haltOnExternalActivation].
@Param[in] h_Fm A handle to an FM Module.
@Param[in] enable TRUE to enable halt on external halt
@@ -973,7 +974,7 @@ t_Error FM_ConfigHaltOnExternalActivation(t_Handle h_Fm, bool enable);
@Description Define FM behavior on external halt activation.
Calling this routine changes the FM behavior on unrecoverable
ECC error in the internal driver data base from its default
- [FALSE].
+ [DEFAULT_haltOnUnrecoverableEccError].
This routine is only avaiable on old FM revisions (FMan v2).
@Param[in] h_Fm A handle to an FM Module.
@@ -1011,7 +1012,7 @@ t_Error FM_ConfigException(t_Handle h_Fm, e_FmExceptions exception, bool enable)
@Description Select external ECC enabling.
Calling this routine changes the ECC enabling control in the internal
- driver data base from its default [FALSE].
+ driver data base from its default [DEFAULT_externalEccRamsEnable].
When this option is enabled Rams ECC enabling is not effected
by FM_EnableRamsEcc/FM_DisableRamsEcc, but by a JTAG.
@@ -1030,9 +1031,9 @@ t_Error FM_ConfigExternalEccRamsEnable(t_Handle h_Fm, bool enable);
@Function FM_ConfigTnumAgingPeriod
@Description Define Tnum aging period.
- Calling this routine changes the Tnum aging of dequeue TNUM's
+ Calling this routine changes the Tnum aging of dequeue TNUMs
in the QMI in the internal driver data base from its default
- [0].
+ [DEFAULT_tnumAgingPeriod].
@Param[in] h_Fm A handle to an FM Module.
@Param[in] tnumAgingPeriod Tnum Aging Period in microseconds.
@@ -1045,6 +1046,8 @@ t_Error FM_ConfigExternalEccRamsEnable(t_Handle h_Fm, bool enable);
@Cautions Allowed only following FM_Config() and before FM_Init().
This routine should NOT be called from guest-partition
(i.e. guestId != NCSW_MASTER_ID)
+ NOTE that if some MAC is configured for PFC, '0' value is NOT
+ allowed.
*//***************************************************************************/
t_Error FM_ConfigTnumAgingPeriod(t_Handle h_Fm, uint16_t tnumAgingPeriod);
@@ -1073,15 +1076,15 @@ t_Error FM_ConfigDmaEmergencySmoother(t_Handle h_Fm, uint32_t emergencyCnt);
@Description Calling this routine changes the internal driver data base
from its default FM threshold configuration:
- dispLimit: [0]
- prsDispTh: [16]
- plcrDispTh: [16]
- kgDispTh: [16]
- bmiDispTh: [16]
- qmiEnqDispTh: [16]
- qmiDeqDispTh: [16]
- fmCtl1DispTh: [16]
- fmCtl2DispTh: [16]
+ dispLimit: [DEFAULT_dispLimit]
+ prsDispTh: [DEFAULT_prsDispTh]
+ plcrDispTh: [DEFAULT_plcrDispTh]
+ kgDispTh: [DEFAULT_kgDispTh]
+ bmiDispTh: [DEFAULT_bmiDispTh]
+ qmiEnqDispTh: [DEFAULT_qmiEnqDispTh]
+ qmiDeqDispTh: [DEFAULT_qmiDeqDispTh]
+ fmCtl1DispTh: [DEFAULT_fmCtl1DispTh]
+ fmCtl2DispTh: [DEFAULT_fmCtl2DispTh]
@Param[in] h_Fm A handle to an FM Module.
@@ -1099,7 +1102,7 @@ t_Error FM_ConfigThresholds(t_Handle h_Fm, t_FmThresholds *p_FmThresholds);
@Function FM_ConfigDmaSosEmergencyThreshold
@Description Calling this routine changes the internal driver data base
- from its default dma SOS emergency configuration [0]
+ from its default dma SOS emergency configuration [DEFAULT_dmaSosEmergency]
@Param[in] h_Fm A handle to an FM Module.
@Param[in] dmaSosEmergency The selected new value.
@@ -1117,8 +1120,8 @@ t_Error FM_ConfigDmaSosEmergencyThreshold(t_Handle h_Fm, uint32_t dmaSosEmergenc
@Description Calling this routine changes the internal driver data base
from its default configuration of DMA write buffer threshold
- assertEmergency: [DMA_THRESH_MAX_BUF]
- clearEmergency: [DMA_THRESH_MAX_BUF]
+ assertEmergency: [DEFAULT_dmaWriteIntBufLow]
+ clearEmergency: [DEFAULT_dmaWriteIntBufHigh]
This routine is only avaiable on old FM revisions (FMan v2).
@Param[in] h_Fm A handle to an FM Module.
@@ -1139,8 +1142,8 @@ t_Error FM_ConfigDmaWriteBufThresholds(t_Handle h_Fm, t_FmDmaThresholds *p_FmDma
@Description Calling this routine changes the internal driver data base
from its default configuration of DMA command queue threshold
- assertEmergency: [DMA_THRESH_MAX_COMMQ]
- clearEmergency: [DMA_THRESH_MAX_COMMQ]
+ assertEmergency: [DEFAULT_dmaCommQLow]
+ clearEmergency: [DEFAULT_dmaCommQHigh]
@Param[in] h_Fm A handle to an FM Module.
@Param[in] p_FmDmaThresholds A structure of thresholds to define emergency behavior -
@@ -1160,8 +1163,8 @@ t_Error FM_ConfigDmaCommQThresholds(t_Handle h_Fm, t_FmDmaThresholds *p_FmDmaThr
@Description Calling this routine changes the internal driver data base
from its default configuration of DMA read buffer threshold
- assertEmergency: [DMA_THRESH_MAX_BUF]
- clearEmergency: [DMA_THRESH_MAX_BUF]
+ assertEmergency: [DEFAULT_dmaReadIntBufLow]
+ clearEmergency: [DEFAULT_dmaReadIntBufHigh]
This routine is only avaiable on old FM revisions (FMan v2).
@Param[in] h_Fm A handle to an FM Module.
@@ -1182,7 +1185,7 @@ t_Error FM_ConfigDmaReadBufThresholds(t_Handle h_Fm, t_FmDmaThresholds *p_FmDmaT
@Description Calling this routine changes the internal driver data base
from its default watchdog configuration, which is disabled
- [0].
+ [DEFAULT_dmaWatchdog].
@Param[in] h_Fm A handle to an FM Module.
@Param[in] watchDogValue The selected new value - in microseconds.
diff --git a/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_mac_ext.h b/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_mac_ext.h
index 614622e..94b305c 100644
--- a/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_mac_ext.h
+++ b/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_mac_ext.h
@@ -101,6 +101,8 @@ typedef enum e_FmMacExceptions {
,e_FM_MAC_EX_1G_RX_DATA_ERR /**< dTSEC Internal data error on receive */
,e_FM_MAC_EX_1G_1588_TS_RX_ERR /**< dTSEC Time-Stamp Receive Error */
,e_FM_MAC_EX_1G_RX_MIB_CNT_OVFL /**< dTSEC MIB counter overflow */
+ ,e_FM_MAC_EX_TS_FIFO_ECC_ERR /**< mEMAC Time-stamp FIFO ECC error interrupt;
+ not supported on T4240/B4860 rev1 chips */
} e_FmMacExceptions;
/**************************************************************************//**
@@ -211,9 +213,14 @@ typedef struct t_FmMacParams {
uint8_t macId; /**< MAC ID <dTSEC 0-3> <10G-MAC 0> */
e_EnetMode enetMode; /**< Ethernet operation mode (MAC-PHY interface and speed);
Note that the speed should indicate the maximum rate that
- this MAC should support rather than the actuall speed;
+ this MAC should support rather than the actual speed;
i.e. user should use the FM_MAC_AdjustLink() routine to
provide accurate speed;
+ In case of mEMAC RGMII mode, the MAC is configured to RGMII
+ automatic mode, where actual speed/duplex mode information
+ is provided by PHY automatically in-band; FM_MAC_AdjustLink()
+ function should be used to switch to manual RGMII speed/duplex mode
+ configuration if RGMII PHY doesn't support in-band status signaling;
In addition, in mEMAC, in case where user is using the higher MACs
(i.e. the MACs that should support 10G), user should pass here
speed=10000 even if the interface is not allowing that (e.g. SGMII). */
@@ -283,7 +290,7 @@ t_Error FM_MAC_Free(t_Handle h_FmMac);
@Function FM_MAC_ConfigResetOnInit
@Description Tell the driver whether to reset the FM MAC before initialization or
- not. It changes the default configuration [FALSE].
+ not. It changes the default configuration [DEFAULT_resetOnInit].
@Param[in] h_FmMac A handle to a FM MAC Module.
@Param[in] enable When TRUE, FM will be reset before any initialization.
@@ -483,7 +490,7 @@ t_Error FM_MAC_Disable1588TimeStamp(t_Handle h_Fm);
@Function FM_MAC_SetTxAutoPauseFrames
@Description Enable/Disable transmission of Pause-Frames.
- The routine changes the default configuration [0xf000].
+ The routine changes the default configuration [DEFAULT_TX_PAUSE_TIME].
@Param[in] h_FmMac - A handle to a FM MAC Module.
@Param[in] pauseTime - Pause quanta value used with transmitted pause frames.
@@ -503,7 +510,7 @@ t_Error FM_MAC_SetTxAutoPauseFrames(t_Handle h_FmMac,
@Description Enable/Disable transmission of Pause-Frames.
The routine changes the default configuration:
- pause-time - [0xf000]
+ pause-time - [DEFAULT_TX_PAUSE_TIME]
threshold-time - [0]
@Param[in] h_FmMac - A handle to a FM MAC Module.
@@ -521,6 +528,9 @@ t_Error FM_MAC_SetTxAutoPauseFrames(t_Handle h_FmMac,
@Return E_OK on success; Error code otherwise.
@Cautions Allowed only following FM_MAC_Init().
+ In order for PFC to work properly the user must configure
+ TNUM-aging in the tx-port it is recommended that pre-fetch and
+ rate limit in the tx port should be disabled;
PFC is supported only on new mEMAC; i.e. in MACs that don't have
PFC support (10G-MAC and dTSEC), user should use 'FM_MAC_NO_PFC'
in the 'priority' field.
@@ -699,12 +709,16 @@ t_Error FM_MAC_SetPromiscuous(t_Handle h_FmMac, bool enable);
@Function FM_MAC_AdjustLink
@Description Adjusts the Ethernet link with new speed/duplex setup.
- This routine is relevant only for dTSEC.
+ This routine is relevant for dTSEC and mEMAC.
+ In case of mEMAC, this routine is also used for manual
+ re-configuration of RGMII speed and duplex mode for
+ RGMII PHYs not supporting in-band status information
+ to MAC.
@Param[in] h_FmMac - A handle to a FM Module.
@Param[in] speed - Ethernet speed.
- @Param[in] fullDuplex - TRUE for Full-Duplex mode;
- FALSE for Half-Duplex mode.
+ @Param[in] fullDuplex - TRUE for full-duplex mode;
+ FALSE for half-duplex mode.
@Return E_OK on success; Error code otherwise.
*//***************************************************************************/
@@ -713,13 +727,13 @@ t_Error FM_MAC_AdjustLink(t_Handle h_FmMac, e_EnetSpeed speed, bool fullDuplex);
/**************************************************************************//**
@Function FM_MAC_RestartAutoneg
- @Description Restarts the autonegotiation process.
- When autonegegotiation process is invoked under traffic the
- autonegotiation process between the internal TBI PHY and the
- external PHY does not always complete succesfuly. Calling this
- function will restart the autonegotiation process that will end
- succesfuly. It is recomended to call this function after issuing
- autoneg restart command to the Eth Phy.
+ @Description Restarts the auto-negotiation process.
+ When auto-negotiation process is invoked under traffic the
+ auto-negotiation process between the internal SGMII PHY and the
+ external PHY does not always complete successfully. Calling this
+ function will restart the auto-negotiation process that will end
+ successfully. It is recommended to call this function after issuing
+ auto-negotiation restart command to the Eth Phy.
This routine is relevant only for dTSEC.
@Param[in] h_FmMac - A handle to a FM Module.
@@ -807,13 +821,5 @@ t_Error FM_MAC_DumpRegs(t_Handle h_FmMac);
/** @} */ /* end of FM_mac_grp group */
/** @} */ /* end of FM_grp group */
-/**************************************************************************//**
- @Function DtsecRestartTbiAN
-
- @Description Restart TBI autonegotiation for a given Dtsec TBI interface.
-
- @Param[in] h_Dtsec - A handle to the Dtsec.
-*//***************************************************************************/
-void DtsecRestartTbiAN(t_Handle h_Dtsec);
#endif /* __FM_MAC_EXT_H */
diff --git a/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_pcd_ext.h b/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_pcd_ext.h
index f4dfd63..60edfd2 100644
--- a/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_pcd_ext.h
+++ b/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_pcd_ext.h
@@ -66,7 +66,7 @@
and the policer global and common registers.
In addition, the FM PCD SW module will initialize all required
key generator schemes, coarse classification flows, and policer
- profiles. When a FM module is configured to work with one of these
+ profiles. When FM module is configured to work with one of these
entities, it will register to it using the FM PORT API. The PCD
module will manage the PCD resources - i.e. resource management of
KeyGen schemes, etc.
@@ -275,8 +275,6 @@ typedef struct t_FmPcdParams {
*//***************************************************************************/
t_Handle FM_PCD_Config(t_FmPcdParams *p_FmPcdParams);
-t_Handle FM_PCD_GetHcDevH(t_Handle h_FmPcd);
-
/**************************************************************************//**
@Function FM_PCD_Init
@@ -314,7 +312,7 @@ t_Error FM_PCD_Free(t_Handle h_FmPcd);
@Description Calling this routine changes the internal driver data base
from its default selection of exceptions enabling.
- [4].
+ [DEFAULT_numOfSharedPlcrProfiles].
@Param[in] h_FmPcd FM PCD module descriptor.
@Param[in] exception The exception to be selected.
@@ -349,7 +347,7 @@ t_Error FM_PCD_ConfigHcFramesDataMemory(t_Handle h_FmPcd, uint8_t memId);
@Description Calling this routine changes the internal driver data base
from its default selection of exceptions enablement.
- [4].
+ [DEFAULT_numOfSharedPlcrProfiles].
@Param[in] h_FmPcd FM PCD module descriptor.
@Param[in] numOfSharedPlcrProfiles Number of profiles to
@@ -364,7 +362,7 @@ t_Error FM_PCD_ConfigPlcrNumOfSharedProfiles(t_Handle h_FmPcd, uint16_t numOfSha
@Description Calling this routine changes the internal driver data base
from its default selection of exceptions enablement.
- By default auto-refresh is [disabled].
+ By default auto-refresh is [DEFAULT_plcrAutoRefresh].
@Param[in] h_FmPcd FM PCD module descriptor.
@Param[in] enable TRUE to enable, FALSE to disable
@@ -381,7 +379,7 @@ t_Error FM_PCD_ConfigPlcrAutoRefreshMode(t_Handle h_FmPcd, bool enable);
@Description Calling this routine changes the internal data structure for
the maximum parsing time from its default value
- [0].
+ [DEFAULT_MAX_PRS_CYC_LIM].
@Param[in] h_FmPcd FM PCD module descriptor.
@Param[in] value 0 to disable the mechanism, or new
@@ -812,7 +810,6 @@ t_Error FM_PCD_HcDumpRegs(t_Handle h_FmPcd);
#define FM_PCD_MAX_SIZE_OF_KEY 56
#define FM_PCD_MAX_NUM_OF_CC_ENTRIES_IN_GRP 16
#define FM_PCD_LAST_KEY_INDEX 0xffff
-#define FM_PCD_MANIP_DSCP_VALUES 64
#define FM_PCD_MAX_NUM_OF_CC_NODES 255 /* Obsolete, not used - will be removed in the future */
/* @} */
@@ -1342,7 +1339,6 @@ typedef union u_FmPcdHdrProtocolOpt {
NET_HEADER_FIELD_UDP_PORT_SRC
NET_HEADER_FIELD_UDP_PORT_DST
-
HEADER_TYPE_UDP_LITE: - relevant only if FM_CAPWAP_SUPPORT define
NET_HEADER_FIELD_UDP_LITE_PORT_SRC
NET_HEADER_FIELD_UDP_LITE_PORT_DST
@@ -1937,6 +1933,8 @@ typedef struct t_FmPcdHashTableParams {
uint16_t maxNumOfKeys; /**< Maximum Number Of Keys that will (ever) be used in this Hash-table */
e_FmPcdCcStatsMode statisticsMode; /**< If not e_FM_PCD_CC_STATS_MODE_NONE, the required structures for the
requested statistics mode will be allocated according to maxNumOfKeys. */
+ uint8_t kgHashShift; /**< KG-Hash-shift as it was configured in the KG-scheme
+ that leads to this hash-table. */
uint16_t hashResMask; /**< Mask that will be used on the hash-result;
The number-of-sets for this hash will be calculated
as (2^(number of bits set in 'hashResMask'));
@@ -2260,7 +2258,7 @@ typedef struct t_FmPcdManipReassemIpParams {
relativeSchemeId[1] - Relative scheme ID for IPV6 Reassembly manipulation;
NOTE: The following comment is relevant only for FMAN v2 devices:
Relative scheme ID for IPv4/IPv6 Reassembly manipulation must be smaller than
- the user schemes id to ensure that the reassembly's schemes will be first match;
+ the user schemes id to ensure that the reassembly schemes will be first match;
Rest schemes, if defined, should have higher relative scheme ID. */
#if (DPAA_VERSION >= 11)
uint32_t nonConsistentSpFqid; /**< In case that other fragments of the frame corresponds to different storage
@@ -2286,7 +2284,8 @@ typedef struct t_FmPcdManipReassemIpParams {
In the case numOfFramesPerHashEntry == e_FM_PCD_MANIP_EIGHT_WAYS_HASH,
maxNumFramesInProcess has to be in the range of 8 - 2048. */
e_FmPcdManipReassemTimeOutMode timeOutMode; /**< Expiration delay initialized by Reassembly process */
- uint32_t fqidForTimeOutFrames; /**< FQID in which time out frames will enqueue during Time Out Process */
+ uint32_t fqidForTimeOutFrames; /**< FQID in which time out frames will enqueue during Time Out Process;
+ Recommended value for this field is 0; in this way timed-out frames will be discarded */
uint32_t timeoutThresholdForReassmProcess;
/**< Represents the time interval in microseconds which defines
if opened frame (at least one fragment was processed but not all the fragments)is found as too old*/
@@ -2583,6 +2582,10 @@ typedef struct t_FmPcdManipReassemIpStats {
uint32_t externalBufferBusy; /**< Counts the number of times external buffer busy occurred */
uint32_t sgFragments; /**< Counts the number of Scatter/Gather fragments */
uint32_t dmaSemaphoreDepletion; /**< Counts the number of failed attempts to allocate a DMA semaphore */
+#if (DPAA_VERSION >= 11)
+ uint32_t nonConsistentSp; /**< Counts the number of Non Consistent Storage Profile events for
+ successfully reassembled frames */
+#endif /* (DPAA_VERSION >= 11) */
struct {
uint32_t successfullyReassembled; /**< Counts the number of successfully reassembled frames */
uint32_t validFragments; /**< Counts the total number of valid fragments that
@@ -3588,6 +3591,8 @@ t_Handle FM_PCD_StatisticsSetNode(t_Handle h_FmPcd, t_FmPcdStatsParams *p_FmPcds
#define e_FM_PCD_MANIP_ONE_WAYS_HASH e_FM_PCD_MANIP_ONE_WAY_HASH
#define e_FM_PCD_MANIP_TOW_WAYS_HASH e_FM_PCD_MANIP_TWO_WAYS_HASH
+#define e_FM_PCD_MANIP_FRAGMENT_PACKECT e_FM_PCD_MANIP_FRAGMENT_PACKET /* Feb13 */
+
#define FM_PCD_SetNetEnvCharacteristics(_pcd, _params) \
FM_PCD_NetEnvCharacteristicsSet(_pcd, _params)
#define FM_PCD_KgSetScheme(_pcd, _params) FM_PCD_KgSchemeSet(_pcd, _params)
diff --git a/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_port_ext.h b/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_port_ext.h
index afa2cd9..89fabbc 100644
--- a/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_port_ext.h
+++ b/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_port_ext.h
@@ -504,8 +504,8 @@ t_Error FM_PORT_ConfigSizeOfFifo(t_Handle h_FmPort, t_FmPortRsrc *p_SizeOfFifo);
@Description Calling this routine changes the dequeue priority in the
internal driver data base from its default configuration
- 1G: [FALSE]
- 10G: [TRUE]
+ 1G: [DEFAULT_PORT_deqHighPriority_1G]
+ 10G: [DEFAULT_PORT_deqHighPriority_10G]
May be used for Non-Rx ports only
@@ -523,7 +523,7 @@ t_Error FM_PORT_ConfigDeqHighPriority(t_Handle h_FmPort, bool highPri);
@Description Calling this routine changes the dequeue type parameter in the
internal driver data base from its default configuration
- [e_FM_PORT_DEQ_TYPE1].
+ [DEFAULT_PORT_deqType].
May be used for Non-Rx ports only
@@ -541,7 +541,7 @@ t_Error FM_PORT_ConfigDeqType(t_Handle h_FmPort, e_FmPortDeqType deqType);
@Description Calling this routine changes the dequeue prefetch option parameter in the
internal driver data base from its default configuration
- [e_FM_PORT_DEQ_FULL_PREFETCH]
+ [DEFAULT_PORT_deqPrefetchOption]
Note: Available for some chips only
May be used for Non-Rx ports only
@@ -560,8 +560,8 @@ t_Error FM_PORT_ConfigDeqPrefetchOption(t_Handle h_FmPort, e_FmPortDeqPrefetchOp
@Description Calling this routine changes the dequeue byte count parameter in
the internal driver data base from its default configuration
- 1G:[0x400].
- 10G:[0x1400].
+ 1G:[DEFAULT_PORT_deqByteCnt_1G].
+ 10G:[DEFAULT_PORT_deqByteCnt_10G].
May be used for Non-Rx ports only
@@ -587,9 +587,9 @@ t_Error FM_PORT_ConfigDeqByteCnt(t_Handle h_FmPort, uint16_t deqByteCnt);
application buffer, and to offset.
Calling this routine changes the buffer margins definitions
in the internal driver data base from its default
- configuration: Data size: [DEFAULT_FM_SP_bufferPrefixContent_privDataSize]
- Pass Parser result: [DEFAULT_FM_SP_bufferPrefixContent_passPrsResult].
- Pass timestamp: [DEFAULT_FM_SP_bufferPrefixContent_passTimeStamp].
+ configuration: Data size: [DEFAULT_PORT_bufferPrefixContent_privDataSize]
+ Pass Parser result: [DEFAULT_PORT_bufferPrefixContent_passPrsResult].
+ Pass timestamp: [DEFAULT_PORT_bufferPrefixContent_passTimeStamp].
May be used for all ports
@@ -611,7 +611,7 @@ t_Error FM_PORT_ConfigBufferPrefixContent(t_Handle h_FmPort
@Description Calling this routine changes the number of checksum bytes to ignore
parameter in the internal driver data base from its default configuration
- [0]
+ [DEFAULT_PORT_cheksumLastBytesIgnore]
May be used by Tx & Rx ports only
@@ -629,7 +629,7 @@ t_Error FM_PORT_ConfigCheksumLastBytesIgnore(t_Handle h_FmPort, uint8_t cheksumL
@Description Calling this routine changes the number of bytes to cut from a
frame's end parameter in the internal driver data base
- from its default configuration [4]
+ from its default configuration [DEFAULT_PORT_cutBytesFromEnd]
Note that if the result of (frame length before chop - cutBytesFromEnd) is
less than 14 bytes, the chop operation is not executed.
@@ -730,7 +730,7 @@ t_Error FM_PORT_ConfigBackupPools(t_Handle h_FmPort, t_FmBackupBmPools *p_FmPort
@Description Calling this routine changes the error frames destination parameter
in the internal driver data base from its default configuration:
- override = [FALSE]
+ override = [DEFAULT_PORT_frmDiscardOverride]
May be used for Rx and OP ports only
@@ -749,7 +749,7 @@ t_Error FM_PORT_ConfigFrmDiscardOverride(t_Handle h_FmPort, bool override);
@Description Calling this routine changes the behaviour on error parameter
in the internal driver data base from its default configuration:
- [FM_PORT_FRM_ERR_CLS_DISCARD].
+ [DEFAULT_PORT_errorsToDiscard].
If a requested error was previously defined as "ErrorsToEnqueue" it's
definition will change and the frame will be discarded.
Errors that were not defined either as "ErrorsToEnqueue" nor as
@@ -771,7 +771,7 @@ t_Error FM_PORT_ConfigErrorsToDiscard(t_Handle h_FmPort, fmPortFrameErrSelect_t
@Description Calling this routine changes the DMA swap data aparameter
in the internal driver data base from its default
- configuration [DEFAULT_FM_SP_dmaSwapData]
+ configuration [DEFAULT_PORT_dmaSwapData]
May be used for all port types
@@ -789,7 +789,7 @@ t_Error FM_PORT_ConfigDmaSwapData(t_Handle h_FmPort, e_FmDmaSwapOption swapData)
@Description Calling this routine changes the internal context cache
attribute parameter in the internal driver data base
- from its default configuration [DEFAULT_FM_SP_dmaIntContextCacheAttr]
+ from its default configuration [DEFAULT_PORT_dmaIntContextCacheAttr]
May be used for all port types
@@ -807,7 +807,7 @@ t_Error FM_PORT_ConfigDmaIcCacheAttr(t_Handle h_FmPort, e_FmDmaCacheOption intCo
@Description Calling this routine changes the header cache
attribute parameter in the internal driver data base
- from its default configuration [DEFAULT_FM_SP_dmaHeaderCacheAttr]
+ from its default configuration [DEFAULT_PORT_dmaHeaderCacheAttr]
May be used for all port types
@@ -825,7 +825,7 @@ t_Error FM_PORT_ConfigDmaHdrAttr(t_Handle h_FmPort, e_FmDmaCacheOption headerCac
@Description Calling this routine changes the scatter gather cache
attribute parameter in the internal driver data base
- from its default configuration [DEFAULT_FM_SP_dmaScatterGatherCacheAttr]
+ from its default configuration [DEFAULT_PORT_dmaScatterGatherCacheAttr]
May be used for all port types
@@ -843,7 +843,7 @@ t_Error FM_PORT_ConfigDmaScatterGatherAttr(t_Handle h_FmPort, e_FmDmaCacheOption
@Description Calling this routine changes the write optimization
parameter in the internal driver data base
- from its default configuration: By default optimize = [DEFAULT_FM_SP_dmaWriteOptimize].
+ from its default configuration: By default optimize = [DEFAULT_PORT_dmaWriteOptimize].
Note:
1. For head optimization, data alignment must be >= 16 (supported by default).
@@ -852,7 +852,6 @@ t_Error FM_PORT_ConfigDmaScatterGatherAttr(t_Handle h_FmPort, e_FmDmaCacheOption
of the frame payload at the tail as needed to achieve optimal bus transfers, so that the last write
is extended to be on 16/64 bytes aligned block (chip dependent).
-
Relevant for non-Tx port types
@Param[in] h_FmPort A handle to a FM Port module.
@@ -885,7 +884,7 @@ t_Error FM_PORT_ConfigNoScatherGather(t_Handle h_FmPort, bool noScatherGather);
@Description Calling this routine changes the internal default color parameter
in the internal driver data base
- from its default configuration [e_FM_PORT_COLOR_GREEN]
+ from its default configuration [DEFAULT_PORT_color]
May be used for all port types
@@ -903,7 +902,7 @@ t_Error FM_PORT_ConfigDfltColor(t_Handle h_FmPort, e_FmPortColor color);
@Description Calling this routine changes the synchronization attribute parameter
in the internal driver data base from its default configuration:
- syncReq = [TRUE]
+ syncReq = [DEFAULT_PORT_syncReq]
May be used for all port types
@@ -922,7 +921,7 @@ t_Error FM_PORT_ConfigSyncReq(t_Handle h_FmPort, bool syncReq);
@Description This routine is relevant for Rx ports that are routed to OP port.
It changes the internal context reuse option in the internal
driver data base from its default configuration:
- reuse = [FALSE]
+ reuse = [DEFAULT_PORT_forwardIntContextReuse]
May be used for Rx ports only
@@ -988,7 +987,7 @@ t_Error FM_PORT_ConfigIMMaxRxBufLength(t_Handle h_FmPort, uint16_t newVal);
@Function FM_PORT_ConfigIMRxBdRingLength
@Description Changes the receive BD ring length from its default
- configuration:[128]
+ configuration:[DEFAULT_PORT_rxBdRingLength]
@Param[in] h_FmPort A handle to a FM Port module.
@Param[in] newVal The desired BD ring length.
@@ -1004,7 +1003,7 @@ t_Error FM_PORT_ConfigIMRxBdRingLength(t_Handle h_FmPort, uint16_t newVal);
@Function FM_PORT_ConfigIMTxBdRingLength
@Description Changes the transmit BD ring length from its default
- configuration:[16]
+ configuration:[DEFAULT_PORT_txBdRingLength]
@Param[in] h_FmPort A handle to a FM Port module.
@Param[in] newVal The desired BD ring length.
@@ -1023,7 +1022,7 @@ t_Error FM_PORT_ConfigIMTxBdRingLength(t_Handle h_FmPort, uint16_t newVal);
data structures (e.g. BD rings).
Calling this routine changes the internal driver data base
from its default configuration
- [0, MEMORY_ATTR_CACHEABLE].
+ [DEFAULT_PORT_ImfwExtStructsMemId, DEFAULT_PORT_ImfwExtStructsMemAttr].
@Param[in] h_FmPort A handle to a FM Port module.
@Param[in] memId Memory partition ID.
@@ -1053,7 +1052,7 @@ t_Error FM_PORT_ConfigIMPolling(t_Handle h_FmPort);
@Function FM_PORT_ConfigMaxFrameLength
@Description Changes the definition of the max size of frame that should be
- transmitted/received on this port from its default value [9600].
+ transmitted/received on this port from its default value [DEFAULT_PORT_maxFrameLength].
This parameter is used for confirmation of the minimum Fifo
size calculations and only for Tx ports or ports working in
independent mode. This should be larger than the maximum possible
@@ -1074,7 +1073,7 @@ t_Error FM_PORT_ConfigMaxFrameLength(t_Handle h_FmPort, uint16_t length);
@Description Calling this routine changes the fifo minimum
fill level parameter in the internal driver data base
- from its default configuration [0]
+ from its default configuration [DEFAULT_PORT_txFifoMinFillLevel]
May be used for Tx ports only
@@ -1093,8 +1092,8 @@ t_Error FM_PORT_ConfigTxFifoMinFillLevel(t_Handle h_FmPort, uint32_t minFillLeve
@Description Calling this routine changes the fifo dequeue
pipeline depth parameter in the internal driver data base
- from its default configuration: 1G ports: [1],
- 10G port: [4]
+ from its default configuration: 1G ports: [DEFAULT_PORT_fifoDeqPipelineDepth_1G],
+ 10G port: [DEFAULT_PORT_fifoDeqPipelineDepth_10G]
May be used for Tx ports only
@@ -1112,7 +1111,7 @@ t_Error FM_PORT_ConfigFifoDeqPipelineDepth(t_Handle h_FmPort, uint8_t deqPipelin
@Description Calling this routine changes the fifo low comfort level
parameter in internal driver data base
- from its default configuration [5]
+ from its default configuration [DEFAULT_PORT_txFifoLowComfLevel]
May be used for Tx ports only
@@ -1130,7 +1129,7 @@ t_Error FM_PORT_ConfigTxFifoLowComfLevel(t_Handle h_FmPort, uint32_t fifoLowComf
@Description Calling this routine changes the threshold of the FIFO
fill level parameter in the internal driver data base
- from its default configuration [BMI_MAX_FIFO_SIZE]
+ from its default configuration [DEFAULT_PORT_rxFifoThreshold]
If the total number of buffers which are
currently in use and associated with the
@@ -1154,7 +1153,7 @@ t_Error FM_PORT_ConfigRxFifoThreshold(t_Handle h_FmPort, uint32_t fifoThreshold)
@Description Calling this routine changes the priority elevation level
parameter in the internal driver data base from its default
- configuration [BMI_MAX_FIFO_SIZE]
+ configuration [DEFAULT_PORT_rxFifoPriElevationLevel]
If the total number of buffers which are currently in use and
associated with the specific RX port exceed the amount specified
@@ -1427,6 +1426,8 @@ t_Error FM_PORT_Enable(t_Handle h_FmPort);
@Return E_OK on success; Error code otherwise.
@Cautions Allowed only following FM_PORT_Init().
+ If rate limit is set on a port that need to send PFC frames,
+ it might violate the stop transmit timing.
*//***************************************************************************/
t_Error FM_PORT_SetRateLimit(t_Handle h_FmPort, t_FmPortRateLimit *p_RateLimit);
@@ -1447,6 +1448,24 @@ t_Error FM_PORT_SetRateLimit(t_Handle h_FmPort, t_FmPortRateLimit *p_RateLimit);
t_Error FM_PORT_DeleteRateLimit(t_Handle h_FmPort);
/**************************************************************************//**
+ @Function FM_PORT_SetPfcPrioritiesMappingToQmanWQ
+
+ @Description Calling this routine maps each PFC received priority to the transmit WQ.
+ This WQ will be blocked upon receiving a PFC frame with this priority.
+
+ May be used for Tx ports only.
+
+ @Param[in] h_FmPort A handle to a FM Port module.
+ @Param[in] prio PFC priority (0-7).
+ @Param[in] wq Work Queue (0-7).
+
+ @Return E_OK on success; Error code otherwise.
+
+ @Cautions Allowed only following FM_PORT_Init().
+*//***************************************************************************/
+t_Error FM_PORT_SetPfcPrioritiesMappingToQmanWQ(t_Handle h_FmPort, uint8_t prio, uint8_t wq);
+
+/**************************************************************************//**
@Function FM_PORT_SetStatisticsCounters
@Description Calling this routine enables/disables port's statistics counters.
@@ -1926,7 +1945,7 @@ typedef struct t_FmPcdPrsStart {
@Description struct for defining external buffer margins
*//***************************************************************************/
typedef struct t_FmPortVSPAllocParams {
- uint8_t numOfProfiles; /**< Number of Virtual Storage Profiles */
+ uint8_t numOfProfiles; /**< Number of Virtual Storage Profiles; must be a power of 2 */
uint8_t dfltRelativeId; /**< The default Virtual-Storage-Profile-id dedicated to Rx/OP port
The same default Virtual-Storage-Profile-id will be for coupled Tx port
if relevant function called for Rx port */
@@ -2053,7 +2072,7 @@ t_Error FM_PORT_PcdPlcrFreeProfiles(t_Handle h_FmPort);
@Return E_OK on success; Error code otherwise.
@Cautions Allowed only following FM_PORT_Init(), and before FM_PORT_SetPCD()
- and also before FM_PORT_Enable() (i.e. the port should be disabled).
+ and also before FM_PORT_Enable(); i.e. the port should be disabled.
*//***************************************************************************/
t_Error FM_PORT_VSPAlloc(t_Handle h_FmPort, t_FmPortVSPAllocParams *p_Params);
#endif /* (DPAA_VERSION >= 11) */
diff --git a/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_rtc_ext.h b/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_rtc_ext.h
index c8fa262..315405c 100644
--- a/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_rtc_ext.h
+++ b/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_rtc_ext.h
@@ -45,7 +45,7 @@
#include "error_ext.h"
#include "std_ext.h"
-
+#include "fsl_fman_rtc.h"
/**************************************************************************//**
@@ -77,8 +77,8 @@
*//***************************************************************************/
typedef enum e_FmRtcAlarmPolarity
{
- e_FM_RTC_ALARM_POLARITY_ACTIVE_HIGH, /**< Active-high output polarity */
- e_FM_RTC_ALARM_POLARITY_ACTIVE_LOW /**< Active-low output polarity */
+ e_FM_RTC_ALARM_POLARITY_ACTIVE_HIGH = E_FMAN_RTC_ALARM_POLARITY_ACTIVE_HIGH, /**< Active-high output polarity */
+ e_FM_RTC_ALARM_POLARITY_ACTIVE_LOW = E_FMAN_RTC_ALARM_POLARITY_ACTIVE_LOW /**< Active-low output polarity */
} e_FmRtcAlarmPolarity;
/**************************************************************************//**
@@ -86,8 +86,8 @@ typedef enum e_FmRtcAlarmPolarity
*//***************************************************************************/
typedef enum e_FmRtcTriggerPolarity
{
- e_FM_RTC_TRIGGER_ON_RISING_EDGE, /**< Trigger on rising edge */
- e_FM_RTC_TRIGGER_ON_FALLING_EDGE /**< Trigger on falling edge */
+ e_FM_RTC_TRIGGER_ON_RISING_EDGE = E_FMAN_RTC_TRIGGER_ON_RISING_EDGE, /**< Trigger on rising edge */
+ e_FM_RTC_TRIGGER_ON_FALLING_EDGE = E_FMAN_RTC_TRIGGER_ON_FALLING_EDGE /**< Trigger on falling edge */
} e_FmRtcTriggerPolarity;
/**************************************************************************//**
@@ -95,9 +95,9 @@ typedef enum e_FmRtcTriggerPolarity
*//***************************************************************************/
typedef enum e_FmSrcClock
{
- e_FM_RTC_SOURCE_CLOCK_EXTERNAL, /**< external high precision timer reference clock */
- e_FM_RTC_SOURCE_CLOCK_SYSTEM, /**< MAC system clock */
- e_FM_RTC_SOURCE_CLOCK_OSCILATOR /**< RTC clock oscilator */
+ e_FM_RTC_SOURCE_CLOCK_EXTERNAL = E_FMAN_RTC_SOURCE_CLOCK_EXTERNAL, /**< external high precision timer reference clock */
+ e_FM_RTC_SOURCE_CLOCK_SYSTEM = E_FMAN_RTC_SOURCE_CLOCK_SYSTEM, /**< MAC system clock */
+ e_FM_RTC_SOURCE_CLOCK_OSCILATOR = E_FMAN_RTC_SOURCE_CLOCK_OSCILATOR /**< RTC clock oscilator */
}e_FmSrcClk;
/**************************************************************************//**
@@ -170,7 +170,7 @@ t_Error FM_RTC_Free(t_Handle h_FmRtc);
@Function FM_RTC_ConfigPeriod
@Description Configures the period of the timestamp if different than
- default [1000].
+ default [DEFAULT_clockPeriod].
@Param[in] h_FmRtc - Handle to FM RTC object.
@Param[in] period - Period in nano-seconds.
@@ -202,7 +202,7 @@ t_Error FM_RTC_ConfigSourceClock(t_Handle h_FmRtc,
@Function FM_RTC_ConfigPulseRealignment
@Description Configures the RTC to automatic FIPER pulse realignment in
- response to timer adjustments [FALSE]
+ response to timer adjustments [DEFAULT_pulseRealign]
In this mode, the RTC clock is identical to the source clock.
This feature can be useful when the system contains an external
@@ -221,7 +221,7 @@ t_Error FM_RTC_ConfigPulseRealignment(t_Handle h_FmRtc, bool enable);
@Function FM_RTC_ConfigFrequencyBypass
@Description Configures the RTC to bypass the frequency compensation
- mechanism. [FALSE]
+ mechanism. [DEFAULT_bypass]
In this mode, the RTC clock is identical to the source clock.
This feature can be useful when the system contains an external
@@ -241,7 +241,7 @@ t_Error FM_RTC_ConfigFrequencyBypass(t_Handle h_FmRtc, bool enabled);
@Function FM_RTC_ConfigInvertedInputClockPhase
@Description Configures the RTC to invert the source clock phase on input.
- [FALSE]
+ [DEFAULT_invertInputClkPhase]
@Param[in] h_FmRtc - Handle to FM RTC object.
@Param[in] inverted - TRUE to invert the source clock phase on input.
@@ -257,7 +257,7 @@ t_Error FM_RTC_ConfigInvertedInputClockPhase(t_Handle h_FmRtc, bool inverted);
@Function FM_RTC_ConfigInvertedOutputClockPhase
@Description Configures the RTC to invert the output clock phase.
- [FALSE]
+ [DEFAULT_invertOutputClkPhase]
@Param[in] h_FmRtc - Handle to FM RTC object.
@Param[in] inverted - TRUE to invert the output clock phase.
@@ -273,7 +273,7 @@ t_Error FM_RTC_ConfigInvertedOutputClockPhase(t_Handle h_FmRtc, bool inverted);
@Function FM_RTC_ConfigOutputClockDivisor
@Description Configures the divisor for generating the output clock from
- the RTC clock. [0x00000002]
+ the RTC clock. [DEFAULT_outputClockDivisor]
@Param[in] h_FmRtc - Handle to FM RTC object.
@Param[in] divisor - Divisor for generation of the output clock.
@@ -288,7 +288,7 @@ t_Error FM_RTC_ConfigOutputClockDivisor(t_Handle h_FmRtc, uint16_t divisor);
@Function FM_RTC_ConfigAlarmPolarity
@Description Configures the polarity (active-high/active-low) of a specific
- alarm signal. [e_FM_RTC_ALARM_POLARITY_ACTIVE_HIGH]
+ alarm signal. [DEFAULT_alarmPolarity]
@Param[in] h_FmRtc - Handle to FM RTC object.
@Param[in] alarmId - Alarm ID.
@@ -306,7 +306,7 @@ t_Error FM_RTC_ConfigAlarmPolarity(t_Handle h_FmRtc,
@Function FM_RTC_ConfigExternalTriggerPolarity
@Description Configures the polarity (rising/falling edge) of a specific
- external trigger signal. [e_FM_RTC_TRIGGER_ON_FALLING_EDGE]
+ external trigger signal. [DEFAULT_triggerPolarity]
@Param[in] h_FmRtc - Handle to FM RTC object.
@Param[in] triggerId - Trigger ID.
diff --git a/drivers/net/ethernet/freescale/fman/inc/core_ext.h b/drivers/net/ethernet/freescale/fman/inc/core_ext.h
index 9cd5669..42174cf 100644
--- a/drivers/net/ethernet/freescale/fman/inc/core_ext.h
+++ b/drivers/net/ethernet/freescale/fman/inc/core_ext.h
@@ -83,3 +83,4 @@ void CORE_MemoryBarrier(void);
#define fsl_mem_core_barrier() CORE_MemoryBarrier()
#endif /* __CORE_EXT_H */
+
diff --git a/drivers/net/ethernet/freescale/fman/inc/cores/e500v2_ext.h b/drivers/net/ethernet/freescale/fman/inc/cores/e500v2_ext.h
index 099c7b9..e79b1dd 100644
--- a/drivers/net/ethernet/freescale/fman/inc/cores/e500v2_ext.h
+++ b/drivers/net/ethernet/freescale/fman/inc/cores/e500v2_ext.h
@@ -59,6 +59,8 @@ void L1DCache_Disable(void);
void L1ICache_Disable(void);
void L1DCache_Flush(void);
void L1ICache_Flush(void);
+uint32_t L1ICache_IsEnabled(void);
+uint32_t L1DCache_IsEnabled(void);
/*
*
*/
diff --git a/drivers/net/ethernet/freescale/fman/inc/debug_ext.h b/drivers/net/ethernet/freescale/fman/inc/debug_ext.h
index 00ae748..62865bb 100644
--- a/drivers/net/ethernet/freescale/fman/inc/debug_ext.h
+++ b/drivers/net/ethernet/freescale/fman/inc/debug_ext.h
@@ -263,3 +263,4 @@
#endif /* __DEBUG_EXT_H */
+
diff --git a/drivers/net/ethernet/freescale/fman/inc/endian_ext.h b/drivers/net/ethernet/freescale/fman/inc/endian_ext.h
index 252f89b..5cdec66 100644
--- a/drivers/net/ethernet/freescale/fman/inc/endian_ext.h
+++ b/drivers/net/ethernet/freescale/fman/inc/endian_ext.h
@@ -444,3 +444,4 @@ static __inline__ void SwapUint64P(uint64_t *p_Val)
#endif /* __ENDIAN_EXT_H */
+
diff --git a/drivers/net/ethernet/freescale/fman/inc/error_ext.h b/drivers/net/ethernet/freescale/fman/inc/error_ext.h
index bbd6743..71f9398 100644
--- a/drivers/net/ethernet/freescale/fman/inc/error_ext.h
+++ b/drivers/net/ethernet/freescale/fman/inc/error_ext.h
@@ -525,3 +525,5 @@ char * ErrTypeStrings (e_ErrorType err);
/** @} */ /* end of General Utils group */
#endif /* __ERROR_EXT_H */
+
+
diff --git a/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman.h b/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman.h
new file mode 100755
index 0000000..795f6b2
--- /dev/null
+++ b/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman.h
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2013 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __FSL_FMAN_H
+#define __FSL_FMAN_H
+
+#include "common/general.h"
+
+
+struct fman_ext_pool_params {
+ uint8_t id; /**< External buffer pool id */
+ uint16_t size; /**< External buffer pool buffer size */
+};
+
+struct fman_ext_pools {
+ uint8_t num_pools_used; /**< Number of pools use by this port */
+ struct fman_ext_pool_params *ext_buf_pool;
+ /**< Parameters for each port */
+};
+
+struct fman_backup_bm_pools {
+ uint8_t num_backup_pools; /**< Number of BM backup pools -
+ must be smaller than the total number
+ of pools defined for the specified
+ port.*/
+ uint8_t *pool_ids; /**< numOfBackupPools pool id's,
+ specifying which pools should be used
+ only as backup. Pool id's specified
+ here must be a subset of the pools
+ used by the specified port.*/
+};
+
+/**************************************************************************//**
+ @Description A structure for defining BM pool depletion criteria
+*//***************************************************************************/
+struct fman_buf_pool_depletion {
+ bool buf_pool_depletion_enabled;
+ bool pools_grp_mode_enable; /**< select mode in which pause frames
+ will be sent after a number of pools
+ (all together!) are depleted */
+ uint8_t num_pools; /**< the number of depleted pools that
+ will invoke pause frames transmission.
+ */
+ bool *pools_to_consider; /**< For each pool, TRUE if it should be
+ considered for depletion (Note - this
+ pool must be used by this port!). */
+ bool single_pool_mode_enable; /**< select mode in which pause frames
+ will be sent after a single-pool
+ is depleted; */
+ bool *pools_to_consider_for_single_mode;
+ /**< For each pool, TRUE if it should be
+ considered for depletion (Note - this
+ pool must be used by this port!) */
+ bool has_pfc_priorities;
+ bool *pfc_priorities_en; /**< This field is used by the MAC as
+ the Priority Enable Vector in the PFC
+ frame which is transmitted */
+};
+
+/**************************************************************************//**
+ @Description Enum for defining port DMA swap mode
+*//***************************************************************************/
+enum fman_dma_swap_option {
+ FMAN_DMA_NO_SWP, /**< No swap, transfer data as is.*/
+ FMAN_DMA_SWP_PPC_LE, /**< The transferred data should be swapped
+ in PowerPc Little Endian mode. */
+ FMAN_DMA_SWP_BE /**< The transferred data should be swapped
+ in Big Endian mode */
+};
+
+/**************************************************************************//**
+ @Description Enum for defining port DMA cache attributes
+*//***************************************************************************/
+enum fman_dma_cache_option {
+ FMAN_DMA_NO_STASH = 0, /**< Cacheable, no Allocate (No Stashing) */
+ FMAN_DMA_STASH = 1 /**< Cacheable and Allocate (Stashing on) */
+};
+
+/* sizes */
+#define CAPWAP_FRAG_EXTRA_SPACE 32
+#define OFFSET_UNITS 16
+#define MAX_INT_OFFSET 240
+#define MAX_IC_SIZE 256
+#define MAX_EXT_OFFSET 496
+#define MAX_EXT_BUFFER_OFFSET 511
+
+
+#endif /* __FSL_FMAN_H */
diff --git a/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_dtsec.h b/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_dtsec.h
index 55527c1..445e73c8 100644
--- a/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_dtsec.h
+++ b/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_dtsec.h
@@ -41,19 +41,19 @@
*
* To prepare dTSEC block for transfer use the following call sequence:
*
- * - dtsec_defconfig() - This step is optional and yet recommended. Its use is
+ * - fman_dtsec_defconfig() - This step is optional and yet recommended. Its use is
* to obtain the default dTSEC configuration parameters.
*
* - Change dtsec configuration in &dtsec_cfg. This structure will be used
* to customize the dTSEC behavior.
*
- * - dtsec_init() - Applies the configuration on dTSEC hardware. Note that
+ * - fman_dtsec_init() - Applies the configuration on dTSEC hardware. Note that
* dTSEC is initialized while both Tx and Rx are disabled.
*
- * - dtsec_set_mac_address() - Set the station address (mac address).
+ * - fman_dtsec_set_mac_address() - Set the station address (mac address).
* This is used by dTSEC to match against received packets.
*
- * - dtsec_adjust_link() - Set the link speed and duplex parameters
+ * - fman_dtsec_adjust_link() - Set the link speed and duplex parameters
* after the PHY establishes the link.
*
* - dtsec_enable_tx() and dtsec_enable_rx() to enable transmission and
@@ -63,15 +63,15 @@
/**
* DOC: dTSEC Graceful stop
*
- * To temporary stop dTSEC activity use dtsec_stop_tx() and dtsec_stop_rx().
+ * To temporary stop dTSEC activity use fman_dtsec_stop_tx() and fman_dtsec_stop_rx().
* Note that these functions request dTSEC graceful stop but return before this
* stop is complete. To query for graceful stop completion use
- * dtsec_get_event() and check DTSEC_IEVENT_GTSC and DTSEC_IEVENT_GRSC bits.
+ * fman_dtsec_get_event() and check DTSEC_IEVENT_GTSC and DTSEC_IEVENT_GRSC bits.
* Alternatively the dTSEC interrupt mask can be set to enable graceful stop
* interrupts.
*
- * To resume operation after graceful stop use dtsec_start_tx() and
- * dtsec_start_rx().
+ * To resume operation after graceful stop use fman_dtsec_start_tx() and
+ * fman_dtsec_start_rx().
*/
/**
@@ -93,10 +93,10 @@
* occurs and its corresponding enable bit is set in the interrupt mask
* register, the event also causes a hardware interrupt at the PIC.
*
- * To poll for event status use the dtsec_get_event() function.
- * To configure the interrupt mask use dtsec_enable_interrupt() and
- * dtsec_disable_interrupt() functions.
- * After servicing a dTSEC interrupt use dtsec_ack_event to reset the serviced
+ * To poll for event status use the fman_dtsec_get_event() function.
+ * To configure the interrupt mask use fman_dtsec_enable_interrupt() and
+ * fman_dtsec_disable_interrupt() functions.
+ * After servicing a dTSEC interrupt use fman_dtsec_ack_event to reset the serviced
* event bit.
*
* The following events may be signaled by dTSEC hardware:
@@ -107,7 +107,7 @@
*
* %DTSEC_IEVENT_RXC - Receive control (pause frame) interrupt. A pause
* control frame was received while Rx pause frame handling is enabled.
- * Also see dtsec_handle_rx_pause().
+ * Also see fman_dtsec_handle_rx_pause().
*
* %DTSEC_IEVENT_MSRO - MIB counter overflow. The count for one of the MIB
* counters has exceeded the size of its register.
@@ -115,7 +115,7 @@
* %DTSEC_IEVENT_GTSC - Graceful transmit stop complete. Graceful stop is now
* complete. The transmitter is in a stopped state, in which only pause frames
* can be transmitted.
- * Also see dtsec_stop_tx().
+ * Also see fman_dtsec_stop_tx().
*
* %DTSEC_IEVENT_BABT - Babbling transmit error. The transmitted frame length
* has exceeded the value in the MAC's Maximum Frame Length register.
@@ -139,7 +139,7 @@
* being transmitted and transmission of the next frame commences. This only
* occurs while in half-duplex mode.
* The number of retransmit attempts can be set in
- * &dtsec_halfdup_cfg.@retransmit before calling dtsec_init().
+ * &dtsec_halfdup_cfg.@retransmit before calling fman_dtsec_init().
*
* %DTSEC_IEVENT_XFUN - Transmit FIFO underrun. This bit indicates that the
* transmit FIFO became empty before the complete frame was transmitted.
@@ -654,7 +654,7 @@ enum dtsec_stat_counters {
* Ethernet frames and passed up to the packet interface on
* a DA match. Received pause control frames are passed to
* the packet interface only if Rx flow control is also
- * disabled. See dtsec_handle_rx_pause() function.
+ * disabled. See fman_dtsec_handle_rx_pause() function.
* @tx_pause_time: Transmit pause time value. This pause value is used as
* part of the pause frame to be sent when a transmit pause
* frame is initiated. If set to 0 this disables
@@ -679,8 +679,8 @@ enum dtsec_stat_counters {
* precedes the layer 2 header.
*
* This structure contains basic dTSEC configuration and must be passed to
- * dtsec_init() function. A default set of configuration values can be obtained
- * by calling dtsec_defconfig().
+ * fman_dtsec_init() function. A default set of configuration values can be obtained
+ * by calling fman_dtsec_defconfig().
*/
struct dtsec_cfg {
bool halfdup_on;
@@ -723,17 +723,17 @@ struct dtsec_cfg {
/**
- * dtsec_defconfig() - Get default dTSEC configuration
+ * fman_dtsec_defconfig() - Get default dTSEC configuration
* @cfg: pointer to configuration structure.
*
* Call this function to obtain a default set of configuration values for
* initializing dTSEC. The user can overwrite any of the values before calling
- * dtsec_init(), if specific configuration needs to be applied.
+ * fman_dtsec_init(), if specific configuration needs to be applied.
*/
-void dtsec_defconfig(struct dtsec_cfg *cfg);
+void fman_dtsec_defconfig(struct dtsec_cfg *cfg);
/**
- * dtsec_init() - Init dTSEC hardware block
+ * fman_dtsec_init() - Init dTSEC hardware block
* @regs: Pointer to dTSEC register block
* @cfg: dTSEC configuration data
* @iface_mode: dTSEC interface mode, the type of MAC - PHY interface.
@@ -747,60 +747,98 @@ void dtsec_defconfig(struct dtsec_cfg *cfg);
*
* dTSEC initialization sequence:
* Before enabling Rx/Tx call dtsec_set_address() to set MAC address,
- * dtsec_adjust_link() to configure interface speed and duplex and finally
+ * fman_dtsec_adjust_link() to configure interface speed and duplex and finally
* dtsec_enable_tx()/dtsec_enable_rx() to start transmission and reception.
*
* Returns: 0 if successful, an error code otherwise.
*/
-int dtsec_init(struct dtsec_regs *regs, struct dtsec_cfg *cfg,
- enum enet_interface iface_mode,
- enum enet_speed iface_speed,
- uint8_t *macaddr, uint8_t fm_rev_maj,
- uint8_t fm_rev_min,
- uint32_t exception_mask);
+int fman_dtsec_init(struct dtsec_regs *regs, struct dtsec_cfg *cfg,
+ enum enet_interface iface_mode,
+ enum enet_speed iface_speed,
+ uint8_t *macaddr, uint8_t fm_rev_maj,
+ uint8_t fm_rev_min,
+ uint32_t exception_mask);
/**
- * dtsec_get_revision() - Get dTSEC hardware revision
+ * fman_dtsec_enable() - Enable dTSEC Tx and Tx
+ * @regs: Pointer to dTSEC register block
+ * @apply_rx: enable rx side
+ * @apply_tx: enable tx side
+ *
+ * This function resets Tx and Rx graceful stop bit and enables dTSEC Tx and Rx.
+ */
+void fman_dtsec_enable(struct dtsec_regs *regs, bool apply_rx, bool apply_tx);
+
+/**
+ * fman_dtsec_disable() - Disable dTSEC Tx and Rx
+ * @regs: Pointer to dTSEC register block
+ * @apply_rx: disable rx side
+ * @apply_tx: disable tx side
+ *
+ * This function disables Tx and Rx in dTSEC.
+ */
+void fman_dtsec_disable(struct dtsec_regs *regs, bool apply_rx, bool apply_tx);
+
+/**
+ * fman_dtsec_get_revision() - Get dTSEC hardware revision
* @regs: Pointer to dTSEC register block
*
* Returns dtsec_id content
*
* Call this function to obtain the dTSEC hardware version.
*/
-uint32_t dtsec_get_revision(struct dtsec_regs *regs);
+uint32_t fman_dtsec_get_revision(struct dtsec_regs *regs);
/**
- * dtsec_set_uc_promisc() - Sets unicast promiscuous mode
+ * fman_dtsec_set_mac_address() - Set MAC station address
+ * @regs: Pointer to dTSEC register block
+ * @macaddr: MAC address array
+ *
+ * This function sets MAC station address. To enable unicast reception call
+ * this after fman_dtsec_init(). While promiscuous mode is disabled dTSEC will match
+ * the destination address of received unicast frames against this address.
+ */
+void fman_dtsec_set_mac_address(struct dtsec_regs *regs, uint8_t *macaddr);
+
+/**
+ * fman_dtsec_get_mac_address() - Query MAC station address
+ * @regs: Pointer to dTSEC register block
+ * @macaddr: MAC address array
+ */
+void fman_dtsec_get_mac_address(struct dtsec_regs *regs, uint8_t *macaddr);
+
+/**
+ * fman_dtsec_set_uc_promisc() - Sets unicast promiscuous mode
* @regs: Pointer to dTSEC register block
* @enable: Enable unicast promiscuous mode
*
* Use this function to enable/disable dTSEC L2 address filtering. If the
* address filtering is disabled all unicast packets are accepted.
- * To set dTSEC in promiscuous mode call both dtsec_set_uc_promisc() and
- * dtsec_set_mc_promisc() to disable filtering for both unicast and multicast
+ * To set dTSEC in promiscuous mode call both fman_dtsec_set_uc_promisc() and
+ * fman_dtsec_set_mc_promisc() to disable filtering for both unicast and multicast
* addresses.
*/
-void dtsec_set_uc_promisc(struct dtsec_regs *regs, bool enable);
+void fman_dtsec_set_uc_promisc(struct dtsec_regs *regs, bool enable);
/**
- * dtsec_adjust_link() - Adjust dTSEC speed/duplex settings
+ * fman_dtsec_adjust_link() - Adjust dTSEC speed/duplex settings
* @regs: Pointer to dTSEC register block
* @iface_mode: dTSEC interface mode
* @speed: Link speed
* @full_dx: True for full-duplex, false for half-duplex.
*
* This function configures the MAC to function and the desired rates. Use it
- * to configure dTSEC after dtsec_init() and whenever the link speed changes
+ * to configure dTSEC after fman_dtsec_init() and whenever the link speed changes
* (for instance following PHY auto-negociation).
*
* Returns: 0 if successful, an error code otherwise.
*/
-int dtsec_adjust_link(struct dtsec_regs *regs,
- enum enet_interface iface_mode,
- enum enet_speed speed, bool full_dx);
+int fman_dtsec_adjust_link(struct dtsec_regs *regs,
+ enum enet_interface iface_mode,
+ enum enet_speed speed, bool full_dx);
/**
- * dtsec_set_tbi_phy_addr() - Updates TBI address field
+ * fman_dtsec_set_tbi_phy_addr() - Updates TBI address field
* @regs: Pointer to dTSEC register block
* @address: Valid PHY address in the range of 1 to 31. 0 is reserved.
*
@@ -809,70 +847,29 @@ int dtsec_adjust_link(struct dtsec_regs *regs,
*
* Returns: 0 if successful, an error code otherwise.
*/
-int dtsec_set_tbi_phy_addr(struct dtsec_regs *regs,
- uint8_t addr);
+int fman_dtsec_set_tbi_phy_addr(struct dtsec_regs *regs,
+ uint8_t addr);
/**
- * dtsec_disable() - Disable dTSEC Tx and Rx
- * @regs: Pointer to dTSEC register block
- * @apply_rx: disable rx side
- * @apply_tx: disable tx side
- *
- * This function disables Tx and Rx in dTSEC.
- */
-void dtsec_disable(struct dtsec_regs *regs, bool apply_rx, bool apply_tx);
-
-/**
- * dtsec_enable() - Enable dTSEC Tx and Tx
- * @regs: Pointer to dTSEC register block
- * @apply_rx: enable rx side
- * @apply_tx: enable tx side
- *
- * This function resets Tx and Rx graceful stop bit and enables dTSEC Tx and Rx.
- */
-void dtsec_enable(struct dtsec_regs *regs, bool apply_rx, bool apply_tx);
-
-/**
- * dtsec_set_mac_address() - Set MAC station address
- * @regs: Pointer to dTSEC register block
- * @macaddr: MAC address array
- *
- * This function sets MAC station address. To enable unicast reception call
- * this after dtsec_init(). While promiscuous mode is disabled dTSEC will match
- * the destination address of received unicast frames against this address.
- */
-void dtsec_set_mac_address(struct dtsec_regs *regs, uint8_t *macaddr);
-
-/**
- * dtsec_get_mac_address() - Query MAC station address
- * @regs: Pointer to dTSEC register block
- * @macaddr: MAC address array
- */
-void dtsec_get_mac_address(struct dtsec_regs *regs, uint8_t *macaddr);
-
-/**
- * dtsec_set_max_frame_len() - Set max frame length
+ * fman_dtsec_set_max_frame_len() - Set max frame length
* @regs: Pointer to dTSEC register block
* @length: Max frame length.
*
* Sets maximum frame length for received and transmitted frames. Frames that
* exceeds this length are truncated.
*/
-
-void dtsec_set_max_frame_len(struct dtsec_regs *regs, uint16_t length);
-
+void fman_dtsec_set_max_frame_len(struct dtsec_regs *regs, uint16_t length);
/**
- * dtsec_get_max_frame_len() - Query max frame length
+ * fman_dtsec_get_max_frame_len() - Query max frame length
* @regs: Pointer to dTSEC register block
*
* Returns: the current value of the maximum frame length.
*/
-uint16_t dtsec_get_max_frame_len(struct dtsec_regs *regs);
-
+uint16_t fman_dtsec_get_max_frame_len(struct dtsec_regs *regs);
/**
- * dtsec_handle_rx_pause() - Configure pause frame handling
+ * fman_dtsec_handle_rx_pause() - Configure pause frame handling
* @regs: Pointer to dTSEC register block
* @en: Enable pause frame handling in dTSEC
*
@@ -882,20 +879,20 @@ uint16_t dtsec_get_max_frame_len(struct dtsec_regs *regs);
* frames will be transferred to the packet interface just like regular Ethernet
* frames.
*/
-void dtsec_handle_rx_pause(struct dtsec_regs *regs, bool en);
+void fman_dtsec_handle_rx_pause(struct dtsec_regs *regs, bool en);
/**
- * dtsec_set_tx_pause_time() - Configure Tx pause time
+ * fman_dtsec_set_tx_pause_frames() - Configure Tx pause time
* @regs: Pointer to dTSEC register block
* @time: Time value included in pause frames
*
* Call this function to set the time value used in transmitted pause frames.
* If time is 0, transmission of pause frames is disabled
*/
-void dtsec_set_tx_pause_time(struct dtsec_regs *regs, uint16_t time);
+void fman_dtsec_set_tx_pause_frames(struct dtsec_regs *regs, uint16_t time);
/**
- * dtsec_ack_event() - Acknowledge handled events
+ * fman_dtsec_ack_event() - Acknowledge handled events
* @regs: Pointer to dTSEC register block
* @ev_mask: Events to acknowledge
*
@@ -903,10 +900,10 @@ void dtsec_set_tx_pause_time(struct dtsec_regs *regs, uint16_t time);
* call this function to reset the associated status bits in dTSEC event
* register.
*/
-void dtsec_ack_event(struct dtsec_regs *regs, uint32_t ev_mask);
+void fman_dtsec_ack_event(struct dtsec_regs *regs, uint32_t ev_mask);
/**
- * dtsec_get_event() - Returns currently asserted events
+ * fman_dtsec_get_event() - Returns currently asserted events
* @regs: Pointer to dTSEC register block
* @ev_mask: Mask of relevant events
*
@@ -915,9 +912,10 @@ void dtsec_ack_event(struct dtsec_regs *regs, uint32_t ev_mask);
*
* Returns: a bit-mask of events asserted in dTSEC.
*/
-uint32_t dtsec_get_event(struct dtsec_regs *regs, uint32_t ev_mask);
+uint32_t fman_dtsec_get_event(struct dtsec_regs *regs, uint32_t ev_mask);
+
/**
- * dtsec_get_interrupt_mask() - Returns a bit-mask of enabled interrupts
+ * fman_dtsec_get_interrupt_mask() - Returns a bit-mask of enabled interrupts
* @regs: Pointer to dTSEC register block
*
* Call this function to obtain a bit-mask of enabled interrupts
@@ -925,51 +923,51 @@ uint32_t dtsec_get_event(struct dtsec_regs *regs, uint32_t ev_mask);
*
* Returns: a bit-mask of enabled interrupts in dTSEC.
*/
-uint32_t dtsec_get_interrupt_mask(struct dtsec_regs *regs);
+uint32_t fman_dtsec_get_interrupt_mask(struct dtsec_regs *regs);
-void dtsec_clear_addr_in_paddr (struct dtsec_regs *regs,
- uint8_t paddr_num);
+void fman_dtsec_clear_addr_in_paddr(struct dtsec_regs *regs,
+ uint8_t paddr_num);
-void dtsec_add_addr_in_paddr (struct dtsec_regs *regs,
- uint64_t addr,
- uint8_t paddr_num);
+void fman_dtsec_add_addr_in_paddr(struct dtsec_regs *regs,
+ uint64_t addr,
+ uint8_t paddr_num);
-void dtsec_enable_tmr_interrupt (struct dtsec_regs *regs);
+void fman_dtsec_enable_tmr_interrupt (struct dtsec_regs *regs);
-void dtsec_disable_tmr_interrupt(struct dtsec_regs *regs);
+void fman_dtsec_disable_tmr_interrupt(struct dtsec_regs *regs);
/**
- * dtsec_disable_interrupt() - Disables interrupts for the specified events
+ * fman_dtsec_disable_interrupt() - Disables interrupts for the specified events
* @regs: Pointer to dTSEC register block
* @ev_mask: Mask of relevant events
*
* Call this function to disable interrupts in dTSEC for the specified events.
- * To enable interrupts use dtsec_enable_interrupt().
+ * To enable interrupts use fman_dtsec_enable_interrupt().
*/
-void dtsec_disable_interrupt(struct dtsec_regs *regs, uint32_t ev_mask);
+void fman_dtsec_disable_interrupt(struct dtsec_regs *regs, uint32_t ev_mask);
/**
- * dtsec_enable_interrupt() - Enable interrupts for the specified events
+ * fman_dtsec_enable_interrupt() - Enable interrupts for the specified events
* @regs: Pointer to dTSEC register block
* @ev_mask: Mask of relevant events
*
* Call this function to enable interrupts in dTSEC for the specified events.
- * To disable interrupts use dtsec_disable_interrupt().
+ * To disable interrupts use fman_dtsec_disable_interrupt().
*/
-void dtsec_enable_interrupt(struct dtsec_regs *regs, uint32_t ev_mask);
+void fman_dtsec_enable_interrupt(struct dtsec_regs *regs, uint32_t ev_mask);
/**
- * dtsec_set_ts() - Enables dTSEC timestamps
+ * fman_dtsec_set_ts() - Enables dTSEC timestamps
* @regs: Pointer to dTSEC register block
* @en: true to enable timestamps, false to disable them
*
* Call this function to enable/disable dTSEC timestamps. This affects both
* Tx and Rx.
*/
-void dtsec_set_ts(struct dtsec_regs *regs, bool en);
+void fman_dtsec_set_ts(struct dtsec_regs *regs, bool en);
/**
- * dtsec_set_bucket() - Enables/disables a filter bucket
+ * fman_dtsec_set_bucket() - Enables/disables a filter bucket
* @regs: Pointer to dTSEC register block
* @bucket: Bucket index
* @enable: true/false to enable/disable this bucket
@@ -982,36 +980,36 @@ void dtsec_set_ts(struct dtsec_regs *regs, bool en);
* is enabled requires further filtering and verification in the upper layers
*
*/
-void dtsec_set_bucket(struct dtsec_regs *regs, int bucket, bool enable);
+void fman_dtsec_set_bucket(struct dtsec_regs *regs, int bucket, bool enable);
/**
- * dtsec_reset_filter_table() - Resets the address filtering table
+ * fman_dtsec_reset_filter_table() - Resets the address filtering table
* @regs: Pointer to dTSEC register block
* @mcast: Reset multicast entries
* @ucast: Reset unicast entries
*
* Resets all entries in L2 address filter table. After calling this function
- * all buckets enabled using dtsec_set_bucket() will be disabled.
+ * all buckets enabled using fman_dtsec_set_bucket() will be disabled.
* If dtsec_init_filter_table() was called with @unicast_hash set to false,
* @ucast argument is ignored.
* This does not affect the primary nor the 15 additional addresses configured
* using dtsec_set_address() or dtsec_set_match_address().
*/
-void dtsec_reset_filter_table(struct dtsec_regs *regs, bool mcast, bool ucast);
+void fman_dtsec_reset_filter_table(struct dtsec_regs *regs, bool mcast, bool ucast);
/**
- * dtsec_set_mc_promisc() - Set multicast promiscous mode
+ * fman_dtsec_set_mc_promisc() - Set multicast promiscous mode
* @regs: Pointer to dTSEC register block
* @enable: Enable multicast promiscous mode
*
* Call this to enable/disable L2 address filtering for multicast packets.
*/
-void dtsec_set_mc_promisc(struct dtsec_regs *regs, bool enable);
+void fman_dtsec_set_mc_promisc(struct dtsec_regs *regs, bool enable);
/* statistics APIs */
/**
- * dtsec_set_stat_level() - Enable a group of MIB statistics counters
+ * fman_dtsec_set_stat_level() - Enable a group of MIB statistics counters
* @regs: Pointer to dTSEC register block
* @level: Specifies a certain group of dTSEC MIB HW counters or _all_,
* to specify all the existing counters.
@@ -1022,16 +1020,16 @@ void dtsec_set_mc_promisc(struct dtsec_regs *regs, bool enable);
*
* Returns: error if invalid @level value given.
*/
-int dtsec_set_stat_level(struct dtsec_regs *regs, enum mac_stat_level level);
+int fman_dtsec_set_stat_level(struct dtsec_regs *regs, enum mac_stat_level level);
/**
- * dtsec_reset_stat() - Completely resets all dTSEC HW counters
+ * fman_dtsec_reset_stat() - Completely resets all dTSEC HW counters
* @regs: Pointer to dTSEC register block
*/
-void dtsec_reset_stat(struct dtsec_regs *regs);
+void fman_dtsec_reset_stat(struct dtsec_regs *regs);
/**
- * dtsec_get_clear_carry_regs() - Read and clear carry bits (CAR1-2 registers)
+ * fman_dtsec_get_clear_carry_regs() - Read and clear carry bits (CAR1-2 registers)
* @regs: Pointer to dTSEC register block
* @car1: car1 register value
* @car2: car2 register value
@@ -1043,18 +1041,19 @@ void dtsec_reset_stat(struct dtsec_regs *regs);
*
* Returns: true if overflow occurred, otherwise - false
*/
-bool dtsec_get_clear_carry_regs(struct dtsec_regs *regs,
- uint32_t *car1, uint32_t *car2);
+bool fman_dtsec_get_clear_carry_regs(struct dtsec_regs *regs,
+ uint32_t *car1, uint32_t *car2);
+
+uint32_t fman_dtsec_check_and_clear_tmr_event(struct dtsec_regs *regs);
-uint32_t dtsec_check_and_clear_tmr_event(struct dtsec_regs *regs);
+uint32_t fman_dtsec_get_stat_counter(struct dtsec_regs *regs,
+ enum dtsec_stat_counters reg_name);
-uint32_t dtsec_get_stat_counter(struct dtsec_regs *regs,
- enum dtsec_stat_counters reg_name);
+void fman_dtsec_start_tx(struct dtsec_regs *regs);
+void fman_dtsec_start_rx(struct dtsec_regs *regs);
+void fman_dtsec_stop_tx(struct dtsec_regs *regs);
+void fman_dtsec_stop_rx(struct dtsec_regs *regs);
+uint32_t fman_dtsec_get_rctrl(struct dtsec_regs *regs);
-void dtsec_start_tx(struct dtsec_regs *regs);
-void dtsec_start_rx(struct dtsec_regs *regs);
-void dtsec_stop_rx(struct dtsec_regs *regs);
-void dtsec_stop_tx(struct dtsec_regs *regs);
-uint32_t dtsec_get_rctrl(struct dtsec_regs *regs);
#endif /* __FSL_FMAN_DTSEC_H */
diff --git a/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_memac.h b/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_memac.h
index 5cf48c7..503eebb 100644
--- a/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_memac.h
+++ b/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_memac.h
@@ -68,6 +68,12 @@
#define IF_MODE_GMII 0x00000002 /* 30-31 GMII (1G) interface */
#define IF_MODE_RGMII 0x00000004
#define IF_MODE_RGMII_AUTO 0x00008000
+#define IF_MODE_RGMII_1000 0x00004000 /* 10 - 1000Mbps RGMII */
+#define IF_MODE_RGMII_100 0x00000000 /* 00 - 100Mbps RGMII */
+#define IF_MODE_RGMII_10 0x00002000 /* 01 - 10Mbps RGMII */
+#define IF_MODE_RGMII_SP_MASK 0x00006000 /* Setsp mask bits */
+#define IF_MODE_RGMII_FD 0x00001000 /* Full duplex RGMII */
+#define IF_MODE_HD 0x00000040 /* Half duplex operation */
/* Hash table Control Register (HASHTABLE_CTRL) */
#define HASH_CTRL_MCAST_SHIFT 26
@@ -86,12 +92,13 @@
#define STATS_CFG_SATURATE 0x00000001 /* 31 Saturate at the maximum val */
/* Interrupt Mask Register (IMASK) */
-#define MEMAC_IMASK_MGI 0x40000000 /* 1 Magic pkt detec indication */
+#define MEMAC_IMASK_MGI 0x40000000 /* 1 Magic pkt detect indication */
+#define MEMAC_IMASK_TSECC_ER 0x20000000 /* 2 Timestamp FIFO ECC error evnt */
#define MEMAC_IMASK_TECC_ER 0x02000000 /* 6 Transmit frame ECC error evnt */
#define MEMAC_IMASK_RECC_ER 0x01000000 /* 7 Receive frame ECC error evnt */
-#define MEMAC_ALL_IMASKS \
- ((uint32_t)(MEMAC_IMASK_MGI | \
+#define MEMAC_ALL_ERRS_IMASK \
+ ((uint32_t)(MEMAC_IMASK_TSECC_ER | \
MEMAC_IMASK_TECC_ER | \
MEMAC_IMASK_RECC_ER))
@@ -99,6 +106,7 @@
#define MEMAC_IEVNT_AN 0x40000000 /* Auto-negotiation */
#define MEMAC_IEVNT_LT 0x20000000 /* Link Training/New page */
#define MEMAC_IEVNT_MGI 0x00004000 /* Magic pkt detection */
+#define MEMAC_IEVNT_TS_ECC_ER 0x00002000 /* Timestamp FIFO ECC error */
#define MEMAC_IEVNT_RX_FIFO_OVFL 0x00001000 /* Rx FIFO overflow */
#define MEMAC_IEVNT_TX_FIFO_UNFL 0x00000800 /* Tx FIFO underflow */
#define MEMAC_IEVNT_TX_FIFO_OVFL 0x00000400 /* Tx FIFO overflow */
@@ -112,24 +120,6 @@
#define MEMAC_IEVNT_REM_FAULT 0x00000002 /* Remote fault (XGMII) */
#define MEMAC_IEVNT_LOC_FAULT 0x00000001 /* Local fault (XGMII) */
-#define MEMAC_EVENTS_MASK \
- ((uint32_t)(MEMAC_IEVNT_PCS | \
- MEMAC_IEVNT_AN | \
- MEMAC_IEVNT_LT | \
- MEMAC_IEVNT_MGI | \
- MEMAC_IEVNT_RX_FIFO_OVFL | \
- MEMAC_IEVNT_TX_FIFO_UNFL | \
- MEMAC_IEVNT_TX_FIFO_OVFL | \
- MEMAC_IEVNT_TX_ECC_ER | \
- MEMAC_IEVNT_RX_ECC_ER | \
- MEMAC_IEVNT_LI_FAULT | \
- MEMAC_IEVNT_RX_EMPTY | \
- MEMAC_IEVNT_TX_EMPTY | \
- MEMAC_IEVNT_RX_LOWP | \
- MEMAC_IEVNT_PHY_LOS | \
- MEMAC_IEVNT_REM_FAULT | \
- MEMAC_IEVNT_LOC_FAULT))
-
enum memac_counters {
E_MEMAC_COUNTER_R64,
E_MEMAC_COUNTER_R127,
@@ -337,45 +327,66 @@ struct memac_cfg {
uint32_t tx_ipg_length;
};
+
/**
- * memac_defconfig() - Get default MEMAC configuration
+ * fman_memac_defconfig() - Get default MEMAC configuration
* @cfg: pointer to configuration structure.
*
* Call this function to obtain a default set of configuration values for
* initializing MEMAC. The user can overwrite any of the values before calling
- * memac_init(), if specific configuration needs to be applied.
+ * fman_memac_init(), if specific configuration needs to be applied.
*/
-void memac_defconfig(struct memac_cfg *cfg);
-void memac_set_promiscuous(struct memac_regs *regs, bool val);
-void memac_hardware_add_addr_in_paddr(struct memac_regs *regs,
- uint8_t *adr,
- uint8_t paddr_num);
-void memac_hardware_clear_addr_in_paddr(struct memac_regs *regs,
- uint8_t paddr_num);
-void memac_enable(struct memac_regs *regs, bool apply_rx, bool apply_tx);
-void memac_disable(struct memac_regs *regs, bool apply_rx, bool apply_tx);
-uint64_t memac_get_counter(struct memac_regs *regs,
- enum memac_counters reg_name);
-void memac_set_tx_pause_frames(struct memac_regs *regs,
- uint8_t priority,
- uint16_t pauseTime,
- uint16_t threshTime);
-uint16_t memac_get_max_frame_length(struct memac_regs *regs);
-void memac_init(struct memac_regs *regs,
- struct memac_cfg *cfg,
- enum enet_interface enet_interface,
- enum enet_speed enet_speed,
- uint32_t exceptions);
-void memac_set_exception(struct memac_regs *regs, uint32_t val, bool enable);
-void memac_reset_counter(struct memac_regs *regs);
-void memac_reset(struct memac_regs *regs);
-void memac_set_hash_table(struct memac_regs *regs, uint32_t val);
-void memac_set_rx_ignore_pause_frames(struct memac_regs *regs,bool enable);
-void memac_set_loopback(struct memac_regs *regs, bool enable);
-void memac_reset_counter(struct memac_regs *regs);
-uint32_t memac_get_event(struct memac_regs *regs, uint32_t ev_mask);
-void memac_ack_event(struct memac_regs *regs, uint32_t ev_mask);
-uint32_t memac_get_interrupt_mask(struct memac_regs *regs);
+void fman_memac_defconfig(struct memac_cfg *cfg);
+
+int fman_memac_init(struct memac_regs *regs,
+ struct memac_cfg *cfg,
+ enum enet_interface enet_interface,
+ enum enet_speed enet_speed,
+ uint32_t exceptions);
+
+void fman_memac_enable(struct memac_regs *regs, bool apply_rx, bool apply_tx);
+
+void fman_memac_disable(struct memac_regs *regs, bool apply_rx, bool apply_tx);
+
+void fman_memac_set_promiscuous(struct memac_regs *regs, bool val);
+
+void fman_memac_add_addr_in_paddr(struct memac_regs *regs,
+ uint8_t *adr,
+ uint8_t paddr_num);
+
+void fman_memac_clear_addr_in_paddr(struct memac_regs *regs,
+ uint8_t paddr_num);
+
+uint64_t fman_memac_get_counter(struct memac_regs *regs,
+ enum memac_counters reg_name);
+
+void fman_memac_set_tx_pause_frames(struct memac_regs *regs,
+ uint8_t priority,
+ uint16_t pauseTime,
+ uint16_t threshTime);
+
+uint16_t fman_memac_get_max_frame_len(struct memac_regs *regs);
+
+void fman_memac_set_exception(struct memac_regs *regs, uint32_t val, bool enable);
+
+void fman_memac_reset_stat(struct memac_regs *regs);
+
+void fman_memac_reset(struct memac_regs *regs);
+
+void fman_memac_set_hash_table(struct memac_regs *regs, uint32_t val);
+
+void fman_memac_set_rx_ignore_pause_frames(struct memac_regs *regs,bool enable);
+
+uint32_t fman_memac_get_event(struct memac_regs *regs, uint32_t ev_mask);
+
+void fman_memac_ack_event(struct memac_regs *regs, uint32_t ev_mask);
+
+uint32_t fman_memac_get_interrupt_mask(struct memac_regs *regs);
+
+void fman_memac_adjust_link(struct memac_regs *regs,
+ enum enet_interface iface_mode,
+ enum enet_speed speed, bool full_dx);
+
#endif /*__FSL_FMAN_MEMAC_H*/
diff --git a/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_rtc.h b/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_rtc.h
new file mode 100755
index 0000000..aa6fd73
--- /dev/null
+++ b/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_rtc.h
@@ -0,0 +1,429 @@
+/*
+ * Copyright 2013 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __FSL_FMAN_RTC_H
+#define __FSL_FMAN_RTC_H
+
+#include "common/general.h"
+
+/* FM RTC Registers definitions */
+#define FMAN_RTC_TMR_CTRL_ALMP1 0x80000000
+#define FMAN_RTC_TMR_CTRL_ALMP2 0x40000000
+#define FMAN_RTC_TMR_CTRL_FS 0x10000000
+#define FMAN_RTC_TMR_CTRL_PP1L 0x08000000
+#define FMAN_RTC_TMR_CTRL_PP2L 0x04000000
+#define FMAN_RTC_TMR_CTRL_TCLK_PERIOD_MASK 0x03FF0000
+#define FMAN_RTC_TMR_CTRL_FRD 0x00004000
+#define FMAN_RTC_TMR_CTRL_SLV 0x00002000
+#define FMAN_RTC_TMR_CTRL_ETEP1 0x00000100
+#define FMAN_RTC_TMR_CTRL_COPH 0x00000080
+#define FMAN_RTC_TMR_CTRL_CIPH 0x00000040
+#define FMAN_RTC_TMR_CTRL_TMSR 0x00000020
+#define FMAN_RTC_TMR_CTRL_DBG 0x00000010
+#define FMAN_RTC_TMR_CTRL_BYP 0x00000008
+#define FMAN_RTC_TMR_CTRL_TE 0x00000004
+#define FMAN_RTC_TMR_CTRL_CKSEL_OSC_CLK 0x00000003
+#define FMAN_RTC_TMR_CTRL_CKSEL_MAC_CLK 0x00000001
+#define FMAN_RTC_TMR_CTRL_CKSEL_EXT_CLK 0x00000000
+#define FMAN_RTC_TMR_CTRL_TCLK_PERIOD_SHIFT 16
+
+#define FMAN_RTC_TMR_TEVENT_ETS2 0x02000000
+#define FMAN_RTC_TMR_TEVENT_ETS1 0x01000000
+#define FMAN_RTC_TMR_TEVENT_ALM2 0x00020000
+#define FMAN_RTC_TMR_TEVENT_ALM1 0x00010000
+#define FMAN_RTC_TMR_TEVENT_PP1 0x00000080
+#define FMAN_RTC_TMR_TEVENT_PP2 0x00000040
+#define FMAN_RTC_TMR_TEVENT_PP3 0x00000020
+#define FMAN_RTC_TMR_TEVENT_ALL (FMAN_RTC_TMR_TEVENT_ETS2 |\
+ FMAN_RTC_TMR_TEVENT_ETS1 |\
+ FMAN_RTC_TMR_TEVENT_ALM2 |\
+ FMAN_RTC_TMR_TEVENT_ALM1 |\
+ FMAN_RTC_TMR_TEVENT_PP1 |\
+ FMAN_RTC_TMR_TEVENT_PP2 |\
+ FMAN_RTC_TMR_TEVENT_PP3)
+
+#define FMAN_RTC_TMR_PRSC_OCK_MASK 0x0000FFFF
+
+/**************************************************************************//**
+ @Description FM RTC Alarm Polarity Options.
+*//***************************************************************************/
+enum fman_rtc_alarm_polarity {
+ E_FMAN_RTC_ALARM_POLARITY_ACTIVE_HIGH, /**< Active-high output polarity */
+ E_FMAN_RTC_ALARM_POLARITY_ACTIVE_LOW /**< Active-low output polarity */
+};
+
+/**************************************************************************//**
+ @Description FM RTC Trigger Polarity Options.
+*//***************************************************************************/
+enum fman_rtc_trigger_polarity {
+ E_FMAN_RTC_TRIGGER_ON_RISING_EDGE, /**< Trigger on rising edge */
+ E_FMAN_RTC_TRIGGER_ON_FALLING_EDGE /**< Trigger on falling edge */
+};
+
+/**************************************************************************//**
+ @Description IEEE1588 Timer Module FM RTC Optional Clock Sources.
+*//***************************************************************************/
+enum fman_src_clock {
+ E_FMAN_RTC_SOURCE_CLOCK_EXTERNAL, /**< external high precision timer
+ reference clock */
+ E_FMAN_RTC_SOURCE_CLOCK_SYSTEM, /**< MAC system clock */
+ E_FMAN_RTC_SOURCE_CLOCK_OSCILATOR /**< RTC clock oscilator */
+};
+
+/* RTC default values */
+#define DEFAULT_SRC_CLOCK E_FMAN_RTC_SOURCE_CLOCK_SYSTEM
+#define DEFAULT_INVERT_INPUT_CLK_PHASE FALSE
+#define DEFAULT_INVERT_OUTPUT_CLK_PHASE FALSE
+#define DEFAULT_ALARM_POLARITY E_FMAN_RTC_ALARM_POLARITY_ACTIVE_HIGH
+#define DEFAULT_TRIGGER_POLARITY E_FMAN_RTC_TRIGGER_ON_FALLING_EDGE
+#define DEFAULT_PULSE_REALIGN FALSE
+
+#define FMAN_RTC_MAX_NUM_OF_ALARMS 3
+#define FMAN_RTC_MAX_NUM_OF_PERIODIC_PULSES 4
+#define FMAN_RTC_MAX_NUM_OF_EXT_TRIGGERS 3
+
+/**************************************************************************//**
+ @Description FM RTC timer alarm
+*//***************************************************************************/
+struct t_tmr_alarm{
+ uint32_t tmr_alarm_h; /**< */
+ uint32_t tmr_alarm_l; /**< */
+};
+
+/**************************************************************************//**
+ @Description FM RTC timer Ex trigger
+*//***************************************************************************/
+struct t_tmr_ext_trigger{
+ uint32_t tmr_etts_h; /**< */
+ uint32_t tmr_etts_l; /**< */
+};
+
+struct rtc_regs {
+ uint32_t tmr_id; /* 0x000 Module ID register */
+ uint32_t tmr_id2; /* 0x004 Controller ID register */
+ uint32_t reserved0008[30];
+ uint32_t tmr_ctrl; /* 0x0080 timer control register */
+ uint32_t tmr_tevent; /* 0x0084 timer event register */
+ uint32_t tmr_temask; /* 0x0088 timer event mask register */
+ uint32_t reserved008c[3];
+ uint32_t tmr_cnt_h; /* 0x0098 timer counter high register */
+ uint32_t tmr_cnt_l; /* 0x009c timer counter low register */
+ uint32_t tmr_add; /* 0x00a0 timer drift compensation addend register */
+ uint32_t tmr_acc; /* 0x00a4 timer accumulator register */
+ uint32_t tmr_prsc; /* 0x00a8 timer prescale */
+ uint32_t reserved00ac;
+ uint32_t tmr_off_h; /* 0x00b0 timer offset high */
+ uint32_t tmr_off_l; /* 0x00b4 timer offset low */
+ struct t_tmr_alarm tmr_alarm[FMAN_RTC_MAX_NUM_OF_ALARMS]; /* 0x00b8 timer
+ alarm */
+ uint32_t tmr_fiper[FMAN_RTC_MAX_NUM_OF_PERIODIC_PULSES]; /* 0x00d0 timer
+ fixed period interval */
+ struct t_tmr_ext_trigger tmr_etts[FMAN_RTC_MAX_NUM_OF_EXT_TRIGGERS];
+ /* 0x00e0 time stamp general purpose external */
+ uint32_t reserved00f0[4];
+};
+
+struct rtc_cfg {
+ enum fman_src_clock src_clk;
+ uint32_t ext_src_clk_freq;
+ uint32_t rtc_freq_hz;
+ bool timer_slave_mode;
+ bool invert_input_clk_phase;
+ bool invert_output_clk_phase;
+ uint32_t events_mask;
+ bool bypass; /**< Indicates if frequency compensation
+ is bypassed */
+ bool pulse_realign;
+ enum fman_rtc_alarm_polarity alarm_polarity[FMAN_RTC_MAX_NUM_OF_ALARMS];
+ enum fman_rtc_trigger_polarity trigger_polarity
+ [FMAN_RTC_MAX_NUM_OF_EXT_TRIGGERS];
+};
+
+/**
+ * fman_rtc_defconfig() - Get default RTC configuration
+ * @cfg: pointer to configuration structure.
+ *
+ * Call this function to obtain a default set of configuration values for
+ * initializing RTC. The user can overwrite any of the values before calling
+ * fman_rtc_init(), if specific configuration needs to be applied.
+ */
+void fman_rtc_defconfig(struct rtc_cfg *cfg);
+
+/**
+ * fman_rtc_get_events() - Get the events
+ * @regs: Pointer to RTC register block
+ *
+ * Returns: The events
+ */
+uint32_t fman_rtc_get_events(struct rtc_regs *regs);
+
+/**
+ * fman_rtc_get_interrupt_mask() - Get the events mask
+ * @regs: Pointer to RTC register block
+ *
+ * Returns: The events mask
+ */
+uint32_t fman_rtc_get_interrupt_mask(struct rtc_regs *regs);
+
+
+/**
+ * fman_rtc_set_interrupt_mask() - Set the events mask
+ * @regs: Pointer to RTC register block
+ * @mask: The mask to set
+ */
+void fman_rtc_set_interrupt_mask(struct rtc_regs *regs, uint32_t mask);
+
+/**
+ * fman_rtc_get_event() - Check if specific events occured
+ * @regs: Pointer to RTC register block
+ * @ev_mask: a mask of the events to check
+ *
+ * Returns: 0 if the events did not occur. Non zero if one of the events occured
+ */
+uint32_t fman_rtc_get_event(struct rtc_regs *regs, uint32_t ev_mask);
+
+/**
+ * fman_rtc_check_and_clear_event() - Clear events which are on
+ * @regs: Pointer to RTC register block
+ *
+ * Returns: A mask of the events which were cleared
+ */
+uint32_t fman_rtc_check_and_clear_event(struct rtc_regs *regs);
+
+/**
+ * fman_rtc_ack_event() - Clear events
+ * @regs: Pointer to RTC register block
+ * @events: The events to disable
+ */
+void fman_rtc_ack_event(struct rtc_regs *regs, uint32_t events);
+
+/**
+ * fman_rtc_enable_interupt() - Enable events interrupts
+ * @regs: Pointer to RTC register block
+ * @mask: The events to disable
+ */
+void fman_rtc_enable_interupt(struct rtc_regs *regs, uint32_t mask);
+
+/**
+ * fman_rtc_disable_interupt() - Disable events interrupts
+ * @regs: Pointer to RTC register block
+ * @mask: The events to disable
+ */
+void fman_rtc_disable_interupt(struct rtc_regs *regs, uint32_t mask);
+
+/**
+ * fman_rtc_get_timer_ctrl() - Get the control register
+ * @regs: Pointer to RTC register block
+ *
+ * Returns: The control register value
+ */
+uint32_t fman_rtc_get_timer_ctrl(struct rtc_regs *regs);
+
+/**
+ * fman_rtc_set_timer_ctrl() - Set timer control register
+ * @regs: Pointer to RTC register block
+ * @val: The value to set
+ */
+void fman_rtc_set_timer_ctrl(struct rtc_regs *regs, uint32_t val);
+
+/**
+ * fman_rtc_get_frequency_compensation() - Get the frequency compensation
+ * @regs: Pointer to RTC register block
+ *
+ * Returns: The timer counter
+ */
+uint32_t fman_rtc_get_frequency_compensation(struct rtc_regs *regs);
+
+/**
+ * fman_rtc_set_frequency_compensation() - Set frequency compensation
+ * @regs: Pointer to RTC register block
+ * @val: The value to set
+ */
+void fman_rtc_set_frequency_compensation(struct rtc_regs *regs, uint32_t val);
+
+/**
+ * fman_rtc_get_trigger_stamp() - Get a trigger stamp
+ * @regs: Pointer to RTC register block
+ * @id: The id of the trigger stamp
+ *
+ * Returns: The time stamp
+ */
+uint64_t fman_rtc_get_trigger_stamp(struct rtc_regs *regs, int id);
+
+/**
+ * fman_rtc_set_timer_alarm_l() - Set timer alarm low register
+ * @regs: Pointer to RTC register block
+ * @index: The index of alarm to set
+ * @val: The value to set
+ */
+void fman_rtc_set_timer_alarm_l(struct rtc_regs *regs, int index,
+ uint32_t val);
+
+/**
+ * fman_rtc_set_timer_alarm() - Set timer alarm
+ * @regs: Pointer to RTC register block
+ * @index: The index of alarm to set
+ * @val: The value to set
+ */
+void fman_rtc_set_timer_alarm(struct rtc_regs *regs, int index, int64_t val);
+
+/**
+ * fman_rtc_set_timer_fiper() - Set timer fiper
+ * @regs: Pointer to RTC register block
+ * @index: The index of fiper to set
+ * @val: The value to set
+ */
+void fman_rtc_set_timer_fiper(struct rtc_regs *regs, int index, uint32_t val);
+
+/**
+ * fman_rtc_set_timer_offset() - Set timer offset
+ * @regs: Pointer to RTC register block
+ * @val: The value to set
+ */
+void fman_rtc_set_timer_offset(struct rtc_regs *regs, int64_t val);
+
+/**
+ * fman_rtc_get_timer() - Get the timer counter
+ * @regs: Pointer to RTC register block
+ *
+ * Returns: The timer counter
+ */
+static inline uint64_t fman_rtc_get_timer(struct rtc_regs *regs)
+{
+ uint64_t time;
+ /* TMR_CNT_L must be read first to get an accurate value */
+ time = (uint64_t)ioread32be(&regs->tmr_cnt_l);
+ time |= ((uint64_t)ioread32be(&regs->tmr_cnt_h) << 32);
+
+ return time;
+}
+
+/**
+ * fman_rtc_set_timer() - Set timer counter
+ * @regs: Pointer to RTC register block
+ * @val: The value to set
+ */
+static inline void fman_rtc_set_timer(struct rtc_regs *regs, int64_t val)
+{
+ iowrite32be((uint32_t)val, &regs->tmr_cnt_l);
+ iowrite32be((uint32_t)(val >> 32), &regs->tmr_cnt_h);
+}
+
+/**
+ * fman_rtc_timers_soft_reset() - Soft reset
+ * @regs: Pointer to RTC register block
+ *
+ * Resets all the timer registers and state machines for the 1588 IP and
+ * the attached client 1588
+ */
+void fman_rtc_timers_soft_reset(struct rtc_regs *regs);
+
+/**
+ * fman_rtc_clear_external_trigger() - Clear an external trigger
+ * @regs: Pointer to RTC register block
+ * @id: The id of the trigger to clear
+ */
+void fman_rtc_clear_external_trigger(struct rtc_regs *regs, int id);
+
+/**
+ * fman_rtc_clear_periodic_pulse() - Clear periodic pulse
+ * @regs: Pointer to RTC register block
+ * @id: The id of the fiper to clear
+ */
+void fman_rtc_clear_periodic_pulse(struct rtc_regs *regs, int id);
+
+/**
+ * fman_rtc_enable() - Enable RTC hardware block
+ * @regs: Pointer to RTC register block
+ */
+void fman_rtc_enable(struct rtc_regs *regs, bool reset_clock);
+
+/**
+ * fman_rtc_is_enabled() - Is RTC hardware block enabled
+ * @regs: Pointer to RTC register block
+ *
+ * Return: TRUE if enabled
+ */
+bool fman_rtc_is_enabled(struct rtc_regs *regs);
+
+/**
+ * fman_rtc_disable() - Disable RTC hardware block
+ * @regs: Pointer to RTC register block
+ */
+void fman_rtc_disable(struct rtc_regs *regs);
+
+/**
+ * fman_rtc_init() - Init RTC hardware block
+ * @cfg: RTC configuration data
+ * @regs: Pointer to RTC register block
+ * @num_alarms: Number of alarms in RTC
+ * @num_fipers: Number of fipers in RTC
+ * @num_ext_triggers: Number of external triggers in RTC
+ * @freq_compensation: Frequency compensation
+ * @output_clock_divisor: Output clock divisor
+ *
+ * This function initializes RTC and applies basic configuration.
+ */
+void fman_rtc_init(struct rtc_cfg *cfg, struct rtc_regs *regs, int num_alarms,
+ int num_fipers, int num_ext_triggers, bool init_freq_comp,
+ uint32_t freq_compensation, uint32_t output_clock_divisor);
+
+/**
+ * fman_rtc_set_alarm() - Set an alarm
+ * @regs: Pointer to RTC register block
+ * @id: id of alarm
+ * @val: value to write
+ * @enable: should interrupt be enabled
+ */
+void fman_rtc_set_alarm(struct rtc_regs *regs, int id, uint32_t val, bool enable);
+
+/**
+ * fman_rtc_set_periodic_pulse() - Set an alarm
+ * @regs: Pointer to RTC register block
+ * @id: id of fiper
+ * @val: value to write
+ * @enable: should interrupt be enabled
+ */
+void fman_rtc_set_periodic_pulse(struct rtc_regs *regs, int id, uint32_t val,
+ bool enable);
+
+/**
+ * fman_rtc_set_ext_trigger() - Set an external trigger
+ * @regs: Pointer to RTC register block
+ * @id: id of trigger
+ * @enable: should interrupt be enabled
+ * @use_pulse_as_input: use the pulse as input
+ */
+void fman_rtc_set_ext_trigger(struct rtc_regs *regs, int id, bool enable,
+ bool use_pulse_as_input);
+
+#endif /* __FSL_FMAN_RTC_H */
diff --git a/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_sp.h b/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_sp.h
new file mode 100755
index 0000000..f8ef7d5
--- /dev/null
+++ b/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_sp.h
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2013 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __FSL_FMAN_SP_H
+#define __FSL_FMAN_SP_H
+
+#include "common/general.h"
+#include "fsl_fman.h"
+
+
+struct fm_pcd_storage_profile_regs{
+ uint32_t fm_sp_ebmpi[8];
+ /*offset 0 - 0xc*/
+ /**< Buffer Manager pool Information */
+
+ uint32_t fm_sp_acnt; /*offset 0x20*/
+ uint32_t fm_sp_ebm; /*offset 0x24*/
+ uint32_t fm_sp_da; /*offset 0x28*/
+ uint32_t fm_sp_icp; /*offset 0x2c*/
+ uint32_t fm_sp_mpd; /*offset 0x30*/
+ uint32_t res1[2]; /*offset 0x34 - 0x38*/
+ uint32_t fm_sp_spliodn; /*offset 0x3c*/
+};
+
+/**************************************************************************//**
+ @Description structure for defining internal context copying
+*//***************************************************************************/
+struct fman_sp_int_context_data_copy{
+ uint16_t ext_buf_offset; /**< Offset in External buffer to which
+ internal context is copied to (Rx)
+ or taken from (Tx, Op). */
+ uint8_t int_context_offset; /**< Offset within internal context to copy
+ from (Rx) or to copy to (Tx, Op).*/
+ uint16_t size; /**< Internal offset size to be copied */
+};
+
+/**************************************************************************//**
+ @Description struct for defining external buffer margins
+*//***************************************************************************/
+struct fman_sp_buf_margins{
+ uint16_t start_margins; /**< Number of bytes to be left at the
+ beginning of the external buffer (must be
+ divisible by 16) */
+ uint16_t end_margins; /**< number of bytes to be left at the end of
+ the external buffer(must be divisible by 16)*/
+};
+
+struct fm_storage_profile_params {
+ struct fman_ext_pools fm_ext_pools;
+ struct fman_backup_bm_pools backup_pools;
+ struct fman_sp_int_context_data_copy *int_context;
+ struct fman_sp_buf_margins *buf_margins;
+ enum fman_dma_swap_option dma_swap_data;
+ enum fman_dma_cache_option int_context_cache_attr;
+ enum fman_dma_cache_option header_cache_attr;
+ enum fman_dma_cache_option scatter_gather_cache_attr;
+ bool dma_write_optimize;
+ uint16_t liodn_offset;
+ bool no_scather_gather;
+ struct fman_buf_pool_depletion buf_pool_depletion;
+};
+
+/**************************************************************************//**
+ @Description Registers bit fields
+*//***************************************************************************/
+#define FMAN_SP_EXT_BUF_POOL_EN_COUNTER 0x40000000
+#define FMAN_SP_EXT_BUF_POOL_VALID 0x80000000
+#define FMAN_SP_EXT_BUF_POOL_BACKUP 0x20000000
+#define FMAN_SP_DMA_ATTR_WRITE_OPTIMIZE 0x00100000
+#define FMAN_SP_SG_DISABLE 0x80000000
+
+/* shifts */
+#define FMAN_SP_EXT_BUF_POOL_ID_SHIFT 16
+#define FMAN_SP_POOL_DEP_NUM_OF_POOLS_SHIFT 16
+#define FMAN_SP_EXT_BUF_MARG_START_SHIFT 16
+#define FMAN_SP_EXT_BUF_MARG_END_SHIFT 0
+#define FMAN_SP_DMA_ATTR_SWP_SHIFT 30
+#define FMAN_SP_DMA_ATTR_IC_CACHE_SHIFT 28
+#define FMAN_SP_DMA_ATTR_HDR_CACHE_SHIFT 26
+#define FMAN_SP_DMA_ATTR_SG_CACHE_SHIFT 24
+#define FMAN_SP_IC_TO_EXT_SHIFT 16
+#define FMAN_SP_IC_FROM_INT_SHIFT 8
+#define FMAN_SP_IC_SIZE_SHIFT 0
+
+/**************************************************************************//**
+ @Description defaults
+*//***************************************************************************/
+#define DEFAULT_FMAN_SP_DMA_SWAP_DATA FMAN_DMA_NO_SWP
+#define DEFAULT_FMAN_SP_DMA_INT_CONTEXT_CACHE_ATTR FMAN_DMA_NO_STASH
+#define DEFAULT_FMAN_SP_DMA_HEADER_CACHE_ATTR FMAN_DMA_NO_STASH
+#define DEFAULT_FMAN_SP_DMA_SCATTER_GATHER_CACHE_ATTR FMAN_DMA_NO_STASH
+#define DEFAULT_FMAN_SP_DMA_WRITE_OPTIMIZE TRUE
+#define DEFAULT_FMAN_SP_NO_SCATTER_GATHER FALSE
+
+void fman_vsp_defconfig(struct fm_storage_profile_params *cfg);
+
+void fman_vsp_init(struct fm_pcd_storage_profile_regs *regs,
+ uint16_t index, struct fm_storage_profile_params *fm_vsp_params,
+ int port_max_num_of_ext_pools, int bm_max_num_of_pools,
+ int max_num_of_pfc_priorities);
+
+uint32_t fman_vsp_get_statistics(struct fm_pcd_storage_profile_regs *regs,
+ uint16_t index);
+
+void fman_vsp_set_statistics(struct fm_pcd_storage_profile_regs *regs,
+ uint16_t index, uint32_t value);
+
+
+#endif /* __FSL_FMAN_SP_H */
diff --git a/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_tgec.h b/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_tgec.h
index 2505888..b95ef37 100644
--- a/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_tgec.h
+++ b/drivers/net/ethernet/freescale/fman/inc/flib/fsl_fman_tgec.h
@@ -328,8 +328,8 @@ struct tgec_regs {
* (increasing bandwidth).
*
* This structure contains basic TGEC configuration and must be passed to
- * tgec_init() function. A default set of configuration values can be obtained
- * by calling tgec_defconfig().
+ * fman_tgec_init() function. A default set of configuration values can be obtained
+ * by calling fman_tgec_defconfig().
*/
struct tgec_cfg {
bool rx_error_discard;
@@ -350,46 +350,66 @@ struct tgec_cfg {
bool skip_fman11_workaround;
};
-void tgec_set_mac_address(struct tgec_regs *regs, uint8_t *macaddr);
+
+void fman_tgec_defconfig(struct tgec_cfg *cfg);
+
+/**
+ * fman_tgec_init() - Init tgec hardware block
+ * @regs: Pointer to tgec register block
+ * @cfg: tgec configuration data
+ * @exceptions_mask: initial exceptions mask
+ *
+ * This function initializes the tgec controller and applies its
+ * basic configuration.
+ *
+ * Returns: 0 if successful, an error code otherwise.
+ */
+
+int fman_tgec_init(struct tgec_regs *regs, struct tgec_cfg *cfg,
+ uint32_t exception_mask);
+
+void fman_tgec_enable(struct tgec_regs *regs, bool apply_rx, bool apply_tx);
+
+void fman_tgec_disable(struct tgec_regs *regs, bool apply_rx, bool apply_tx);
+
+uint32_t fman_tgec_get_revision(struct tgec_regs *regs);
+
+void fman_tgec_set_mac_address(struct tgec_regs *regs, uint8_t *macaddr);
+
+void fman_tgec_set_promiscuous(struct tgec_regs *regs, bool val);
/**
- * tgec_reset_stat() - Completely resets all TGEC HW counters
+ * fman_tgec_reset_stat() - Completely resets all TGEC HW counters
* @regs: Pointer to TGEC register block
*/
-void tgec_reset_stat(struct tgec_regs *regs);
+void fman_tgec_reset_stat(struct tgec_regs *regs);
/**
- * tgec_get_counter() - Reads TGEC HW counters
+ * fman_tgec_get_counter() - Reads TGEC HW counters
* @regs: Pointer to TGEC register block
* @reg_name: Counter name according to the appropriate enum
*
* Returns: Required counter value
*/
-
-uint64_t tgec_get_counter(struct tgec_regs *regs, enum tgec_counters reg_name);
-
-void tgec_enable(struct tgec_regs *regs, bool apply_rx, bool apply_tx);
-void tgec_disable(struct tgec_regs *regs, bool apply_rx, bool apply_tx);
-void tgec_set_promiscuous(struct tgec_regs *regs, bool val);
+uint64_t fman_tgec_get_counter(struct tgec_regs *regs, enum tgec_counters reg_name);
/**
- * tgec_set_hash_table() - Sets the Hashtable Control Register
+ * fman_tgec_set_hash_table() - Sets the Hashtable Control Register
* @regs: Pointer to TGEC register block
* @value: Value to be written in Hashtable Control Register
*/
-void tgec_set_hash_table(struct tgec_regs *regs, uint32_t value);
+void fman_tgec_set_hash_table(struct tgec_regs *regs, uint32_t value);
/**
- * tgec_tx_mac_pause() - Sets the Pause Quanta Register
+ * fman_tgec_set_tx_pause_frames() - Sets the Pause Quanta Register
* @regs: Pointer to TGEC register block
* @pause_time: Pause quanta value used with transmitted pause frames.
* Each quanta represents a 512 bit-times
*/
-
-void tgec_tx_mac_pause(struct tgec_regs *regs, uint16_t pause_time);
+void fman_tgec_set_tx_pause_frames(struct tgec_regs *regs, uint16_t pause_time);
/**
- * tgec_rx_ignore_mac_pause() - Changes the policy WRT pause frames
+ * fman_tgec_set_rx_ignore_pause_frames() - Changes the policy WRT pause frames
* @regs: Pointer to TGEC register block
* @en: Ignore/Respond to pause frame quanta
*
@@ -398,11 +418,10 @@ void tgec_tx_mac_pause(struct tgec_regs *regs, uint16_t pause_time);
* in the Pause frame quanta of a received Pause frame.
* 1 - MAC ignores received Pause frames.
*/
-
-void tgec_rx_ignore_mac_pause(struct tgec_regs *regs, bool en);
+void fman_tgec_set_rx_ignore_pause_frames(struct tgec_regs *regs, bool en);
/**
- * tgec_enable_1588_time_stamp() - change timestamp functionality
+ * fman_tgec_enable_1588_time_stamp() - change timestamp functionality
* @regs: Pointer to TGEC register block
* @en: enable/disable timestamp functionality
*
@@ -411,62 +430,42 @@ void tgec_rx_ignore_mac_pause(struct tgec_regs *regs, bool en);
* 0 disabled, 1 enabled
*/
-void tgec_enable_1588_time_stamp(struct tgec_regs *regs, bool en);
+void fman_tgec_enable_1588_time_stamp(struct tgec_regs *regs, bool en);
+
+uint32_t fman_tgec_get_event(struct tgec_regs *regs, uint32_t ev_mask);
-uint32_t tgec_get_event(struct tgec_regs *regs, uint32_t ev_mask);
-void tgec_ack_event(struct tgec_regs *regs, uint32_t ev_mask);
-uint32_t tgec_get_interrupt_mask(struct tgec_regs *regs);
+void fman_tgec_ack_event(struct tgec_regs *regs, uint32_t ev_mask);
+uint32_t fman_tgec_get_interrupt_mask(struct tgec_regs *regs);
/**
- * tgec_add_addr_in_paddr() - Sets additional exact match MAC address
+ * fman_tgec_add_addr_in_paddr() - Sets additional exact match MAC address
* @regs: Pointer to TGEC register block
* @addr_ptr: Pointer to 6-byte array containing the MAC address
*
* Sets the additional station MAC address
*/
+void fman_tgec_add_addr_in_paddr(struct tgec_regs *regs, uint8_t *addr_ptr);
-void tgec_add_addr_in_paddr(struct tgec_regs *regs, uint8_t *addr_ptr);
-void tgec_clear_addr_in_paddr(struct tgec_regs *regs);
-uint32_t tgec_get_revision(struct tgec_regs *regs);
-void tgec_enable_interrupt(struct tgec_regs *regs, uint32_t ev_mask);
-void tgec_disable_interrupt(struct tgec_regs *regs, uint32_t ev_mask);
+void fman_tgec_clear_addr_in_paddr(struct tgec_regs *regs);
-/**
- * tgec_get_max_frame_len() - Returns the maximum frame length value
- * @regs: Pointer to TGEC register block
- */
+void fman_tgec_enable_interrupt(struct tgec_regs *regs, uint32_t ev_mask);
-uint16_t tgec_get_max_frame_len(struct tgec_regs *regs);
+void fman_tgec_disable_interrupt(struct tgec_regs *regs, uint32_t ev_mask);
/**
- * tgec_defconfig() - Initialize the main tgec configuration parameters
- * @cfg: Pointer to tgec_cfg structure
- *
- * This routine determines the values of the tgec_cfg structure members.
- * This structure represents the initial parameters which the tgec controller
- * will be initialized with later when calling the tgec_init function.
+ * fman_tgec_get_max_frame_len() - Returns the maximum frame length value
+ * @regs: Pointer to TGEC register block
*/
-
-void tgec_defconfig(struct tgec_cfg *cfg);
+uint16_t fman_tgec_get_max_frame_len(struct tgec_regs *regs);
/**
- * tgec_init() - Init tgec hardware block
- * @regs: Pointer to tgec register block
- * @cfg: tgec configuration data
- * @exceptions_mask: initial exceptions mask
- *
- * This function initializes the tgec controller and applies its
- * basic configuration.
+ * fman_tgec_set_erratum_tx_fifo_corruption_10gmac_a007() - Initialize the main tgec configuration parameters
+ * @regs: Pointer to TGEC register block
*
- * Returns: 0 if successful, an error code otherwise.
+ * TODO
*/
-
-int tgec_init(struct tgec_regs *regs, struct tgec_cfg *cfg,
- uint32_t exception_mask);
-
-
-void tgec_fm_tx_fifo_corruption_errata_10gmac_a007(struct tgec_regs *regs);
+void fman_tgec_set_erratum_tx_fifo_corruption_10gmac_a007(struct tgec_regs *regs);
#endif /* __FSL_FMAN_TGEC_H */
diff --git a/drivers/net/ethernet/freescale/fman/inc/integrations/P1023/dpaa_integration_ext.h b/drivers/net/ethernet/freescale/fman/inc/integrations/P1023/dpaa_integration_ext.h
index cbc322a..92906db 100644
--- a/drivers/net/ethernet/freescale/fman/inc/integrations/P1023/dpaa_integration_ext.h
+++ b/drivers/net/ethernet/freescale/fman/inc/integrations/P1023/dpaa_integration_ext.h
@@ -110,16 +110,19 @@ typedef enum {
#define INTG_MAX_NUM_OF_FM 1
/* Ports defines */
-#define FM_MAX_NUM_OF_1G_RX_PORTS 2
-#define FM_MAX_NUM_OF_10G_RX_PORTS 0
-#define FM_MAX_NUM_OF_RX_PORTS (FM_MAX_NUM_OF_10G_RX_PORTS+FM_MAX_NUM_OF_1G_RX_PORTS)
-#define FM_MAX_NUM_OF_1G_TX_PORTS 2
-#define FM_MAX_NUM_OF_10G_TX_PORTS 0
-#define FM_MAX_NUM_OF_TX_PORTS (FM_MAX_NUM_OF_10G_TX_PORTS+FM_MAX_NUM_OF_1G_TX_PORTS)
+#define FM_MAX_NUM_OF_1G_MACS 2
+#define FM_MAX_NUM_OF_10G_MACS 0
+#define FM_MAX_NUM_OF_MACS (FM_MAX_NUM_OF_1G_MACS + FM_MAX_NUM_OF_10G_MACS)
#define FM_MAX_NUM_OF_OH_PORTS 5
-#define FM_MAX_NUM_OF_1G_MACS (FM_MAX_NUM_OF_1G_RX_PORTS)
-#define FM_MAX_NUM_OF_10G_MACS (FM_MAX_NUM_OF_10G_RX_PORTS)
-#define FM_MAX_NUM_OF_MACS (FM_MAX_NUM_OF_1G_MACS+FM_MAX_NUM_OF_10G_MACS)
+
+#define FM_MAX_NUM_OF_1G_RX_PORTS FM_MAX_NUM_OF_1G_MACS
+#define FM_MAX_NUM_OF_10G_RX_PORTS FM_MAX_NUM_OF_10G_MACS
+#define FM_MAX_NUM_OF_RX_PORTS (FM_MAX_NUM_OF_10G_RX_PORTS + FM_MAX_NUM_OF_1G_RX_PORTS)
+
+#define FM_MAX_NUM_OF_1G_TX_PORTS FM_MAX_NUM_OF_1G_MACS
+#define FM_MAX_NUM_OF_10G_TX_PORTS FM_MAX_NUM_OF_10G_MACS
+#define FM_MAX_NUM_OF_TX_PORTS (FM_MAX_NUM_OF_10G_TX_PORTS + FM_MAX_NUM_OF_1G_TX_PORTS)
+
#define FM_MAX_NUM_OF_MACSECS 1
#define FM_MACSEC_SUPPORT
diff --git a/drivers/net/ethernet/freescale/fman/inc/integrations/P3040_P4080_P5020/dpaa_integration_ext.h b/drivers/net/ethernet/freescale/fman/inc/integrations/P3040_P4080_P5020/dpaa_integration_ext.h
index a655882..257acb0 100644
--- a/drivers/net/ethernet/freescale/fman/inc/integrations/P3040_P4080_P5020/dpaa_integration_ext.h
+++ b/drivers/net/ethernet/freescale/fman/inc/integrations/P3040_P4080_P5020/dpaa_integration_ext.h
@@ -43,11 +43,7 @@
#define DPAA_VERSION 10
-/**************************************************************************//**
- @Description DPAA SW Portals Enumeration.
-*//***************************************************************************/
-typedef enum
-{
+typedef enum {
e_DPAA_SWPORTAL0 = 0,
e_DPAA_SWPORTAL1,
e_DPAA_SWPORTAL2,
@@ -61,11 +57,7 @@ typedef enum
e_DPAA_SWPORTAL_DUMMY_LAST
} e_DpaaSwPortal;
-/**************************************************************************//**
- @Description DPAA Direct Connect Portals Enumeration.
-*//***************************************************************************/
-typedef enum
-{
+typedef enum {
e_DPAA_DCPORTAL0 = 0,
e_DPAA_DCPORTAL1,
e_DPAA_DCPORTAL2,
diff --git a/drivers/net/ethernet/freescale/fman/inc/integrations/T4240/dpaa_integration_ext.h b/drivers/net/ethernet/freescale/fman/inc/integrations/T4240/dpaa_integration_ext.h
index 641d6c8..be08780 100644
--- a/drivers/net/ethernet/freescale/fman/inc/integrations/T4240/dpaa_integration_ext.h
+++ b/drivers/net/ethernet/freescale/fman/inc/integrations/T4240/dpaa_integration_ext.h
@@ -178,13 +178,13 @@ typedef enum
******************************************************************************/
#define BM_MAX_NUM_OF_POOLS 64 /**< Number of buffers pools */
-
/*****************************************************************************
SEC INTEGRATION-SPECIFIC DEFINITIONS
******************************************************************************/
#define SEC_NUM_OF_DECOS 3
#define SEC_ALL_DECOS_MASK 0x00000003
+
/*****************************************************************************
FM INTEGRATION-SPECIFIC DEFINITIONS
******************************************************************************/
@@ -259,6 +259,7 @@ typedef enum
/* FM errata */
#define FM_HEAVY_TRAFFIC_HANG_ERRATA_FMAN_A005669
#define FM_WRONG_RESET_VALUES_ERRATA_FMAN_A005127
+#define FM_RX_FIFO_CORRUPT_ERRATA_10GMAC_A006320
#define FM_BCB_ERRATA_BMI_SW001
#define FM_LEN_CHECK_ERRATA_FMAN_SW002