9
0
Fork 0

net fec_imx: add support for i.MX6 1000Mbps mode

Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Hubert Feurstein 2013-02-07 11:06:06 +01:00 committed by Sascha Hauer
parent 3fa377ae66
commit 91afe6c222
2 changed files with 11 additions and 4 deletions

View File

@ -361,12 +361,18 @@ static int fec_init(struct eth_device *dev)
static void fec_update_linkspeed(struct eth_device *edev)
{
struct fec_priv *fec = (struct fec_priv *)edev->priv;
int speed = edev->phydev->speed;
u32 rcntl = readl(fec->regs + FEC_R_CNTRL) & ~FEC_R_CNTRL_RMII_10T;
u32 ecntl = readl(fec->regs + FEC_ECNTRL) & ~FEC_ECNTRL_SPEED;
if (edev->phydev->speed == SPEED_10) {
u32 rcntl = readl(fec->regs + FEC_R_CNTRL);
if (speed == SPEED_10)
rcntl |= FEC_R_CNTRL_RMII_10T;
writel(rcntl, fec->regs + FEC_R_CNTRL);
}
if (speed == SPEED_1000)
ecntl |= FEC_ECNTRL_SPEED;
writel(rcntl, fec->regs + FEC_R_CNTRL);
writel(ecntl, fec->regs + FEC_ECNTRL);
}
/**

View File

@ -92,6 +92,7 @@
#define FEC_ECNTRL_RESET 0x00000001 /**< reset the FEC */
#define FEC_ECNTRL_ETHER_EN 0x00000002 /**< enable the FEC */
#define FEC_ECNTRL_SPEED 0x00000020 /**< i.MX6: enable 1000Mbps mode */
/**
* @brief Descriptor buffer alignment