All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sanjeev Premi <premi@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] omap3evm: eth: split function setup_net_chip
Date: Thu, 23 Jun 2011 00:54:07 +0530	[thread overview]
Message-ID: <1308770649-3802-2-git-send-email-premi@ti.com> (raw)
In-Reply-To: <1308770649-3802-1-git-send-email-premi@ti.com>

In current implementation, the function sets up the ethernet
chip and resets it. The steps to reset depend upon the board
revision.

The patch moves the reset actions to new function reset_net_chip().

Signed-off-by: Sanjeev Premi <premi@ti.com>
---
 board/ti/evm/evm.c |   12 +++++++++++-
 board/ti/evm/evm.h |    1 +
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index aaf3033..8f9f141 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -130,6 +130,9 @@ int misc_init_r(void)
 #endif
 	omap3_evm_get_revision();
 
+#if defined(CONFIG_CMD_NET)
+	reset_net_chip();
+#endif
 	dieid_num_r();
 
 	return 0;
@@ -153,7 +156,6 @@ void set_muxconf_regs(void)
  */
 static void setup_net_chip(void)
 {
-	struct gpio *gpio3_base = (struct gpio *)OMAP34XX_GPIO3_BASE;
 	struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
 
 	/* Configure GPMC registers */
@@ -172,6 +174,14 @@ static void setup_net_chip(void)
 	/* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
 	writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
 		&ctrl_base->gpmc_nadv_ale);
+}
+
+/**
+ * Reset the ethernet chip.
+ */
+static void reset_net_chip(void)
+{
+	struct gpio *gpio3_base = (struct gpio *)OMAP34XX_GPIO3_BASE;
 
 	/* Make GPIO 64 as output pin */
 	writel(readl(&gpio3_base->oe) & ~(GPIO0), &gpio3_base->oe);
diff --git a/board/ti/evm/evm.h b/board/ti/evm/evm.h
index b721ad6..623cf1b 100644
--- a/board/ti/evm/evm.h
+++ b/board/ti/evm/evm.h
@@ -49,6 +49,7 @@ u32 get_omap3_evm_rev(void);
 
 #if defined(CONFIG_CMD_NET)
 static void setup_net_chip(void);
+static void reset_net_chip(void);
 #endif
 
 /*
-- 
1.7.2.2

  reply	other threads:[~2011-06-22 19:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22 19:24 [U-Boot] [PATCH 0/3] omap3evm: Generic ethernet fixes Sanjeev Premi
2011-06-22 19:24 ` Sanjeev Premi [this message]
2011-07-28 13:29   ` [U-Boot] [PATCH 1/3] omap3evm: eth: split function setup_net_chip Wolfgang Denk
2011-06-22 19:24 ` [U-Boot] [PATCH 2/3] omap3evm: Update ethernet reset sequence for Rev.G board Sanjeev Premi
2011-06-23  9:07   ` Igor Grinberg
2011-06-23 11:12     ` Premi, Sanjeev
2011-06-23 11:18       ` Premi, Sanjeev
2011-06-27  5:06         ` Premi, Sanjeev
2011-06-27  6:47           ` Igor Grinberg
2011-06-27 10:43             ` Premi, Sanjeev
2011-07-28 13:32   ` Wolfgang Denk
2011-06-22 19:24 ` [U-Boot] [PATCH 3/3] omap3evm: eth: Include functions only when necessary Sanjeev Premi

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=1308770649-3802-2-git-send-email-premi@ti.com \
    --to=premi@ti.com \
    --cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.