From bf85a4429e47f90eb0ec41055cf2338de1666132 Mon Sep 17 00:00:00 2001 From: Harini Katakam Date: Fri, 9 Oct 2015 13:40:37 +0530 Subject: [PATCH] emacps: Fix examaples to avoid compilation errors in Zynq Modify clock config function to move all ZynqMP GEM related code inside XPAR_ checks. This fixes the compilation errors for Zynq that are caused by references to GEM2/3. Signed-off-by: Harini Katakam Acked by: Punnaiah Choudary Kalluri --- .../emacps/examples/xemacps_example_intr_dma.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/XilinxProcessorIPLib/drivers/emacps/examples/xemacps_example_intr_dma.c b/XilinxProcessorIPLib/drivers/emacps/examples/xemacps_example_intr_dma.c index bccd7482..ff4c2cbf 100644 --- a/XilinxProcessorIPLib/drivers/emacps/examples/xemacps_example_intr_dma.c +++ b/XilinxProcessorIPLib/drivers/emacps/examples/xemacps_example_intr_dma.c @@ -1207,8 +1207,8 @@ void XEmacPsClkSetup(XEmacPs *EmacPsInstancePtr, u16 EmacPsIntrId) if (GemVersion > 2) { - if (EmacPsIntrId == XPS_GEM0_INT_ID) { #ifdef XPAR_PSU_ETHERNET_0_DEVICE_ID + if (EmacPsIntrId == XPS_GEM0_INT_ID) { /* GEM0 1G clock configuration*/ CrlApbClkCntrl = *(volatile unsigned int *)(CRL_GEM0_REF_CTRL); @@ -1217,9 +1217,12 @@ void XEmacPsClkSetup(XEmacPs *EmacPsInstancePtr, u16 EmacPsIntrId) CrlApbClkCntrl |= CRL_GEM_1G_DIV0; *(volatile unsigned int *)(CRL_GEM0_REF_CTRL) = CrlApbClkCntrl; + + } #endif - } else if (EmacPsIntrId == XPS_GEM1_INT_ID) { #ifdef XPAR_PSU_ETHERNET_1_DEVICE_ID + if (EmacPsIntrId == XPS_GEM1_INT_ID) { + /* GEM1 1G clock configuration*/ CrlApbClkCntrl = *(volatile unsigned int *)(CRL_GEM1_REF_CTRL); @@ -1228,9 +1231,11 @@ void XEmacPsClkSetup(XEmacPs *EmacPsInstancePtr, u16 EmacPsIntrId) CrlApbClkCntrl |= CRL_GEM_1G_DIV0; *(volatile unsigned int *)(CRL_GEM1_REF_CTRL) = CrlApbClkCntrl; + } #endif - } else if (EmacPsIntrId == XPS_GEM2_INT_ID) { #ifdef XPAR_PSU_ETHERNET_2_DEVICE_ID + if (EmacPsIntrId == XPS_GEM2_INT_ID) { + /* GEM1 1G clock configuration*/ CrlApbClkCntrl = *(volatile unsigned int *)(CRL_GEM2_REF_CTRL); @@ -1239,9 +1244,11 @@ void XEmacPsClkSetup(XEmacPs *EmacPsInstancePtr, u16 EmacPsIntrId) CrlApbClkCntrl |= CRL_GEM_1G_DIV0; *(volatile unsigned int *)(CRL_GEM2_REF_CTRL) = CrlApbClkCntrl; + + } #endif - } else if (EmacPsIntrId == XPS_GEM3_INT_ID) { #ifdef XPAR_PSU_ETHERNET_3_DEVICE_ID + if (EmacPsIntrId == XPS_GEM3_INT_ID) { /* GEM1 1G clock configuration*/ CrlApbClkCntrl = *(volatile unsigned int *)(CRL_GEM3_REF_CTRL); @@ -1250,7 +1257,7 @@ void XEmacPsClkSetup(XEmacPs *EmacPsInstancePtr, u16 EmacPsIntrId) CrlApbClkCntrl |= CRL_GEM_1G_DIV0; *(volatile unsigned int *)(CRL_GEM3_REF_CTRL) = CrlApbClkCntrl; -#endif } +#endif } }