linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: "Varadarajan, Charulatha" <charu@ti.com>, Sanjeev Premi <premi@ti.com>
Cc: "tony@atomide.com" <tony@atomide.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"paul@pwsan.com" <paul@pwsan.com>,
	"Cousson, Benoit" <b-cousson@ti.com>,
	"Nayak, Rajendra" <rnayak@ti.com>,
	"Basak, Partha" <p-basak2@ti.com>
Subject: Re: [PATCH v6 00/13] OMAP: GPIO: Implement GPIO in hwmod way
Date: Fri, 24 Sep 2010 11:37:22 -0700	[thread overview]
Message-ID: <8762xvdm3h.fsf@deeprootsystems.com> (raw)
In-Reply-To: <EAF47CD23C76F840A9E7FCE10091EFAB02CD46A104@dbde02.ent.ti.com> (Charulatha Varadarajan's message of "Fri, 24 Sep 2010 20:42:04 +0530")

"Varadarajan, Charulatha" <charu@ti.com> writes:

>> -----Original Message-----
>> From: Kevin Hilman [mailto:khilman@deeprootsystems.com]
>> 
>> >> "Varadarajan, Charulatha" <charu@ti.com> writes:
>
> <<snip>>
>
>> >>>> Hi Charu,
>> >>>>
>> >>>> I haven't been fully through the series, but here's some quick
>> feedback
>> >>>> based on what I tried today.
>> >>>>
>> >>>> Basically, I got stuck because the first board I tried it on was the
>> >>>> 35xx-based OMAP3EVM platform, which uses a GPIO-based interrupt for
>> the
>> >>>> network.  My setup uses DHCP + nfsroot, so the GPIO IRQ must be
>> working
>> >>>> during boot.
>> >>>>
>> >>>> The first thing I noticed, is that GPIO interrupts are not firing
>> during
>> >>>> boot, so neither the DHCP or the nfsroot works during boot.  I
>> haven't
>> >>>> been able to fully debug this, but the 3430SDP should have the same
>> >>>> issue for its smc91x if you set it up for DHCP + nfsroot.  This is
>> >>>> working fine on my pm-wip/idle-reorg branch which has the
>> prerequisites
>> >>>> you mentioned, but didn't work when I applied the clk_alias patch
>> plus
>> >>>> this series.
>> >>>
>> >>> I tested this GPIO series in pm-wip/idle-reorg branch with clock
>> >>> add alias patch and I did not see any issues. I tested with DHCP +
>> nfsroot
>> >>> on SDP3430. Please provide me some more info on this.
>> >>
>> >> Hmm, I don't have many more details yet.  All I can see is that the
>> GPIO
>> >> bank that has the smc91x interrupt (GPIO6) is loosing interrupts, and
>> >> thus preventing DHCP and nfsroot from working.
>> >>
>
> The root cause of this issue is that during OMAP3EVM board init, the
> Ethernet controller (smsc911x) is not reset and it relies on the uboot
> configurations for it's operations. The reset GPIO pin used for this
> purpose is not even reserved.

Aha.  Thanks for digging into this.

Now it makes sense why it worked for SDP and overo, but not omap3evm.
Relying too much on bootloader settings is definitely a bug in the board
file.  Since we understand it, I am OK if your series breaks this board
support.

> With GPIO hwmod series, gpio module reset happens during init and hence
> the uboot settings are modified which makes the Ethernet controller to fail.
>
> Patch [1] below if applied on top of gpio hwmod series would make the
> evm board work with DHCP and nfsroot.

Indeed, I verified that this method works, although maybe I have an
older board with a reset line that is not in GPIO1, because setting the
flag in GPIO1 didn't work.  I blindly set it in all the banks, and got
my board working.  

> Rather, patch [2] below would be a better fix for this. I am not
> getting deeper into the minor details of Ethernet controller
> initialization for OMAP3 EVM board. This patch would suffice for
> now. But my observation is that omap3evm_init_smsc911x() needs to be
> fixed including CS configuration and other required settings for
> Ethernet controller.

Yes, patch 2 is the better approach (although, I couldn't get it to work
for me.)  I suggest you raise this with Sanjeev and post your patch 2 as an RFC to
the list saying that something like this will be needed after your GPIO
series.  We'll let Sanjeev or someone on his team fix omap3evm support,
being sure it works for older boards as well.

> [1]
>
> diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
> index 43ed2ab..b137e0a 100644
> --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
> +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
> @@ -373,6 +373,7 @@ static struct omap_hwmod omap3xxx_gpio1_hwmod = {
>         .class          = &omap3xxx_gpio_hwmod_class,
>         .dev_attr       = &gpio_dev_attr,
>         .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
> +       .flags          = HWMOD_INIT_NO_RESET,
>  };
>
>
> [2]
>
> From b191662eca02450bbeaf29370916bca8811bb752 Mon Sep 17 00:00:00 2001
> From: Varadarajan, Charulatha <charu@ti.com>
> Date: Fri, 24 Sep 2010 20:00:06 +0530
> Subject: [PATCH] Fix: OMAP3EVM: Ethernet controller smsc911x reset
>
> Do reset of Ethernet controller smsc911x using OMAP gpio7
> while initializing the Ethernet controller.
>
> Signed-off-by: Charulatha V <charu@ti.com>
> ---
>  arch/arm/mach-omap2/board-omap3evm.c |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
> index f76d9c0..3ee87d0 100644
> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -55,6 +55,7 @@
>  #define OMAP3EVM_ETHR_SIZE	1024
>  #define OMAP3EVM_ETHR_ID_REV	0x50
>  #define OMAP3EVM_ETHR_GPIO_IRQ	176
> +#define OMAP3EVM_ETHR_GPIO_RST  7
>  #define OMAP3EVM_SMSC911X_CS	5
>  
>  static u8 omap3_evm_version;
> @@ -134,6 +135,14 @@ static inline void __init omap3evm_init_smsc911x(void)
>  	else
>  		rate = clk_get_rate(l3ck);
>  
> +	gpio_direction_output(OMAP3EVM_ETHR_GPIO_RST, 1);
> +
> +	/* reset pulse to ethernet controller*/
> +	gpio_set_value(OMAP3EVM_ETHR_GPIO_RST, 0);
> +	usleep_range(150, 220);
> +	gpio_set_value(OMAP3EVM_ETHR_GPIO_RST, 1);
> +	usleep_range(1, 2);
> +
>  	if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) {
>  		printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
>  			OMAP3EVM_ETHR_GPIO_IRQ);
> @@ -141,6 +150,13 @@ static inline void __init omap3evm_init_smsc911x(void)
>  	}
>  
>  	gpio_direction_input(OMAP3EVM_ETHR_GPIO_IRQ);
> +
> +	/* Configure ethernet controller reset gpio */
> +	if (gpio_request(OMAP3EVM_ETHR_GPIO_RST, "SMSC911x gpio") < 0) {
> +		pr_err(KERN_ERR "Failed to request GPIO8 for smsc911x gpio\n");
> +		return;
> +	}
> +

This request has to come before you set the direction and set the value.

>  	platform_device_register(&omap3evm_smsc911x_device);
>  }

Kevin

  reply	other threads:[~2010-09-24 18:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-18 14:15 [PATCH v6 00/13] OMAP: GPIO: Implement GPIO in hwmod way Varadarajan, Charulatha
2010-09-18 14:15 ` [PATCH v6 01/13] OMAP: GPIO: Modify init() in preparation for platform device implementation Varadarajan, Charulatha
2010-09-18 14:15 ` [PATCH v6 02/13] OMAP: GPIO: Introduce support for OMAP15xx chip GPIO init Varadarajan, Charulatha
2010-09-18 14:15 ` [PATCH v6 03/13] OMAP: GPIO: Introduce support for OMAP16xx " Varadarajan, Charulatha
2010-09-18 14:15 ` [PATCH v6 04/13] OMAP: GPIO: Introduce support for OMAP7xx " Varadarajan, Charulatha
2010-09-18 14:15 ` [PATCH v6 05/13] OMAP2420: hwmod data: Add GPIO Varadarajan, Charulatha
2010-09-18 14:15 ` [PATCH v6 06/13] OMAP2430: " Varadarajan, Charulatha
2010-09-18 14:15 ` [PATCH v6 07/13] OMAP3: " Varadarajan, Charulatha
2010-09-21 23:22   ` Kevin Hilman
2010-09-18 14:15 ` [PATCH v6 08/13] OMAP4: " Varadarajan, Charulatha
2010-09-18 14:15 ` [PATCH v6 09/13] OMAP2PLUS: GPIO: use omap_device_build for device registration Varadarajan, Charulatha
2010-09-18 14:15 ` [PATCH v6 10/13] OMAP: GPIO: Implement GPIO as a platform device Varadarajan, Charulatha
2010-09-18 14:15 ` [PATCH v6 11/13] OMAP: GPIO: Make gpio_context as part of gpio_bank structure Varadarajan, Charulatha
2010-09-18 14:15 ` [PATCH v6 12/13] OMAP: GPIO: Use dev_pm_ops instead of sys_dev_class Varadarajan, Charulatha
2010-09-18 14:15 ` [PATCH v6 13/13] OMAP: GPIO: Remove omap_gpio_init() Varadarajan, Charulatha
2010-09-21  0:07 ` [PATCH v6 00/13] OMAP: GPIO: Implement GPIO in hwmod way Kevin Hilman
2010-09-21 14:06   ` Varadarajan, Charulatha
2010-09-21 17:57     ` Kevin Hilman
2010-09-21 23:34       ` Kevin Hilman
2010-09-22  0:18         ` Kevin Hilman
2010-09-22 14:27           ` Varadarajan, Charulatha
2010-09-22 14:33             ` Kevin Hilman
2010-09-22 23:11           ` Kevin Hilman
2010-09-24 15:12           ` Varadarajan, Charulatha
2010-09-24 18:37             ` Kevin Hilman [this message]
2010-09-25 11:59               ` Varadarajan, Charulatha

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=8762xvdm3h.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=b-cousson@ti.com \
    --cc=charu@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=p-basak2@ti.com \
    --cc=paul@pwsan.com \
    --cc=premi@ti.com \
    --cc=rnayak@ti.com \
    --cc=tony@atomide.com \
    /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;
as well as URLs for NNTP newsgroup(s).