[U-Boot] [PATCH v2] add dm9000 eeprom read/write command
Stefano Babic
sbabic at denx.de
Wed Aug 31 15:01:43 CEST 2011
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
=====================================================================
More information about the U-Boot
mailing list