From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Brodkin Date: Sat, 4 Jul 2015 15:12:51 +0000 Subject: [U-Boot] [PATCH] net/designware: revert MAC-address setup on init In-Reply-To: <20150701220228.GS28577@bill-the-cat> References: <1435759164-29148-1-git-send-email-abrodkin@synopsys.com> <1435760700.4689.55.camel@synopsys.com> <20150701220228.GS28577@bill-the-cat> Message-ID: <1436022770.8931.0.camel@synopsys.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Joe, On Wed, 2015-07-01 at 18:02 -0400, Tom Rini wrote: > On Wed, Jul 01, 2015 at 10:26:21AM -0500, Joe Hershberger wrote: > > Hi Alexey, > > > > On Wed, Jul 1, 2015 at 9:25 AM, Alexey Brodkin > > wrote: > > > Hi Tom, Joe, > > > > > > On Wed, 2015-07-01 at 22:22 +0800, Bin Meng wrote: > > > > Hi Alexey, > > > > > > > > On Wed, Jul 1, 2015 at 9:59 PM, Alexey Brodkin > > > > wrote: > > > > > http://git.denx.de/?p=u > > > > > -boot.git;a=patch;h=f566c9949fbdce2e09a900c5343ca9986e5ba360 > > > > > broke DW GMAC operation if !DM_ETH because eth_write_hwaddr() > > > > > doesn't > > > > > exist if !DM_NET. > > > > > > > > > > As for DM_ETH case I'm still not sure if existing > > > > > implementation > > > > > will > > > > > fly. > > > > > > > > > > The point is as it is said in the comment on "soft reset" > > > > > that is > > > > > triggered with setting DMAMAC_SRST in "busmode" register HW > > > > > address > > > > > gets > > > > > reset as well. And we inevitably need to set HW address > > > > > again. > > > > > > > > > > So probably better solution is to move mentioned "soft-reset" > > > > > from > > > > > "init" (that is used on start of any network activity) to > > > > > "initialize" > > > > > (which is only executed once in "board_r" sequence). But > > > > > that's a > > > > > bit of > > > > > a different story and for now let's just get DW GMAC > > > > > functional > > > > > again. > > > > > > > > > > Signed-off-by: Alexey Brodkin > > > > > Cc: Joe Hershberger > > > > > Cc: Michal Simek > > > > > Cc: Tom Rini > > > > > --- > > > > > drivers/net/designware.c | 4 ++++ > > > > > 1 file changed, 4 insertions(+) > > > > > > > > > > diff --git a/drivers/net/designware.c > > > > > b/drivers/net/designware.c > > > > > index ae51cf3..07281a6 100644 > > > > > --- a/drivers/net/designware.c > > > > > +++ b/drivers/net/designware.c > > > > > @@ -243,6 +243,10 @@ static int _dw_eth_init(struct > > > > > dw_eth_dev > > > > > *priv, u8 *enetaddr) > > > > > mdelay(100); > > > > > }; > > > > > > > > > > + /* Soft reset above clears HW address registers. > > > > > + * So we have to set it here once again */ > > > > > + _dw_write_hwaddr(priv, enetaddr); > > > > > + > > > > > rx_descs_init(priv); > > > > > tx_descs_init(priv); > > > > > > > > > > -- > > > > > > > > There is already a patch submitted. Please check > > > > http://patchwork.ozlabs.org/patch/484214/ > > > > > > Any chance for mentioned patch "net: designware: Program MAC > > > address to > > > hardware after soft reset" to be applied? > > > > > > This really fixes GMAC operation and it would be nice to have > > > this fix > > > in upcoming release. > > > > I think that sounds appropriate. Tom? > > Yes. Of the handful of recent (in my mind anyhow) net patches, are > you > going to do a PR for them or should I just grab things? Any chance to see that patch upstream anytime soon? -Alexey