add dm9000 eeprom read/write command
PATCH v2 1/1 add dm9000 eeprom read/write command
Changes for v2:
- remove DM9000 driver dependant compilation flag
--- README | 1 + common/Makefile | 1 + common/cmd_dm9000ee.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 0 deletions(-) create mode 100644 common/cmd_dm9000ee.c
README +1 -0
@@ -707,6 +707,7 @@ The following options need to be configured: CONFIG_CMD_DATE * support for RTC, date/time... CONFIG_CMD_DHCP * DHCP support CONFIG_CMD_DIAG * Diagnostics + CONFIG_CMD_DM9000EE DM9000 external EEPROM support CONFIG_CMD_DS4510 * ds4510 I2C gpio commands CONFIG_CMD_DS4510_INFO * ds4510 I2C info command CONFIG_CMD_DS4510_MEM * ds4510 I2C eeprom/sram commansd
common/Makefile +1 -0
@@ -81,6 +81,7 @@ ifdef CONFIG_POST COBJS-$(CONFIG_CMD_DIAG) += cmd_diag.o endif COBJS-$(CONFIG_CMD_DISPLAY) += cmd_display.o +COBJS-$(CONFIG_CMD_DM9000EE) += cmd_dm9000ee.o COBJS-$(CONFIG_CMD_DTT) += cmd_dtt.o COBJS-$(CONFIG_CMD_ECHO) += cmd_echo.o COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += cmd_eeprom.o
common/cmd_dm9000ee.c new file +82 -0
82 lines not on this page · raw message
PATCH v2 1/1 add dm9000 eeprom read/write command
Quoted 8 lines · Eric Jarrige
Signed-off-by Eric Jarrige <[email protected]>Signed-off-by Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>Changes for v2:
- remove DM9000 driver dependant compilation flag
---
Hi Eric,
why should this code put in a separate file and not inserted in the driver itself ? I think this remains an open point from our previous discussion.
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== 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 =====================================================================
PATCH v2 1/1 add dm9000 eeprom read/write command
Hi Stefano,
Quoted 10 lines · Stefano Babic
Quoted 8 lines · Eric Jarrige
Signed-off-by Eric Jarrige <[email protected]>Signed-off-by Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>Changes for v2:
- remove DM9000 driver dependant compilation flag
---
Quoted 6 lines
Hi Eric,
why should this code put in a separate file and not inserted in the driver itself ? I think this remains an open point from our previous discussion.
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.
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.
Why do you recommend to put the command interface in drivers as it is seems to be something quite unusual in U-Boot ?
Best regards,
Eric
PATCH v2 1/1 add dm9000 eeprom read/write command
Quoted 1 line · Eric Jarrige
Hi Stefano,
Hi Eric,
Quoted 5 lines
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 compilationCONFIG_CMD_XXXto 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.
Quoted 3 lines
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.
Quoted 3 lines
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
Signature · 5 lines
===================================================================== 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 =====================================================================
PATCH v2 1/1 add dm9000 eeprom read/write command
Quoted 8 lines · Stefano Babic
Hi Eric,
Quoted 5 lines
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 compilationCONFIG_CMD_XXXto enable the command line feature.
Quoted 4 lines
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_DEBUGandCONFIG_DM9000_BASEthat are currently used in the driver.
In such a case MAKEALL fails to compile the trizepsiv board with a double definition of 'do_dm9000_eeprom'.
Quoted 8 lines
Quoted 4 lines
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.
That makes sense but there is still a compilation failure and some impact on 7 other boards.
Quoted 12 lines
Quoted 4 lines
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.canddrivers/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.
Quoted 5 lines
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 ifCONFIG_DRIVER_DM9000is set, because the file is simply not compiled if it is unset.
I understand your point of view but I am not sure at all that board maintainers will want to give a command interface to modify the content of the DM9000 eeprom.
Best regards,
Eric
PATCH v2 1/1 add dm9000 eeprom read/write command
Quoted 9 lines · Eric Jarrige
Quoted 4 lines · Stefano Babic
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_DEBUGandCONFIG_DM9000_BASEthat are currently used in the driver.In such a case MAKEALL fails to compile the trizepsiv board with a double definition of '
do_dm9000_eeprom'.
Of course, the command must be dropped from the trizeps board. It makes no sense to have such a duplication of identical code, even without compilation errors.
Feel free to drop completely the eeprom.c file from the trizeps board.
Quoted 2 lines
That makes sense but there is still a compilation failure and some impact on 7 other boards.
Sure, there is an incremented footprint, but I guess it is limited. And at the moment, there are some dead code (dm9000_read_srom_word and dm9000_write_srom_word) that is compiled in any case if CONFIG_DM9000_NO_SROM is not set.
Because your code is a slightly modification of the code in the trizeps board, we can assume we get the same impact. For the trizeps, I can see:
000221d4 T do_write_dm9000_eeprom
00022248 T do_read_dm9000_eeprom000222b4 T do_dm9000_eeprom0002234c T __aeabi_unwind_cpp_pr0
It seems to me that the code in TEXT for these functions increases for only 376 bytes.
Quoted 2 lines
I understand your point of view but I am not sure at all that board maintainers will want to give a command interface to modify the content of the DM9000 eeprom.
Why not ? If the eeprom is soldered on the board, it must be preprogrammed, because there is no way to do this in the bootloader.
Anyway, we are currently discussing this topic on the ML, and everyone can raise his objections if he disagree ;-).
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== 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 =====================================================================