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

ar71xx: Add TP-Link WR940N v6 support #635

Closed
wants to merge 1 commit into from

Conversation

@robimarko
Copy link
Contributor

commented Jan 9, 2018

Add support for TL-WR940N v6 board.
It is pretty much the same as v5 except they only left WAN LED and removed other ones.

Installation:
Flash factory image through WEB UI
or use TFTP to flash it.

Signed-off-by: Robert Marko robimarko@gmail.com

@JamesT42

This comment has been minimized.

Copy link

commented Jan 10, 2018

WAN Led seems to be dual color, are both of these available in your PR? (I know that switching the color is not easy etc... but I still could use it with some scripting).

@robimarko

This comment has been minimized.

Copy link
Contributor Author

commented Jan 10, 2018

Are you sure?
I only found 1 GPIO assigned to LEDs

@heinzek

This comment has been minimized.

Copy link
Contributor

commented Jan 10, 2018

From User Guide:

image

@robimarko

This comment has been minimized.

Copy link
Contributor Author

commented Jan 10, 2018

Ok,will look into GPL again tommorow.

@robimarko

This comment has been minimized.

Copy link
Contributor Author

commented Jan 11, 2018

Took another look at GPL and they defined GPIO14 to be used too, but only in the bootloader.
I did not find it earlier since I was searching by model name and not their product identifier code.
/` turn on all wan blue/
li t0, GPIO_OUT
lw t1, 0(t0)
li t2, ~((1<<14) | (1<<15))
/li t2, 0xfffb3e07/
and t1, t1, t2
sw t1, 0(t0)

/* wait for a while */
li t0, 0x0
li t1, 0x9000000

1:
addi t0, t0, 1
bne t0, t1, 1b
nop

/* turn on wan orange*/
li t0, GPIO_OUT
lw t1, 0(t0)
li t2, ((1<<14)|(1<<15))
or t1, t1, t2
sw t1, `0(t0)

Not really intuitive, but it looks like its GPIO14 for another color.
I could add it to GPIOs so it can be used as diagnosing LED.

@JamesT42 Would you be willing to test the new image?

@robimarko robimarko force-pushed the robimarko:WR940N-v6 branch 2 times, most recently from adb9915 to e61668f Jan 31, 2018
@robimarko

This comment has been minimized.

Copy link
Contributor Author

commented Jan 31, 2018

No interest so far in testing GPIO for other color.
Rebased on master due to makefile changes.
So,this is good to go

@JamesT42

This comment has been minimized.

Copy link

commented Feb 1, 2018

Really sorry, I did not see your comment before. I do not have such a device yet, so I can not test it.

@JamesT42

This comment has been minimized.

Copy link

commented Feb 20, 2018

@robimarko I have a WR940N V6 now, if you send me an image I will test it ASAP.

@robimarko robimarko force-pushed the robimarko:WR940N-v6 branch from e61668f to a5cf48a Feb 21, 2018
@robimarko

This comment has been minimized.

Copy link
Contributor Author

commented Feb 21, 2018

@JamesT42 Here is a test image:
https://drive.google.com/drive/folders/1iUQUSMz-KlBGESlkbHBJxsDrMijG7gIe?usp=sharing

Orange LED should be used during first boot as I set it as diag one.
Please inform me which color is lit and when

@jernejs

This comment has been minimized.

Copy link

commented Feb 21, 2018

I tested the image, during bootup both LEDs were lit (looked kinda whitish).

echo 1 > /sys/class/leds/tp-link\:blue\:wan/brightness turns OFF the orange LED, 0 turns it on
echo 1 > /sys/class/leds/tp-link\:orange\:diag/brightness turns on the blue LED, 0 turns it off

So the colours are swapped, and for orange LED on/off is swapped.

@robimarko

This comment has been minimized.

Copy link
Contributor Author

commented Feb 21, 2018

@jernejs

This comment has been minimized.

Copy link

commented Feb 21, 2018

Orange LED is now flashing during bootup, and stays lit after it's finished. /sys/class/leds now behave as expected.

@robimarko

This comment has been minimized.

Copy link
Contributor Author

commented Feb 21, 2018

It should be turned off after everything is booted.
Blue one should be on after WAN is connected

@jernejs

This comment has been minimized.

Copy link

commented Feb 21, 2018

Confirmed, this now works properly.

@robimarko

This comment has been minimized.

Copy link
Contributor Author

commented Feb 21, 2018

Great,just pushed those changes to this PR.
This should be mergeable now

Add support for TL-WR940N v6 board.
It is pretty much the same as v5 except they only left WAN LED and removed other ones.

Installation:
Flash factory image through WEB UI
or use TFTP to flash it.

Signed-off-by: Robert Marko <robimarko@gmail.com>
@robimarko robimarko force-pushed the robimarko:WR940N-v6 branch from a5cf48a to de65bdd Feb 21, 2018
@JamesT42

This comment has been minimized.

Copy link

commented Feb 22, 2018

Sorry, but I can not confirm that.
I tried your image, and also build my own using your patches.
After boot, blue switches on and of very shortly, then orange turns on, then blinks. After the boot is finished, it mostly lights blue/redish at the same time, but blinks orange on wan traffic.
When unplugging wan, it lights orange. (Which is kind of ok I guess, but not supposed to be so)
If I add a new LED entry for the orange led i can manually turn off the orange led, and then it only blinks blue as expected, not blue+orange. So I think the "turn off the orange led after boot" is missing.

@JamesT42

This comment has been minimized.

Copy link

commented Feb 23, 2018

Maybe we need something like

ucidef_set_led_netdev "wan" "WAN (blue)" "tp-link:blue:wan" "eth0"
ucidef_set_led_default "diag" "DIAG (orange)" "tp-link:orange:diag" "0" 

so the orange led has a defined state and is pre-configured in (l)uci?
(I tested this and it works as it should as far as I can tell)

@robimarko

This comment has been minimized.

Copy link
Contributor Author

commented Feb 24, 2018

No,orange one is just for diag.sh
Most likely it is set to 1 as default by bootloader.
So I need to set it to 0 by default.
Will have a image to test soon

@JamesT42

This comment has been minimized.

Copy link

commented Feb 24, 2018

Why not make the orange led accessible in (l)uci as standard?

@robimarko

This comment has been minimized.

Copy link
Contributor Author

commented Feb 24, 2018

Well,it is accessible.
You can make whatever rules you want with it

@rotanid

This comment has been minimized.

Copy link
Contributor

commented Feb 26, 2018

It is pretty much the same as v5

but there is no v5 support in OpenWrt, is there?

@heinzek

This comment has been minimized.

Copy link
Contributor

commented Feb 26, 2018

WR940Nv5 use the same image as WR940Nv4

@JamesT42

This comment has been minimized.

Copy link

commented Mar 9, 2018

@robimarko Have you found the missing "orange LED off" somewhere?

@movikbence This is no support forum! Use the Version for your region code, wrong one are not accepted anyway. You should use the provided image only for testing purposes.

@robimarko

This comment has been minimized.

Copy link
Contributor Author

commented Mar 9, 2018

@JamesT42

This comment has been minimized.

Copy link

commented Mar 24, 2018

Any news on this? Would be nice to have the new hardware in snapshots now.

@pepe2k pepe2k self-assigned this Apr 5, 2018
@pepe2k

This comment has been minimized.

Copy link
Member

commented Apr 5, 2018

@robimarko

Thank you for your contribution! I have merged your changes into my staging tree.

Cheers,
Piotr

@pepe2k pepe2k closed this Apr 5, 2018
@robimarko robimarko deleted the robimarko:WR940N-v6 branch Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.