* RE: [Uclinux-dist-devel] [PATCH 01/01] smsc911x: fix MAC addresssetting after reset
@ 2008-05-19 13:03 Steve.Glendinning
2008-06-02 18:38 ` Peter Korsgaard
2008-06-03 10:01 ` Jens Gehrlein
0 siblings, 2 replies; 5+ messages in thread
From: Steve.Glendinning @ 2008-05-19 13:03 UTC (permalink / raw)
To: netdev
(re-sending to netdev in plain text)
Hi Michael,
I've been maintaining the smsc911x driver out-of-tree, I'll send my latest
full patch following this email. Bill Gatliff already fixed the same MAC
address issue, and I've added support for the new LAN9210 and LAN9211
devices.
(adding netdev to cc) I'd still like to see this driver replace smc911x in
mainline, how does everyone else feel?
Regards,
--
Steve Glendinning
SMSC GmbH
m: +44 777 933 9124
e: steve.glendinning@smsc.com
"Hennerich, Michael" <Michael.Hennerich@analog.com>
16/05/2008 11:58
To
"Enrik Berkhan" <Enrik.Berkhan@ge.com>, Steve Glendinning/SMSC@SMSC
cc
<hennerich@blackfin.uclinux.org>, Ian Saturley/SMSC@SMSC,
<uclinux-dist-devel@blackfin.uclinux.org>, <bahadir.balban@arm.com>,
<bgat@billgatliff.com>
Subject
RE: [Uclinux-dist-devel] [PATCH 01/01] smsc911x: fix MAC addresssetting
after reset
Hi Steve,
I received a patch to address the MAC address soft reset issue,
discussed before.
Is there a newer driver with this and maybe other fixes?
Some time ago I thought this driver is going to be mainlined.
Are you still panning to get it merged, - replace smc911x.c.
-Michael
>-----Original Message-----
>From: uclinux-dist-devel-bounces@blackfin.uclinux.org
[mailto:uclinux-dist-
>devel-bounces@blackfin.uclinux.org] On Behalf Of Enrik Berkhan
>Sent: Donnerstag, 15. Mai 2008 19:08
>To: uclinux-dist-devel@blackfin.uclinux.org
>Subject: [Uclinux-dist-devel] [PATCH 01/01] smsc911x: fix MAC
>addresssetting after reset
>
>The SMSC911X driver soft-resets the chip on open(). This makes the
>chip forget and re-load its MAC address from its EEPROM, if avail-
>able.
>
>If the MAC address has been set externally (e. g. by the bootloader
>or via command line), this setting is lost. This patch fixes the
>problem by always setting the saved MAC address after soft reset.
>
>Signed-Off-By: Enrik Berkhan <Enrik.Berkhan@ge.com>
>---
> drivers/net/smsc911x.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
>Index: drivers/net/smsc911x.c
>===================================================================
>--- drivers/net/smsc911x.c.orig 2008-05-15
18:49:30.000000000
+0200
>+++ drivers/net/smsc911x.c 2008-05-15 18:51:28.000000000
+0200
>@@ -1182,6 +1182,10 @@ static int smsc911x_open(struct net_devi
> udelay(10);
> }
>
>+ /* Set MAC again in case it has been set from non-EEPROM
source
>+ * (config or even bootloader) */
>+ smsc911x_set_mac_address(pdata, dev->dev_addr);
>+
> if (unlikely(timeout == 0)) {
> SMSC_WARNING("Timed out waiting for
EEPROM "
> "busy bit to
clear");
>_______________________________________________
>Uclinux-dist-devel mailing list
>Uclinux-dist-devel@blackfin.uclinux.org
>http://blackfin.uclinux.org/mailman/listinfo/uclinux-dist-devel
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Uclinux-dist-devel] [PATCH 01/01] smsc911x: fix MAC addresssetting after reset
2008-05-19 13:03 [Uclinux-dist-devel] [PATCH 01/01] smsc911x: fix MAC addresssetting after reset Steve.Glendinning
@ 2008-06-02 18:38 ` Peter Korsgaard
2008-06-03 10:01 ` Jens Gehrlein
1 sibling, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2008-06-02 18:38 UTC (permalink / raw)
To: Steve.Glendinning; +Cc: netdev
>>>>> "Steve" == Steve Glendinning <Steve.Glendinning@smsc.com> writes:
Hi,
Steve> (re-sending to netdev in plain text)
Steve> Hi Michael,
Steve> I've been maintaining the smsc911x driver out-of-tree, I'll
Steve> send my latest full patch following this email. Bill Gatliff
Steve> already fixed the same MAC address issue, and I've added
Steve> support for the new LAN9210 and LAN9211 devices.
Steve> (adding netdev to cc) I'd still like to see this driver
Steve> replace smc911x in mainline, how does everyone else feel?
I still think it would be better to add new hw support/cleanups to the
existing driver instead of adding a completely new driver.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Uclinux-dist-devel] [PATCH 01/01] smsc911x: fix MAC addresssetting after reset
2008-05-19 13:03 [Uclinux-dist-devel] [PATCH 01/01] smsc911x: fix MAC addresssetting after reset Steve.Glendinning
2008-06-02 18:38 ` Peter Korsgaard
@ 2008-06-03 10:01 ` Jens Gehrlein
2008-06-05 9:47 ` Steve.Glendinning
1 sibling, 1 reply; 5+ messages in thread
From: Jens Gehrlein @ 2008-06-03 10:01 UTC (permalink / raw)
To: Steve.Glendinning; +Cc: netdev
Hi Steve,
Steve.Glendinning@smsc.com schrieb:
>> If the MAC address has been set externally (e. g. by the bootloader
>> or via command line), this setting is lost. This patch fixes the
>> problem by always setting the saved MAC address after soft reset.
Sorry. Newbie question:
How can I pass the MAC address via kernel command line for this driver?
Is there a predefined parameter?
My problem is:
U-Boot resets the chip after each completed transfer. Wolfgang Denk
suggested to pass the MAC address via kernel command line. I need the
ethernet device at kernel startup to mount a root filesystem via NFS, so
I added the platform device in my board specific code as shown below (it
still relates to the old driver).
Should I patch the driver directly to get the MAC address via __setup()
or can I pass the MAC address via the device structures.
What do you suggest?
Thanks and best regards
Jens
--
static struct resource smc911x_resources[] = {
[0] = {
.start = CS4_BASE_ADDR,
.end = CS4_BASE_ADDR + 0xFF,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = MXC_GPIO_BASE + 4,
.end = MXC_GPIO_BASE + 4,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device smc911x_device = {
.name = "smc911x",
.id = 0,
.num_resources = ARRAY_SIZE(smc911x_resources),
.resource = smc911x_resources,
};
static struct platform_device *myboard_devices[] __initdata = {
&smc911x_device,
};
static int __init <myboard>_devices_setup(void)
{
return platform_add_devices(myboard_devices, ARRAY_SIZE(myboard_devices));
}
device_initcall(myboard_devices_setup);
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Uclinux-dist-devel] [PATCH 01/01] smsc911x: fix MAC addresssetting after reset
2008-06-03 10:01 ` Jens Gehrlein
@ 2008-06-05 9:47 ` Steve.Glendinning
2008-06-05 10:23 ` Jens Gehrlein
0 siblings, 1 reply; 5+ messages in thread
From: Steve.Glendinning @ 2008-06-05 9:47 UTC (permalink / raw)
To: Jens Gehrlein; +Cc: netdev
Hi Jens,
> Sorry. Newbie question:
> How can I pass the MAC address via kernel command line for this driver?
> Is there a predefined parameter?
> My problem is:
> U-Boot resets the chip after each completed transfer. Wolfgang Denk
> suggested to pass the MAC address via kernel command line. I need the
> ethernet device at kernel startup to mount a root filesystem via NFS, so
> I added the platform device in my board specific code as shown below (it
> still relates to the old driver).
> Should I patch the driver directly to get the MAC address via __setup()
> or can I pass the MAC address via the device structures.
>
> What do you suggest?
The smsc911x driver accepts mac addresses set "by configuration", so if
brought up after boot you could assign the mac address like this:
ifconfig eth0 hw ether 00:11:22:33:44:55 up
But as you're using an NFS root, you need to assign the mac address during
boot. I'm not sure of the best way to do this, there isn't currently a
dev_addr field in smsc911x_platform_config, but you could add one.
Alternatively, if the bootloader already sets the mac address you could
modify the driver to read it off the device (into dev->dev_addr) before
resetting it?
Regards,
--
Steve Glendinning
SMSC GmbH
m: +44 777 933 9124
e: steve.glendinning@smsc.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Uclinux-dist-devel] [PATCH 01/01] smsc911x: fix MAC addresssetting after reset
2008-06-05 9:47 ` Steve.Glendinning
@ 2008-06-05 10:23 ` Jens Gehrlein
0 siblings, 0 replies; 5+ messages in thread
From: Jens Gehrlein @ 2008-06-05 10:23 UTC (permalink / raw)
To: Steve.Glendinning; +Cc: netdev
Hi Steve,
Steve.Glendinning@smsc.com schrieb:
> Hi Jens,
>
>> Sorry. Newbie question:
>> How can I pass the MAC address via kernel command line for this driver?
>> Is there a predefined parameter?
>> My problem is:
>> U-Boot resets the chip after each completed transfer. Wolfgang Denk
>> suggested to pass the MAC address via kernel command line. I need the
>> ethernet device at kernel startup to mount a root filesystem via NFS, so
>
>> I added the platform device in my board specific code as shown below (it
>
>> still relates to the old driver).
>> Should I patch the driver directly to get the MAC address via __setup()
>> or can I pass the MAC address via the device structures.
>>
>> What do you suggest?
>
> The smsc911x driver accepts mac addresses set "by configuration", so if
> brought up after boot you could assign the mac address like this:
>
> ifconfig eth0 hw ether 00:11:22:33:44:55 up
>
> But as you're using an NFS root, you need to assign the mac address during
> boot. I'm not sure of the best way to do this, there isn't currently a
> dev_addr field in smsc911x_platform_config, but you could add one.
>
> Alternatively, if the bootloader already sets the mac address you could
> modify the driver to read it off the device (into dev->dev_addr) before
> resetting it?
My hope was, that U-Boot leaves the MAC address in the controller's
register, but it resets the chip. We don't have an EEPROM connected to
the controller. Unfortunately, ARM Linux doesn't provide board info
structures or flat device tree like PowerPC Linux to pass data from the
bootloader to the Kernel.
Additionally, I didn't succeed in compiling your new driver with Kernel
2.6.22, because the Kernel API changed, and I can't switch to a new
kernel. So I'm creating a private patch: getting the the MAC address
from private kernel commmand line parameter using __setup().
However, as a suggestion for improvement of your new driver: could you
extend the code, so that the board specific code could pass the MAC
address via "struct platform_device", e.g. using the struct member .dev?
Like using ifconfig it would allow multiple instances and the board
specific code can take care, where it get the MAC addresses from.
Best regards,
Jens
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-06-05 10:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-19 13:03 [Uclinux-dist-devel] [PATCH 01/01] smsc911x: fix MAC addresssetting after reset Steve.Glendinning
2008-06-02 18:38 ` Peter Korsgaard
2008-06-03 10:01 ` Jens Gehrlein
2008-06-05 9:47 ` Steve.Glendinning
2008-06-05 10:23 ` Jens Gehrlein
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).