]> git.sur5r.net Git - u-boot/blobdiff - drivers/net/fm/memac.c
Merge branch 'u-boot-pxa/master' into 'u-boot-arm/master'
[u-boot] / drivers / net / fm / memac.c
index 32c7054e352ca89891051c6e7707a548f95a6897..d3eee248ac9d6d8f2b46ca05411b69ab4ccc5105 100644 (file)
@@ -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);