DIR-300 revb build 18687 breaks LAN

Post new topic   Reply to topic    DD-WRT Forum Index -> Ralink SoC based Hardware
Goto page Previous  1, 2, 3, 4  Next
Author Message
Ric03
DD-WRT User


Joined: 11 Apr 2011
Posts: 83
Location: Milan, Italy

PostPosted: Sat Mar 17, 2012 11:48    Post subject: Reply with quote
vasek00 wrote:
Speech about the beginning went about DIR300/B1.

In the beginning we have uboot and only then a kernel dd-wrt.
Quote:
uboot
*(unsigned long *)(0xb0110050) = 0x00002001;
*(unsigned long *)(0xb0110090) = 0x00007f7f;
*(unsigned long *)(0xb0110098) = 0x00007f3f; //disable VLAN
*(unsigned long *)(0xb01100CC) = 0x0002500c;
*(unsigned long *)(0xb011009C) = 0x0008a301; //hashing algorithm=XOR48, aging interval=300sec
*(unsigned long *)(0xb011008C) = 0x02404040;


But it is the data from native SDK Ralink, and that there actually in uboot the given device the manufacturer of the device knows only.
After working off uboot then control it will be transferred in a kernel dd-wrt. And here we matter:
Quote:
root@Senao:~# switch reg r 90
switch reg read offset=90, value=3f807f7f


Has checked up operation here such script on the worker ralink 305x:
Code:
#!/bin/sh
switch reg r 90 > sw_1
sleep 2
switch reg w 90 3f807f7f
sleep 2
switch reg r 90 > sw_2
sleep 10
switch reg w 90 00007f7f
sleep 2
switch reg r 90 > sw_3


After 3f807f7f die away LAN ports (disable), but after 00007f7f start to work (enable).
Just values 3f8 speak:
Code:
3 - DIS_GMII_PORT_1 и DIS_GMII_PORT_0 – disable
F8 – WAN, LAN1-LAN4 – disable


Exactly as you said it should work. But, at least in my case, when I try to set reg r 90 to 7f7f actually enabling the interfaces, nothing happens.

I have also tried to re-set all the registers to the ralink SDK values but still the ethernet interfaces are not working. This probably means that even if the hardware is properly configured, after kernel boot with hardware not properly configured the kernel does not handle the ethernet anymore even if I re-configure the registers to the proper values.
Sponsor
vasek00
DD-WRT Guru


Joined: 06 Nov 2010
Posts: 3312

PostPosted: Sat Mar 17, 2012 12:08    Post subject: Reply with quote
And indication link though has appeared?
Ric03
DD-WRT User


Joined: 11 Apr 2011
Posts: 83
Location: Milan, Italy

PostPosted: Sat Mar 17, 2012 12:12    Post subject: Reply with quote
vasek00 wrote:
And indication link though has appeared?


Yes it says

RT305x_ESW: Link Status Changed

but then it is silent.

I have just reloaded the old 16214 that works and checked all the registers and they ALL are compliant with the ralink SDK, and in fact the switch is working. This means in the 18740 there is something that make the switch non operative.
Ric03
DD-WRT User


Joined: 11 Apr 2011
Posts: 83
Location: Milan, Italy

PostPosted: Sat Mar 17, 2012 19:03    Post subject: Reply with quote
Using "strings" I've checked if the sysinit code in services.so contains the correct switch reg w for esr9752 and in fact it contains:

switch reg w 14 405555
switch reg w 50 2001
switch reg w 98 7f3f
switch reg w e4 3f
switch reg w 40 1002
switch reg w 44 1001
switch reg w 48 1001
switch reg w 70 ffff417e
switch reg w 50 7001
switch reg w 98 7f2f
switch reg w e4 2f
switch reg w 40 1007

and considering the compiler optimizations on repeated strings, all the switch writes are present as per HAVE_ESR9752 define. There's no reason to think that the writes are not performed at sys initialization.

In fact I have checked the content of those registers and actually they correctly contain the values written by sysinit.

Hmmm and there is a bug in the /proc filesystem: the entry rt3052 is repeated two times. If some code is meant to reach config files into the /proc/rt3052/ it will never be able to reach them. Note that for the DIR600 in sysinit-rt2880.c there's a bunch of writes in there. Lines like this:

writeproc("/proc/rt3052/mii/ctrl","\"write 0 0 0x3300\"");

Don't know if there is some initialization also for the other rt3052 architectures, but sure with that double entry on esr9752 nothing can reach the mii/ctrl. In fact if I cd into that directory it is void.

Anyway: the fact that /proc/rt3052/ has been registered two times is a sure bug.
vasek00
DD-WRT Guru


Joined: 06 Nov 2010
Posts: 3312

PostPosted: Sun Mar 18, 2012 4:22    Post subject: Reply with quote
Ric03 wrote:
Using "strings" I've checked if the sysinit code in services.so contains the correct switch reg w for esr9752 and in fact it contains:

switch reg w 14 405555
switch reg w 50 2001
switch reg w 98 7f3f
switch reg w e4 3f
switch reg w 40 1002
switch reg w 44 1001
switch reg w 48 1001
switch reg w 70 ffff417e
switch reg w 50 7001
switch reg w 98 7f2f
switch reg w e4 2f
switch reg w 40 1007

and considering the compiler optimizations on repeated strings, all the switch writes are present as per HAVE_ESR9752 define. There's no reason to think that the writes are not performed at sys initialization.

In fact I have checked the content of those registers and actually they correctly contain the values written by sysinit.

Hmmm and there is a bug in the /proc filesystem: the entry rt3052 is repeated two times. If some code is meant to reach config files into the /proc/rt3052/ it will never be able to reach them. Note that for the DIR600 in sysinit-rt2880.c there's a bunch of writes in there. Lines like this:

writeproc("/proc/rt3052/mii/ctrl","\"write 0 0 0x3300\"");

Don't know if there is some initialization also for the other rt3052 architectures, but sure with that double entry on esr9752 nothing can reach the mii/ctrl. In fact if I cd into that directory it is void.

Anyway: the fact that /proc/rt3052/ has been registered two times is a sure bug.


Don't pay to this attention, all works and with:
Code:
root@My-Fan:~# cd /proc/
root@My-Fan:/proc# ls -l
...
-r--r--r--    1 root     root             0 Mar 18 07:37 partitions
dr-xr-xr-x    2 root     root             0 Mar 18 07:37 rt3052
dr-xr-xr-x    2 root     root             0 Mar 18 07:37 rt3052
dr-xr-xr-x    4 root     root             0 Mar 18 07:37 scsi
...
root@My-Fan:/proc# cd rt3052
root@My-Fan:/proc/rt3052# ls
root@My-Fan:/proc/rt3052# cd ..
root@My-Fan:/proc# cat cpuinfo
system type             : Ralink RT3052   id:1 rev:3
processor               : 0
cpu model               : MIPS 24Kc V4.12
BogoMIPS                : 255.59
CPUClock                : 384
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x0ff8, 0x0ff8, 0x0ff8]
ASEs implemented        : mips16
shadow register sets    : 1
kscratch registers      : 0
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available
root@My-Fan:/proc#

Apropos:
Quote:

writeproc("/proc/rt3052/mii/ctrl","\"write 0 0 0x3300\"");

that's the same:
Code:

root@Senao:~# mii_mgr -g -p 0 -r 0
Get: phy[0].reg[0] = 3100
...
root@Senao:~# mii_mgr -g -p 4 -r 0
Get: phy[4].reg[0] = 3100

It is setting 100/10MB and Full/Half Duplex to WAN/LAN port.

Now on mine there is "general-purpose"
http://svn.dd-wrt.com:8000/browser/src/linux/universal/linux-3.2/drivers/net/ethernet/raeth?rev=18766
http://svn.dd-wrt.com:8000/browser/src/linux/universal/linux-3.2/drivers/net/ethernet/raeth/rt3052_access.c?rev=18766
Ric03
DD-WRT User


Joined: 11 Apr 2011
Posts: 83
Location: Milan, Italy

PostPosted: Sun Mar 18, 2012 10:34    Post subject: Reply with quote
Yes but the /proc filesystem looks like if rt3052_access_init() has been called two times and this should be fixed, if not because it's a bug, just for the cosmetics of the code.

Btw the access is called only in ra2882eth_init() but this is the hardware initialization. The problem there is that the driver printk() only 1 initialization string at boot time so the raeth function is called 1 time only. Who's responsible for the second call to rt3052_access_init()?
vasek00
DD-WRT Guru


Joined: 06 Nov 2010
Posts: 3312

PostPosted: Sun Mar 18, 2012 14:07    Post subject: Reply with quote
To you it was not thought and not to guess.
It is checked up. There is a router on a chip rt3052 and the loader uboot, in which disable all ports switch (a command f807f7f). Further we take dd-wrt SVN version 18740 in advance in Startup a command on reading and we look. Value of the given register instead of normal value 00007f7f we have f807f7f with ports disable here to you and the answer.
The command in stratup-00007f7f helps only


Last edited by vasek00 on Sun Mar 18, 2012 14:12; edited 1 time in total
BrainSlayer
Site Admin


Joined: 06 Jun 2006
Posts: 7492
Location: Dresden, Germany

PostPosted: Sun Mar 18, 2012 14:08    Post subject: Reply with quote
its not access_init. the wireless driver itself caused the collision. i fixed that now
_________________
"So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s
BrainSlayer
Site Admin


Joined: 06 Jun 2006
Posts: 7492
Location: Dresden, Germany

PostPosted: Sun Mar 18, 2012 14:13    Post subject: Reply with quote
here the test build
_________________
"So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s
D2mian
DD-WRT Novice


Joined: 02 Oct 2011
Posts: 11

PostPosted: Sun Mar 18, 2012 14:16    Post subject: Reply with quote
On dir600 revB LAN doesn't work Sad

Can I flash firmware form dlink 300 to dir 600 revB???
Ric03
DD-WRT User


Joined: 11 Apr 2011
Posts: 83
Location: Milan, Italy

PostPosted: Sun Mar 18, 2012 14:38    Post subject: Reply with quote
vasek00 wrote:
To you it was not thought and not to guess.
It is checked up. There is a router on a chip rt3052 and the loader uboot, in which disable all ports switch (a command f807f7f). Further we take dd-wrt SVN version 18740 in advance in Startup a command on reading and we look. Value of the given register instead of normal value 00007f7f we have f807f7f with ports disable here to you and the answer.
The command in stratup-00007f7f helps only


I may not be a guru of dd-wrt, but I'm quite confident with linux sources and startup processes. When I guess something I usually guess right and if I say something means I thought long enough.
Reading the sources sometimes is not enough, don't you know? Cool
Ric03
DD-WRT User


Joined: 11 Apr 2011
Posts: 83
Location: Milan, Italy

PostPosted: Sun Mar 18, 2012 14:39    Post subject: Reply with quote
BrainSlayer wrote:
here the test build


BS, if you make a build for the esr-9752 I'll test it right away Very Happy
BrainSlayer
Site Admin


Joined: 06 Jun 2006
Posts: 7492
Location: Dresden, Germany

PostPosted: Sun Mar 18, 2012 14:40    Post subject: Reply with quote
here the dir 600 build
_________________
"So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s
BrainSlayer
Site Admin


Joined: 06 Jun 2006
Posts: 7492
Location: Dresden, Germany

PostPosted: Sun Mar 18, 2012 14:41    Post subject: Reply with quote
Ric03 wrote:
BrainSlayer wrote:
here the test build


BS, if you make a build for the esr-9752 I'll test it right away Very Happy


the esr9752 does not use the /proc/rt3052 dir. so it can't be affected

_________________
"So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s
Ric03
DD-WRT User


Joined: 11 Apr 2011
Posts: 83
Location: Milan, Italy

PostPosted: Sun Mar 18, 2012 14:44    Post subject: Reply with quote
BrainSlayer wrote:
Ric03 wrote:
BrainSlayer wrote:
here the test build


BS, if you make a build for the esr-9752 I'll test it right away Very Happy


the esr9752 does not use the /proc/rt3052 dir. so it can't be affected


damn .. so the LAN not working issue is still there for this chip ?
Remember issue #2040 ?
I'm sad now ....... Sad
Goto page Previous  1, 2, 3, 4  Next Display posts from previous:    Page 2 of 4
Post new topic   Reply to topic    DD-WRT Forum Index -> Ralink SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum