Skip to contentSkip to conversation

FIX: OMAP3EVM: Ethernet controller smsc911x reset

RFC PATCH In review Varadarajan, Charulatha 4 participants 5 messages Sep 25, 2010 – Jan 13, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 FIX: OMAP3EVM: Ethernet controller smsc911x reset

Do reset of Ethernet controller smsc911x using OMAP gpio7 while initializing the Ethernet controller.

---
 arch/arm/mach-omap2/board-omap3evm.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-omap3evm.c +15 -0
index f76d9c0..54a7e20 100644
@@ -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,20 @@ static inline void __init omap3evm_init_smsc911x(void)
 	else
 		rate = clk_get_rate(l3ck);
 
+	/* 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;
+	}
+
+	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);
Signature · 1 line
1.7.0.4
#1 lore raw

Sanjeev,

With GPIO hwmod series, OMAP3EVM board is not up with DHCP + nfs root. This issue was reported by Kevin.

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.

After gpio hmwod series are merged, this patch is required to make the EVM board working. Also omap3evm_init_smsc911x() needs to be fixed including CS settings and other required settings for Ethernet controller.

Links to related discussions:
http://www.spinics.net/lists/linux-omap/msg37234.html
http://www.spinics.net/lists/linux-omap/msg36698.html
http://www.spinics.net/lists/linux-omap/msg36799.html

The below patch is tested on OMAP3 EVM board (ES3.1).

Thanks,
V Charulatha

Quoted 54 lines

-----Original Message-----
From: Varadarajan, Charulatha
Sent: Saturday, September 25, 2010 5:07 PM
To: [email protected]
Cc: [email protected]; [email protected]; Premi, Sanjeev; Varadarajan, Charulatha
Subject: [PATCH RFC:] FIX: OMAP3EVM: Ethernet controller smsc911x reset

Do reset of Ethernet controller smsc911x using OMAP gpio7 while initializing the Ethernet controller.

---
 arch/arm/mach-omap2/board-omap3evm.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-omap2/board-omap3evm.c +0 -0

omap2/board-omap3evm.c
index f76d9c0..54a7e20 100644

arch/arm/mach-omap2/board-omap3evm.c +15 -0
@@ -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,20 @@ static inline void __init
 omap3evm_init_smsc911x(void)
 	else
 		rate = clk_get_rate(l3ck);
 
+	/* 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;
+	}
+
+	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) {
arch/arm/mach-omap2/board-omap3evm.c +0 -1
 		printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
 			OMAP3EVM_ETHR_GPIO_IRQ);
--

1.7.0.4

#2 lore raw
Quoted 14 lines · Charulatha

Sanjeev,

With GPIO hwmod series, OMAP3EVM board is not up with DHCP + nfs root. This issue was reported by Kevin.

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.

After gpio hmwod series are merged, this patch is required to make the EVM board working. Also omap3evm_init_smsc911x() needs to be fixed including CS settings and other required settings for Ethernet controller.

Quoted 6 lines

Links to related discussions:
http://www.spinics.net/lists/linux-omap/msg37234.html
http://www.spinics.net/lists/linux-omap/msg36698.html
http://www.spinics.net/lists/linux-omap/msg36799.html

The below patch is tested on OMAP3 EVM board (ES3.1).

Also note that the patch below didn't work on my EVM (ES2.1), making me assume that it uses a different GPIO for older boards.

Kevin

Quoted 56 lines
Quoted 56 lines

-----Original Message-----
From: Varadarajan, Charulatha
Sent: Saturday, September 25, 2010 5:07 PM
To: [email protected]
Cc: [email protected]; [email protected]; Premi, Sanjeev; Varadarajan, Charulatha
Subject: [PATCH RFC:] FIX: OMAP3EVM: Ethernet controller smsc911x reset

Do reset of Ethernet controller smsc911x using OMAP gpio7 while initializing the Ethernet controller.

---
 arch/arm/mach-omap2/board-omap3evm.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-omap2/board-omap3evm.c +0 -0

omap2/board-omap3evm.c
index f76d9c0..54a7e20 100644

arch/arm/mach-omap2/board-omap3evm.c +15 -0
@@ -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,20 @@ static inline void __init
 omap3evm_init_smsc911x(void)
 	else
 		rate = clk_get_rate(l3ck);
 
+	/* 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;
+	}
+
+	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) {
arch/arm/mach-omap2/board-omap3evm.c +0 -1
 		printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
 			OMAP3EVM_ETHR_GPIO_IRQ);
--

1.7.0.4

#3 lore raw
Quoted 33 lines

-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Monday, September 27, 2010 8:26 PM
To: Varadarajan, Charulatha
Cc: [email protected]; Premi, Sanjeev; [email protected]
Subject: Re: [PATCH RFC:] FIX: OMAP3EVM: Ethernet controller smsc911x reset

Quoted 3 lines · Charulatha

Sanjeev,

With GPIO hwmod series, OMAP3EVM board is not up with DHCP

+ nfs root.

Quoted 4 lines

This issue was reported by Kevin.

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

Quoted 4 lines

configurations for it's operations. The reset GPIO pin used for this purpose is not even reserved.

After gpio hmwod series are merged, this patch is required

to make the

Quoted 2 lines

EVM board working. Also omap3evm_init_smsc911x() needs to be fixed including CS settings and other required settings for

Ethernet controller.

Quoted 6 lines

Links to related discussions:
http://www.spinics.net/lists/linux-omap/msg37234.html
http://www.spinics.net/lists/linux-omap/msg36698.html
http://www.spinics.net/lists/linux-omap/msg36799.html

Quoted 5 lines
Quoted 1 line

The below patch is tested on OMAP3 EVM board (ES3.1).

Also note that the patch below didn't work on my EVM (ES2.1), making me
assume that it uses a different GPIO for older boards.

I am waiting for right person to review the patches; he was on travel this weekend. Hope to get his time tomorrow...

Quoted 61 lines

Kevin

Quoted 9 lines
Quoted 9 lines

-----Original Message-----
From: Varadarajan, Charulatha
Sent: Saturday, September 25, 2010 5:07 PM
To: [email protected]
Cc: [email protected]; [email protected]; Premi, Sanjeev; Varadarajan, Charulatha
Subject: [PATCH RFC:] FIX: OMAP3EVM: Ethernet controller

smsc911x reset

Quoted 36 lines
Quoted 36 lines

Do reset of Ethernet controller smsc911x using OMAP gpio7 while initializing the Ethernet controller.

---
 arch/arm/mach-omap2/board-omap3evm.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-omap2/board-omap3evm.c +0 -0

omap2/board-omap3evm.c
index f76d9c0..54a7e20 100644

arch/arm/mach-omap2/board-omap3evm.c +9 -0
@@ -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,20 @@ static inline void __init
 omap3evm_init_smsc911x(void)
 	else
 		rate = clk_get_rate(l3ck);
 
+	/* 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;
+	}
+
+	gpio_direction_output(OMAP3EVM_ETHR_GPIO_RST, 1);
+
Quoted 8 lines
Quoted 8 lines
arch/arm/mach-omap2/board-omap3evm.c +6 -0
+	/* 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",

Quoted 3 lines
Quoted 3 lines

OMAP3EVM_ETHR_GPIO_IRQ);
--
1.7.0.4

#4 lore raw
In reply to Kevin Hilman
Quoted 31 lines

-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Kevin Hilman
Sent: Monday, September 27, 2010 8:26 PM
To: Varadarajan, Charulatha
Cc: [email protected]; Premi, Sanjeev; [email protected]
Subject: Re: [PATCH RFC:] FIX: OMAP3EVM: Ethernet controller smsc911x reset

Quoted 5 lines · Charulatha

Sanjeev,

With GPIO hwmod series, OMAP3EVM board is not up with DHCP + nfs root. This issue was reported by Kevin.

Quoted 8 lines

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.

After gpio hmwod series are merged, this patch is required to make the EVM board working. Also omap3evm_init_smsc911x() needs to be fixed including CS settings and other required settings for Ethernet

controller.

Quoted 6 lines

Links to related discussions:
http://www.spinics.net/lists/linux-omap/msg37234.html
http://www.spinics.net/lists/linux-omap/msg36698.html
http://www.spinics.net/lists/linux-omap/msg36799.html

Quoted 5 lines
Quoted 1 line

The below patch is tested on OMAP3 EVM board (ES3.1).

Also note that the patch below didn't work on my EVM (ES2.1), making me assume that it uses a different GPIO for older boards.

[Hiremath, Vaibhav] I have also tried it on my REV-G version of EVM (Silicon ES3.1) and it is not working for me.

Trying to debug further.

Thanks,
Vaibhav

Quoted 62 lines

Kevin

Quoted 48 lines
Quoted 48 lines

-----Original Message-----
From: Varadarajan, Charulatha
Sent: Saturday, September 25, 2010 5:07 PM
To: [email protected]
Cc: [email protected]; [email protected]; Premi, Sanjeev; Varadarajan, Charulatha
Subject: [PATCH RFC:] FIX: OMAP3EVM: Ethernet controller smsc911x reset

Do reset of Ethernet controller smsc911x using OMAP gpio7 while initializing the Ethernet controller.

---
 arch/arm/mach-omap2/board-omap3evm.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-omap2/board-omap3evm.c +0 -0

omap2/board-omap3evm.c
index f76d9c0..54a7e20 100644

arch/arm/mach-omap2/board-omap3evm.c +12 -0
@@ -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,20 @@ static inline void __init
 omap3evm_init_smsc911x(void)
 	else
 		rate = clk_get_rate(l3ck);
 
+	/* 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;
+	}
+
+	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);
Quoted 8 lines
Quoted 8 lines
arch/arm/mach-omap2/board-omap3evm.c +3 -0
+	gpio_set_value(OMAP3EVM_ETHR_GPIO_RST, 1);
+	usleep_range(1, 2);
+
 	if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) {
arch/arm/mach-omap2/board-omap3evm.c +0 -1
 		printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
 			OMAP3EVM_ETHR_GPIO_IRQ);
--

1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html