1

I am doing a project with Raspberry Pi and OpenWrt. I need to attach indicator LEDs. Basically, I need to modify the DTS for bcm2710 and add additional GPIOs in the led section such that it gets recognised in /sys/class/leds/.

But the RaspberryPi3 DTS is a bit confusing.

I came across this:

+&leds {
+   act_led: act {
+       label = "led0";
+       linux,default-trigger = "mmc0";
+       gpios = <&virtgpio 0 0>;
+   };
+
+   pwr_led: pwr {
+       label = "led1";
+       linux,default-trigger = "input";
+       gpios = <&expgpio 7 0>;
+   };
+};

+/ {
+   __overrides__ {
+       act_led_gpio = <&act_led>,"gpios:4";
+       act_led_activelow = <&act_led>,"gpios:8";
+       act_led_trigger = <&act_led>,"linux,default-trigger";
+
+       pwr_led_gpio = <&pwr_led>,"gpios:4";
+       pwr_led_activelow = <&pwr_led>,"gpios:8";
+       pwr_led_trigger = <&pwr_led>,"linux,default-trigger";
+   };
+};

Why does the overrides section have the same gpios for both the leds? How do I declare more GPIOs as led?

Attempts: When more leds are added to the &led section, the building of DTB from DTS fails.

+   mng_led: mng {
+       label = "led2";
+       gpios = <&expgpio 21 0>;
+   };

Also added a section to the __overrides__

+       mng_led_gpio = <&mng_led>,"gpios:4";
+       mng_led_activelow = <&mng_led>,"gpios:8";

I also tried adding an overlay as documented in rpi3-act-led.

Any help will be much appreciated.

Thanks.

Links:

OpenWrt bcm2708 DTS patch

bcm2710-rpi3b-dts

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.