[OpenWrt-Devel] Explanation of LED infrastructure

Russell Senior russell at personaltelco.net
Wed Aug 6 01:24:23 EDT 2014

I am working with the AsiaRF AWM002/AWM003 modules (primarily the
latter) in their EVB eval board.  It seems that the LED configuration
is broken.  In the process of trying to figure out how to fix it, I'm
confronted by the unfortunate reality that I don't understand how the
full chain from DTS to blinking LEDs works.  I am hoping that someone
can clarify or at least clue-ify me so that I can fix my current
problem and be in a position to fix future ones.

I am referring to trunk, as of r41997.

There is a DTS (target/linux/ramips/dts/AWM003-EVB.dts) for the board,
which includes some LED configuration:

        gpio-leds {
                compatible = "gpio-leds";
                tx {
                        label = "awm002-evb:green:tx";
                        gpios = <&gpio0 15 1>;
                rx {
                        label = "awm002-evb:green:rx";
                        gpios = <&gpio0 16 1>;
                wps {
                        label = "awm002-evb:green:wps";
                        gpios = <&gpio0 21 1>;

However, on boot, these LEDs do not appear in sysfs.  The contents of
/sys/class/leds/ is:

  lrwxrwxrwx  1 root  root  0 Aug  5 17:45 rt2800soc-phy0::assoc -> ../../devices/10180000.wmac/leds/rt2800soc-phy0::assoc
  lrwxrwxrwx  1 root  root  0 Aug  5 17:45 rt2800soc-phy0::quality -> ../../devices/10180000.wmac/leds/rt2800soc-phy0::quality
  lrwxrwxrwx  1 root  root  0 Aug  5 17:45 rt2800soc-phy0::radio -> ../../devices/10180000.wmac/leds/rt2800soc-phy0::radio

These do not appear to be the same LEDs as in the DTS, which leads me
to wonder how the hell the sysfs gets populated and what my build is
missing.  There is the additional infrastructure in:




but as far as I can tell, I am going off the rails earlier in the
process (munging those didn't seem to help).  

The jump between the DTS and the sysfs is the magical part I am not
understanding.  If someone could explain that, I would most appreciate
it.  git grep'ing in the tree isn't finding where the connection is
taking place for me, or what might be going wrong.  Maybe the
explanation for my non-workingness is that there is no connection?

Thanks for any clues!

Russell Senior, President
russell at personaltelco.net
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list