mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Bo Shen <voice.shen@atmel.com>
To: s.hauer@pengutronix.de
Cc: barebox@lists.infradead.org
Subject: [PATCH v2 1/4] net: macb: enable GEM with only FE feature
Date: Tue, 23 Sep 2014 16:29:15 +0800	[thread overview]
Message-ID: <1411460958-27491-2-git-send-email-voice.shen@atmel.com> (raw)
In-Reply-To: <1411460958-27491-1-git-send-email-voice.shen@atmel.com>

If the GEM is used, however only FE featuren enabled, then it can not
support FBLDO configured as 16, and no RGMII/GMII configuratin bit.

So, in order to support GEM only with FE feature enabled, we do:
  - using default value for FBLDO.
  - using same bit for RMII/MII configuration as GEM for RGMII/GMII.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
Changes in v2:
  - using the same bit for RMII/MII configuration for GEM only with FE feature.

 drivers/net/macb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 12a2a3c..876af0d 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -304,7 +304,6 @@ static void macb_configure_dma(struct macb_device *bp)
 	if (macb_is_gem(bp)) {
 		dmacfg = gem_readl(bp, DMACFG) & ~GEM_BF(RXBS, -1L);
 		dmacfg |= GEM_BF(RXBS, bp->rx_buffer_size / RX_BUFFER_MULTIPLE);
-		dmacfg |= GEM_BF(FBLDO, 16);
 		dmacfg |= GEM_BIT(TXPBMS) | GEM_BF(RXBMS, -1L);
 		dmacfg |= GEM_BIT(DDRP);
 		dmacfg &= ~GEM_BIT(ENDIA);
@@ -352,7 +351,10 @@ static void macb_init(struct macb_device *macb)
 		break;
 	case PHY_INTERFACE_MODE_RMII:
 		if (IS_ENABLED(CONFIG_ARCH_AT91))
-			val = MACB_BIT(RMII) | MACB_BIT(CLKEN);
+			if (macb_is_gem(macb))
+				val = GEM_BIT(RGMII);
+			else
+				val = MACB_BIT(RMII) | MACB_BIT(CLKEN);
 		else
 			val = 0;
 		break;
-- 
2.1.0.24.g4109c28


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

  reply	other threads:[~2014-09-23  8:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23  8:29 [PATCH v2 0/4] ARM: at91: add sama5d4ek board support Bo Shen
2014-09-23  8:29 ` Bo Shen [this message]
2014-09-23  8:29 ` [PATCH v2 2/4] ARM: at91: add sama5d4 soc support #1 Bo Shen
2014-09-23  8:29 ` [PATCH v2 3/4] ARM: at91: add sama5d4 soc support #2 Bo Shen
2014-09-23  8:29 ` [PATCH v2 4/4] ARM: at91: add sama5d4ek board support Bo Shen
2014-09-24  4:47 ` [PATCH v2 0/4] " 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=1411460958-27491-2-git-send-email-voice.shen@atmel.com \
    --to=voice.shen@atmel.com \
    --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