From: Vikram Narayanan <vikram186@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] tx25: Use generic gpio_* calls
Date: Mon, 11 Jun 2012 20:28:30 +0530 [thread overview]
Message-ID: <4FD60796.8050003@gmail.com> (raw)
In-Reply-To: <CAOMZO5CNd9A-vv7VftMJ2Ph=LS9-mqhoO6ibaW0RcxqMfidHiQ@mail.gmail.com>
Hi Fabio,
On 6/10/2012 8:08 PM, Fabio Estevam wrote:
> On Sun, Jun 10, 2012 at 10:03 AM, Vikram Narayanan<vikram186@gmail.com> wrote:
>
>> /* drop PHY power and assert reset (low) */
>> - val = readl(&gpio4->gpio_dr)& ~((1<< 7) | (1<< 9));
>> - writel(val,&gpio4->gpio_dr);
>> - val = readl(&gpio4->gpio_dir) | (1<< 7) | (1<< 9);
>> - writel(val,&gpio4->gpio_dir);
>> + gpio_direction_output(GPIO_FEC_RESET_B, 0);
>> + gpio_direction_output(GPIO_FEC_ENABLE_B, 0);
>> +
>> + gpio_direction_output(GPIO_FEC_RESET_B, 1);
>> + gpio_direction_output(GPIO_FEC_ENABLE_B, 1);
>
> gpio_direction_output should be set only once for each GPIO.
>
> After you set the direction (input or output) you should use
> 'gpio_set_value' for setting the GPIO to 0 or 1.
That was my understanding too. But some board file used it in the above
way. Hope I got a wrong example. I'll fix this.
> Also, please remove the:
>
>> + gpio_direction_output(GPIO_FEC_RESET_B, 1);
>> + gpio_direction_output(GPIO_FEC_ENABLE_B, 1);
>
> lines, as the setting to 1 should be after the delay (via gpio_set_value).
Any idea about the delay value?
Thanks,
Vikram
next prev parent reply other threads:[~2012-06-11 14:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-10 13:01 [U-Boot] imx: gpio cleanups Vikram Narayanan
2012-06-10 13:02 ` [U-Boot] [PATCH 1/3] imx25: Move MXC_GPIO_PORT_TO_NUM to imx-regs.h Vikram Narayanan
2012-06-10 14:33 ` Fabio Estevam
2012-06-11 15:00 ` Vikram Narayanan
2012-06-11 19:56 ` Troy Kisky
2012-06-10 15:03 ` Fabio Estevam
2012-06-11 15:02 ` Vikram Narayanan
2012-06-13 11:37 ` Fabio Estevam
2012-06-15 14:55 ` Stefano Babic
2012-06-15 18:10 ` Vikram Narayanan
2012-06-15 18:13 ` Fabio Estevam
2012-06-10 13:03 ` [U-Boot] [PATCH 2/3] tx25: Use generic gpio_* calls Vikram Narayanan
2012-06-10 14:38 ` Fabio Estevam
2012-06-11 14:58 ` Vikram Narayanan [this message]
2012-06-11 15:01 ` Fabio Estevam
2012-06-10 13:04 ` [U-Boot] [PATCH 3/3] imx: Define a common header file for gpio.h Vikram Narayanan
2012-06-10 13:06 ` [U-Boot] imx: gpio cleanups Vikram Narayanan
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=4FD60796.8050003@gmail.com \
--to=vikram186@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox