On 22 May 2017 at 19:01, Amit Kucheria <amit.kucheria@linaro.org> wrote:
On Mon, May 22, 2017 at 5:07 PM, Daniel Thompson
<daniel.thompson@linaro.org> wrote:
> Hi Folks
>
> I've ended up talking to a few people recently about LEDs.
>
> CE and EE have four user lights which are often hooked up in different ways
> on each board.
>
> Are there any common recommendations about default LED hook ups for the
> kernel (e.g. USR1 -> heartbeat, USR2 -> disk I/O, etc)?

There aren't, AFAIK. But perhaps we can make some progress this time
with Mani's help. Homogenising the LED names in DT and sysfs is
certainly something that he's working on.

> Similarly it might be useful to have a couple of events nominated where we
> recommend a firmware level bootloader[1] change LED status. Some examples:
>
>  - Set USR1 on when bootloader starts up (a NOR/eMMC/SD is not empty
>    light).
>  - Set USR3 on when entering fastboot mode (if supported)
>  - Set USR3 off when leaving fastboot mode, including via "fastboot
>    boot" (if supported)
>  - Set USR1 off and USR2, 3 and 4 on if bootloader panics.

You want to create you own implementation of BIOS codes from the PC world :)

Unless, you make it mandatory though, they won't be reliably
implemented across boards. And making them mandatory defeats the
purpose of these being user LEDs. So I'm loathe to require this in the
specs.

> Especially for CE board (where users often don't have a UART adapter) even
> the above simple hints that the bootloader has been fetched from somewhere
> is useful.
>
> I know this can't be a rule, only "good advice" (like asking CE boards to
> put console on LS-UART1 if possible). However, is there any appetite to
> converge for the boards we have influence over?

IMHO, one could start by implementing a few of these suggestions for a
board or two and get that merged into the relevant codebases. If there
is enough traction perhaps we might start seeing convergence?

We could have something as elaborate as follows and document it in a
wikipage for future boards, if needed (B=blink, DC=don't care):

USR1  USR2  USR3  USR4        Event
------------------------------------------------------------
  OFF       B         OFF      B         bootloader panic
    B          B          B          B        Transition from
bootloader to kernel (blink at 2Hz for 2s?)
  OFF       B          B          B         kernel panic
    B         DC       DC       DC       heartbeat (1Hz, bootloader and kernel)
  DC         B         DC       DC       onboard storage i/o (1Hz,
bootloader and kernel)
  DC        DC        B         DC      SD card i/o (1Hz, bootloader and kernel)

Getting even one board to do this might set the trend but I see it as
a bunch of small projects for anybody in the community that'd like to
get their hands dirty. Perhaps list it in the page the Robert is going
to maintain for ideas on starter projects?
Amit, you're right. We should implement this at-least in one of our CE boards as of now so that others can also adopt. 
I will discuss with Robert regarding extending this as a project for me.

Thanks,
Mani

Regards,
Amit



--
Manivannan Sadhasivam
Applications Engineer
Social: Linkedin | Twitter
IRC: mani_s