AIF Module Setup

AIF module setup, aif_setup.c
There are two functions in aif_setup.c:
 * 1) vConfigAif AIF configuration
 * 2) vCloseAif closing AIF handle

AIF configuration,
The AIF setup begins by initializing the CSL library, CSL_aifInit(&AifContext). This function initializes the context object. It needs to be invoked before using an AIF module. Upon success, this function returns CSL_status CSL_SOK. Next, the SERDES link used for the data transfers is defined in the aifParam structure. Then, the AIF module requested is opened, CSL_aifOpen. The function returns an AIF handle; which is used as the input for the rest of the APIs used within the AIF module. Once an AIF handle associated to the link is returned, the link setup starts by associating the global fields, common link fields, inbound and outbound links setup structure to the particular link, including the mains blocks of the AIF interface.

Global setup, gblCfg

This structure is used to configure AIF global parameters.

SERDES link setup, aSdCfg

This structure is used to configure SERDES parameters specific for the chosen link.

SERDES common setup, sdCommonCfg

 

Link setup – common parameters to all links, aCommoncfg

Inbound link configuration, aInboundCfg 

Outbound link configuration, aOutboundCfg  

Protocol Decoder common configuration, pdCommonCfg 

Rx MAC setup, aRmCfg

Tx MAC setup, aTmCfg

Protocol Encoder setup, aPeCfg

Aggregator setup, aAgCfg

 

As all mains blocks of each link are configured correctly, the AIF module setup is completed by configuring it using CSL_aifHwSetup. Upon setup completion,it returns CSL_SOK. The chosen link is activated for Tx/Rx data transfers only when the PLL is activated. This is achievable by querying the PLL status with the function CSL_aifGetHwStatus. However, note that the SERDES PLL must be locked, and be enabled before enabling the Tx/Rx links. The new delta offset value is send every time the Tx is in its optimal state. The AIF setup is completed by inserting the CPRI protocol version, as well as the pointer, p, which defines the sub-channel boundary between the vendor-specific region and the fast control and management region.