Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
openwrt-bot opened this issue Jul 19, 2017 · 1 comment
Labels

Comments

@openwrt-bot
Copy link

Occupied:

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

@openwrt-bot
Copy link
Author

Occupied:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant