X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fnet%2Ffm%2Fmemac.c;h=144e109fd0336ec3a812ee53592afe94c2c9472a;hb=5b9c79a81db80c3f9e50c77477957cd803429af8;hp=32c7054e352ca89891051c6e7707a548f95a6897;hpb=a42c87f9d831c4eb36104255766cc7897876867c;p=oweals%2Fu-boot.git diff --git a/drivers/net/fm/memac.c b/drivers/net/fm/memac.c index 32c7054e35..144e109fd0 100644 --- a/drivers/net/fm/memac.c +++ b/drivers/net/fm/memac.c @@ -2,20 +2,7 @@ * Copyright 2012 Freescale Semiconductor, Inc. * Roy Zang * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ /* MAXFRM - maximum frame length */ @@ -112,6 +99,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(®s->if_mode, if_mode);