All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/3] omap3evm: Generic ethernet fixes
@ 2011-06-22 19:24 Sanjeev Premi
  2011-06-22 19:24 ` [U-Boot] [PATCH 1/3] omap3evm: eth: split function setup_net_chip Sanjeev Premi
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Sanjeev Premi @ 2011-06-22 19:24 UTC (permalink / raw)
  To: u-boot

This patchset mainly fixes the ethernet reset sequence
on the Rev G EVM board.

Function setup_net_chip() is required to detect the
board revision. However, steps to reset the ethernet
chip now depend upon the board revision.

Therefore, steps to reset the ethernet chip have been
moved to a new function reset_net_chip() - called
after board revision has been detected/ identified.

Sanjeev Premi (2):
  omap3evm: eth: split function setup_net_chip
  omap3evm: eth: Include functions only when necessary

Sriramakrishnan (1):
  omap3evm: Update ethernet reset sequence for Rev.G board

 board/ti/evm/evm.c |   37 +++++++++++++++++++++++++++++--------
 board/ti/evm/evm.h |    1 +
 2 files changed, 30 insertions(+), 8 deletions(-)

-- 
1.7.2.2

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 1/3] omap3evm: eth: split function setup_net_chip
  2011-06-22 19:24 [U-Boot] [PATCH 0/3] omap3evm: Generic ethernet fixes Sanjeev Premi
@ 2011-06-22 19:24 ` Sanjeev Premi
  2011-07-28 13:29   ` 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-22 19:24 ` [U-Boot] [PATCH 3/3] omap3evm: eth: Include functions only when necessary Sanjeev Premi
  2 siblings, 1 reply; 12+ messages in thread
From: Sanjeev Premi @ 2011-06-22 19:24 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/3] omap3evm: Update ethernet reset sequence for Rev.G board
  2011-06-22 19:24 [U-Boot] [PATCH 0/3] omap3evm: Generic ethernet fixes Sanjeev Premi
  2011-06-22 19:24 ` [U-Boot] [PATCH 1/3] omap3evm: eth: split function setup_net_chip Sanjeev Premi
@ 2011-06-22 19:24 ` Sanjeev Premi
  2011-06-23  9:07   ` Igor Grinberg
  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
  2 siblings, 2 replies; 12+ messages in thread
From: Sanjeev Premi @ 2011-06-22 19:24 UTC (permalink / raw)
  To: u-boot

From: Sriramakrishnan <srk@ti.com>

The GPIO pin used for resetting the external LAN chip has
changed for Rev.G board.

Signed-off-by: Sriramakrishnan <srk@ti.com>
Signed-off-by: Sanjeev Premi <premi@ti.com>
---
 board/ti/evm/evm.c |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 8f9f141..57e5fa5 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -181,17 +181,26 @@ static void setup_net_chip(void)
  */
 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);
-
-	/* Now send a pulse on the GPIO pin */
-	writel(GPIO0, &gpio3_base->setdataout);
+	struct gpio *gpio_base;
+	u32 pin;
+
+	if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1) {
+		gpio_base = (struct gpio *)OMAP34XX_GPIO3_BASE;
+		pin = GPIO0;	/* Output pin: GPIO Bank 3, pin 0 */
+	} else {
+		gpio_base = (struct gpio *)OMAP34XX_GPIO1_BASE;
+		pin = GPIO7;	/* Output pin: GPIO Bank 0, pin 7 */
+	}
+
+	/* Configure the pin as output */
+	writel(readl(&gpio_base->oe) & ~(pin), &gpio_base->oe);
+
+	/* Send a pulse on the GPIO pin */
+	writel(pin, &gpio_base->setdataout);
 	udelay(1);
-	writel(GPIO0, &gpio3_base->cleardataout);
+	writel(pin, &gpio_base->cleardataout);
 	udelay(1);
-	writel(GPIO0, &gpio3_base->setdataout);
+	writel(pin, &gpio_base->setdataout);
 }
 
 int board_eth_init(bd_t *bis)
-- 
1.7.2.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 3/3] omap3evm: eth: Include functions only when necessary
  2011-06-22 19:24 [U-Boot] [PATCH 0/3] omap3evm: Generic ethernet fixes Sanjeev Premi
  2011-06-22 19:24 ` [U-Boot] [PATCH 1/3] omap3evm: eth: split function setup_net_chip Sanjeev Premi
  2011-06-22 19:24 ` [U-Boot] [PATCH 2/3] omap3evm: Update ethernet reset sequence for Rev.G board Sanjeev Premi
@ 2011-06-22 19:24 ` Sanjeev Premi
  2 siblings, 0 replies; 12+ messages in thread
From: Sanjeev Premi @ 2011-06-22 19:24 UTC (permalink / raw)
  To: u-boot

These functions are not required when CONFIG_CMD_NET
is not defined:
  - setup_net_chip()
  - reset_net_chip()
  - board_eth_init()

This patch wraps them in #ifdef CONFIG_CMD_NET...#endif

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

diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 57e5fa5..599e366 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -149,6 +149,7 @@ void set_muxconf_regs(void)
 	MUX_EVM();
 }
 
+#ifdef CONFIG_CMD_NET
 /*
  * Routine: setup_net_chip
  * Description: Setting up the configuration GPMC registers specific to the
@@ -211,3 +212,4 @@ int board_eth_init(bd_t *bis)
 #endif
 	return rc;
 }
+#endif /* CONFIG_CMD_NET */
-- 
1.7.2.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/3] omap3evm: Update ethernet reset sequence for Rev.G board
  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-07-28 13:32   ` Wolfgang Denk
  1 sibling, 1 reply; 12+ messages in thread
From: Igor Grinberg @ 2011-06-23  9:07 UTC (permalink / raw)
  To: u-boot

Hi Sanjeev,

On 06/22/11 22:24, Sanjeev Premi wrote:
> From: Sriramakrishnan <srk@ti.com>
>
> The GPIO pin used for resetting the external LAN chip has
> changed for Rev.G board.
>
> Signed-off-by: Sriramakrishnan <srk@ti.com>
> Signed-off-by: Sanjeev Premi <premi@ti.com>
> ---
>  board/ti/evm/evm.c |   27 ++++++++++++++++++---------
>  1 files changed, 18 insertions(+), 9 deletions(-)
>
> diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
> index 8f9f141..57e5fa5 100644
> --- a/board/ti/evm/evm.c
> +++ b/board/ti/evm/evm.c
> @@ -181,17 +181,26 @@ static void setup_net_chip(void)
>   */
>  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);
> -
> -	/* Now send a pulse on the GPIO pin */
> -	writel(GPIO0, &gpio3_base->setdataout);
> +	struct gpio *gpio_base;
> +	u32 pin;
> +
> +	if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1) {
> +		gpio_base = (struct gpio *)OMAP34XX_GPIO3_BASE;
> +		pin = GPIO0;	/* Output pin: GPIO Bank 3, pin 0 */
> +	} else {
> +		gpio_base = (struct gpio *)OMAP34XX_GPIO1_BASE;
> +		pin = GPIO7;	/* Output pin: GPIO Bank 0, pin 7 */
> +	}
> +
> +	/* Configure the pin as output */
> +	writel(readl(&gpio_base->oe) & ~(pin), &gpio_base->oe);
> +
> +	/* Send a pulse on the GPIO pin */
> +	writel(pin, &gpio_base->setdataout);
>  	udelay(1);
> -	writel(GPIO0, &gpio3_base->cleardataout);
> +	writel(pin, &gpio_base->cleardataout);
>  	udelay(1);
> -	writel(GPIO0, &gpio3_base->setdataout);
> +	writel(pin, &gpio_base->setdataout);

Why keep messing with the gpio registers?
Why not use gpio framework?
Though it is omap specific, but it will be much cleaner then the above.


-- 
Regards,
Igor.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/3] omap3evm: Update ethernet reset sequence for Rev.G board
  2011-06-23  9:07   ` Igor Grinberg
@ 2011-06-23 11:12     ` Premi, Sanjeev
  2011-06-23 11:18       ` Premi, Sanjeev
  0 siblings, 1 reply; 12+ messages in thread
From: Premi, Sanjeev @ 2011-06-23 11:12 UTC (permalink / raw)
  To: u-boot

> -----Original Message-----
> From: Igor Grinberg [mailto:grinberg at compulab.co.il] 
> Sent: Thursday, June 23, 2011 2:38 PM
> To: Premi, Sanjeev
> Cc: u-boot at lists.denx.de; Govindarajan, Sriramakrishnan
> Subject: Re: [U-Boot] [PATCH 2/3] omap3evm: Update ethernet 
> reset sequence for Rev.G board
> 
> Hi Sanjeev,
> 
> On 06/22/11 22:24, Sanjeev Premi wrote:
> > From: Sriramakrishnan <srk@ti.com>
> >
> > The GPIO pin used for resetting the external LAN chip has
> > changed for Rev.G board.
> >
> > Signed-off-by: Sriramakrishnan <srk@ti.com>
> > Signed-off-by: Sanjeev Premi <premi@ti.com>
> > ---
> >  board/ti/evm/evm.c |   27 ++++++++++++++++++---------
> >  1 files changed, 18 insertions(+), 9 deletions(-)
> >
> > diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
> > index 8f9f141..57e5fa5 100644
> > --- a/board/ti/evm/evm.c
> > +++ b/board/ti/evm/evm.c
> > @@ -181,17 +181,26 @@ static void setup_net_chip(void)
> >   */
> >  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);
> > -
> > -	/* Now send a pulse on the GPIO pin */
> > -	writel(GPIO0, &gpio3_base->setdataout);
> > +	struct gpio *gpio_base;
> > +	u32 pin;
> > +
> > +	if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1) {
> > +		gpio_base = (struct gpio *)OMAP34XX_GPIO3_BASE;
> > +		pin = GPIO0;	/* Output pin: GPIO Bank 3, pin 0 */
> > +	} else {
> > +		gpio_base = (struct gpio *)OMAP34XX_GPIO1_BASE;
> > +		pin = GPIO7;	/* Output pin: GPIO Bank 0, pin 7 */
> > +	}
> > +
> > +	/* Configure the pin as output */
> > +	writel(readl(&gpio_base->oe) & ~(pin), &gpio_base->oe);
> > +
> > +	/* Send a pulse on the GPIO pin */
> > +	writel(pin, &gpio_base->setdataout);
> >  	udelay(1);
> > -	writel(GPIO0, &gpio3_base->cleardataout);
> > +	writel(pin, &gpio_base->cleardataout);
> >  	udelay(1);
> > -	writel(GPIO0, &gpio3_base->setdataout);
> > +	writel(pin, &gpio_base->setdataout);
> 
> Why keep messing with the gpio registers?
> Why not use gpio framework?
> Though it is omap specific, but it will be much cleaner then 
> the above.

[sp] I guess the intent was to keep code similar. But yes,
     gpio framework can be used.

~sanjeev

> 
> 
> -- 
> Regards,
> Igor.
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/3] omap3evm: Update ethernet reset sequence for Rev.G board
  2011-06-23 11:12     ` Premi, Sanjeev
@ 2011-06-23 11:18       ` Premi, Sanjeev
  2011-06-27  5:06         ` Premi, Sanjeev
  0 siblings, 1 reply; 12+ messages in thread
From: Premi, Sanjeev @ 2011-06-23 11:18 UTC (permalink / raw)
  To: u-boot

> -----Original Message-----
> From: u-boot-bounces at lists.denx.de 
> [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Premi, Sanjeev
> Sent: Thursday, June 23, 2011 4:43 PM
> To: Igor Grinberg
> Cc: Govindarajan, Sriramakrishnan; u-boot at lists.denx.de
> Subject: Re: [U-Boot] [PATCH 2/3] omap3evm: Update ethernet 
> reset sequence for Rev.G board
> 
> > -----Original Message-----
> > From: Igor Grinberg [mailto:grinberg at compulab.co.il] 
> > Sent: Thursday, June 23, 2011 2:38 PM
> > To: Premi, Sanjeev
> > Cc: u-boot at lists.denx.de; Govindarajan, Sriramakrishnan
> > Subject: Re: [U-Boot] [PATCH 2/3] omap3evm: Update ethernet 
> > reset sequence for Rev.G board
> > 
> > Hi Sanjeev,
> > 
> > On 06/22/11 22:24, Sanjeev Premi wrote:
> > > From: Sriramakrishnan <srk@ti.com>
> > >
> > > The GPIO pin used for resetting the external LAN chip has
> > > changed for Rev.G board.
> > >
> > > Signed-off-by: Sriramakrishnan <srk@ti.com>
> > > Signed-off-by: Sanjeev Premi <premi@ti.com>
> > > ---
> > >  board/ti/evm/evm.c |   27 ++++++++++++++++++---------
> > >  1 files changed, 18 insertions(+), 9 deletions(-)
> > >
> > > diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
> > > index 8f9f141..57e5fa5 100644
> > > --- a/board/ti/evm/evm.c
> > > +++ b/board/ti/evm/evm.c
> > > @@ -181,17 +181,26 @@ static void setup_net_chip(void)
> > >   */
> > >  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);
> > > -
> > > -	/* Now send a pulse on the GPIO pin */
> > > -	writel(GPIO0, &gpio3_base->setdataout);
> > > +	struct gpio *gpio_base;
> > > +	u32 pin;
> > > +
> > > +	if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1) {
> > > +		gpio_base = (struct gpio *)OMAP34XX_GPIO3_BASE;
> > > +		pin = GPIO0;	/* Output pin: GPIO Bank 3, pin 0 */
> > > +	} else {
> > > +		gpio_base = (struct gpio *)OMAP34XX_GPIO1_BASE;
> > > +		pin = GPIO7;	/* Output pin: GPIO Bank 0, pin 7 */
> > > +	}
> > > +
> > > +	/* Configure the pin as output */
> > > +	writel(readl(&gpio_base->oe) & ~(pin), &gpio_base->oe);
> > > +
> > > +	/* Send a pulse on the GPIO pin */
> > > +	writel(pin, &gpio_base->setdataout);
> > >  	udelay(1);
> > > -	writel(GPIO0, &gpio3_base->cleardataout);
> > > +	writel(pin, &gpio_base->cleardataout);
> > >  	udelay(1);
> > > -	writel(GPIO0, &gpio3_base->setdataout);
> > > +	writel(pin, &gpio_base->setdataout);
> > 
> > Why keep messing with the gpio registers?
> > Why not use gpio framework?
> > Though it is omap specific, but it will be much cleaner then 
> > the above.
> 
> [sp] I guess the intent was to keep code similar. But yes,
>      gpio framework can be used.
> 

[sp] Sorry, mail went earlier than I wanted :(

     The only issue is that I couln't see gpio framework for omap.
     Let me dig further...

> ~sanjeev
> 
> > 
> > 
> > -- 
> > Regards,
> > Igor.
> > 
> > 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/3] omap3evm: Update ethernet reset sequence for Rev.G board
  2011-06-23 11:18       ` Premi, Sanjeev
@ 2011-06-27  5:06         ` Premi, Sanjeev
  2011-06-27  6:47           ` Igor Grinberg
  0 siblings, 1 reply; 12+ messages in thread
From: Premi, Sanjeev @ 2011-06-27  5:06 UTC (permalink / raw)
  To: u-boot

> -----Original Message-----
> From: Premi, Sanjeev 
> Sent: Thursday, June 23, 2011 4:48 PM
> To: Premi, Sanjeev; Igor Grinberg
> Cc: Govindarajan, Sriramakrishnan; u-boot at lists.denx.de
> Subject: RE: [U-Boot] [PATCH 2/3] omap3evm: Update ethernet 
> reset sequence for Rev.G board
> 
> > -----Original Message-----
> > From: u-boot-bounces at lists.denx.de 
> > [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Premi, Sanjeev
> > Sent: Thursday, June 23, 2011 4:43 PM
> > To: Igor Grinberg
> > Cc: Govindarajan, Sriramakrishnan; u-boot at lists.denx.de
> > Subject: Re: [U-Boot] [PATCH 2/3] omap3evm: Update ethernet 
> > reset sequence for Rev.G board
> > 
> > > -----Original Message-----
> > > From: Igor Grinberg [mailto:grinberg at compulab.co.il] 
> > > Sent: Thursday, June 23, 2011 2:38 PM
> > > To: Premi, Sanjeev
> > > Cc: u-boot at lists.denx.de; Govindarajan, Sriramakrishnan
> > > Subject: Re: [U-Boot] [PATCH 2/3] omap3evm: Update ethernet 
> > > reset sequence for Rev.G board
> > > 
> > > Hi Sanjeev,
> > > 
> > > On 06/22/11 22:24, Sanjeev Premi wrote:
> > > > From: Sriramakrishnan <srk@ti.com>
> > > >
> > > > The GPIO pin used for resetting the external LAN chip has
> > > > changed for Rev.G board.
> > > >
> > > > Signed-off-by: Sriramakrishnan <srk@ti.com>
> > > > Signed-off-by: Sanjeev Premi <premi@ti.com>
> > > > ---
> > > >  board/ti/evm/evm.c |   27 ++++++++++++++++++---------
> > > >  1 files changed, 18 insertions(+), 9 deletions(-)
> > > >

[snip]...[snip]

> > > > +	/* Send a pulse on the GPIO pin */
> > > > +	writel(pin, &gpio_base->setdataout);
> > > >  	udelay(1);
> > > > -	writel(GPIO0, &gpio3_base->cleardataout);
> > > > +	writel(pin, &gpio_base->cleardataout);
> > > >  	udelay(1);
> > > > -	writel(GPIO0, &gpio3_base->setdataout);
> > > > +	writel(pin, &gpio_base->setdataout);
> > > 
> > > Why keep messing with the gpio registers?
> > > Why not use gpio framework?
> > > Though it is omap specific, but it will be much cleaner then 
> > > the above.
> > 
> > [sp] I guess the intent was to keep code similar. But yes,
> >      gpio framework can be used.
> > 
> 
> [sp] Sorry, mail went earlier than I wanted :(
> 
>      The only issue is that I couln't see gpio framework for omap.
>      Let me dig further...
> 

[sp] Implementing GPIO for OMAP would be a long task. It should be
     done for long term; but is it necessary pre-condition for the
     patch?

~sanjeev

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/3] omap3evm: Update ethernet reset sequence for Rev.G board
  2011-06-27  5:06         ` Premi, Sanjeev
@ 2011-06-27  6:47           ` Igor Grinberg
  2011-06-27 10:43             ` Premi, Sanjeev
  0 siblings, 1 reply; 12+ messages in thread
From: Igor Grinberg @ 2011-06-27  6:47 UTC (permalink / raw)
  To: u-boot

On 06/27/11 08:06, Premi, Sanjeev wrote:

>> -----Original Message-----
>> From: Premi, Sanjeev 
>> Sent: Thursday, June 23, 2011 4:48 PM
>> To: Premi, Sanjeev; Igor Grinberg
>> Cc: Govindarajan, Sriramakrishnan; u-boot at lists.denx.de
>> Subject: RE: [U-Boot] [PATCH 2/3] omap3evm: Update ethernet 
>> reset sequence for Rev.G board
>>
>>> -----Original Message-----
>>> From: u-boot-bounces at lists.denx.de 
>>> [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Premi, Sanjeev
>>> Sent: Thursday, June 23, 2011 4:43 PM
>>> To: Igor Grinberg
>>> Cc: Govindarajan, Sriramakrishnan; u-boot at lists.denx.de
>>> Subject: Re: [U-Boot] [PATCH 2/3] omap3evm: Update ethernet 
>>> reset sequence for Rev.G board
>>>
>>>> -----Original Message-----
>>>> From: Igor Grinberg [mailto:grinberg at compulab.co.il] 
>>>> Sent: Thursday, June 23, 2011 2:38 PM
>>>> To: Premi, Sanjeev
>>>> Cc: u-boot at lists.denx.de; Govindarajan, Sriramakrishnan
>>>> Subject: Re: [U-Boot] [PATCH 2/3] omap3evm: Update ethernet 
>>>> reset sequence for Rev.G board
>>>>
>>>> Hi Sanjeev,
>>>>
>>>> On 06/22/11 22:24, Sanjeev Premi wrote:
>>>>> From: Sriramakrishnan <srk@ti.com>
>>>>>
>>>>> The GPIO pin used for resetting the external LAN chip has
>>>>> changed for Rev.G board.
>>>>>
>>>>> Signed-off-by: Sriramakrishnan <srk@ti.com>
>>>>> Signed-off-by: Sanjeev Premi <premi@ti.com>
>>>>> ---
>>>>>  board/ti/evm/evm.c |   27 ++++++++++++++++++---------
>>>>>  1 files changed, 18 insertions(+), 9 deletions(-)
>>>>>
> [snip]...[snip]
>
>>>>> +	/* Send a pulse on the GPIO pin */
>>>>> +	writel(pin, &gpio_base->setdataout);
>>>>>  	udelay(1);
>>>>> -	writel(GPIO0, &gpio3_base->cleardataout);
>>>>> +	writel(pin, &gpio_base->cleardataout);
>>>>>  	udelay(1);
>>>>> -	writel(GPIO0, &gpio3_base->setdataout);
>>>>> +	writel(pin, &gpio_base->setdataout);
>>>> Why keep messing with the gpio registers?
>>>> Why not use gpio framework?
>>>> Though it is omap specific, but it will be much cleaner then 
>>>> the above.
>>> [sp] I guess the intent was to keep code similar. But yes,
>>>      gpio framework can be used.
>>>
>> [sp] Sorry, mail went earlier than I wanted :(
>>
>>      The only issue is that I couln't see gpio framework for omap.
>>      Let me dig further...
>>
> [sp] Implementing GPIO for OMAP would be a long task. It should be
>      done for long term; but is it necessary pre-condition for the
>      patch?

There is no need to implement GPIO for OMAP. It is already there,
you just need to use it instead of writing directly to the GPIO registers.
You can find all the implementation in: arch/arm/cpu/armv7/omap3/gpio.c
and the header is: arch/arm/include/asm/arch-omap3/gpio.h

All you need is to include the header, request the appropriate gpio,
send the pulse and maybe (if you don't need it anymore) free that gpio.
This is not hard or long at all.



-- 
Regards,
Igor.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/3] omap3evm: Update ethernet reset sequence for Rev.G board
  2011-06-27  6:47           ` Igor Grinberg
@ 2011-06-27 10:43             ` Premi, Sanjeev
  0 siblings, 0 replies; 12+ messages in thread
From: Premi, Sanjeev @ 2011-06-27 10:43 UTC (permalink / raw)
  To: u-boot

> -----Original Message-----
> From: Igor Grinberg [mailto:grinberg at compulab.co.il] 
> Sent: Monday, June 27, 2011 12:17 PM
> To: Premi, Sanjeev
> Cc: Govindarajan, Sriramakrishnan; u-boot at lists.denx.de
> Subject: Re: [U-Boot] [PATCH 2/3] omap3evm: Update ethernet 
> reset sequence for Rev.G board
> 
> On 06/27/11 08:06, Premi, Sanjeev wrote:
> 
> >> -----Original Message-----
> >> From: Premi, Sanjeev 
> >> Sent: Thursday, June 23, 2011 4:48 PM
> >> To: Premi, Sanjeev; Igor Grinberg
> >> Cc: Govindarajan, Sriramakrishnan; u-boot at lists.denx.de
> >> Subject: RE: [U-Boot] [PATCH 2/3] omap3evm: Update ethernet 
> >> reset sequence for Rev.G board
> >>
> >>> -----Original Message-----
> >>> From: u-boot-bounces at lists.denx.de 
> >>> [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Premi, Sanjeev
> >>> Sent: Thursday, June 23, 2011 4:43 PM
> >>> To: Igor Grinberg
> >>> Cc: Govindarajan, Sriramakrishnan; u-boot at lists.denx.de
> >>> Subject: Re: [U-Boot] [PATCH 2/3] omap3evm: Update ethernet 
> >>> reset sequence for Rev.G board
> >>>
> >>>> -----Original Message-----
> >>>> From: Igor Grinberg [mailto:grinberg at compulab.co.il] 
> >>>> Sent: Thursday, June 23, 2011 2:38 PM
> >>>> To: Premi, Sanjeev
> >>>> Cc: u-boot at lists.denx.de; Govindarajan, Sriramakrishnan
> >>>> Subject: Re: [U-Boot] [PATCH 2/3] omap3evm: Update ethernet 
> >>>> reset sequence for Rev.G board
> >>>>
> >>>> Hi Sanjeev,
> >>>>
> >>>> On 06/22/11 22:24, Sanjeev Premi wrote:
> >>>>> From: Sriramakrishnan <srk@ti.com>
> >>>>>
> >>>>> The GPIO pin used for resetting the external LAN chip has
> >>>>> changed for Rev.G board.
> >>>>>
> >>>>> Signed-off-by: Sriramakrishnan <srk@ti.com>
> >>>>> Signed-off-by: Sanjeev Premi <premi@ti.com>
> >>>>> ---
> >>>>>  board/ti/evm/evm.c |   27 ++++++++++++++++++---------
> >>>>>  1 files changed, 18 insertions(+), 9 deletions(-)
> >>>>>
> > [snip]...[snip]
> >
> >>>>> +	/* Send a pulse on the GPIO pin */
> >>>>> +	writel(pin, &gpio_base->setdataout);
> >>>>>  	udelay(1);
> >>>>> -	writel(GPIO0, &gpio3_base->cleardataout);
> >>>>> +	writel(pin, &gpio_base->cleardataout);
> >>>>>  	udelay(1);
> >>>>> -	writel(GPIO0, &gpio3_base->setdataout);
> >>>>> +	writel(pin, &gpio_base->setdataout);
> >>>> Why keep messing with the gpio registers?
> >>>> Why not use gpio framework?
> >>>> Though it is omap specific, but it will be much cleaner then 
> >>>> the above.
> >>> [sp] I guess the intent was to keep code similar. But yes,
> >>>      gpio framework can be used.
> >>>
> >> [sp] Sorry, mail went earlier than I wanted :(
> >>
> >>      The only issue is that I couln't see gpio framework for omap.
> >>      Let me dig further...
> >>
> > [sp] Implementing GPIO for OMAP would be a long task. It should be
> >      done for long term; but is it necessary pre-condition for the
> >      patch?
> 
> There is no need to implement GPIO for OMAP. It is already there,
> you just need to use it instead of writing directly to the 
> GPIO registers.
> You can find all the implementation in: 
> arch/arm/cpu/armv7/omap3/gpio.c
> and the header is: arch/arm/include/asm/arch-omap3/gpio.h

[sp] No wonder, I couldn't find it in drivers/gpio.
     (Didn't occur that it could be in ARCH specific dir)

     Will rebase and send an updated patch soon.

~sanjeev

> 
> All you need is to include the header, request the appropriate gpio,
> send the pulse and maybe (if you don't need it anymore) free 
> that gpio.
> This is not hard or long at all.
> 
> 
> 
> -- 
> Regards,
> Igor.
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 1/3] omap3evm: eth: split function setup_net_chip
  2011-06-22 19:24 ` [U-Boot] [PATCH 1/3] omap3evm: eth: split function setup_net_chip Sanjeev Premi
@ 2011-07-28 13:29   ` Wolfgang Denk
  0 siblings, 0 replies; 12+ messages in thread
From: Wolfgang Denk @ 2011-07-28 13:29 UTC (permalink / raw)
  To: u-boot

Dear Sanjeev Premi,

In message <1308770649-3802-2-git-send-email-premi@ti.com> you wrote:
> 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().

Your patch does not add any such new function, so it will result in
compile errors?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
miracle:  an  extremely  outstanding  or  unusual  event,  thing,  or
accomplishment.                                - Webster's Dictionary

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/3] omap3evm: Update ethernet reset sequence for Rev.G board
  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-07-28 13:32   ` Wolfgang Denk
  1 sibling, 0 replies; 12+ messages in thread
From: Wolfgang Denk @ 2011-07-28 13:32 UTC (permalink / raw)
  To: u-boot

Dear Sanjeev Premi,

In message <1308770649-3802-3-git-send-email-premi@ti.com> you wrote:
> 
> +	if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1) {
> +		gpio_base = (struct gpio *)OMAP34XX_GPIO3_BASE;
> +		pin = GPIO0;	/* Output pin: GPIO Bank 3, pin 0 */
> +	} else {
> +		gpio_base = (struct gpio *)OMAP34XX_GPIO1_BASE;
> +		pin = GPIO7;	/* Output pin: GPIO Bank 0, pin 7 */

Is this bank 0 or bank 1?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There are some things worth dying for.
	-- Kirk, "Errand of Mercy", stardate 3201.7

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-07-28 13:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-22 19:24 [U-Boot] [PATCH 0/3] omap3evm: Generic ethernet fixes Sanjeev Premi
2011-06-22 19:24 ` [U-Boot] [PATCH 1/3] omap3evm: eth: split function setup_net_chip Sanjeev Premi
2011-07-28 13:29   ` 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

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.