[FS#915] WRT54GS v1.1 Power LED flashes & leds-gpio fails to load with error -16
LEDE Bugs
lede-bugs at lists.infradead.org
Wed Jul 19 12:12:29 PDT 2017
A new Flyspray task has been opened. Details are below.
User who did this - Occupied (Occupied)
Attached to Project - LEDE Project
Summary - WRT54GS v1.1 Power LED flashes & leds-gpio fails to load with error -16
Task Type - Bug Report
Category - Base system
Status - Unconfirmed
Assigned To -
Operating System - All
Severity - Low
Priority - Very Low
Reported Version - All
Due in Version - Undecided
Due Date - Undecided
Details - The leds-gpio module fails to load on WRT54GS v1.1 with this error message in the console:
"leds-gpio: probe of leds-gpio failed with error -16"
This applies both to OpenWRT 15.05.1 and LEDE 17.01.2 as well as the latest Snapshot.
The nvram variable "boardtype" is 0x0708 on this device.
In leds.c this gets mapped to "bcm47xx_leds_linksys_wrt54g_generic"
http://elixir.free-electrons.com/linux/latest/source/arch/mips/bcm47xx/leds.c#L677
With the following layout:
BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
BCM47XX_GPIO_LED(5, "white", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
BCM47XX_GPIO_LED(7, "orange", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
But this layout is invalid because this board does not have the "SecureEasySetup" WPS button.
GPIO5 is used by the reset button, that is why leds-gpio fails with error -16 (Device or resource busy).
As a quick test I changed the "boardtype" to 0x0101, leds-gpio can then load successfully and the power LED no longer flashes.
That layout is however not correct for the WRT54GS, the actual layout is:
Name GPIO Polarity
WLAN 0 Active low
POWER 1 Active high
DMZ 7 Active low
The problem in the source is that "boardtype" 0x0708 is not a unique identifier.
That actually matches several WRT54G v2 > v3.1 devices, and apparently also WRT54GS up to revision 2.1 that has the WPS button.
See the following old bug report for a list: https://lists.openwrt.org/pipermail/openwrt-devel/2014-June/025868.html
So the proper fix would be to introduce the variable "boardflags" as well into the code:
http://elixir.free-electrons.com/linux/latest/source/arch/mips/bcm47xx/board.c#L297
It is also worth noting that the reason the Power LED flickers is due to it's hardware implementation.
The LED can only be on or flashing, the flashing is done by an oscillator on the board itself.
Ref: https://bugs.lede-project.org/index.php?do=details&task_id=793
More information can be found at the following URL:
https://bugs.lede-project.org/index.php?do=details&task_id=915
More information about the lede-bugs
mailing list