summaryrefslogtreecommitdiff
path: root/drivers/net/fm/memac.c
diff options
context:
space:
mode:
authorZang Roy-R61911 <tie-fei.zang@freescale.com>2013-03-04 03:59:20 +0000
committerAndy Fleming <afleming@freescale.com>2013-05-02 16:56:44 -0500
commitc5729f0b1fb8777c5dcfd2e510bc351045e9b1c4 (patch)
tree9f94fc7e3fd0938975c8fbe4c715291d51f40110 /drivers/net/fm/memac.c
parent7b700d212532b1b7b11e003d6949407d74fb69e3 (diff)
downloadu-boot-imx-c5729f0b1fb8777c5dcfd2e510bc351045e9b1c4.zip
u-boot-imx-c5729f0b1fb8777c5dcfd2e510bc351045e9b1c4.tar.gz
u-boot-imx-c5729f0b1fb8777c5dcfd2e510bc351045e9b1c4.tar.bz2
fman/mEMAC: set SETSP bit in IF_MODE regisgter for RGMII speed
Some legacy RGMII phys don't have in band signaling for the speed information. so set the RGMII MAC mode according to the speed got from PHY. Signed-off-by: Roy Zang <tie-fei.zang@freescale.com> Reported-by: John Traill <john.traill@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
Diffstat (limited to 'drivers/net/fm/memac.c')
-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);