OpenWrt Forum Archive

Topic: TL-WR841N Atheros AR9431 WAN port swap

The content of this topic has been archived on 30 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all,

recently I received a WR841N (v8.4), which has no link activity when WAN port is connected.
I flashed it with OpenWrt image, but problem persists, which makes me believe it's more of a HW problem, as all other Eth ports (LANs) and Wireless adapter are functioning as expected.

( As a side note: I did only basic electrical measurements on the input RJ jack and magnetics and they seemed to be ok, so I'd narrow down the problem towards the SoC itself).

So just before giving up on this router, I found the SoC's (Atheros AR9431) datasheet, which states that WAN input twards the GMAC0 eth controller can be swapped between P0 and P4 of the underlying eth switch. This could be achieved by writing to SW_PHY_ADDR_SWAP and SW_PHY_SWAP of the ETH_CFG register

imgur.com/ BMJwz39

My question is if my assumption that swapping this port would mean that this router can still be used as a router and if yes, then how can I (if even possible) set this configuration?
I'm not really deep into linux environments, but would it be possible to have calls with *ioctl*-type procedures to access such device registers?

Cheers,
Dimitar

I think a change like that would require recompiling the chip init code in the kernel.  It is also unlikely to be successful as there is probably hardware damage to the phy on the chip.  This is quite common when lightning strikes near the cable or DSL line. 

You can use the regular configuration system to set up the switch to run VLANs to eth1 and make one of the 4 regular switched ports usable for WAN.

Indeed, mk24, from what I saw on debug screen, port configuration happens during chip init phase that is within the ethernet driver.
Unfortunately, my experiences with ux based compiling tools and OpenWrt platform are quite limited so any hint on how to start-off customizing the driver code and rebuildin the full image would be really appreciated smile

P.S. As of the likelihood of success of all this - I don't really care, let's just have fun smile

The discussion might have continued from here.