Adding new commands
Hi,
I have to add two new commands so I have to add something like this to cmd_confdefs.h:
#define CFG_CMD_NEW1 0x8000000000000000ULL
#define CFG_CMD_NEW2 ???
IIUC we have 64 bits available for the commands and 63 commands are already defined. So how to define more than 64 commands?
TIA,
llandre
DAVE Electronics System House - R&D Department
web: http://www.dave-tech.it email: r&d2 at dave-tech.it
Dear llandre!
Quoted 5 lines · llandre
#define
CFG_CMD_NEW10x8000000000000000ULL
#defineCFG_CMD_NEW2???IIUC we have 64 bits available for the commands and 63 commands are already defined. So how to define more than 64 commands?
This is indeed a big problem which will occur to nearly every developer who implements new commands. CFG_CMD_* and CONFIG_COMMANDS are only used for preprocessor evaluation; they don't seem to be used in object code. But they rely on the ULL (unsigned long long int) type; I don't think that there is something like a 128bit type which can be used directly for logical AND operations.
For new command there could be used another macro like CONFIG_COMMANDS2 and CFG_CMD2_* for the configuration values.
Here are some statistics about usage of the old definitions:CONFIG_COMMANDS: about 1650 entries in 470 filesCFG_CMD: about 4126 entries in 470
With best regards
Andreas Schweigstill
Signature · 5 lines
Dipl.-Phys. Andreas Schweigstill Schweigstill IT | Embedded Systems Schauenburgerstra?e 116, D-24118 Kiel, Germany Phone: (+49) 431 5606-435, Fax: (+49) 431 5606-436 Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/
Quoted 16 lines · Andreas Schweigstill
Dear llandre!
Quoted 5 lines · llandre
#define
CFG_CMD_NEW10x8000000000000000ULL
#defineCFG_CMD_NEW2???IIUC we have 64 bits available for the commands and 63 commands are already defined. So how to define more than 64 commands?
This is indeed a big problem which will occur to nearly every developer who implements new commands. CFG_CMD_* and
CONFIG_COMMANDSare only used for preprocessor evaluation; they don't seem to be used in object code. But they rely on the ULL (unsigned long long int) type; I don't think that there is something like a 128bit type which can be used directly for logical AND operations.
Quoted 3 lines
For new command there could be used another macro like
CONFIG_COMMANDS2and CFG_CMD2_* for the configuration values.
The number of options is growing all the time.
Maybe it would be a good idea to adopt the Kconfig system. Wolfgang does not like to have a lot of files like they do in the kernel but you do not have to split it up like they do it in the kernel. You could have a single Config.in file.
Best Regards,
Ulf Samuelsson
ulf at atmel.com
GSM: +46 (706) 22 44 57
Tel: +46 (8) 441 54 22
Fax: +46 (8) 441 54 29
Mail: Box 2033 174 02 Sundbyberg
Visit: Kavalleriv?gen 24
174 58 Sundbyberg'Sweden
Quoted 9 lines · In message <[email protected]> you wrote:
I have to add two new commands so I have to add something like this to
cmd_confdefs.h:#define
CFG_CMD_NEW10x8000000000000000ULL
#defineCFG_CMD_NEW2???IIUC we have 64 bits available for the commands and 63 commands are already defined. So how to define more than 64 commands?
We have to rework this whole configuration setup. At the moment I don't have a good and quick solution available.
What exactly are your two new commands?
Best regards,
Wolfgang Denk
Signature · 4 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Out of register space (ugh)" - vi
Quoted 5 lines · Wolfgang Denk
Quoted 4 lines · In message <[email protected]> you wrote:
I have to add two new commands so I have to add something like this to
cmd_confdefs.h:
Quoted 9 lines
Quoted 5 lines
#define
CFG_CMD_NEW10x8000000000000000ULL
#defineCFG_CMD_NEW2???IIUC we have 64 bits available for the commands and 63 commands are already defined. So how to define more than 64 commands?
We have to rework this whole configuration setup. At the moment I don't have a good and quick solution available.
You can always define a command outside the CFG_CMD in your board header file.
Then you can do an #ifdef in the source file.
Best Regards,
Ulf Samuelsson
Quoted 4 lines · Wolfgang Denk
Quoted 3 lines · In message <[email protected]> you wrote:
I have to add two new commands so I have to add something like this to
cmd_confdefs.h:
Quoted 9 lines
Quoted 5 lines
#define
CFG_CMD_NEW10x8000000000000000ULL
#defineCFG_CMD_NEW2???IIUC we have 64 bits available for the commands and 63 commands are already defined. So how to define more than 64 commands?
We have to rework this whole configuration setup. At the moment I don't have a good and quick solution available.
One possibility is to get rid of existing bitmap scheme. A cmd_defaults.h would define all default CFG_COMMAND_XXX. And board configs would add remove commands by defining more or remove from defaults by undefining the corresponding macros after the inclusion of cmd_defaults.h.
Another quick solution would be to use Most Significant Bit as an expansion flag and use up to 63 more commands via CONFIG_COMMANDS2 macro.
The test logic will need to be modified but it could be wrapped to a macro like:
Instead of this:
#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP) #include <rtc.h>
#endif
Use this:
#if IS_CONFIG_COMMAND(CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP) #include <rtc.h>
#endif
And IS_CONFIG_COMMAND macro defined something like:
#define IS_CONFIG_COMMAND(x) ((x) & 0x8000000000000000ULL) ? \ ((x) & CONFIG_COMMANDS2) | \ ((x) & CONFIG_COMMANDS))
And if we get to 63+62=126 commands we can use next to MSB in CONFIG_COMMANDS2 as another expansion bit along with CONFIG_COMMANDS3 (if we ever get that far).
Actually we do not even need to modify the existing (CONFIG_COMMAND & ....) but any new configuration options needs to test for enabling via the new macro.
Best regards,
Tolunay
Quoted 5 lines · In message <[email protected]> you wrote:
You can always define a command outside the
CFG_CMDin your board header file.Then you can do an #ifdef in the source file.
Yes, but this is not a general solution. I consider this a dirty hack which I don't want to see in the public source tree. There, I want to have one general mechanism to select commands. We have rteached the limits of the current one, and need to implement a better one.
Best regards,
Wolfgang Denk
Signature · 4 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The human mind ordinarily operates at only ten percent of its capaci- ty - the rest is overhead for the operating system.
Hi,
Quoted 1 line
What exactly are your two new commands?
the first one is used to boot WinCE images (don't blame me :) ), the second is used to turn watchdog timer on and off.
Regards,
llandre
DAVE Electronics System House - R&D Department
web: http://www.dave-tech.it email: r&d2 at dave-tech.it
Quoted 7 lines · llandre
Hi,
Quoted 1 line
What exactly are your two new commands?
the first one is used to boot WinCE images (don't blame me :) ), the second is used to turn watchdog timer on and off.
Are these more general-purpose commands, or like the watchdog timer, perhaps board-specific? I've added a number of new commands for some boards I'm working on, but because they were either board or CPU-specific (and only defined under the board directory), I didn't bother guarding them at all. Not sure if this is cannon.
Quoted 17 lines
Regards,
llandreDAVE Electronics System House - R&D Department
web: http://www.dave-tech.it email: r&d2 at dave-tech.it-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users
Quoted 2 lines
Are these more general-purpose commands, or like the watchdog timer, perhaps board-specific?
Both are basically general-purpose. They require a little board-specific portion.
The watchdog command "extends" the existing infrastructure in order to allow the user to enable/disable the watchdog without rebuilding (very useful during debugging stage).
Regards,
llandre
DAVE Electronics System House - R&D Department
web: http://www.dave-tech.it email: r&d2 at dave-tech.it