Exemplo n.º 1
0
int et131x_adapter_setup(struct et131x_adapter *etdev)
{
    int status = 0;

    /* Configure the JAGCore */
    ConfigGlobalRegs(etdev);

    ConfigMACRegs1(etdev);

    /* Configure the MMC registers */
    /* All we need to do is initialize the Memory Control Register */
    writel(ET_MMC_ENABLE, &etdev->regs->mmc.mmc_ctrl);

    ConfigRxMacRegs(etdev);
    ConfigTxMacRegs(etdev);

    ConfigRxDmaRegs(etdev);
    ConfigTxDmaRegs(etdev);

    ConfigMacStatRegs(etdev);

    /* Move the following code to Timer function?? */
    status = et131x_xcvr_find(etdev);

    if (status != 0)
        dev_warn(&etdev->pdev->dev, "Could not find the xcvr\n");

    /* Prepare the TRUEPHY library. */
    ET1310_PhyInit(etdev);

    /* Reset the phy now so changes take place */
    ET1310_PhyReset(etdev);

    /* Power down PHY */
    ET1310_PhyPowerDown(etdev, 1);

    /*
     * We need to turn off 1000 base half dulplex, the mac does not
     * support it. For the 10/100 part, turn off all gig advertisement
     */
    if (etdev->pdev->device != ET131X_PCI_DEVICE_ID_FAST)
        ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_FULL);
    else
        ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);

    /* Power up PHY */
    ET1310_PhyPowerDown(etdev, 0);

    et131x_setphy_normal(etdev);
    ;
    return status;
}
Exemplo n.º 2
0
/**
 * TPAL_SetPhy1000FullDuplex - Force 1000 Base T Full Duplex mode
 * @etdev: pointer to the adapter structure
 *
 * Also sets the MAC so it is syncd up properly.
 */
void TPAL_SetPhy1000FullDuplex(struct et131x_adapter *etdev)
{
	/* Power down PHY */
	ET1310_PhyPowerDown(etdev, 1);

	/* first we need to turn off all other advertisement */
	ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);

	ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);

	/* set our advertise values accordingly */
	ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_FULL);

	/* power up PHY */
	ET1310_PhyPowerDown(etdev, 0);
}
Exemplo n.º 3
0
void TPAL_SetPhy1000FullDuplex(struct et131x_adapter *etdev)
{
	
	ET1310_PhyPowerDown(etdev, 1);

	
	ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);

	ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);

	
	ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_FULL);

	
	ET1310_PhyPowerDown(etdev, 0);
}
Exemplo n.º 4
0
int et131x_setphy_normal(struct et131x_adapter *adapter)
{
	int status;

	
	ET1310_PhyPowerDown(adapter, 0);
	status = et131x_xcvr_init(adapter);
	return status;
}
Exemplo n.º 5
0
/**
 * et131x_setphy_normal - Set PHY for normal operation.
 * @adapter: pointer to our private adapter structure
 *
 * Used by Power Management to force the PHY into 10 Base T half-duplex mode,
 * when going to D3 in WOL mode. Also used during initialization to set the
 * PHY for normal operation.
 */
int et131x_setphy_normal(struct et131x_adapter *adapter)
{
	int status;

	/* Make sure the PHY is powered up */
	ET1310_PhyPowerDown(adapter, 0);
	status = et131x_xcvr_init(adapter);
	return status;
}
Exemplo n.º 6
0
void TPAL_SetPhy100HalfDuplex(struct et131x_adapter *etdev)
{
	
	ET1310_PhyPowerDown(etdev, 1);

	
	ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);

	ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);

	
	ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_HALF);

	
	ET1310_PhySpeedSelect(etdev, TRUEPHY_SPEED_100MBPS);

	
	ET1310_PhyPowerDown(etdev, 0);
}
Exemplo n.º 7
0
/**
 * TPAL_SetPhy100HalfDuplex - Force 100 Base T Half Duplex mode.
 * @etdev: pointer to the adapter structure
 *
 * Also sets the MAC so it is syncd up properly.
 */
void TPAL_SetPhy100HalfDuplex(struct et131x_adapter *etdev)
{
	/* Power down PHY */
	ET1310_PhyPowerDown(etdev, 1);

	/* first we need to turn off all other advertisement */
	ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);

	ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);

	/* Set our advertise values accordingly */
	ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_HALF);

	/* Set speed */
	ET1310_PhySpeedSelect(etdev, TRUEPHY_SPEED_100MBPS);

	/* Power up PHY */
	ET1310_PhyPowerDown(etdev, 0);
}
Exemplo n.º 8
0
void TPAL_SetPhyAutoNeg(struct et131x_adapter *etdev)
{
	
	ET1310_PhyPowerDown(etdev, 1);

	
	ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_BOTH);

	ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_BOTH);

	if (etdev->pdev->device != ET131X_PCI_DEVICE_ID_FAST)
		ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_FULL);
	else
		ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);

	
	ET1310_PhyAutoNeg(etdev, true);

	
	ET1310_PhyPowerDown(etdev, 0);
}
Exemplo n.º 9
0
/**
 * TPAL_SetPhyAutoNeg - Set phy to autonegotiation mode.
 * @etdev: pointer to the adapter structure
 */
void TPAL_SetPhyAutoNeg(struct et131x_adapter *etdev)
{
	/* Power down PHY */
	ET1310_PhyPowerDown(etdev, 1);

	/* Turn on advertisement of all capabilities */
	ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_BOTH);

	ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_BOTH);

	if (etdev->pdev->device != ET131X_PCI_DEVICE_ID_FAST)
		ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_FULL);
	else
		ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);

	/* Make sure auto-neg is ON (it is disabled in FORCE modes) */
	ET1310_PhyAutoNeg(etdev, true);

	/* Power up PHY */
	ET1310_PhyPowerDown(etdev, 0);
}
Exemplo n.º 10
0
void TPAL_SetPhy100Force(struct et131x_adapter *etdev)
{
	
	ET1310_PhyPowerDown(etdev, 1);

	
	ET1310_PhyAutoNeg(etdev, false);

	
	ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
	ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
	ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);

	
	ET1310_PhySpeedSelect(etdev, TRUEPHY_SPEED_100MBPS);

	
	ET1310_PhyDuplexMode(etdev, TRUEPHY_DUPLEX_FULL);

	
	ET1310_PhyPowerDown(etdev, 0);
}
Exemplo n.º 11
0
/**
 * TPAL_SetPhy100Force - Force 100 BaseT FD mode WITHOUT using autonegotiation
 * @etdev: pointer to the adapter structure
 */
void TPAL_SetPhy100Force(struct et131x_adapter *etdev)
{
	/* Power down PHY */
	ET1310_PhyPowerDown(etdev, 1);

	/* Disable autoneg */
	ET1310_PhyAutoNeg(etdev, false);

	/* Disable all advertisement */
	ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
	ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
	ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);

	/* Force 100 Mbps */
	ET1310_PhySpeedSelect(etdev, TRUEPHY_SPEED_100MBPS);

	/* Force Full duplex */
	ET1310_PhyDuplexMode(etdev, TRUEPHY_DUPLEX_FULL);

	/* Power up PHY */
	ET1310_PhyPowerDown(etdev, 0);
}
Exemplo n.º 12
0
/**
 * et131x_setphy_normal - Set PHY for normal operation.
 * @etdev: pointer to our private adapter structure
 *
 * Used by Power Management to force the PHY into 10 Base T half-duplex mode,
 * when going to D3 in WOL mode. Also used during initialization to set the
 * PHY for normal operation.
 */
void et131x_setphy_normal(struct et131x_adapter *etdev)
{
	/* Make sure the PHY is powered up */
	ET1310_PhyPowerDown(etdev, 0);
	et131x_xcvr_init(etdev);
}