* [U-Boot-Users] Adding new commands
@ 2006-10-16 11:10 llandre
2006-10-16 11:48 ` Andreas Schweigstill
2006-10-16 20:06 ` Wolfgang Denk
0 siblings, 2 replies; 10+ messages in thread
From: llandre @ 2006-10-16 11:10 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot-Users] Adding new commands
2006-10-16 11:10 [U-Boot-Users] Adding new commands llandre
@ 2006-10-16 11:48 ` Andreas Schweigstill
2006-10-16 18:09 ` Ulf Samuelsson
2006-10-16 20:06 ` Wolfgang Denk
1 sibling, 1 reply; 10+ messages in thread
From: Andreas Schweigstill @ 2006-10-16 11:48 UTC (permalink / raw)
To: u-boot
Dear llandre!
llandre schrieb:
> #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?
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 files
CFG_CMD: about 4126 entries in 470
With best regards
Andreas Schweigstill
--
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/
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot-Users] Adding new commands
2006-10-16 11:48 ` Andreas Schweigstill
@ 2006-10-16 18:09 ` Ulf Samuelsson
0 siblings, 0 replies; 10+ messages in thread
From: Ulf Samuelsson @ 2006-10-16 18:09 UTC (permalink / raw)
To: u-boot
Andreas Schweigstill wrote:
> Dear llandre!
>
> llandre schrieb:
>> #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?
>
> 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.
>
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot-Users] Adding new commands
2006-10-16 11:10 [U-Boot-Users] Adding new commands llandre
2006-10-16 11:48 ` Andreas Schweigstill
@ 2006-10-16 20:06 ` Wolfgang Denk
2006-10-16 20:24 ` Ulf Samuelsson
` (2 more replies)
1 sibling, 3 replies; 10+ messages in thread
From: Wolfgang Denk @ 2006-10-16 20:06 UTC (permalink / raw)
To: u-boot
In message <453368A1.5050407@dave-tech.it> you wrote:
>
> 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?
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
--
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot-Users] Adding new commands
2006-10-16 20:06 ` Wolfgang Denk
@ 2006-10-16 20:24 ` Ulf Samuelsson
2006-10-16 21:19 ` Wolfgang Denk
2006-10-16 20:45 ` Tolunay Orkun
2006-10-17 7:19 ` llandre
2 siblings, 1 reply; 10+ messages in thread
From: Ulf Samuelsson @ 2006-10-16 20:24 UTC (permalink / raw)
To: u-boot
Wolfgang Denk wrote:
> In message <453368A1.5050407@dave-tech.it> you wrote:
>>
>> 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?
>
> 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot-Users] Adding new commands
2006-10-16 20:06 ` Wolfgang Denk
2006-10-16 20:24 ` Ulf Samuelsson
@ 2006-10-16 20:45 ` Tolunay Orkun
2006-10-17 7:19 ` llandre
2 siblings, 0 replies; 10+ messages in thread
From: Tolunay Orkun @ 2006-10-16 20:45 UTC (permalink / raw)
To: u-boot
Wolfgang Denk wrote:
> In message <453368A1.5050407@dave-tech.it> you wrote:
>> 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?
>
> 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot-Users] Adding new commands
2006-10-16 20:24 ` Ulf Samuelsson
@ 2006-10-16 21:19 ` Wolfgang Denk
0 siblings, 0 replies; 10+ messages in thread
From: Wolfgang Denk @ 2006-10-16 21:19 UTC (permalink / raw)
To: u-boot
In message <024001c6f163$46118f10$01c4af0a@atmel.com> you wrote:
>
> 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.
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
--
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot-Users] Adding new commands
2006-10-16 20:06 ` Wolfgang Denk
2006-10-16 20:24 ` Ulf Samuelsson
2006-10-16 20:45 ` Tolunay Orkun
@ 2006-10-17 7:19 ` llandre
2006-10-17 9:57 ` Brent Cook
2 siblings, 1 reply; 10+ messages in thread
From: llandre @ 2006-10-17 7:19 UTC (permalink / raw)
To: u-boot
Hi,
> 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot-Users] Adding new commands
2006-10-17 7:19 ` llandre
@ 2006-10-17 9:57 ` Brent Cook
2006-10-17 10:35 ` llandre
0 siblings, 1 reply; 10+ messages in thread
From: Brent Cook @ 2006-10-17 9:57 UTC (permalink / raw)
To: u-boot
On Tuesday 17 October 2006 02:19, llandre wrote:
> Hi,
>
> > 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.
> Regards,
> llandre
>
> DAVE 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot-Users] Adding new commands
2006-10-17 9:57 ` Brent Cook
@ 2006-10-17 10:35 ` llandre
0 siblings, 0 replies; 10+ messages in thread
From: llandre @ 2006-10-17 10:35 UTC (permalink / raw)
To: u-boot
> 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
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-10-17 10:35 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-16 11:10 [U-Boot-Users] Adding new commands llandre
2006-10-16 11:48 ` Andreas Schweigstill
2006-10-16 18:09 ` Ulf Samuelsson
2006-10-16 20:06 ` Wolfgang Denk
2006-10-16 20:24 ` Ulf Samuelsson
2006-10-16 21:19 ` Wolfgang Denk
2006-10-16 20:45 ` Tolunay Orkun
2006-10-17 7:19 ` llandre
2006-10-17 9:57 ` Brent Cook
2006-10-17 10:35 ` llandre
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox