]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: designware: Respect "bus mode" register contents on SW reset
authorAlexey Brodkin <Alexey.Brodkin@synopsys.com>
Wed, 25 Sep 2013 13:33:10 +0000 (17:33 +0400)
committerJoe Hershberger <joe.hershberger@ni.com>
Fri, 22 Nov 2013 22:50:54 +0000 (16:50 -0600)
"bus mode" register contains lots of fields and some of them don't
expect to be written with 0 (zero). So since we're only interested in
resetting MAC (which is done with setting the least significant bit of
this register with "0") I believe it's better to modify only 1 bit of
the register.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Acked-by: Vipin Kumar <vipin.kumar@st.com>
Patch: 277864

drivers/net/designware.c

index 8413d57767a753e22616c432276d0c7ad6725eac..22155b4d949f76587570cbf93001370fc0d7619f 100644 (file)
@@ -96,7 +96,7 @@ static int mac_reset(struct eth_device *dev)
        ulong start;
        int timeout = CONFIG_MACRESET_TIMEOUT;
 
-       writel(DMAMAC_SRST, &dma_p->busmode);
+       writel(readl(&dma_p->busmode) | DMAMAC_SRST, &dma_p->busmode);
 
        if (priv->interface != PHY_INTERFACE_MODE_RGMII)
                writel(MII_PORTSELECT, &mac_p->conf);