首页 > 其他分享 >NET2272.C 代码分析——SetProcessorSpecificDefaultConfiguration

NET2272.C 代码分析——SetProcessorSpecificDefaultConfiguration

时间:2023-01-04 14:32:55浏览次数:45  
标签:NET2272 16 DMA 代码 SetProcessorSpecificDefaultConfiguration access PF pDev bit

section("L1_code") int SetProcessorSpecificDefaultConfiguration(ADI_NET2272_DEVICE *pDev)
{
/* enable async bank 3 */
*pEBIU_AMGCTL |= 0xF;
ssync();

/* default settings, one should be able to change through
device controls before issuing USB_CMD_START */

#if defined(__ADSPBF533__)
pDev->DmaStreamID = ADI_DMA_MDMA_0;
pDev->PeripheralID = ADI_INT_PFA;
pDev->PF_Reset = PF11;
pDev->PF_Int = PF10;
pDev->PF_Clear = 0;
pDev->PF_Set = 0;
pDev->PeripheralIVG = ik_ivg13; /* use default by querying the SSL */
#elif defined(__ADSPBF537__)
pDev->DmaStreamID = ADI_DMA_MDMA_0;
pDev->PeripheralID = ADI_INT_PORTFG_A;
pDev->PF_Reset = PF6;
pDev->PF_Int = PF7;
pDev->PF_Clear = 0;
pDev->PF_Set = 0;
pDev->PeripheralIVG = ik_ivg13; /* use default by querying the SSL */
#elif defined(__ADSPBF561__)
pDev->DmaStreamID = ADI_DMA_MDMA2_0;
pDev->PeripheralID = ADI_INT_PF0_15_A;
pDev->PF_Reset = PF11;
pDev->PF_Int = PF10;
pDev->PF_Clear = PF12; /* PF12 used by USB EZ-EXTENDER to indicate we are connected to BF561 EZ-KIT */
pDev->PF_Set = 0;
pDev->PeripheralIVG = ik_ivg13; /* use default by querying the SSL */
#else
#error *** Processor not supported ***
#endif
return 0;
}

本函数的作用是对NET2272与ADSP的接口进行配置。

首先要使能内存异步块3

*pEBIU_AMGCTL |= 0xF;

ssync();

Asynchronous Memory Global
Control Register (EBIU_AMGCTL)


The Asynchronous Memory Global Control register configures global aspects of the controller. It contains bank enables and other information as described in this section. This register should not be programmed while the AMC is in use. The EBIU_AMGCTL register should be the last control register written to when configuring the processor to access external memory-mapped asynchronous devices. Writes to this register should be followed by an SSYNC

Figure 16-3. Asynchronous Memory Global Control (EBIU_AMGCTL)




Within the EBIU_AMGCTL register, the AMCKEN bit is used for external devices that are connected to CLKOUT. When it is needed, the CLKOUT/SCLK1 pin can be enabled by setting the AMCKEN bit in the EBIU_AMGCTL register. In systems that do not use CLKOUT/SCLK1, set the AMCKEN

Writing a “1” to the AMBEN2–0

The 16-bit packing enable bits (B0PEN, B1PEN, B2PEN and B3PEN) are available to control the access size for each asynchronous memory bank separately. When one of these bits is set to one, any request to the corresponding AMC (Asynchronous Memory Controller) bank will result in a 16-bit access to external devices. Regardless of whether the request comes from a 8-bit, 16-bit, 32-bit data fetch or whether the fetch originates from the DMA controller, the EBIU will perform a 16-bit access. In the case of 32-bit requests to the AMC, a dual 16-bit access will be made to fetch 32-bits.

For more details on the use of ABE3–0, please refer to ​​"Byte Enables" on another page​​.

When a 16-bit packing enable bit is set to zero (that is, “cleared”), the AMC treats any request to the dedicated bank as a 32-bit access to external device. Regardless of the kind of access (8,16 or 32-bit fetch), the external bus will perform a 32-bit access.

The CDPRIO bit configures the AMC to control the priority requests that occur simultaneously to the EBIU from either the processor core or the DMA controller. When this bit is set to zero, requests from either core have priority over a request from the DMA controller to the AMC, unless the DMA is “urgent”. When the CDPRIO

标签:NET2272,16,DMA,代码,SetProcessorSpecificDefaultConfiguration,access,PF,pDev,bit
From: https://blog.51cto.com/u_15929756/5988624

相关文章