/* Function to configure the phy in loopback mode. */
s32 synopGMAC_phy_loopback(synopGMACdevice *gmacdev, bool loopback)
/* Function to configure the phy in loopback mode. */
s32 synopGMAC_phy_loopback(synopGMACdevice *gmacdev, bool loopback)
{
s32 status = -ESYNOPGMACNOERR;
u16 *temp;
    status = synopGMAC_read_phy_reg(gmacdev->MacBase, gmacdev->PhyBase, PHY_CONTROL_REG,temp);
if(loopback)
    *temp |= 0x4000;
else
    *temp = *temp;
    status = synopGMAC_write_phy_reg(gmacdev->MacBase, gmacdev->PhyBase, PHY_CONTROL_REG, *temp);
return status;
}