mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Johannes Stezenbach <js@sig21.net>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 6/6] drivers/net: add designware driver
Date: Wed, 20 Jun 2012 10:11:58 +0200	[thread overview]
Message-ID: <20120620081158.GA25946@sig21.net> (raw)
In-Reply-To: <20120620071301.GG28394@pengutronix.de>

Hi Sascha,

On Wed, Jun 20, 2012 at 09:13:01AM +0200, Sascha Hauer wrote:
> On Mon, Jun 18, 2012 at 04:48:00PM +0200, Johannes Stezenbach wrote:
> > Straight forward port of Synopsys Designware ethernet
> > driver from u-boot v2012.04.01.
...
> > +config DRIVER_NET_DESIGNWARE
> > +	bool "Designware Universal MAC ethernet driver"
> > +	select MIIDEV
> > +	depends on HAS_DESIGNWARE_ETH
> > +	help
> > +	  This option enables support for the Synopsys
> > +	  Designware Core Univesal MAC 10M/100M/1G ethernet IP.
> 
> This driver uses DMA, but it has no cache flush/invalidation. At least
> on ARM this means that it won't work with MMU enabled, so we should
> either add the following to Kconfig:
> 
> 	depends on !ARM || !MMU
> 
> Or add the dma_* functions. I added hints where to add these functions
> inline, but I can't test this.

Well, the driver was tested on a platform with ARM926EJ-S CPU
and works -- because it uses dma_alloc_coherent().  That
might not be optimal wrt performance, but it matches what
the u-boot driver is doing.  Do you want me to convert it
to use cachable memory and dma flush/inv?


> > +	start = get_time_ns();
> > +	while (readl(&mac_p->miiaddr) & MII_BUSY) {
> > +		if (is_timeout(start, 10 * MSECOND)) {
> > +			dev_err(&priv->netdev.dev, "MDIO timeout\n");
> > +			return -EIO;
> > +		}
> > +		udelay(10);
> 
> We do not need udelay in timeout loops as we are polling anyway.

OK, will fix

> > +#if defined(CONFIG_DW_ALTDESCRIPTOR)
> 
> Do we need this? If yes, we should add an (invisible, board selectable)
> option to Kconfig.
> 
> In U-Boot this is described with:
> 
> 1. CONFIG_DW_ALTDESCRIPTOR
> 	Define this to use the Alternate/Enhanced Descriptor configurations.
> 
> Does this mean this is an alternative way to use this hardware or does
> this mean it's another version (or IP core configuration) of this hardware?

This depends on IP core configuration.  (The major difference of the
alternate descriptor is that it has a larger length field
with can support jumbo packets.)

I wasn't sure about Kconfig because of the arch/arm/board/*/config.h.
To me it looked like config.h is a good place for this?


Thanks,
Johannes

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-06-20  8:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-18 14:47 [PATCH 0/6] misc ethernet fixes and new driver Johannes Stezenbach
2012-06-18 14:47 ` [PATCH 1/6] miidev: fix auto negotiation Johannes Stezenbach
2012-06-18 17:52   ` Roberto Nibali
2012-06-18 19:26     ` Johannes Stezenbach
2012-06-18 14:47 ` [PATCH 2/6] miidev: actually probe the PHY Johannes Stezenbach
2012-06-18 18:27   ` Roberto Nibali
2012-06-18 19:39     ` Johannes Stezenbach
2012-06-18 14:47 ` [PATCH 3/6] miidev: add support for 1000Mbit Johannes Stezenbach
2012-06-18 14:47 ` [PATCH 4/6] miidev: consistent md and mw on phy regs Johannes Stezenbach
2012-06-20  6:49   ` Sascha Hauer
2012-06-18 14:47 ` [PATCH 5/6] eth: eth MAC addresses are six bytes Johannes Stezenbach
2012-06-18 14:48 ` [PATCH 6/6] drivers/net: add designware driver Johannes Stezenbach
2012-06-20  7:13   ` Sascha Hauer
2012-06-20  8:11     ` Johannes Stezenbach [this message]
2012-06-20  8:41       ` Sascha Hauer
2012-06-20  7:15 ` [PATCH 0/6] misc ethernet fixes and new driver Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120620081158.GA25946@sig21.net \
    --to=js@sig21.net \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox