/* Returns a negative error code if SERDES is disabled or the given device is not supported in the current SERDES protocol.  */
int serdes_get_first_lane(enum srds_prtcl device)
/* Returns a negative error code if SERDES is disabled or the given device is not supported in the current SERDES protocol.  */
int serdes_get_first_lane(enum srds_prtcl device)
{
	u32 prtcl;
	const ccsr_gur_t *gur;
	gur = (typeof(gur))CONFIG_SYS_MPC85xx_GUTS_ADDR;
	if (unlikely((in_be32(&gur->rcwsr[5]) & 0x2000) == 0))
		return -ENODEV;
	prtcl = (in_be32(&gur->rcwsr[4]) & FSL_CORENET_RCWSR4_SRDS_PRTCL) >> 26;
	return __serdes_get_first_lane(prtcl, device);
}