emacps: Fix examaples to avoid compilation errors in Zynq
Modify clock config function to move all ZynqMP GEM related code inside XPAR_<psu ethernet ip> checks. This fixes the compilation errors for Zynq that are caused by references to GEM2/3. Signed-off-by: Harini Katakam <harinik@xilinx.com> Acked by: Punnaiah Choudary Kalluri <punnaia@xilinx.com>
This commit is contained in:
parent
9f455efaa1
commit
bf85a4429e
1 changed files with 12 additions and 5 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue