public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 2/3] net: Add a command to access the EEPROM from ethernet devices
Date: Tue, 14 Oct 2014 22:59:28 +0200	[thread overview]
Message-ID: <201410142259.28957.marex@denx.de> (raw)
In-Reply-To: <CAPnjgZ27HpCGWk8mg_EHJvsta0pjuFYCx2SWtj31hO5FnLLpSg@mail.gmail.com>

On Tuesday, October 14, 2014 at 07:21:06 PM, Simon Glass wrote:
> Hi,
> 
> On 14 October 2014 18:26, Alban Bedel <alban.bedel@avionic-design.de> wrote:
> > Many ethernet devices use an EEPROM to store various settings, most
> > commonly the device MAC address. But on some devices it can contains
> > a lot more, for example USB device might also have many USB related
> > parameters.
> > 
> > This commit add a set of commands to read/write this EEPROM, write a
> > default configuration and read/write the device MAC address. The
> > defaults command allow priming the EEPROM for devices that need more
> > than just a MAC address in the EEPROM.
> > 
> > Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
> > ---
> > v2: * No changes since v1
> > v3: * Replace the dedicated 'eth_eeprom' command with a subcommand
> > 
> >       to the newly introduced 'eth' command
> 
> I see a few EEPROM implementations in the code base. It feels to me
> like we need an EEPROM interface. In driver model terms this could be
> a uclass. I started something here:
> 
> http://patchwork.ozlabs.org/patch/399039/
> 
> Of course we don't have DM for Ethernet yet - when we do I think a
> child EEPROM device below the Ethernet would make sense. It could be
> created by the Ethernet driver when it knows that this information
> exists. But even without that I feel that the EEPROM should be
> logically separated from Ethernet.
> 
> So I suggest that instead of an #ifdef to adjust the Ethernet API, add
> a pointer to another struct containing the EEPROM API and put it in
> its own header. I also feel that there should ultimately be an eeprom
> command which operates on these. Then the only Ethernet API call would
> be to find the EEPROM pointer, if there is one.
> 
> If someone feels like taking it on, driver model support for Ethernet
> should be pretty easy. Or even EEPROM could be done now and this might
> avoid churn. But I would be happy for this series to be applied as is
> while working on a driver model version. I just don't feel we should
> be adding new subsystems that don't use driver model.

Speaking of eeprom command, I am now in the process of cleaning up 
common/cmd_eeprom.c . Simon, do you have anything related to DM which
explicitly touches this file ? If not, I'd suggest you wait a bit until
I manage to resolve the ifdef maze in there and look into it only after
the cleanup is done.

Best regards,
Marek Vasut

  parent reply	other threads:[~2014-10-14 20:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-14 16:26 [U-Boot] [PATCH v3 1/3] net: Add a command to manipulate ethernet devices Alban Bedel
2014-10-14 16:26 ` [U-Boot] [PATCH v3 2/3] net: Add a command to access the EEPROM from " Alban Bedel
2014-10-14 17:21   ` Simon Glass
2014-10-14 19:14     ` Joe Hershberger
2014-10-14 19:18       ` Simon Glass
2014-10-15  9:42         ` Alban Bedel
2014-10-17 20:12           ` Simon Glass
2014-10-21 12:51             ` Alban Bedel
2014-10-21 16:19               ` Simon Glass
2014-10-14 20:59     ` Marek Vasut [this message]
2014-10-14 16:26 ` [U-Boot] [PATCH v3 3/3] usb: eth: smsc95xx: Add EEPROM access support for LAN9514 Alban Bedel

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=201410142259.28957.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /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