OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version All
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Occupied - 19.07.2017

FS#915 - WRT54GS v1.1 Power LED flashes & leds-gpio fails to load with error -16

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 0×0708 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 0×0101, 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” 0×0708 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

Occupied commented on 21.07.2017 14:52

User jmv2009 on #lede-dev experienced exactly the same issue with his WRT54G v2.2
His boardtype is also 0x0708 and GPIO5 is also used by the reset button on his.
The boardflags on his WRT54G v2.2 router is 0x0118

Looking again on the list I linked in the initial report this makes sense:
https://lists.openwrt.org/pipermail/openwrt-devel/2014-June/025868.html

There is one error in that list though, I wrote above:
"That actually matches several WRT54G v2 > v3.1 devices"
Actually the second entry on the list is incorrect. so it should be: "WRT54G v2.2 > v3.1 devices"
You can confirm this because "eou_device_id" is identical on the following entry.

The “SecureEasySetup” WPS button was added in WRT54G v3.0 & WRT54GS v2.0
But looking at the "boardflags" nvram variable this is identical between:
WRT54G v2.2 > 3.1
WRT54GS v1.1 > v2.1
So unfortunately that can not be used to differentiate if the board has a WPS button or not.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing