public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] add dm9000 eeprom read/write command
Date: Wed, 31 Aug 2011 15:01:43 +0200	[thread overview]
Message-ID: <4E5E30B7.2050805@denx.de> (raw)
In-Reply-To: <4D514DD1-A708-4081-A9B4-1AD48A76BF9C@armadeus.org>

On 08/30/2011 11:17 PM, Eric Jarrige wrote:
> Hi Stefano,

Hi Eric,

> Sorry for the confusion, I did not understood that your remark was
> not related to the compilation flags.
> Now, I've checked how to have this U-Boot commands in the driver
> itself. I think it's doable if  I can have a compilation
> CONFIG_CMD_XXX to enable the command line feature.

You could add a CONFIG_DM9000_* switch. This set a switch only for the
DM9000 driver and the name remembers that it is used only inside the
driver itself, such as CONFIG_DM9000_DEBUG and CONFIG_DM9000_BASE that
are currently used in the driver.

> Without this option, there is a direct impact one memory footprint for
> every board featuring the DM9000 controller and I failed to find any
> model of driver with an optional command line interface in a driver.

Or you can reuse CONFIG_DM9000_NO_SROM (already in driver) and enable
your command if this switch is not defined. If the eeprom is present, it
makes sense to have this command enabled.

> 
> Why do you recommend to put the command interface in drivers
> as it is seems to be something quite unusual in U-Boot ? 

Not sure it is so unusual. I see that all commands under common/* are
general commands, and they are not related to a specific driver. There
are then two commands in drivers, drivers/misc/fsl_pmic.c and
drivers/qe/qe.c. These commands are only related to these drivers and
make no sense without the driver. I see then a lot of board related
commands stored in the board directories.

If I understand well the concept, each command resides where it is
thought: general commands in common, board commands in board
directories, driver commands in the driver itself. If your command is in
the driver file, there is also no need to check if CONFIG_DRIVER_DM9000
is set, because the file is simply not compiled if it is unset.

Best regards,
Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

  reply	other threads:[~2011-08-31 13:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-28 21:47 [U-Boot] [PATCH v2] add dm9000 eeprom read/write command Eric Jarrige
2011-08-30  9:47 ` Stefano Babic
2011-08-30 21:17   ` Eric Jarrige
2011-08-31 13:01     ` Stefano Babic [this message]
2011-08-31 22:27       ` Eric Jarrige
2011-09-01  8:05         ` Stefano Babic

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=4E5E30B7.2050805@denx.de \
    --to=sbabic@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