Example #1
0
phy_interface_t fman_port_enet_if(enum fm_port port)
{
    if (is_device_disabled(port))
        return PHY_INTERFACE_MODE_NONE;

    if ((port == FM1_10GEC1 || port == FM1_10GEC2)
            && (is_serdes_configured(XAUI_FM1)))
        return PHY_INTERFACE_MODE_XGMII;

    /* Fix me need to handle RGMII here first */

    switch (port) {
    case FM1_DTSEC1:
    case FM1_DTSEC2:
    case FM1_DTSEC3:
    case FM1_DTSEC4:
    case FM1_DTSEC5:
    case FM1_DTSEC6:
        if (is_serdes_configured(SGMII_FM1_DTSEC1 + port - FM1_DTSEC1))
            return PHY_INTERFACE_MODE_SGMII;
        break;
    default:
        return PHY_INTERFACE_MODE_NONE;
    }

    return PHY_INTERFACE_MODE_NONE;
}
Example #2
0
phy_interface_t fman_port_enet_if(enum fm_port port)
{
	ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
	u32 pordevsr = in_be32(&gur->pordevsr);

	if (is_device_disabled(port))
		return PHY_INTERFACE_MODE_NONE;

	/* DTSEC1 can be SGMII, RGMII or RMII */
	if (port == FM1_DTSEC1) {
		if (is_serdes_configured(SGMII_FM1_DTSEC1))
			return PHY_INTERFACE_MODE_SGMII;
		if (pordevsr & MPC85xx_PORDEVSR_SGMII1_DIS) {
			if (pordevsr & MPC85xx_PORDEVSR_TSEC1_PRTC)
				return PHY_INTERFACE_MODE_RGMII;
			else
				return PHY_INTERFACE_MODE_RMII;
		}
	}

	/* DTSEC2 only supports SGMII or RGMII */
	if (port == FM1_DTSEC2) {
		if (is_serdes_configured(SGMII_FM1_DTSEC2))
			return PHY_INTERFACE_MODE_SGMII;
		if (pordevsr & MPC85xx_PORDEVSR_SGMII2_DIS)
			return PHY_INTERFACE_MODE_RGMII;
	}

	return PHY_INTERFACE_MODE_NONE;
}
Example #3
0
phy_interface_t fman_port_enet_if(enum fm_port port)
{
	ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
	u32 rcwsr11 = in_be32(&gur->rcwsr[11]);

	if (is_device_disabled(port))
		return PHY_INTERFACE_MODE_NONE;

	if ((port == FM1_10GEC1) && (is_serdes_configured(XAUI_FM1)))
		return PHY_INTERFACE_MODE_XGMII;

	if ((port == FM2_10GEC1) && (is_serdes_configured(XAUI_FM2)))
		return PHY_INTERFACE_MODE_XGMII;

	/* handle RGMII first */
	if ((port == FM1_DTSEC5) && ((rcwsr11 & FSL_CORENET_RCWSR11_EC1) ==
		FSL_CORENET_RCWSR11_EC1_FM1_DTSEC5_RGMII))
		return PHY_INTERFACE_MODE_RGMII;

	if ((port == FM1_DTSEC5) && ((rcwsr11 & FSL_CORENET_RCWSR11_EC1) ==
		FSL_CORENET_RCWSR11_EC1_FM1_DTSEC5_MII))
		return PHY_INTERFACE_MODE_MII;

	if ((port == FM2_DTSEC5) && ((rcwsr11 & FSL_CORENET_RCWSR11_EC2) ==
		FSL_CORENET_RCWSR11_EC2_FM2_DTSEC5_RGMII))
		return PHY_INTERFACE_MODE_RGMII;

	if ((port == FM2_DTSEC5) && ((rcwsr11 & FSL_CORENET_RCWSR11_EC2) ==
		FSL_CORENET_RCWSR11_EC2_FM2_DTSEC5_MII))
		return PHY_INTERFACE_MODE_MII;

	switch (port) {
	case FM1_DTSEC1:
	case FM1_DTSEC2:
	case FM1_DTSEC3:
	case FM1_DTSEC4:
	case FM1_DTSEC5:
		if (is_serdes_configured(SGMII_FM1_DTSEC1 + port - FM1_DTSEC1))
			return PHY_INTERFACE_MODE_SGMII;
		break;
	case FM2_DTSEC1:
	case FM2_DTSEC2:
	case FM2_DTSEC3:
	case FM2_DTSEC4:
	case FM2_DTSEC5:
		if (is_serdes_configured(SGMII_FM2_DTSEC1 + port - FM2_DTSEC1))
			return PHY_INTERFACE_MODE_SGMII;
		break;
	default:
		return PHY_INTERFACE_MODE_NONE;
	}

	return PHY_INTERFACE_MODE_NONE;
}
Example #4
0
phy_interface_t wriop_dpmac_enet_if(int dpmac_id, int lane_prtcl)
{
	enum srds_prtcl;

	if (is_device_disabled(dpmac_id + 1))
		return PHY_INTERFACE_MODE_NONE;

	if (lane_prtcl >= SGMII1 && lane_prtcl <= SGMII16)
		return PHY_INTERFACE_MODE_SGMII;

	if (lane_prtcl >= XFI1 && lane_prtcl <= XFI8)
		return PHY_INTERFACE_MODE_XGMII;

	if (lane_prtcl >= XAUI1 && lane_prtcl <= XAUI2)
		return PHY_INTERFACE_MODE_XGMII;

	if (lane_prtcl >= QSGMII_A && lane_prtcl <= QSGMII_D)
		return PHY_INTERFACE_MODE_QSGMII;

	return PHY_INTERFACE_MODE_NONE;
}
Example #5
0
phy_interface_t wriop_dpmac_enet_if(int dpmac_id, int lane_prtcl)
{
	enum srds_prtcl;

	if (is_device_disabled(dpmac_id + 1))
		return PHY_INTERFACE_MODE_NONE;

	switch (lane_prtcl) {
	case SGMII1:
	case SGMII2:
	case SGMII3:
	case SGMII7:
		return PHY_INTERFACE_MODE_SGMII;
	}

	if (lane_prtcl >= XFI1 && lane_prtcl <= XFI2)
		return PHY_INTERFACE_MODE_XGMII;

	if (lane_prtcl >= QSGMII_A && lane_prtcl <= QSGMII_B)
		return PHY_INTERFACE_MODE_QSGMII;

	return PHY_INTERFACE_MODE_NONE;
}
Example #6
0
phy_interface_t fman_port_enet_if(enum fm_port port)
{
    struct ccsr_gur *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
    u32 rcwsr13 = in_be32(&gur->rcwsr[13]);

    if (is_device_disabled(port)) {
        printf("%s:%d: port(%d) is disabled\n", __func__,
               __LINE__, port);
        return PHY_INTERFACE_MODE_NONE;
    }

    if ((port == FM1_10GEC1) && (is_serdes_configured(XFI_FM1_MAC9)))
        return PHY_INTERFACE_MODE_XGMII;

    if ((port == FM1_DTSEC9) && (is_serdes_configured(XFI_FM1_MAC9)))
        return PHY_INTERFACE_MODE_NONE;

    if (port == FM1_DTSEC3)
        if ((rcwsr13 & FSL_CHASSIS2_RCWSR13_EC1) ==
                FSL_CHASSIS2_RCWSR13_EC1_DTSEC3_RGMII) {
            printf("%s:%d: port(FM1_DTSEC3) is OK\n",
                   __func__, __LINE__);
            return PHY_INTERFACE_MODE_RGMII;
        }
    if (port == FM1_DTSEC4)
        if ((rcwsr13 & FSL_CHASSIS2_RCWSR13_EC2) ==
                FSL_CHASSIS2_RCWSR13_EC2_DTSEC4_RGMII) {
            printf("%s:%d: port(FM1_DTSEC4) is OK\n",
                   __func__, __LINE__);
            return PHY_INTERFACE_MODE_RGMII;
        }

    /* handle SGMII */
    switch (port) {
    case FM1_DTSEC1:
    case FM1_DTSEC2:
        if ((port == FM1_DTSEC2) &&
                is_serdes_configured(SGMII_2500_FM1_DTSEC2))
            return PHY_INTERFACE_MODE_SGMII_2500;
    case FM1_DTSEC5:
    case FM1_DTSEC6:
    case FM1_DTSEC9:
        if (is_serdes_configured(SGMII_FM1_DTSEC1 + port - FM1_DTSEC1))
            return PHY_INTERFACE_MODE_SGMII;
        else if ((port == FM1_DTSEC9) &&
                 is_serdes_configured(SGMII_2500_FM1_DTSEC9))
            return PHY_INTERFACE_MODE_SGMII_2500;
        break;
    default:
        break;
    }

    /* handle QSGMII */
    switch (port) {
    case FM1_DTSEC1:
    case FM1_DTSEC2:
    case FM1_DTSEC5:
    case FM1_DTSEC6:
        /* only MAC 1,2,5,6 available for QSGMII */
        if (is_serdes_configured(QSGMII_FM1_A))
            return PHY_INTERFACE_MODE_QSGMII;
        break;
    default:
        break;
    }

    return PHY_INTERFACE_MODE_NONE;
}
Example #7
0
phy_interface_t fman_port_enet_if(enum fm_port port)
{
	ccsr_gur_t *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
	u32 rcwsr13 = in_be32(&gur->rcwsr[13]);

	if (is_device_disabled(port))
		return PHY_INTERFACE_MODE_NONE;

	if ((port == FM1_10GEC1 || port == FM1_10GEC2) &&
	    ((is_serdes_configured(XAUI_FM1_MAC9))	||
	     (is_serdes_configured(XAUI_FM1_MAC10))	||
	     (is_serdes_configured(XFI_FM1_MAC9))	||
	     (is_serdes_configured(XFI_FM1_MAC10))))
		return PHY_INTERFACE_MODE_XGMII;

	if ((port == FM2_10GEC1 || port == FM2_10GEC2) &&
	    ((is_serdes_configured(XAUI_FM2_MAC9))	||
	     (is_serdes_configured(XAUI_FM2_MAC10))	||
	     (is_serdes_configured(XFI_FM2_MAC9))	||
	     (is_serdes_configured(XFI_FM2_MAC10))))
		return PHY_INTERFACE_MODE_XGMII;

#define FSL_CORENET_RCWSR13_EC1			0x60000000 /* bits 417..418 */
#define FSL_CORENET_RCWSR13_EC1_FM2_DTSEC5_RGMII	0x00000000
#define FSL_CORENET_RCWSR13_EC1_FM2_GPIO		0x40000000
#define FSL_CORENET_RCWSR13_EC2			0x18000000 /* bits 419..420 */
#define FSL_CORENET_RCWSR13_EC2_FM1_DTSEC5_RGMII	0x00000000
#define FSL_CORENET_RCWSR13_EC2_FM2_DTSEC6_RGMII	0x08000000
#define FSL_CORENET_RCWSR13_EC2_FM1_GPIO		0x10000000
	/* handle RGMII first */
	if ((port == FM2_DTSEC5) && ((rcwsr13 & FSL_CORENET_RCWSR13_EC1) ==
		FSL_CORENET_RCWSR13_EC1_FM2_DTSEC5_RGMII))
		return PHY_INTERFACE_MODE_RGMII;

	if ((port == FM1_DTSEC5) && ((rcwsr13 & FSL_CORENET_RCWSR13_EC2) ==
		FSL_CORENET_RCWSR13_EC2_FM1_DTSEC5_RGMII))
		return PHY_INTERFACE_MODE_RGMII;

	if ((port == FM2_DTSEC6) && ((rcwsr13 & FSL_CORENET_RCWSR13_EC2) ==
		FSL_CORENET_RCWSR13_EC2_FM2_DTSEC6_RGMII))
		return PHY_INTERFACE_MODE_RGMII;
	switch (port) {
	case FM1_DTSEC1:
	case FM1_DTSEC2:
	case FM1_DTSEC3:
	case FM1_DTSEC4:
	case FM1_DTSEC5:
	case FM1_DTSEC6:
	case FM1_DTSEC9:
	case FM1_DTSEC10:
		if (is_serdes_configured(SGMII_FM1_DTSEC1 + port - FM1_DTSEC1))
			return PHY_INTERFACE_MODE_SGMII;
		break;
	case FM2_DTSEC1:
	case FM2_DTSEC2:
	case FM2_DTSEC3:
	case FM2_DTSEC4:
	case FM2_DTSEC5:
	case FM2_DTSEC6:
	case FM2_DTSEC9:
	case FM2_DTSEC10:
		if (is_serdes_configured(SGMII_FM2_DTSEC1 + port - FM2_DTSEC1))
			return PHY_INTERFACE_MODE_SGMII;
		break;
	default:
		return PHY_INTERFACE_MODE_NONE;
	}

	return PHY_INTERFACE_MODE_NONE;
}
Example #8
0
phy_interface_t fman_port_enet_if(enum fm_port port)
{
	struct ccsr_gur *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
	u32 rcwsr13 = in_be32(&gur->rcwsr[13]);

	if (is_device_disabled(port))
		return PHY_INTERFACE_MODE_NONE;

	if ((port == FM1_10GEC1) && (is_serdes_configured(XFI_FM1_MAC9)))
		return PHY_INTERFACE_MODE_XGMII;

	if ((port == FM1_DTSEC9) && (is_serdes_configured(XFI_FM1_MAC9)))
		return PHY_INTERFACE_MODE_NONE;

	if ((port == FM1_10GEC2) && (is_serdes_configured(XFI_FM1_MAC10)))
		return PHY_INTERFACE_MODE_XGMII;

	if ((port == FM1_DTSEC10) && (is_serdes_configured(XFI_FM1_MAC10)))
		return PHY_INTERFACE_MODE_NONE;

	if (port == FM1_DTSEC3)
		if ((rcwsr13 & FSL_CHASSIS2_RCWSR13_EC1) ==
				FSL_CHASSIS2_RCWSR13_EC1_DTSEC3_RGMII)
			return PHY_INTERFACE_MODE_RGMII;

	if (port == FM1_DTSEC4)
		if ((rcwsr13 & FSL_CHASSIS2_RCWSR13_EC2) ==
				FSL_CHASSIS2_RCWSR13_EC2_DTSEC4_RGMII)
			return PHY_INTERFACE_MODE_RGMII;

	/* handle SGMII, only MAC 2/5/6/9/10 available */
	switch (port) {
	case FM1_DTSEC2:
	case FM1_DTSEC5:
	case FM1_DTSEC6:
	case FM1_DTSEC9:
	case FM1_DTSEC10:
		if (is_serdes_configured(SGMII_FM1_DTSEC2 + port - FM1_DTSEC2))
			return PHY_INTERFACE_MODE_SGMII;
		break;
	default:
		break;
	}

	/* handle 2.5G SGMII, only MAC 5/9/10 available */
	switch (port) {
	case FM1_DTSEC5:
	case FM1_DTSEC9:
	case FM1_DTSEC10:
		if (is_serdes_configured(SGMII_2500_FM1_DTSEC5 +
					 port - FM1_DTSEC5))
			return PHY_INTERFACE_MODE_SGMII_2500;
		break;
	default:
		break;
	}

	/* handle QSGMII, only MAC 1/5/6/10 available */
	switch (port) {
	case FM1_DTSEC1:
	case FM1_DTSEC5:
	case FM1_DTSEC6:
	case FM1_DTSEC10:
		if (is_serdes_configured(QSGMII_FM1_A))
			return PHY_INTERFACE_MODE_QSGMII;
		break;
	default:
		break;
	}

	return PHY_INTERFACE_MODE_NONE;
}