* [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller in board_init
@ 2011-01-25 15:22 Vaibhav Hiremath
2011-01-25 15:28 ` Hiremath, Vaibhav
0 siblings, 1 reply; 12+ messages in thread
From: Vaibhav Hiremath @ 2011-01-25 15:22 UTC (permalink / raw)
To: linux-omap; +Cc: Vaibhav Hiremath, Charulatha V
With addition of hwmod support to gpio, the ethernet controller
goes undetected for OMAP35xEVM. So explicitly assert the reset signal to
ethernet controller smsc911x -
- GPIO7 (>=RevG version of EVM's)
- GPIO64 (<=RevD version of EVM's)
This patch is based on intial version from Charulatha V, reference
to original discussion -
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg35784.html
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Charulatha V <charu@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
---
Since Kevin reported that this patch doesn't get applied cleanly,
so I am reposting it again after making sure that it gets applied cleanly.
arch/arm/mach-omap2/board-omap3evm.c | 39 +++++++++++++++++++++++++++++++++-
1 files changed, 38 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 323c380..97e0f65 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -58,6 +58,13 @@
#define OMAP3EVM_ETHR_ID_REV 0x50
#define OMAP3EVM_ETHR_GPIO_IRQ 176
#define OMAP3EVM_SMSC911X_CS 5
+/*
+ * Eth Reset signal
+ * 64 = Generation 1 (<=RevD)
+ * 7 = Generation 2 (>=RevE)
+ */
+#define OMAP3EVM_GEN1_ETHR_GPIO_RST 64
+#define OMAP3EVM_GEN2_ETHR_GPIO_RST 7
static u8 omap3_evm_version;
@@ -124,10 +131,15 @@ static struct platform_device omap3evm_smsc911x_device = {
static inline void __init omap3evm_init_smsc911x(void)
{
- int eth_cs;
+ int eth_cs, eth_rst;
struct clk *l3ck;
unsigned int rate;
+ if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1)
+ eth_rst = OMAP3EVM_GEN1_ETHR_GPIO_RST;
+ else
+ eth_rst = OMAP3EVM_GEN2_ETHR_GPIO_RST;
+
eth_cs = OMAP3EVM_SMSC911X_CS;
l3ck = clk_get(NULL, "l3_ck");
@@ -136,6 +148,27 @@ static inline void __init omap3evm_init_smsc911x(void)
else
rate = clk_get_rate(l3ck);
+ /* Configure ethernet controller reset gpio */
+ if (cpu_is_omap3430()) {
+ if (gpio_request(eth_rst, "SMSC911x gpio") < 0) {
+ pr_err(KERN_ERR "Failed to request %d for smsc911x\n",
+ eth_rst);
+ return;
+ }
+
+ if (gpio_direction_output(eth_rst, 1) < 0) {
+ pr_err(KERN_ERR "Failed to set direction of %d for" \
+ " smsc911x\n", eth_rst);
+ return;
+ }
+ /* reset pulse to ethernet controller*/
+ usleep_range(150, 220);
+ gpio_set_value(eth_rst, 0);
+ usleep_range(150, 220);
+ gpio_set_value(eth_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);
@@ -658,6 +691,10 @@ static struct omap_board_mux board_mux[] __initdata = {
OMAP_PIN_OFF_WAKEUPENABLE),
OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW),
+ OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
+ OMAP_PIN_OFF_NONE),
+ OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
+ OMAP_PIN_OFF_NONE),
{ .reg_offset = OMAP_MUX_TERMINATOR },
};
#endif
--
1.6.2.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* RE: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller in board_init
2011-01-25 15:22 [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller in board_init Vaibhav Hiremath
@ 2011-01-25 15:28 ` Hiremath, Vaibhav
0 siblings, 0 replies; 12+ messages in thread
From: Hiremath, Vaibhav @ 2011-01-25 15:28 UTC (permalink / raw)
To: Hiremath, Vaibhav, linux-omap; +Cc: Varadarajan, Charulatha, linux-arm-kernel
> -----Original Message-----
> From: Hiremath, Vaibhav
> Sent: Tuesday, January 25, 2011 8:53 PM
> To: linux-omap@vger.kernel.org
> Cc: Hiremath, Vaibhav; Varadarajan, Charulatha
> Subject: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller
> in board_init
>
> With addition of hwmod support to gpio, the ethernet controller
> goes undetected for OMAP35xEVM. So explicitly assert the reset signal to
> ethernet controller smsc911x -
>
> - GPIO7 (>=RevG version of EVM's)
> - GPIO64 (<=RevD version of EVM's)
>
> This patch is based on intial version from Charulatha V, reference
> to original discussion -
> http://www.mail-archive.com/linux-omap@vger.kernel.org/msg35784.html
> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> Signed-off-by: Charulatha V <charu@ti.com>
> Tested-by: Kevin Hilman <khilman@ti.com>
> ---
> Since Kevin reported that this patch doesn't get applied cleanly,
> so I am reposting it again after making sure that it gets applied cleanly.
>
[Hiremath, Vaibhav] Oops, missed linux-arm-kernel list, adding here.
Not sure whether I need to repost keeping linux-arm-kernel?
Thanks,
Vaibhav
> arch/arm/mach-omap2/board-omap3evm.c | 39
> +++++++++++++++++++++++++++++++++-
> 1 files changed, 38 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-
> omap2/board-omap3evm.c
> index 323c380..97e0f65 100644
> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -58,6 +58,13 @@
> #define OMAP3EVM_ETHR_ID_REV 0x50
> #define OMAP3EVM_ETHR_GPIO_IRQ 176
> #define OMAP3EVM_SMSC911X_CS 5
> +/*
> + * Eth Reset signal
> + * 64 = Generation 1 (<=RevD)
> + * 7 = Generation 2 (>=RevE)
> + */
> +#define OMAP3EVM_GEN1_ETHR_GPIO_RST 64
> +#define OMAP3EVM_GEN2_ETHR_GPIO_RST 7
>
> static u8 omap3_evm_version;
>
> @@ -124,10 +131,15 @@ static struct platform_device
> omap3evm_smsc911x_device = {
>
> static inline void __init omap3evm_init_smsc911x(void)
> {
> - int eth_cs;
> + int eth_cs, eth_rst;
> struct clk *l3ck;
> unsigned int rate;
>
> + if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1)
> + eth_rst = OMAP3EVM_GEN1_ETHR_GPIO_RST;
> + else
> + eth_rst = OMAP3EVM_GEN2_ETHR_GPIO_RST;
> +
> eth_cs = OMAP3EVM_SMSC911X_CS;
>
> l3ck = clk_get(NULL, "l3_ck");
> @@ -136,6 +148,27 @@ static inline void __init
> omap3evm_init_smsc911x(void)
> else
> rate = clk_get_rate(l3ck);
>
> + /* Configure ethernet controller reset gpio */
> + if (cpu_is_omap3430()) {
> + if (gpio_request(eth_rst, "SMSC911x gpio") < 0) {
> + pr_err(KERN_ERR "Failed to request %d for smsc911x\n",
> + eth_rst);
> + return;
> + }
> +
> + if (gpio_direction_output(eth_rst, 1) < 0) {
> + pr_err(KERN_ERR "Failed to set direction of %d for" \
> + " smsc911x\n", eth_rst);
> + return;
> + }
> + /* reset pulse to ethernet controller*/
> + usleep_range(150, 220);
> + gpio_set_value(eth_rst, 0);
> + usleep_range(150, 220);
> + gpio_set_value(eth_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);
> @@ -658,6 +691,10 @@ static struct omap_board_mux board_mux[] __initdata =
> {
> OMAP_PIN_OFF_WAKEUPENABLE),
> OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
> OMAP_PIN_OFF_INPUT_PULLUP |
> OMAP_PIN_OFF_OUTPUT_LOW),
> + OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
> + OMAP_PIN_OFF_NONE),
> + OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
> + OMAP_PIN_OFF_NONE),
> { .reg_offset = OMAP_MUX_TERMINATOR },
> };
> #endif
> --
> 1.6.2.4
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller in board_init
@ 2011-01-25 15:28 ` Hiremath, Vaibhav
0 siblings, 0 replies; 12+ messages in thread
From: Hiremath, Vaibhav @ 2011-01-25 15:28 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: Hiremath, Vaibhav
> Sent: Tuesday, January 25, 2011 8:53 PM
> To: linux-omap at vger.kernel.org
> Cc: Hiremath, Vaibhav; Varadarajan, Charulatha
> Subject: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller
> in board_init
>
> With addition of hwmod support to gpio, the ethernet controller
> goes undetected for OMAP35xEVM. So explicitly assert the reset signal to
> ethernet controller smsc911x -
>
> - GPIO7 (>=RevG version of EVM's)
> - GPIO64 (<=RevD version of EVM's)
>
> This patch is based on intial version from Charulatha V, reference
> to original discussion -
> http://www.mail-archive.com/linux-omap at vger.kernel.org/msg35784.html
> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> Signed-off-by: Charulatha V <charu@ti.com>
> Tested-by: Kevin Hilman <khilman@ti.com>
> ---
> Since Kevin reported that this patch doesn't get applied cleanly,
> so I am reposting it again after making sure that it gets applied cleanly.
>
[Hiremath, Vaibhav] Oops, missed linux-arm-kernel list, adding here.
Not sure whether I need to repost keeping linux-arm-kernel?
Thanks,
Vaibhav
> arch/arm/mach-omap2/board-omap3evm.c | 39
> +++++++++++++++++++++++++++++++++-
> 1 files changed, 38 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-
> omap2/board-omap3evm.c
> index 323c380..97e0f65 100644
> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -58,6 +58,13 @@
> #define OMAP3EVM_ETHR_ID_REV 0x50
> #define OMAP3EVM_ETHR_GPIO_IRQ 176
> #define OMAP3EVM_SMSC911X_CS 5
> +/*
> + * Eth Reset signal
> + * 64 = Generation 1 (<=RevD)
> + * 7 = Generation 2 (>=RevE)
> + */
> +#define OMAP3EVM_GEN1_ETHR_GPIO_RST 64
> +#define OMAP3EVM_GEN2_ETHR_GPIO_RST 7
>
> static u8 omap3_evm_version;
>
> @@ -124,10 +131,15 @@ static struct platform_device
> omap3evm_smsc911x_device = {
>
> static inline void __init omap3evm_init_smsc911x(void)
> {
> - int eth_cs;
> + int eth_cs, eth_rst;
> struct clk *l3ck;
> unsigned int rate;
>
> + if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1)
> + eth_rst = OMAP3EVM_GEN1_ETHR_GPIO_RST;
> + else
> + eth_rst = OMAP3EVM_GEN2_ETHR_GPIO_RST;
> +
> eth_cs = OMAP3EVM_SMSC911X_CS;
>
> l3ck = clk_get(NULL, "l3_ck");
> @@ -136,6 +148,27 @@ static inline void __init
> omap3evm_init_smsc911x(void)
> else
> rate = clk_get_rate(l3ck);
>
> + /* Configure ethernet controller reset gpio */
> + if (cpu_is_omap3430()) {
> + if (gpio_request(eth_rst, "SMSC911x gpio") < 0) {
> + pr_err(KERN_ERR "Failed to request %d for smsc911x\n",
> + eth_rst);
> + return;
> + }
> +
> + if (gpio_direction_output(eth_rst, 1) < 0) {
> + pr_err(KERN_ERR "Failed to set direction of %d for" \
> + " smsc911x\n", eth_rst);
> + return;
> + }
> + /* reset pulse to ethernet controller*/
> + usleep_range(150, 220);
> + gpio_set_value(eth_rst, 0);
> + usleep_range(150, 220);
> + gpio_set_value(eth_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);
> @@ -658,6 +691,10 @@ static struct omap_board_mux board_mux[] __initdata =
> {
> OMAP_PIN_OFF_WAKEUPENABLE),
> OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
> OMAP_PIN_OFF_INPUT_PULLUP |
> OMAP_PIN_OFF_OUTPUT_LOW),
> + OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
> + OMAP_PIN_OFF_NONE),
> + OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
> + OMAP_PIN_OFF_NONE),
> { .reg_offset = OMAP_MUX_TERMINATOR },
> };
> #endif
> --
> 1.6.2.4
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller in board_init
2011-01-25 15:28 ` Hiremath, Vaibhav
(?)
@ 2011-01-25 16:09 ` Will Deacon
-1 siblings, 0 replies; 12+ messages in thread
From: Will Deacon @ 2011-01-25 16:09 UTC (permalink / raw)
To: 'Hiremath, Vaibhav', linux-omap
Cc: linux-arm-kernel, Varadarajan, Charulatha
Hello,
> > Subject: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller
> > in board_init
> >
> > With addition of hwmod support to gpio, the ethernet controller
> > goes undetected for OMAP35xEVM. So explicitly assert the reset signal to
> > ethernet controller smsc911x -
> >
> > - GPIO7 (>=RevG version of EVM's)
> > - GPIO64 (<=RevD version of EVM's)
> >
> > This patch is based on intial version from Charulatha V, reference
> > to original discussion -
> > http://www.mail-archive.com/linux-omap@vger.kernel.org/msg35784.html
> > Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> > Signed-off-by: Charulatha V <charu@ti.com>
> > Tested-by: Kevin Hilman <khilman@ti.com>
Out of interest - have you tried this network chip (smsc9118) in an SMP
environment [is it on OMAP4?]? On the Versatile Express it's quite easy to
get it to `lock up'. It claims to be servicing interrupts but you certainly
don't get any useful packets. and ifdown/ifup brings it back to life again.
I took a brief look at the driver and found a few issues there:
1.) Read-after-read and read-after-write minimum delays aren't respected
2.) The locking is too low-level (it's around the register accessors) so
there is plenty of scope for deadlock if a calling function holds some
other locks too.
3.) FIFO fastforwarding uses the word count instead of the byte count.
4.) Bit 20 of the HW_CFG register apparently always needs to be asserted,
but it's 0 out of reset (who knows what they were thinking?!).
I tried to resolve these problems (admittedly as a quick bit of hacking)
but the issue persists.
Anyway, it would just be nice to know if anybody else has seen problems
with this chip/driver because it makes the Versatile Express pretty much
useless as a remote box.
Will
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller in board_init
2011-01-25 15:28 ` Hiremath, Vaibhav
(?)
(?)
@ 2011-01-25 16:09 ` Will Deacon
-1 siblings, 0 replies; 12+ messages in thread
From: Will Deacon @ 2011-01-25 16:09 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
> > Subject: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller
> > in board_init
> >
> > With addition of hwmod support to gpio, the ethernet controller
> > goes undetected for OMAP35xEVM. So explicitly assert the reset signal to
> > ethernet controller smsc911x -
> >
> > - GPIO7 (>=RevG version of EVM's)
> > - GPIO64 (<=RevD version of EVM's)
> >
> > This patch is based on intial version from Charulatha V, reference
> > to original discussion -
> > http://www.mail-archive.com/linux-omap at vger.kernel.org/msg35784.html
> > Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> > Signed-off-by: Charulatha V <charu@ti.com>
> > Tested-by: Kevin Hilman <khilman@ti.com>
Out of interest - have you tried this network chip (smsc9118) in an SMP
environment [is it on OMAP4?]? On the Versatile Express it's quite easy to
get it to `lock up'. It claims to be servicing interrupts but you certainly
don't get any useful packets. and ifdown/ifup brings it back to life again.
I took a brief look at the driver and found a few issues there:
1.) Read-after-read and read-after-write minimum delays aren't respected
2.) The locking is too low-level (it's around the register accessors) so
there is plenty of scope for deadlock if a calling function holds some
other locks too.
3.) FIFO fastforwarding uses the word count instead of the byte count.
4.) Bit 20 of the HW_CFG register apparently always needs to be asserted,
but it's 0 out of reset (who knows what they were thinking?!).
I tried to resolve these problems (admittedly as a quick bit of hacking)
but the issue persists.
Anyway, it would just be nice to know if anybody else has seen problems
with this chip/driver because it makes the Versatile Express pretty much
useless as a remote box.
Will
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller in board_init
2011-01-25 15:28 ` Hiremath, Vaibhav
@ 2011-01-27 19:58 ` Kevin Hilman
-1 siblings, 0 replies; 12+ messages in thread
From: Kevin Hilman @ 2011-01-27 19:58 UTC (permalink / raw)
To: Hiremath, Vaibhav; +Cc: linux-omap, Varadarajan, Charulatha, linux-arm-kernel
"Hiremath, Vaibhav" <hvaibhav@ti.com> writes:
>> -----Original Message-----
>> From: Hiremath, Vaibhav
>> Sent: Tuesday, January 25, 2011 8:53 PM
>> To: linux-omap@vger.kernel.org
>> Cc: Hiremath, Vaibhav; Varadarajan, Charulatha
>> Subject: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller
>> in board_init
>>
>> With addition of hwmod support to gpio, the ethernet controller
>> goes undetected for OMAP35xEVM. So explicitly assert the reset signal to
>> ethernet controller smsc911x -
>>
>> - GPIO7 (>=RevG version of EVM's)
>> - GPIO64 (<=RevD version of EVM's)
>>
>> This patch is based on intial version from Charulatha V, reference
>> to original discussion -
>> http://www.mail-archive.com/linux-omap@vger.kernel.org/msg35784.html
>> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
>> Signed-off-by: Charulatha V <charu@ti.com>
>> Tested-by: Kevin Hilman <khilman@ti.com>
>> ---
>> Since Kevin reported that this patch doesn't get applied cleanly,
>> so I am reposting it again after making sure that it gets applied cleanly.
>>
> [Hiremath, Vaibhav] Oops, missed linux-arm-kernel list, adding here.
>
> Not sure whether I need to repost keeping linux-arm-kernel?
Yes, please repost.
Kevin
>
>> arch/arm/mach-omap2/board-omap3evm.c | 39
>> +++++++++++++++++++++++++++++++++-
>> 1 files changed, 38 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-
>> omap2/board-omap3evm.c
>> index 323c380..97e0f65 100644
>> --- a/arch/arm/mach-omap2/board-omap3evm.c
>> +++ b/arch/arm/mach-omap2/board-omap3evm.c
>> @@ -58,6 +58,13 @@
>> #define OMAP3EVM_ETHR_ID_REV 0x50
>> #define OMAP3EVM_ETHR_GPIO_IRQ 176
>> #define OMAP3EVM_SMSC911X_CS 5
>> +/*
>> + * Eth Reset signal
>> + * 64 = Generation 1 (<=RevD)
>> + * 7 = Generation 2 (>=RevE)
>> + */
>> +#define OMAP3EVM_GEN1_ETHR_GPIO_RST 64
>> +#define OMAP3EVM_GEN2_ETHR_GPIO_RST 7
>>
>> static u8 omap3_evm_version;
>>
>> @@ -124,10 +131,15 @@ static struct platform_device
>> omap3evm_smsc911x_device = {
>>
>> static inline void __init omap3evm_init_smsc911x(void)
>> {
>> - int eth_cs;
>> + int eth_cs, eth_rst;
>> struct clk *l3ck;
>> unsigned int rate;
>>
>> + if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1)
>> + eth_rst = OMAP3EVM_GEN1_ETHR_GPIO_RST;
>> + else
>> + eth_rst = OMAP3EVM_GEN2_ETHR_GPIO_RST;
>> +
>> eth_cs = OMAP3EVM_SMSC911X_CS;
>>
>> l3ck = clk_get(NULL, "l3_ck");
>> @@ -136,6 +148,27 @@ static inline void __init
>> omap3evm_init_smsc911x(void)
>> else
>> rate = clk_get_rate(l3ck);
>>
>> + /* Configure ethernet controller reset gpio */
>> + if (cpu_is_omap3430()) {
>> + if (gpio_request(eth_rst, "SMSC911x gpio") < 0) {
>> + pr_err(KERN_ERR "Failed to request %d for smsc911x\n",
>> + eth_rst);
>> + return;
>> + }
>> +
>> + if (gpio_direction_output(eth_rst, 1) < 0) {
>> + pr_err(KERN_ERR "Failed to set direction of %d for" \
>> + " smsc911x\n", eth_rst);
>> + return;
>> + }
>> + /* reset pulse to ethernet controller*/
>> + usleep_range(150, 220);
>> + gpio_set_value(eth_rst, 0);
>> + usleep_range(150, 220);
>> + gpio_set_value(eth_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);
>> @@ -658,6 +691,10 @@ static struct omap_board_mux board_mux[] __initdata =
>> {
>> OMAP_PIN_OFF_WAKEUPENABLE),
>> OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
>> OMAP_PIN_OFF_INPUT_PULLUP |
>> OMAP_PIN_OFF_OUTPUT_LOW),
>> + OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
>> + OMAP_PIN_OFF_NONE),
>> + OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
>> + OMAP_PIN_OFF_NONE),
>> { .reg_offset = OMAP_MUX_TERMINATOR },
>> };
>> #endif
>> --
>> 1.6.2.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller in board_init
@ 2011-01-27 19:58 ` Kevin Hilman
0 siblings, 0 replies; 12+ messages in thread
From: Kevin Hilman @ 2011-01-27 19:58 UTC (permalink / raw)
To: linux-arm-kernel
"Hiremath, Vaibhav" <hvaibhav@ti.com> writes:
>> -----Original Message-----
>> From: Hiremath, Vaibhav
>> Sent: Tuesday, January 25, 2011 8:53 PM
>> To: linux-omap at vger.kernel.org
>> Cc: Hiremath, Vaibhav; Varadarajan, Charulatha
>> Subject: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller
>> in board_init
>>
>> With addition of hwmod support to gpio, the ethernet controller
>> goes undetected for OMAP35xEVM. So explicitly assert the reset signal to
>> ethernet controller smsc911x -
>>
>> - GPIO7 (>=RevG version of EVM's)
>> - GPIO64 (<=RevD version of EVM's)
>>
>> This patch is based on intial version from Charulatha V, reference
>> to original discussion -
>> http://www.mail-archive.com/linux-omap at vger.kernel.org/msg35784.html
>> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
>> Signed-off-by: Charulatha V <charu@ti.com>
>> Tested-by: Kevin Hilman <khilman@ti.com>
>> ---
>> Since Kevin reported that this patch doesn't get applied cleanly,
>> so I am reposting it again after making sure that it gets applied cleanly.
>>
> [Hiremath, Vaibhav] Oops, missed linux-arm-kernel list, adding here.
>
> Not sure whether I need to repost keeping linux-arm-kernel?
Yes, please repost.
Kevin
>
>> arch/arm/mach-omap2/board-omap3evm.c | 39
>> +++++++++++++++++++++++++++++++++-
>> 1 files changed, 38 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-
>> omap2/board-omap3evm.c
>> index 323c380..97e0f65 100644
>> --- a/arch/arm/mach-omap2/board-omap3evm.c
>> +++ b/arch/arm/mach-omap2/board-omap3evm.c
>> @@ -58,6 +58,13 @@
>> #define OMAP3EVM_ETHR_ID_REV 0x50
>> #define OMAP3EVM_ETHR_GPIO_IRQ 176
>> #define OMAP3EVM_SMSC911X_CS 5
>> +/*
>> + * Eth Reset signal
>> + * 64 = Generation 1 (<=RevD)
>> + * 7 = Generation 2 (>=RevE)
>> + */
>> +#define OMAP3EVM_GEN1_ETHR_GPIO_RST 64
>> +#define OMAP3EVM_GEN2_ETHR_GPIO_RST 7
>>
>> static u8 omap3_evm_version;
>>
>> @@ -124,10 +131,15 @@ static struct platform_device
>> omap3evm_smsc911x_device = {
>>
>> static inline void __init omap3evm_init_smsc911x(void)
>> {
>> - int eth_cs;
>> + int eth_cs, eth_rst;
>> struct clk *l3ck;
>> unsigned int rate;
>>
>> + if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1)
>> + eth_rst = OMAP3EVM_GEN1_ETHR_GPIO_RST;
>> + else
>> + eth_rst = OMAP3EVM_GEN2_ETHR_GPIO_RST;
>> +
>> eth_cs = OMAP3EVM_SMSC911X_CS;
>>
>> l3ck = clk_get(NULL, "l3_ck");
>> @@ -136,6 +148,27 @@ static inline void __init
>> omap3evm_init_smsc911x(void)
>> else
>> rate = clk_get_rate(l3ck);
>>
>> + /* Configure ethernet controller reset gpio */
>> + if (cpu_is_omap3430()) {
>> + if (gpio_request(eth_rst, "SMSC911x gpio") < 0) {
>> + pr_err(KERN_ERR "Failed to request %d for smsc911x\n",
>> + eth_rst);
>> + return;
>> + }
>> +
>> + if (gpio_direction_output(eth_rst, 1) < 0) {
>> + pr_err(KERN_ERR "Failed to set direction of %d for" \
>> + " smsc911x\n", eth_rst);
>> + return;
>> + }
>> + /* reset pulse to ethernet controller*/
>> + usleep_range(150, 220);
>> + gpio_set_value(eth_rst, 0);
>> + usleep_range(150, 220);
>> + gpio_set_value(eth_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);
>> @@ -658,6 +691,10 @@ static struct omap_board_mux board_mux[] __initdata =
>> {
>> OMAP_PIN_OFF_WAKEUPENABLE),
>> OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
>> OMAP_PIN_OFF_INPUT_PULLUP |
>> OMAP_PIN_OFF_OUTPUT_LOW),
>> + OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
>> + OMAP_PIN_OFF_NONE),
>> + OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
>> + OMAP_PIN_OFF_NONE),
>> { .reg_offset = OMAP_MUX_TERMINATOR },
>> };
>> #endif
>> --
>> 1.6.2.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller in board_init
2011-01-25 15:28 ` Hiremath, Vaibhav
@ 2011-01-27 20:08 ` Kevin Hilman
-1 siblings, 0 replies; 12+ messages in thread
From: Kevin Hilman @ 2011-01-27 20:08 UTC (permalink / raw)
To: Hiremath, Vaibhav; +Cc: linux-omap, Varadarajan, Charulatha, linux-arm-kernel
"Hiremath, Vaibhav" <hvaibhav@ti.com> writes:
>> -----Original Message-----
>> From: Hiremath, Vaibhav
>> Sent: Tuesday, January 25, 2011 8:53 PM
>> To: linux-omap@vger.kernel.org
>> Cc: Hiremath, Vaibhav; Varadarajan, Charulatha
>> Subject: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller
>> in board_init
>>
>> With addition of hwmod support to gpio, the ethernet controller
>> goes undetected for OMAP35xEVM. So explicitly assert the reset signal to
>> ethernet controller smsc911x -
>>
>> - GPIO7 (>=RevG version of EVM's)
>> - GPIO64 (<=RevD version of EVM's)
>>
>> This patch is based on intial version from Charulatha V, reference
>> to original discussion -
>> http://www.mail-archive.com/linux-omap@vger.kernel.org/msg35784.html
>> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
>> Signed-off-by: Charulatha V <charu@ti.com>
>> Tested-by: Kevin Hilman <khilman@ti.com>
>> ---
>> Since Kevin reported that this patch doesn't get applied cleanly,
>> so I am reposting it again after making sure that it gets applied cleanly.
>>
> [Hiremath, Vaibhav] Oops, missed linux-arm-kernel list, adding here.
>
> Not sure whether I need to repost keeping linux-arm-kernel?
>
Also, did you post the smc911x driver fix yet that is needed for testing
with newer kernels?
Kevin
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller in board_init
@ 2011-01-27 20:08 ` Kevin Hilman
0 siblings, 0 replies; 12+ messages in thread
From: Kevin Hilman @ 2011-01-27 20:08 UTC (permalink / raw)
To: linux-arm-kernel
"Hiremath, Vaibhav" <hvaibhav@ti.com> writes:
>> -----Original Message-----
>> From: Hiremath, Vaibhav
>> Sent: Tuesday, January 25, 2011 8:53 PM
>> To: linux-omap at vger.kernel.org
>> Cc: Hiremath, Vaibhav; Varadarajan, Charulatha
>> Subject: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller
>> in board_init
>>
>> With addition of hwmod support to gpio, the ethernet controller
>> goes undetected for OMAP35xEVM. So explicitly assert the reset signal to
>> ethernet controller smsc911x -
>>
>> - GPIO7 (>=RevG version of EVM's)
>> - GPIO64 (<=RevD version of EVM's)
>>
>> This patch is based on intial version from Charulatha V, reference
>> to original discussion -
>> http://www.mail-archive.com/linux-omap at vger.kernel.org/msg35784.html
>> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
>> Signed-off-by: Charulatha V <charu@ti.com>
>> Tested-by: Kevin Hilman <khilman@ti.com>
>> ---
>> Since Kevin reported that this patch doesn't get applied cleanly,
>> so I am reposting it again after making sure that it gets applied cleanly.
>>
> [Hiremath, Vaibhav] Oops, missed linux-arm-kernel list, adding here.
>
> Not sure whether I need to repost keeping linux-arm-kernel?
>
Also, did you post the smc911x driver fix yet that is needed for testing
with newer kernels?
Kevin
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller in board_init
2011-01-27 20:08 ` Kevin Hilman
@ 2011-01-29 12:11 ` Hiremath, Vaibhav
-1 siblings, 0 replies; 12+ messages in thread
From: Hiremath, Vaibhav @ 2011-01-29 12:11 UTC (permalink / raw)
To: Hilman, Kevin; +Cc: linux-omap, Varadarajan, Charulatha, linux-arm-kernel
> -----Original Message-----
> From: Hilman, Kevin
> Sent: Friday, January 28, 2011 1:38 AM
> To: Hiremath, Vaibhav
> Cc: linux-omap@vger.kernel.org; Varadarajan, Charulatha; linux-arm-
> kernel@lists.infradead.org
> Subject: Re: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet
> controller in board_init
>
> "Hiremath, Vaibhav" <hvaibhav@ti.com> writes:
>
> >> -----Original Message-----
> >> From: Hiremath, Vaibhav
> >> Sent: Tuesday, January 25, 2011 8:53 PM
> >> To: linux-omap@vger.kernel.org
> >> Cc: Hiremath, Vaibhav; Varadarajan, Charulatha
> >> Subject: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet
> controller
> >> in board_init
> >>
> >> With addition of hwmod support to gpio, the ethernet controller
> >> goes undetected for OMAP35xEVM. So explicitly assert the reset signal
> to
> >> ethernet controller smsc911x -
> >>
> >> - GPIO7 (>=RevG version of EVM's)
> >> - GPIO64 (<=RevD version of EVM's)
> >>
> >> This patch is based on intial version from Charulatha V, reference
> >> to original discussion -
> >> http://www.mail-archive.com/linux-omap@vger.kernel.org/msg35784.html
> >> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> >> Signed-off-by: Charulatha V <charu@ti.com>
> >> Tested-by: Kevin Hilman <khilman@ti.com>
> >> ---
> >> Since Kevin reported that this patch doesn't get applied cleanly,
> >> so I am reposting it again after making sure that it gets applied
> cleanly.
> >>
> > [Hiremath, Vaibhav] Oops, missed linux-arm-kernel list, adding here.
> >
> > Not sure whether I need to repost keeping linux-arm-kernel?
> >
>
> Also, did you post the smc911x driver fix yet that is needed for testing
> with newer kernels?
>
[Hiremath, Vaibhav] Not yet. Got completely loaded with some high priority issues. I will try to post it sometime this week.
Thanks,
Vaibhav
> Kevin
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller in board_init
@ 2011-01-29 12:11 ` Hiremath, Vaibhav
0 siblings, 0 replies; 12+ messages in thread
From: Hiremath, Vaibhav @ 2011-01-29 12:11 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: Hilman, Kevin
> Sent: Friday, January 28, 2011 1:38 AM
> To: Hiremath, Vaibhav
> Cc: linux-omap at vger.kernel.org; Varadarajan, Charulatha; linux-arm-
> kernel at lists.infradead.org
> Subject: Re: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet
> controller in board_init
>
> "Hiremath, Vaibhav" <hvaibhav@ti.com> writes:
>
> >> -----Original Message-----
> >> From: Hiremath, Vaibhav
> >> Sent: Tuesday, January 25, 2011 8:53 PM
> >> To: linux-omap at vger.kernel.org
> >> Cc: Hiremath, Vaibhav; Varadarajan, Charulatha
> >> Subject: [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet
> controller
> >> in board_init
> >>
> >> With addition of hwmod support to gpio, the ethernet controller
> >> goes undetected for OMAP35xEVM. So explicitly assert the reset signal
> to
> >> ethernet controller smsc911x -
> >>
> >> - GPIO7 (>=RevG version of EVM's)
> >> - GPIO64 (<=RevD version of EVM's)
> >>
> >> This patch is based on intial version from Charulatha V, reference
> >> to original discussion -
> >> http://www.mail-archive.com/linux-omap at vger.kernel.org/msg35784.html
> >> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> >> Signed-off-by: Charulatha V <charu@ti.com>
> >> Tested-by: Kevin Hilman <khilman@ti.com>
> >> ---
> >> Since Kevin reported that this patch doesn't get applied cleanly,
> >> so I am reposting it again after making sure that it gets applied
> cleanly.
> >>
> > [Hiremath, Vaibhav] Oops, missed linux-arm-kernel list, adding here.
> >
> > Not sure whether I need to repost keeping linux-arm-kernel?
> >
>
> Also, did you post the smc911x driver fix yet that is needed for testing
> with newer kernels?
>
[Hiremath, Vaibhav] Not yet. Got completely loaded with some high priority issues. I will try to post it sometime this week.
Thanks,
Vaibhav
> Kevin
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller in board_init
@ 2011-01-24 19:25 Vaibhav Hiremath
0 siblings, 0 replies; 12+ messages in thread
From: Vaibhav Hiremath @ 2011-01-24 19:25 UTC (permalink / raw)
To: linux-omap; +Cc: tony, khilman, Vaibhav Hiremath
With addition of hwmod support to gpio, the ethernet controller
goes undetected for OMAP35xEVM. So explicitly assert the reset signal to
ethernet controller smsc911x -
- GPIO7 (>=RevG version of EVM's)
- GPIO64 (<=RevD version of EVM's)
Tested this patch on RevG version of EVM with ES3.1 Si.
This patch is based on intial version from Charulatha V, reference
to original discussion -
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg35784.html
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
---
Changes from V1 -
- Removed hardcoded value for rst gpio
- Added check for return value to gpio_direction_output api
arch/arm/mach-omap2/board-omap3evm.c | 39 +++++++++++++++++++++++++++++++++-
1 files changed, 38 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index a888a7d..1716f4c 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -58,6 +58,13 @@
#define OMAP3EVM_ETHR_ID_REV 0x50
#define OMAP3EVM_ETHR_GPIO_IRQ 176
#define OMAP3EVM_SMSC911X_CS 5
+/*
+ * Eth Reset signal
+ * 64 = Generation 1 (<=RevD)
+ * 7 = Generation 2 (>=RevE)
+ */
+#define OMAP3EVM_GEN1_ETHR_GPIO_RST 64
+#define OMAP3EVM_GEN2_ETHR_GPIO_RST 7
static u8 omap3_evm_version;
@@ -124,10 +131,15 @@ static struct platform_device omap3evm_smsc911x_device = {
static inline void __init omap3evm_init_smsc911x(void)
{
- int eth_cs;
+ int eth_cs, eth_rst;
struct clk *l3ck;
unsigned int rate;
+ if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1)
+ eth_rst = OMAP3EVM_GEN1_ETHR_GPIO_RST;
+ else
+ eth_rst = OMAP3EVM_GEN2_ETHR_GPIO_RST;
+
eth_cs = OMAP3EVM_SMSC911X_CS;
l3ck = clk_get(NULL, "l3_ck");
@@ -136,6 +148,27 @@ static inline void __init omap3evm_init_smsc911x(void)
else
rate = clk_get_rate(l3ck);
+ /* Configure ethernet controller reset gpio */
+ if (cpu_is_omap3430()) {
+ if (gpio_request(eth_rst, "SMSC911x gpio") < 0) {
+ pr_err(KERN_ERR "Failed to request %d for smsc911x\n",
+ eth_rst);
+ return;
+ }
+
+ if (gpio_direction_output(eth_rst, 1) < 0) {
+ pr_err(KERN_ERR "Failed to set direction of %d for" \
+ " smsc911x\n", eth_rst);
+ return;
+ }
+ /* reset pulse to ethernet controller*/
+ usleep_range(150, 220);
+ gpio_set_value(eth_rst, 0);
+ usleep_range(150, 220);
+ gpio_set_value(eth_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);
@@ -689,6 +722,10 @@ static struct omap_board_mux omap35x_board_mux[] __initdata = {
OMAP_PIN_OFF_WAKEUPENABLE),
OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW),
+ OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
+ OMAP_PIN_OFF_NONE),
+ OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
+ OMAP_PIN_OFF_NONE),
{ .reg_offset = OMAP_MUX_TERMINATOR },
};
--
1.6.2.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
end of thread, other threads:[~2011-01-29 12:11 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25 15:22 [PATCH-V2] OMAP3EVM:FIX: Reset the smsc911x ethernet controller in board_init Vaibhav Hiremath
2011-01-25 15:28 ` Hiremath, Vaibhav
2011-01-25 15:28 ` Hiremath, Vaibhav
2011-01-25 16:09 ` Will Deacon
2011-01-25 16:09 ` Will Deacon
2011-01-27 19:58 ` Kevin Hilman
2011-01-27 19:58 ` Kevin Hilman
2011-01-27 20:08 ` Kevin Hilman
2011-01-27 20:08 ` Kevin Hilman
2011-01-29 12:11 ` Hiremath, Vaibhav
2011-01-29 12:11 ` Hiremath, Vaibhav
-- strict thread matches above, loose matches on Subject: below --
2011-01-24 19:25 Vaibhav Hiremath
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.