summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-05-11 00:06:03 +0200
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-05-11 00:06:03 +0200
commite825b100d209a9d3c79b2998452cafa94eec986a (patch)
treee1654c4d745839eba8d37f67d15acde79382e23e /drivers/net
parentb03b25caea1ff3a501161f5bc1ad5e5b5b124e0c (diff)
parent66a62ce0dc48d2319938c72f34a562f519c5d5c2 (diff)
downloadu-boot-imx-e825b100d209a9d3c79b2998452cafa94eec986a.zip
u-boot-imx-e825b100d209a9d3c79b2998452cafa94eec986a.tar.gz
u-boot-imx-e825b100d209a9d3c79b2998452cafa94eec986a.tar.bz2
Merge branch 'u-boot-pxa/master' into 'u-boot-arm/master'
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/fm/memac.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/fm/memac.c b/drivers/net/fm/memac.c
index 32c7054..d3eee24 100644
--- a/drivers/net/fm/memac.c
+++ b/drivers/net/fm/memac.c
@@ -112,6 +112,23 @@ static void memac_set_interface_mode(struct fsl_enet_mac *mac,
/* Enable automatic speed selection */
if_mode |= IF_MODE_EN_AUTO;
+ if (type == PHY_INTERFACE_MODE_RGMII) {
+ if_mode &= ~IF_MODE_EN_AUTO;
+ if_mode &= ~IF_MODE_SETSP_MASK;
+ switch (speed) {
+ case SPEED_1000:
+ if_mode |= IF_MODE_SETSP_1000M;
+ break;
+ case SPEED_100:
+ if_mode |= IF_MODE_SETSP_100M;
+ break;
+ case SPEED_10:
+ if_mode |= IF_MODE_SETSP_10M;
+ default:
+ break;
+ }
+ }
+
debug(" %s, if_mode = %x\n", __func__, if_mode);
debug(" %s, if_status = %x\n", __func__, if_status);
out_be32(&regs->if_mode, if_mode);