]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/net/designware.c
net: dm9000: random mac address support
[karo-tx-uboot.git] / drivers / net / designware.c
index bf21a08bdf475afb81d6335f51cfb84cf4a7e8f9..22155b4d949f76587570cbf93001370fc0d7619f 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2010
  * Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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+
  */
 
 /*
@@ -112,8 +96,10 @@ static int mac_reset(struct eth_device *dev)
        ulong start;
        int timeout = CONFIG_MACRESET_TIMEOUT;
 
-       writel(DMAMAC_SRST, &dma_p->busmode);
-       writel(MII_PORTSELECT, &mac_p->conf);
+       writel(readl(&dma_p->busmode) | DMAMAC_SRST, &dma_p->busmode);
+
+       if (priv->interface != PHY_INTERFACE_MODE_RGMII)
+               writel(MII_PORTSELECT, &mac_p->conf);
 
        start = get_timer(0);
        while (get_timer(start) < timeout) {