[U-Boot] [RFC] Add 'led' command

Jason Kridner jkridner at beagleboard.org
Fri Nov 5 18:04:35 CET 2010


On Fri, Nov 5, 2010 at 9:13 AM, Reinhard Meyer <u-boot at emk-elektronik.de> wrote:
> Dear Wolfgang Denk,
>>> It is desired to have the led command on the BeagleBoard to allow for some
>>> interaction in the scripts.
>>>
>>> This patch allows any board implementing the coloured LED API
>>> to control the LEDs from the console.
>>>
>>> led [green | yellow | red | all ]  [ on | off ]
>>>
>>> or
>>>
>>> led [ 1 | 2 | 3 | all ]  [ on | off ]
>>>
>>> Adds configuration item CONFIG_CMD_LED enabling the command.
>>>
>>> Partially based on patch from Ulf Samuelsson:
>>> http://www.mail-archive.com/u-boot@lists.denx.de/msg09593.html.
>>>
>>> Signed-off-by: Jason Kridner <jkridner at beagleboard.org>
>>> ---
>>>  common/Makefile  |    1 +
>>>  common/cmd_led.c |  207 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>  2 files changed, 208 insertions(+), 0 deletions(-)
>>>  create mode 100644 common/cmd_led.c
>>
>> I understand the requirement, but I think it is more than time to come
>> up with a common solution here instead of adding more and more copies
>> of very similar code.
>>
>> We already have:
>> ...
>>       arch/arm/cpu/arm926ejs/at91/led.c
>>       board/atmel/at91cap9adk/led.c
>>       board/atmel/at91rm9200dk/led.c
>>       board/atmel/at91rm9200ek/led.c
>>       board/atmel/at91sam9260ek/led.c
>>       board/atmel/at91sam9261ek/led.c
>>       board/atmel/at91sam9263ek/led.c
>>       board/atmel/at91sam9m10g45ek/led.c
>>       board/atmel/at91sam9rlek/led.c
>
> At least the atmel stuff are functions to implement the control of
> the LEDs (via gpio, i2c, spi etc.) which inherently is board specific;
> but not a command interface to control them from u-boot prompt/scripts.
>
> His patch tries to add a command, not a LED implementation.
> Such a command was on my mind for a while.

I tried to make it such that this command is enabled by the
implementations on the other architectures by following the existing
design.  I don't know how they are making use of the LED functions, so
it seems this command is required to make their implementations
useful.  I hope that is reason enough to at least get different
maintainers to try this command out and give some additional feedback.

It would be great if we had a summary of how these LED functions are
used.  For the BeagleBoard, we are simply enabling scripts to use this
command.  I think others are using the LED functions to indicate boot
status and other u-boot native operations.  Does such a summary exist
so that I can make any command implementation suitable?

Regards,
Jason


More information about the U-Boot mailing list