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

ramips: mt7620: Enable all ports of Lava LR-25G001 #4806

Closed
wants to merge 1 commit into from

Conversation

CHKDSK88
Copy link
Contributor

In 20b09a2 Lava LR-25G001 router have problem with two inactive
ethernet ports. JBOOT bootloader didn't configure ethernet devices by default.
The same situation was there. It is required to enable all phy ports.
This is fragment of stock bootlog:

switch reg write_athr offset=90, value=2b0
switch reg write_athr offset=8c, value=2b0
switch reg write_athr offset=88, value=2b0
switch reg write_athr offset=84, value=2b0
switch reg write_athr offset=80, value=2b0

This patch adds proper registers configuration ar8337 initvals.

When switch is now ok, let's fix port numeration too.

Fixes: 20b09a2 ("ramips: add support for Lava LR-25G001")

Signed-off-by: Pawel Dembicki paweldembicki@gmail.com

@CHKDSK88
Copy link
Contributor Author

@nbriggs
Maybe it will work on Your device too?

@nbriggs
Copy link
Contributor

nbriggs commented Nov 29, 2021

@CHKDSK88 Thanks for the heads up. All the ports on my ESR600 were already working based on the changes that @mpratt14 had made some time back. I haven't updated it in a while, but I should, to make sure that any recent changes haven't broken anything.

@mpratt14
Copy link
Contributor

From what I understood, the PORT STATUS for ports 1 through 5 are automatically set by the switch when it detects link
(at least if the bootloader enables this, like you said, if JBOOT does nothing I guess you do have a problem)

looking at the datasheet for AR8327:

setting port status to 0x2b0 sets the bits:
4 TX flow control enable
5 RX flow control enable
7 half-duplex flow control enable
9 phy link auto-negotiation

there is another bit, 12 which is flow control auto-negotiation which may be more appropriate than having it on by default

so you can try bits 9 and 12 only which is 0x1200

Also, I might as well share this small section I added to the wiki, which is a way to print all the registers in kernel log at boot time. For example, I have noticed a difference between which registers are set by Uboot when the boot is interrupted and you upload an initramfs kernel compared to when you let it boot normally from flash.

https://openwrt.org/docs/techref/hardware/switch/atheros

@adschm adschm added the target/ramips pull request/issue for ramips target label Nov 30, 2021
@CHKDSK88
Copy link
Contributor Author

CHKDSK88 commented Dec 2, 2021

@mpratt14
Thank You for the feedback. 0x1200 works fine. I changed commit.

@mpratt14
Copy link
Contributor

mpratt14 commented Dec 3, 2021

nice

now adjust the title because "ports" can also refer to the SOC RGMII interfaces and internal PHYs

maybe like "enable switch PHYs auto-negotiation for Lava ..."

@@ -175,7 +175,7 @@ ramips_setup_interfaces()
;;
lava,lr-25g001)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0"
"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "0@eth0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change makes it the same as engenius,esr600 at line 140

should remove this block and add the lava board to that instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

In 20b09a2 Lava LR-25G001 router have problem with two inactive
ethernet ports. JBOOT bootloader didn't configure ethernet devices by default.
The same situation was there. It is required to enable all phy ports.
This is fragment of stock bootlog:

switch reg write_athr offset=90, value=2b0
switch reg write_athr offset=8c, value=2b0
switch reg write_athr offset=88, value=2b0
switch reg write_athr offset=84, value=2b0
switch reg write_athr offset=80, value=2b0

This patch adds proper registers configuration ar8337 initvals.
0x2b0 value causes force flow control configuration, 0x1200 was used
instead (flow control config auto-neg with phy). [1]

When switch is now ok, let's fix port numeration too.

Fixes: 20b09a2 ("ramips: add support for Lava LR-25G001")

[1] openwrt#4806 (comment)

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
@CHKDSK88
Copy link
Contributor Author

CHKDSK88 commented Dec 3, 2021

@mpratt14

Done, thank You.

jow- pushed a commit that referenced this pull request Dec 3, 2021
In 20b09a2 Lava LR-25G001 router have problem with two inactive
ethernet ports. JBOOT bootloader didn't configure ethernet devices by default.
The same situation was there. It is required to enable all phy ports.
This is fragment of stock bootlog:

switch reg write_athr offset=90, value=2b0
switch reg write_athr offset=8c, value=2b0
switch reg write_athr offset=88, value=2b0
switch reg write_athr offset=84, value=2b0
switch reg write_athr offset=80, value=2b0

This patch adds proper registers configuration ar8337 initvals.
0x2b0 value causes force flow control configuration, 0x1200 was used
instead (flow control config auto-neg with phy). [1]

When switch is now ok, let's fix port numeration too.

Fixes: 20b09a2 ("ramips: add support for Lava LR-25G001")

[1] #4806 (comment)

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
@chunkeey
Copy link
Member

chunkeey commented Dec 3, 2021

Merged. Thanks!

@chunkeey chunkeey closed this Dec 3, 2021
aiamadeus pushed a commit to immortalwrt/immortalwrt that referenced this pull request Dec 5, 2021
In 20b09a2 Lava LR-25G001 router have problem with two inactive
ethernet ports. JBOOT bootloader didn't configure ethernet devices by default.
The same situation was there. It is required to enable all phy ports.
This is fragment of stock bootlog:

switch reg write_athr offset=90, value=2b0
switch reg write_athr offset=8c, value=2b0
switch reg write_athr offset=88, value=2b0
switch reg write_athr offset=84, value=2b0
switch reg write_athr offset=80, value=2b0

This patch adds proper registers configuration ar8337 initvals.
0x2b0 value causes force flow control configuration, 0x1200 was used
instead (flow control config auto-neg with phy). [1]

When switch is now ok, let's fix port numeration too.

Fixes: 20b09a2 ("ramips: add support for Lava LR-25G001")

[1] openwrt/openwrt#4806 (comment)

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Vladdrako pushed a commit to Vladdrako/openwrt that referenced this pull request Dec 11, 2021
In 20b09a2 Lava LR-25G001 router have problem with two inactive
ethernet ports. JBOOT bootloader didn't configure ethernet devices by default.
The same situation was there. It is required to enable all phy ports.
This is fragment of stock bootlog:

switch reg write_athr offset=90, value=2b0
switch reg write_athr offset=8c, value=2b0
switch reg write_athr offset=88, value=2b0
switch reg write_athr offset=84, value=2b0
switch reg write_athr offset=80, value=2b0

This patch adds proper registers configuration ar8337 initvals.
0x2b0 value causes force flow control configuration, 0x1200 was used
instead (flow control config auto-neg with phy). [1]

When switch is now ok, let's fix port numeration too.

Fixes: 20b09a2 ("ramips: add support for Lava LR-25G001")

[1] openwrt#4806 (comment)

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
@polex
Copy link
Contributor

polex commented Apr 6, 2022

@CHKDSK88 Thanks for the heads up. All the ports on my ESR600 were already working based on the changes that @mpratt14 had made some time back. I haven't updated it in a while, but I should, to make sure that any recent changes haven't broken anything.

Without the:
#4111
The connection between MT7620A and AR8x37 did not work (not only the 2 LANs).

I injected the Sitecom WLR-4100 V1 002 in the 21.02 branch and it did not work because the:
#4303
is missing.
The WLR-4100 v1 002 on top of #4303 works.

@nbriggs can you test the 21.02?
I reccomend to test it on RAM because, in case of it did not work, you will loose the chance to manage the device from the LAN.

@nbriggs
Copy link
Contributor

nbriggs commented Apr 6, 2022

@polex -- it will take me a while to test the 21.02 release -- I have to collect all the necessary bits of hardware/software together again, but I'll report back here when I have done so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target/ramips pull request/issue for ramips target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants