netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christer Weinigel <christer@weinigel.se>
To: David Miller <davem@davemloft.net>
Cc: shemminger@vyatta.com, s.hauer@pengutronix.de, yanok@emcraft.com,
	linux-arm-kernel@lists.arm.linux.org.uk, netdev@vger.kernel.org,
	wd@denx.de, dzu@denx.de
Subject: Re: [PATCH] dnet: Dave DNET ethernet controller driver
Date: Thu, 12 Mar 2009 15:21:47 +0100	[thread overview]
Message-ID: <49B91A7B.7050303@weinigel.se> (raw)
In-Reply-To: <20090312.055523.193191701.davem@davemloft.net>

David Miller wrote:
> From: Christer Weinigel <christer@weinigel.se>
> Date: Thu, 12 Mar 2009 11:41:24 +0100
> 
>> 1. The bootloader can pass a command line to the kernel and it is saved in non-volatile storage that can be changed from the bootloader
>>
>> 2. I can not modify the bootloader
>>
>> 3. I can modify the Linux kernel
>>
>> 4. The manufacturer has hardcoded a MAC address in the ethernet driver
>>
>> 5. I want to use NFS root to make it easy to develop on the platform
>>
>> 6. We get a second board so the hardcoded MAC addresses collide
> 
> This is getting rediculious.

Yes, ridiculous in the complexity of the workarounds for not having a 
generic way to set the mac address from the command line.  :-/

> If you can modify the kernel, you can have the kernel look in the
> non-volatile storage for the MAC address and export that information
> to the ethernet driver.

Which means that the non-volatile storage must be available through a 
Linux driver before the MAC address is set.  AFAIK there is no guarantee 
that the MTD layer will be ready to use by that time.  And that is 
assuming that there actually is a MTD driver available, usually when I 
work on a Linux port for a reference board, the first thing I do is to 
get a NFS root up and running, then I can put a have a complete Debian 
system with all nice debugging tools available.  When I have that up and 
running I start porting the other drivers, such as the MTD driver.

Also, I don't really want to spend time on reverse engineering some 
random non-volatile storage format, that's quite fragile.

> Or, you can parse the command line in your platform specific code
> and program the MAC address into the chip.

Which is actually what I'm doing, except that it's easier to hack that 
into the ethernet driver each time it is needed.

> In fact there are many reasonable ways to solve the problem in
> your scenerio, and none of them require device driver command
> line option handler.

Yes, that why I'd want that in a generic piece of code instead of having 
to hack it into each device driver.  Would a generic command line 
option, something like "ethaddrs=eth0=00:de:ad:be:ef:01" which assigns 
addresses to network cards be acceptable?

Next time I have to port something to an embedded platform with this 
kind of problem, I might try to do something more generic instead of the 
simple hack I usually do now.

   /Christer


  reply	other threads:[~2009-03-12 14:21 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-11  2:29 [PATCH] dnet: Dave DNET ethernet controller driver Ilya Yanok
2009-03-11  4:00 ` Eric Dumazet
2009-03-11 23:33   ` [PATCH] dnet: Dave DNET ethernet controller driver (updated) Ilya Yanok
2009-03-12  6:29     ` David Miller
2009-03-11  4:18 ` [PATCH] dnet: Dave DNET ethernet controller driver Stephen Hemminger
2009-03-11  8:44   ` Sascha Hauer
2009-03-11  8:49     ` David Miller
2009-03-11  8:57       ` Sascha Hauer
2009-03-11  9:09         ` Wolfgang Denk
2009-03-11 10:35           ` Sascha Hauer
2009-03-11 13:23           ` David Miller
2009-03-11 14:00             ` Dan Williams
2009-03-11 18:23             ` Robert Schwebel
2009-03-11 19:15             ` Riku Voipio
2009-03-12  0:44               ` David Miller
2009-03-11 20:56       ` Christer Weinigel
2009-03-11 21:33         ` Russell King - ARM Linux
2009-03-12  0:13         ` Stephen Hemminger
2009-03-12 10:41           ` Christer Weinigel
2009-03-12 12:55             ` David Miller
2009-03-12 14:21               ` Christer Weinigel [this message]
2009-03-12 14:34                 ` Sascha Hauer
2009-03-12 15:01                 ` David Miller
2009-03-12 15:12                 ` Neil Horman
2009-03-12 16:25                   ` Christer Weinigel
2009-03-12 17:43                     ` David Miller
2009-03-12 17:52                       ` Christer Weinigel
2009-03-12 18:06                         ` Jamie Lokier
2009-03-12 18:39                           ` Dan Williams
2009-03-12 18:48                           ` Christer Weinigel
2009-03-12 19:04                             ` Sascha Hauer
2009-03-12 19:15                               ` Jamie Lokier
2009-03-12 19:16                               ` Neil Horman
2009-03-12 19:21                               ` Christer Weinigel
2009-03-12 20:14                               ` Wolfgang Denk
2009-03-12 20:27                                 ` Sascha Hauer
2009-03-12 20:35                                 ` Russell King - ARM Linux
2009-03-12 17:49                     ` Neil Horman
2009-03-12 18:25                       ` Christer Weinigel
2009-03-12 19:05                         ` Neil Horman
2009-03-12 19:14                           ` Sascha Hauer
2009-03-12 19:29                           ` Christer Weinigel
2009-03-12 21:59                           ` Jamie Lokier
2009-03-12 23:42                             ` Christer Weinigel
2009-03-13  0:21                               ` Neil Horman
2009-03-13  1:29                                 ` Christer Weinigel
2009-03-13 10:30                                   ` Neil Horman
2009-03-13  0:16                             ` Neil Horman
2009-03-12 19:25                         ` Jamie Lokier
2009-03-12 19:43                           ` Christer Weinigel
2009-03-12 20:24                   ` Mike (mwester)
2009-03-13  0:29                     ` Neil Horman
2009-03-12 13:41   ` Michael Cashwell
2009-03-12 14:05     ` David Miller
2009-03-12 14:26       ` Neil Horman
2009-03-12 18:02       ` Jamie Lokier
2009-03-13 19:49       ` Robert Schwebel
2009-03-13 20:12         ` David Miller

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=49B91A7B.7050303@weinigel.se \
    --to=christer@weinigel.se \
    --cc=davem@davemloft.net \
    --cc=dzu@denx.de \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shemminger@vyatta.com \
    --cc=wd@denx.de \
    --cc=yanok@emcraft.com \
    /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;
as well as URLs for NNTP newsgroup(s).