* [U-Boot] Linux Kernel without Ethernet (missed MAC)
@ 2010-01-19 9:44 Arno Steffen
2010-01-19 13:34 ` Prafulla Wadaskar
2010-01-19 14:50 ` Daniel Gorsulowski
0 siblings, 2 replies; 12+ messages in thread
From: Arno Steffen @ 2010-01-19 9:44 UTC (permalink / raw)
To: u-boot
Changing my OMAP EVM board to newest uboot 2009-11 I do have a problem
with ethernet.
Although the kernel could be loaded via tftp perfectly, the upcoming
kernel complains about invalid MAC.
Kernel command line: mem=128M console=ttyS0,115200n8
root=/dev/mtdblock8 rw rootfstype=jffs2 ip=dhcp
...
loop: module loaded
eth0: LAN9115 (rev 2) at 0x2c000000 IRQ 336
eth0: Invalid ethernet MAC address. Please set using ifconfig
i2c /dev entries driver
...
IP-Config: Failed to open eth0
IP-Config: No network devices available.
...
After Linux has booted, I don't have an /dev/ethX device
I already checked this:
http://www.denx.de/wiki/view/DULG/EthernetDoesNotWorkInLinux
but I am not expert enough to see wether the kernel has a bug.
In /driver/net/smc911x.c the devinit smc911x_probe will generate the first
message that something goes wrong
if (!is_valid_ether_addr(dev->dev_addr)) {
printk("%s: Invalid ethernet MAC address. Please "
"set using ifconfig\n", dev->name);
/driver/net/smc911x.c checks in smc911x_open() the validity of MAC,
which seems to fail.
/driver/net/smc911x.c calls SMC_GET_MAC_ADDR which is a macro in
/driver/net/smc91x.h
In uboot-env the Mac has been configured.
"Warning: smc911x-0 MAC addresses don't match:
Address in SROM is ff:ff:ff:ff:ff:ff
Address in environment is 00:19:66:cc:44:ee"
Loading via TFTP works
OMAP3_EVM # tftpboot 0x80000000 evm/uImage
smc911x: detected LAN9115 controller
smc911x: phy initialized
smc911x: MAC 00:19:66:cc:44:ee
Using smc911x-0 device
TFTP from server 192.168.90.230; our IP address is 192.168.90.200
Filename 'evm/uImage'.
Load address: 0x80000000
Loading: #################################################################
#################################################################
#
done
Best regards
Arno
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] Linux Kernel without Ethernet (missed MAC)
2010-01-19 9:44 [U-Boot] Linux Kernel without Ethernet (missed MAC) Arno Steffen
@ 2010-01-19 13:34 ` Prafulla Wadaskar
2010-01-19 13:54 ` Arno Steffen
2010-01-19 14:50 ` Daniel Gorsulowski
1 sibling, 1 reply; 12+ messages in thread
From: Prafulla Wadaskar @ 2010-01-19 13:34 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: u-boot-bounces at lists.denx.de
> [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Arno Steffen
> Sent: Tuesday, January 19, 2010 3:14 PM
> To: u-boot at lists.denx.de
> Subject: [U-Boot] Linux Kernel without Ethernet (missed MAC)
>
> Changing my OMAP EVM board to newest uboot 2009-11 I do have a problem
> with ethernet.
> Although the kernel could be loaded via tftp perfectly, the upcoming
> kernel complains about invalid MAC.
>
> Kernel command line: mem=128M console=ttyS0,115200n8
> root=/dev/mtdblock8 rw rootfstype=jffs2 ip=dhcp
Hi Arno
I hope, when you are booting the kernel from media (i.e. NAND/Flash/Sata and not Ethernet) you are getting this problem.
u-boot does not perform peripheral h/w initialization by default, u-boot as well as kernel assumes h/w is doing this.
May be in your case, smc91x h/w does not do it on Power on by default.
When you do any network activity prior to kernel boot, device_init is invoked and the MAC address is set and your system works.
Possible Solution: add dummy network command like (ping x.x.x.x) in your auto boot sequence.
Regards..
Prafulla . .
> ...
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] Linux Kernel without Ethernet (missed MAC)
2010-01-19 13:34 ` Prafulla Wadaskar
@ 2010-01-19 13:54 ` Arno Steffen
2010-01-19 14:15 ` Wolfgang Denk
0 siblings, 1 reply; 12+ messages in thread
From: Arno Steffen @ 2010-01-19 13:54 UTC (permalink / raw)
To: u-boot
I think this is a uboot bug.
If this is a kernel bug - where does the kernel gets the mac address from?
Is it reading a device register? So it must be set by u-boot. But obviously
it isn't there (kernel boot log):
"eth0: LAN9115 (rev 2) at 0x2c000000 IRQ 336
eth0: Invalid ethernet MAC address. Please set using ifconfig"
The problem occures in any boot sequence (nand, network) - so although
the uboot initializes the ethernet chip, linux kernel doesn't find the
mac-address. So your advice doesn't help.
I am not expert enough to know how it should be. In an older uboot
(2008.10) I could solve the problem with any ethernet access in uboot
(as you suggested) - then I get ethernet in kernel boot as well.
In 2009.11 it is different - no way to get it working - same kernel.
Looks like uboot either doesn't set mac or deletes mac.
Best regards
Arno
2010/1/19 Prafulla Wadaskar <prafulla@marvell.com>:
>
>
>> -----Original Message-----
>> From: u-boot-bounces at lists.denx.de
>> [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Arno Steffen
>> Sent: Tuesday, January 19, 2010 3:14 PM
>> To: u-boot at lists.denx.de
>> Subject: [U-Boot] Linux Kernel without Ethernet (missed MAC)
>>
>> Changing my OMAP EVM board to newest uboot 2009-11 I do have a problem
>> with ethernet.
>> Although the kernel could be loaded via tftp perfectly, the upcoming
>> kernel complains about invalid MAC.
>>
>> Kernel command line: mem=128M console=ttyS0,115200n8
>> root=/dev/mtdblock8 rw rootfstype=jffs2 ip=dhcp
>
> Hi Arno
>
> I hope, when you are booting the kernel from media (i.e. NAND/Flash/Sata and not Ethernet) you are getting this problem.
> u-boot does not perform peripheral h/w initialization by default, u-boot as well as kernel assumes h/w is doing this.
>
> May be in your case, smc91x h/w does not do it on Power on by default.
> When you do any network activity prior to kernel boot, device_init is invoked and the MAC address is set and your system works.
>
> Possible Solution: add dummy network command like (ping x.x.x.x) in your auto boot sequence.
>
> Regards..
> Prafulla . .
>
>> ...
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] Linux Kernel without Ethernet (missed MAC)
2010-01-19 13:54 ` Arno Steffen
@ 2010-01-19 14:15 ` Wolfgang Denk
2010-01-19 14:59 ` Arno Steffen
0 siblings, 1 reply; 12+ messages in thread
From: Wolfgang Denk @ 2010-01-19 14:15 UTC (permalink / raw)
To: u-boot
Dear Arno Steffen,
In message <804f0d21001190554r13f582abl3dbbc80b50df3c06@mail.gmail.com> you wrote:
> I think this is a uboot bug.
You sound as is you were really sure about this.
But maybe you did not even read the FAQ, for example
http://www.denx.de/wiki/view/DULG/EthernetDoesNotWorkInLinux ?
And you also did not bother to search the archives, or did you?
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
FORTRAN? The syntactically incorrect statement "DO 10 I = 1.10" will
parse and generate code creating a variable, DO10I, as follows:
"DO10I = 1.10" If that doesn't terrify you, it should.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] Linux Kernel without Ethernet (missed MAC)
2010-01-19 9:44 [U-Boot] Linux Kernel without Ethernet (missed MAC) Arno Steffen
2010-01-19 13:34 ` Prafulla Wadaskar
@ 2010-01-19 14:50 ` Daniel Gorsulowski
2010-01-19 16:33 ` Arno Steffen
2010-01-19 18:45 ` Wolfgang Denk
1 sibling, 2 replies; 12+ messages in thread
From: Daniel Gorsulowski @ 2010-01-19 14:50 UTC (permalink / raw)
To: u-boot
Hi Arno,
Arno Steffen wrote:
> Changing my OMAP EVM board to newest uboot 2009-11 I do have a problem
> with ethernet.
> Although the kernel could be loaded via tftp perfectly, the upcoming
> kernel complains about invalid MAC.
>
> Kernel command line: mem=128M console=ttyS0,115200n8
> root=/dev/mtdblock8 rw rootfstype=jffs2 ip=dhcp
> ...
On ARM, I solved that problem as follows:
1. Add "ethaddr=$(ethaddr)" to your kernel command line. e.g.:
mem=128M console=ttyS0,115200n8 ethaddr=$(ethaddr)
2. Apply this patch on linux kernel (approved on v2.6.31):
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 92fe36d..cddf67a 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/slab.h>
+#include <linux/string.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
@@ -81,9 +82,14 @@ static void __init macb_get_hwaddr(struct macb *bp)
u32 bottom;
u16 top;
u8 addr[6];
+ char *ptr = NULL;
+ char *ptr_end;
+ char ethaddr[17];
+ int i;
bottom = macb_readl(bp, SA1B);
top = macb_readl(bp, SA1T);
+ ptr = strstr(boot_command_line, "ethaddr=");
addr[0] = bottom & 0xff;
addr[1] = (bottom >> 8) & 0xff;
@@ -94,6 +100,16 @@ static void __init macb_get_hwaddr(struct macb *bp)
if (is_valid_ether_addr(addr)) {
memcpy(bp->dev->dev_addr, addr, sizeof(addr));
+ } else if (ptr) {
+ memcpy(ethaddr, ptr + 8, 17 * sizeof(char));
+ printk(KERN_NOTICE "ethaddr parsed from commandline: %s\n", ethaddr);
+ ptr_end = ethaddr;
+ for (i = 0; i <= 5; i++) {
+ addr[i] = simple_strtol(ptr_end, &ptr_end, 16) |
+ simple_strtol(ptr_end, &ptr_end, 16) << 4;
+ ptr_end++; /* skip ":" in ethaddr */
+ }
+ memcpy(bp->dev->dev_addr, addr, sizeof(addr));
} else {
dev_info(&bp->pdev->dev, "invalid hw address, using random\n");
random_ether_addr(bp->dev->dev_addr);
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] Linux Kernel without Ethernet (missed MAC)
2010-01-19 14:15 ` Wolfgang Denk
@ 2010-01-19 14:59 ` Arno Steffen
2010-01-19 16:04 ` Nishanth Menon
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Arno Steffen @ 2010-01-19 14:59 UTC (permalink / raw)
To: u-boot
2010/1/19 Wolfgang Denk <wd@denx.de>:
> Dear Arno Steffen,
>
> In message <804f0d21001190554r13f582abl3dbbc80b50df3c06@mail.gmail.com> you wrote:
>> I think this is a uboot bug.
>
> You sound as is you were really sure about this.
I can't be sure, as I don't know how MAC is transfered into kernel (no
eprom) - that's what I ask for.
An older versions of uboot it works with the same kernel - so what
should I think about it?
At least things have been changed ...
>
> But maybe you did not even read the FAQ, for example
> http://www.denx.de/wiki/view/DULG/EthernetDoesNotWorkInLinux ?
In my first mail
(http://lists.denx.de/pipermail/u-boot/2010-January/066703.html)
I wrote that I have checked this and wrote down what I found out.
Probably it is due to my limited experience in this, that's why I
asked for help.
A "ifconfig" after boot will not help, as I don't have an eth-device.
> And you also did not bother to search the archives, or did you
Call me stupid, I just know this access : http://lists.denx.de/pipermail/u-boot/
This doesn't allow a practial search (at least I don't know how) - sorry.
I am working puzzling more than a day with this - so I am not lazy with that.
I try my best.
> Wolfgang Denk
Best regards
Arno
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] Linux Kernel without Ethernet (missed MAC)
2010-01-19 14:59 ` Arno Steffen
@ 2010-01-19 16:04 ` Nishanth Menon
2010-01-19 18:47 ` Wolfgang Denk
2010-01-20 10:06 ` Detlev Zundel
2 siblings, 0 replies; 12+ messages in thread
From: Nishanth Menon @ 2010-01-19 16:04 UTC (permalink / raw)
To: u-boot
Hi Arno,
On Tue, Jan 19, 2010 at 8:59 AM, Arno Steffen
<arno.steffen@googlemail.com> wrote:
>
> Call me stupid, I just know this access : http://lists.denx.de/pipermail/u-boot/
> This doesn't allow a practial search (at least I don't know how) - sorry.
> I am working puzzling more than a day with this - so I am not lazy with that.
> I try my best.
you could try http://old.nabble.com/Uboot---Users-f553.html
i kind of find it easier to search on that.
Regards,
Nishanth Menon
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] Linux Kernel without Ethernet (missed MAC)
2010-01-19 14:50 ` Daniel Gorsulowski
@ 2010-01-19 16:33 ` Arno Steffen
2010-01-19 18:45 ` Wolfgang Denk
1 sibling, 0 replies; 12+ messages in thread
From: Arno Steffen @ 2010-01-19 16:33 UTC (permalink / raw)
To: u-boot
2010/1/19 Daniel Gorsulowski <Daniel.Gorsulowski@esd.eu>:
> On ARM, I solved that problem as follows:
>
> 1. Add "ethaddr=$(ethaddr)" to your kernel command line. e.g.:
> ? mem=128M console=ttyS0,115200n8 ethaddr=$(ethaddr)
>
> 2. Apply this patch on linux kernel (approved on v2.6.31):
>
Thanks for this idea. I checked the kernel and set in
file smsc911x.c in function smc911x_reset()
dev->dev_addr[0] = 0
to get valid (but not my mac address).
Nevertheless I would prefer to patch the uboot instead of kernel.
What I don't understand is: MAC (that is set in uboot - at least if I
do a tftp) will disapear.
Is it cleaned up by uboot? Somehow it has worked before ...
Or the other way around: What is the current valid and recommended way
to pass mac from uboot to kernel? It should work without patches.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] Linux Kernel without Ethernet (missed MAC)
2010-01-19 14:50 ` Daniel Gorsulowski
2010-01-19 16:33 ` Arno Steffen
@ 2010-01-19 18:45 ` Wolfgang Denk
1 sibling, 0 replies; 12+ messages in thread
From: Wolfgang Denk @ 2010-01-19 18:45 UTC (permalink / raw)
To: u-boot
Dear Daniel Gorsulowski,
In message <4B55C699.5040401@esd.eu> you wrote:
>
> 1. Add "ethaddr=$(ethaddr)" to your kernel command line. e.g.:
> mem=128M console=ttyS0,115200n8 ethaddr=$(ethaddr)
Please use "ethaddr=${ethaddr}" instead - the $(...) syntax has been
deprecated a long, long time ago and will be removed one day.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Blast medicine anyway! We've learned to tie into every organ in the
human body but one. The brain! The brain is what life is all about.
-- McCoy, "The Menagerie", stardate 3012.4
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] Linux Kernel without Ethernet (missed MAC)
2010-01-19 14:59 ` Arno Steffen
2010-01-19 16:04 ` Nishanth Menon
@ 2010-01-19 18:47 ` Wolfgang Denk
2010-01-20 10:06 ` Detlev Zundel
2 siblings, 0 replies; 12+ messages in thread
From: Wolfgang Denk @ 2010-01-19 18:47 UTC (permalink / raw)
To: u-boot
Dear Arno Steffen,
In message <804f0d21001190659i5fe415d5qeb7e72459cecfb9c@mail.gmail.com> you wrote:
>
> Call me stupid, I just know this access : http://lists.denx.de/pipermail/u-boot/
> This doesn't allow a practial search (at least I don't know how) - sorry.
The U-Boot home page at http://www.denx.de/wiki/U-Boot/WebHome
also lists the gmane archives which allow for all kinds of searching.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Save yourself! Reboot in 5 seconds!
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] Linux Kernel without Ethernet (missed MAC)
2010-01-19 14:59 ` Arno Steffen
2010-01-19 16:04 ` Nishanth Menon
2010-01-19 18:47 ` Wolfgang Denk
@ 2010-01-20 10:06 ` Detlev Zundel
2010-01-20 14:11 ` Arno Steffen
2 siblings, 1 reply; 12+ messages in thread
From: Detlev Zundel @ 2010-01-20 10:06 UTC (permalink / raw)
To: u-boot
Hi Arno,
>> But maybe you did not even read the FAQ, for example
>> http://www.denx.de/wiki/view/DULG/EthernetDoesNotWorkInLinux ?
>
> In my first mail
> (http://lists.denx.de/pipermail/u-boot/2010-January/066703.html)
> I wrote that I have checked this and wrote down what I found out.
> Probably it is due to my limited experience in this, that's why I
> asked for help.
> A "ifconfig" after boot will not help, as I don't have an eth-device.
I will not comment yet another time on this infamous topic of passing
MAC addresses to the Linux kernel in the ARM world - we tried several
times to fix this. Usually we were informed that this can be easily
(really that's what they tell you on the ARM mailing list) done with an
initial ramdisk - even if you want to use an NFS rootfilesystem.
So for your information - you should still have an ethernet interface
in Linux, you simply have to assign a mac. Use something like "ifconfig
eth0 hw ether xx:xx:xx:xx:xx:xx". Then the interface should work.
Cheers
Detlev
--
I've never understood the tendency to pick up tastes because they are popular.
In fact, I think it is foolish to do that. I mean, don't you know what you
like? People who are so weak that they will take their tastes from people
around them in the desperate desire to be accepted, I think of them as
cowards. -- Richard M. Stallman
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] Linux Kernel without Ethernet (missed MAC)
2010-01-20 10:06 ` Detlev Zundel
@ 2010-01-20 14:11 ` Arno Steffen
0 siblings, 0 replies; 12+ messages in thread
From: Arno Steffen @ 2010-01-20 14:11 UTC (permalink / raw)
To: u-boot
I did a small mod in uboot now. After each ethernet-access the
interface chip seems to get a soft reset, which deletes the mac
address in its registers.
So in smc911x.h (!!!!) in function smc911x_reset I commented the line
// smc911x_reg_write(dev, HW_CFG, HW_CFG_SRST);
It is somehow pitty that kernel (even latest) and uboot doesn't match anymore.
As I coudn't find out how does the kernel usually know the mac from, I
don't know what part is responsible.
Thanks all of you for your help.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2010-01-20 14:11 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-19 9:44 [U-Boot] Linux Kernel without Ethernet (missed MAC) Arno Steffen
2010-01-19 13:34 ` Prafulla Wadaskar
2010-01-19 13:54 ` Arno Steffen
2010-01-19 14:15 ` Wolfgang Denk
2010-01-19 14:59 ` Arno Steffen
2010-01-19 16:04 ` Nishanth Menon
2010-01-19 18:47 ` Wolfgang Denk
2010-01-20 10:06 ` Detlev Zundel
2010-01-20 14:11 ` Arno Steffen
2010-01-19 14:50 ` Daniel Gorsulowski
2010-01-19 16:33 ` Arno Steffen
2010-01-19 18:45 ` Wolfgang Denk
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.