OpenWrt Forum Archive

Topic: TP-Link TL-MR3020 Support

The content of this topic has been archived between 16 Jun 2013 and 7 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Hi,

TP-Link is coming out with a new small router: TL-MR3020. (same as wr703n?)
http://www.tp-link.com/en/products/deta … =TL-MR3020

Have anyone tested it with OpenWrt? could not find in the supported list yet.
I know, it is kind'a new. smile but I thought I would still ask.

Cheers
-Anders

(Last edited by carlberg on 11 Dec 2011, 12:29)

Hi,

I have bought the TL-MR3020 device and opened it. My device is labeled version 1.0.
The serial console is available as 4-pin header and it is the same as on many other TP-Link products.

At the moment I try to make a backup of the firmware before experimenting with it.

Does anybody know the root password of the TP-Link devices? Do they have a default one? (it is NOT "admin").
I will post some photos of the PCB later.

The serial SPI flash is a 32MBit type from Spansion.

BTW: I have payed 27EUR for the TL-MR3020 in Germany (KM-Elektronik).

@carlberg:
I suggest you correct the topic of this thread. The "T" is missing in the model number. It is "TL-MR3020".

U-Boot 1.1.4 (Aug 17 2011 - 09:25:09)

AP121-2MB (ar9330) U-boot

DRAM:  32 MB
led turning on for 1s...
id read 0x100000ff
flash size 4194304, sector count = 64
Flash:  4 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ag7240_enet_initialize...
No valid address in Flash. Using fixed address
No valid address in Flash. Using fixed address
: cfg1 0x5 cfg2 0x7114
eth0: 00:03:7f:09:0b:ad
ag7240_phy_setup
eth0 up
: cfg1 0xf cfg2 0x7214
eth1: 00:03:7f:09:0b:ad
athrs26_reg_init_lan
ATHRS26: resetting s26
ATHRS26: s26 reset done
ag7240_phy_setup
eth1 up
eth0, eth1
Autobooting in 1 seconds
## Booting image at 9f020000 ...
   Uncompressing Kernel Image ... OK

Starting kernel ...

Booting AR9330(Hornet)...
Linux version 2.6.31--LSDK-9.2.0.312 (root@bogon) (gcc version 4.3.3 (GCC) ) #185 Fri Oct 21 16:26:50 CST 2011
flash_size passed from bootloader = 4
CPU revision is: 00019374 (MIPS 24Kc)
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
User-defined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Zone PFN ranges:
  Normal   0x00000000 -> 0x00002000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00002000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ar7240-nor0:128k(u-boot),1024k(kernel),2816(rootfs),64k(config),64k(ART) mem=32M
PID hash table entries: 128 (order: 7, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00000000
Readback ErrCtl register=00000000
Memory: 29864k/32768k available (1889k kernel code, 2904k reserved, 524k data, 116k init, 0k highmem)
Hierarchical RCU implementation.
NR_IRQS:128
plat_time_init: plat time init done
Calibrating delay loop... 266.24 BogoMIPS (lpj=532480)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
===== ar7240_platform_init: 0


Whoops! This kernel is for product mr3020 v1.0!

bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
NET: Registered protocol family 1
AR7240 GPIOC major 0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
NTFS driver 2.1.29 [Flags: R/O].
msgmni has been set to 58
alg: No test for lzma (lzma-generic)
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
ttyS0: detected caps 00000000 should be 00000100
serial8250.0: ttyS0 at MMIO 0xb8020000 (irq = 19) is a 16550A
console [ttyS0] enabled
PPP generic driver version 2.4.2
NET: Registered protocol family 24
cmdlinepart partition parsing not available
set partition boot
set partition kernel
set partition rootfs
set partition config
set partition art
set partition ÿ
Searching for RedBoot partition table
5 RedBoot partitions found on MTD device ar7240-nor0
Creating 5 MTD partitions on "ar7240-nor0":
0x000000000000-0x000000020000 : "boot"
0x000000020000-0x000000120000 : "kernel"
0x000000120000-0x0000003e0000 : "rootfs"
0x0000003e0000-0x0000003f0000 : "config"
0x0000003f0000-0x000000400000 : "art"
->Oops: flash id 0x10215 .
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
Port Status 1c000004
ar7240-ehci ar7240-ehci.0: ATH EHCI
ar7240-ehci ar7240-ehci.0: new USB bus registered, assigned bus number 1
ehci_reset Intialize USB CONTROLLER in host mode: 3
ehci_reset Port Status 1c000000
ar7240-ehci ar7240-ehci.0: irq 3, io mem 0x1b000000
ehci_reset Intialize USB CONTROLLER in host mode: 3
ehci_reset Port Status 1c000000
ar7240-ehci ar7240-ehci.0: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
TCP cubic registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
ar7240wdt_init: Registering WDT success
VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
Freeing unused kernel memory: 116k freed
init started:  BusyBox v1.01 (2011.04.01-07:49+0000) multi-call binary
This Board use 2.6.31
xt_time: kernel timezone is -0000
nf_conntrack version 0.5.0 (512 buckets, 5120 max)
ip_tables: (C) 2000-2006 Netfilter Core Team
insmod: cannot open module `/lib/modules/2.6.31/kernel/iptable_raw.ko': No such file or directory
insmod: cannot open module `/lib/modules/2.6.31/kernel/flashid.ko': No such file or directory
PPPoL2TP kernel driver, V1.0
PPTP driver version 0.8.3
insmod: cannot open module `/lib/modules/2.6.31/kernel/harmony.ko': No such file or directory

 (none) mips #185 Now flash open!
Fri Oct 21 16:26:50 CST 2011 (none)
(none) login: Now flash open!
ATHR_GMAC: Length per segment 1536
ATHR_GMAC: fifo cfg 3 01f00140
ATHR_GMAC: Mac address for unit 1:bf1f0006
ATHR_GMAC: 6e:09:80:e4:67:1b
ATHR_GMAC: Max segments per packet :   1
ATHR_GMAC: Max tx descriptor count :   40
ATHR_GMAC: Max rx descriptor count :   96
ATHR_GMAC: Mac capability flags    :   4D83
ATHR_GMAC: Mac address for unit 0:bf1f0000
ATHR_GMAC: 12:03:cb:60:38:f7
ATHR_GMAC: Max segments per packet :   1
ATHR_GMAC: Max tx descriptor count :   40
ATHR_GMAC: Max rx descriptor count :   252
ATHR_GMAC: Mac capability flags    :   4403
athr_gmac_ring_alloc Allocated 640 at 0x81e79800
athr_gmac_ring_alloc Allocated 4032 at 0x81d63000
Setting Drop CRC Errors, Pause Frames and Length Error frames
Setting PHY...mac 0
athr_gmac_ring_alloc Allocated 640 at 0x81e79400
athr_gmac_ring_alloc Allocated 1536 at 0x81f22000
athr_gmac_mii_setup: MDC check failed
Setting Drop CRC Errors, Pause Frames and Length Error frames
ATHRS26: resetting s26
ATHRS26: s26 reset done
Setting PHY...mac 1
device eth0 entered promiscuous mode
Now flash open!
nf_conntrack_rtsp v0.6.21 loading
nf_nat_rtsp v0.6.21 loading
asf: module license 'Proprietary' taints kernel.
Disabling lock debugging due to kernel taint
ath_hal: 0.9.17.1 (AR9380, DEBUG, REGOPS_FUNC, WRITE_EEPROM, 11D)
ath_rate_atheros: Copyright (c) 2001-2005 Atheros Communications, Inc, All Rights Reserved
ath_dev: Copyright (c) 2001-2007 Atheros Communications, Inc, All Rights Reserved
ath_ahb: 9.2.0_U5.508 (Atheros/multi-bss)
Boostrap clock 25MHz
ar9300RadioAttach: Need analog access recipe!!
Restoring Cal data from Flash
ath_get_caps[4735] rx chainmask mismatch actual 1 sc_chainmak 0
ath_get_caps[4710] tx chainmask mismatch actual 1 sc_chainmak 0
wifi0: Atheros 9380: mem=0xb8100000, irq=2
wlan_vap_create : enter. devhandle=0x80c042c0, opmode=IEEE80211_M_HOSTAP, flags=0x1
wlan_vap_create : exit. devhandle=0x80c042c0, opmode=IEEE80211_M_HOSTAP, flags=0x1.
VAP device ath0 created

 DES SSID SET=TP-LINK_POCKET_3020_3ABB7A
ieee80211_scan_unregister_event_handler: Failed to unregister evhandler=c0a048a0 arg=81e9e2c0
wlan_vap_delete : enter. vaphandle=0x81e9c000
wlan_vap_delete : exit. vaphandle=0x81e9c000
wlan_vap_create : enter. devhandle=0x80c042c0, opmode=IEEE80211_M_HOSTAP, flags=0x1
wlan_vap_create : exit. devhandle=0x80c042c0, opmode=IEEE80211_M_HOSTAP, flags=0x1.
VAP device ath0 created

 DES SSID SET=TP-LINK_POCKET_3020_3ABB7A
 ieee80211_ioctl_siwmode: imr.ifm_active=393856, new mode=3, valid=1
WARNING: Fragmentation with HT mode NOT ALLOWED!!
device ath0 entered promiscuous mode
br0: port 2(ath0) entering forwarding state
 ieee80211_ioctl_siwmode: imr.ifm_active=1442432, new mode=3, valid=1
br0: port 2(ath0) entering disabled state

 DES SSID SET=TP-LINK_POCKET_3020_3ABB7A
br0: port 2(ath0) entering forwarding state
gpio_tricolor_led_write 699
green_led_onoff = 1

 TL-MR3020 mips #185 Fri Oct 21 16:26:50 CST 2011 (none)
TL-MR3020 login:

(Last edited by cille75 on 11 Dec 2011, 12:04)

The factory image is available from the TP-Link website:
http://www.tp-link.com/en/support/downl … n=V1#tbl_j

The image does not seem to contain the bootloader. As I also own a TL-WR1043ND, I know that there are also firmware images which contain the bootloader. The filename contains the word "boot" then.

The TL-MR3020 firmware file name from the above link does not contain the word "boot".

(Last edited by cille75 on 11 Dec 2011, 12:04)

pictures:
http://img545.imageshack.us/img545/142/img1944x.jpg
http://img535.imageshack.us/img535/3038/img1945qq.jpg

Currently I am trying to extract the factory image:

user@debian:~$ openwrt/trunk/build_dir/host/firmware-utils/bin/mktplinkfw -i mr3020nv1_en_3_12_11_up\(111128\).bin
File name              : mr3020nv1_en_3_12_11_up(111128).bin
File size              : 0x003c0000 /  3932160 bytes
Version 1 Header size  : 0x00000200 /      512 bytes
Header MD5Sum1         : b3 60 84 35 0e 17 11 33 f9 be bf 0c 1c 1d 25 1b (ok)
Header MD5Sum2         : b6 c7 08 28 b3 1e 73 2a 1f bb c8 87 15 81 55 b3 (purpose yet unknown, unchecked here)

Vendor name            : TP-LINK Technologies
Firmware version       : ver. 1.0
Hardware ID            : 0x30200001 (unknown)
Hardware Revision      : 0x00000001

Kernel data offset     : 0x00000200 /      512 bytes
Kernel data length     : 0x000da3b3 /   893875 bytes
Kernel load address    : 0x80002000
Kernel entry point     : 0x801d69e0
Rootfs data offset     : 0x00100000 /  1048576 bytes
Rootfs data length     : 0x002c0000 /  2883584 bytes
Boot loader data offset: 0x00000000 /        0 bytes
Boot loader data length: 0x00000000 /        0 bytes
Total firmware length  : 0x003c0000 /  3932160 bytes
user@debian:~$

Using the "-x" for mktplinkfw I can extract the kernel image and the rootfs image.
But later if I try to extract the rootfs (squashfs) I get the following:

user@debian:~$ openwrt/trunk/build_dir/host/squashfs4.2/squashfs-tools/unsquashfs mr3020nv1_en_3_12_11_up\(111128\).bin-rootfs 
Parallel unsquashfs: Using 1 processor
lzma uncompress failed with error code 9
read_block: failed to read block @0x29ef6d
read_fragment_table: failed to read fragment table index
FATAL ERROR aborting: failed to read fragment table
user@debian:~$

Any ideas? I can extract other openwrt factory images for TP-Link devices without any problems.

(Last edited by cille75 on 11 Dec 2011, 19:42)

are the serial console headers already soldered or you did it yourself ?

(Last edited by maurer on 11 Dec 2011, 19:43)

Can someone update the openwrt wiki for this device, it does not exist yet

Has anyone in Canada brought it yet?  Some websites says its available after Dec 14

(Last edited by kocoman on 11 Dec 2011, 22:52)

kocoman wrote:

Can someone update the openwrt wiki for this device, it does not exist yet

Maybe You? wink Wiki page now exist but info is copy/paste from similar wiki and may not be accurate. Please edit as required.

cille75 wrote:

Does anybody know the root password of the TP-Link devices? Do they have a default one? (it is NOT "admin").
I will post some photos of the PCB later.

Try "tpl". Extract /etc/passwd from image for further help.
Post images to wiki.

Try "root" with "5up" at serial login.

aind wrote:

Try "root" with "5up" at serial login.

Thanks! that works!

maurer wrote:

are the serial console headers already soldered or you did it yourself ?

I did it myself.

Nilfred wrote:
cille75 wrote:

Does anybody know the root password of the TP-Link devices? Do they have a default one? (it is NOT "admin").
I will post some photos of the PCB later.

Try "tpl". Extract /etc/passwd from image for further help.
Post images to wiki.

Ok. At the moment I do not have a login to the wiki.
Maybe someone could put them in the wiki:
http://img545.imageshack.us/img545/142/img1944x.jpg
http://img535.imageshack.us/img535/3038/img1945qq.jpg

Meanwhile I have copied the whole SPI flash content to my PC:
mtdblock0: u-boot (128K)
mtdblock1: kernel (1M)
mtdblock2: rootfs
mtdblock3: config (64K)
mtdblock4: art (64K)

http://nanodev.nfshost.com/TL-MR3020-MTD_Image.zip

So now let's start experimenting with it. I think the WR-703N images will probably work out of the box.

BTW: A few days ago I found a big archive on http://www.tp-link.com/resources/gpl/150Router.tar.gz
Unfortunately, it does not seem to be available anymore. It is about 850MBytes and seems to contain the source code from many devices incl. the WR-703n.

(Last edited by cille75 on 12 Dec 2011, 16:36)

obsy wrote:

@cille75: use other version of unsquashfs. From MR3020: http://ecco.selfip.net/test/squashfs-root.tar.gz

Which version of unsquashfs did you use?

I tried 3.x and 4.x which are build in openwrt.
I have also compiled the lastest version myself (with LZMA, GZIP, ...).
And the version which comes with Debian Squeeze.

None of the above worked.

cille75 wrote:
obsy wrote:

@cille75: use other version of unsquashfs. From MR3020: http://ecco.selfip.net/test/squashfs-root.tar.gz

Which version of unsquashfs did you use?

I tried 3.x and 4.x which are build in openwrt.
I have also compiled the lastest version myself (with LZMA, GZIP, ...).
And the version which comes with Debian Squeeze.

None of the above worked.

squashfs4.0-lzma from firmware mod kit.

obsy wrote:
cille75 wrote:
obsy wrote:

@cille75: use other version of unsquashfs. From MR3020: http://ecco.selfip.net/test/squashfs-root.tar.gz

Which version of unsquashfs did you use?

I tried 3.x and 4.x which are build in openwrt.
I have also compiled the lastest version myself (with LZMA, GZIP, ...).
And the version which comes with Debian Squeeze.

None of the above worked.

squashfs4.0-lzma from firmware mod kit.

good luck @cille75....

@Obsy check PM, thank

Hi!

I just want to report SUCCESS!

I have modified the latest SVN snapshot and added the MR3020 to the code base. I had to modify a couple of files.
Fortunately, it was quite easy because the WR703N was already there. So I just had to copy the parts.

Now I have to test if everything is working. Since I have only copied the code from WR703N, the GPIO for buttons and LEDs will probably be wrong.

U-Boot 1.1.4 (Aug 17 2011 - 09:25:09)

AP121-2MB (ar9330) U-boot

DRAM:  32 MB
led turning on for 1s...
id read 0x100000ff
flash size 4194304, sector count = 64
Flash:  4 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ag7240_enet_initialize...
No valid address in Flash. Using fixed address
No valid address in Flash. Using fixed address
: cfg1 0x5 cfg2 0x7114
eth0: 00:03:7f:09:0b:ad
ag7240_phy_setup
eth0 up
: cfg1 0xf cfg2 0x7214
eth1: 00:03:7f:09:0b:ad
athrs26_reg_init_lan
ATHRS26: resetting s26
ATHRS26: s26 reset done
ag7240_phy_setup
eth1 up
eth0, eth1
Autobooting in 1 seconds
## Booting image at 9f020000 ...
   Uncompressing Kernel Image ... OK

Starting kernel ...

[    0.000000] Linux version 2.6.39.4 (cille@debian) (gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08) )                                                            #1 Wed Dec 14 23:43:28 CET 2011
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR9330 rev 1
[    0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00002000
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00002000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line:  board=TL-MR3020 console=ttyATH0,115200 rootfstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 29360k/32768k available (2013k kernel code, 3408k reserved, 393k data, 184k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:80
[    0.000000] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
[    0.080000] pid_max: default: 32768 minimum: 301
[    0.080000] Mount-cache hash table entries: 512
[    0.090000] NET: Registered protocol family 16
[    0.090000] MIPS: machine is TP-LINK TL-MR3020 v1
[    0.340000] bio: create slab <bio-0> at 0
[    0.350000] Switching to clocksource MIPS
[    0.350000] NET: Registered protocol family 2
[    0.360000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.360000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.360000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.370000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.380000] TCP reno registered
[    0.380000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.390000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.390000] NET: Registered protocol family 1
[    0.410000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.420000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.430000] msgmni has been set to 57
[    0.430000] io scheduler noop registered
[    0.430000] io scheduler deadline registered (default)
[    0.440000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.440000] ar933x-uart: ttyATH0 at MMIO 0x18020000 (irq = 11) is a AR933X UART
[    0.450000] console [ttyATH0] enabled, bootconsole disabled
[    0.450000] console [ttyATH0] enabled, bootconsole disabled
[    0.460000] Atheros AR71xx SPI Controller driver version 0.2.4
[    0.470000] m25p80 spi0.0: found s25sl032a, expected m25p80
[    0.470000] m25p80 spi0.0: s25sl032a (4096 Kbytes)
[    0.480000] 5 tp-link partitions found on MTD device spi0.0
[    0.480000] Creating 5 MTD partitions on "spi0.0":
[    0.490000] 0x000000000000-0x000000020000 : "u-boot"
[    0.490000] 0x000000020000-0x000000100000 : "kernel"
[    0.500000] 0x000000100000-0x0000003f0000 : "rootfs"
[    0.510000] mtd: partition "rootfs" set to be root filesystem
[    0.510000] mtd: partition "rootfs_data" created automatically, ofs=270000, len=180000
[    0.520000] 0x000000270000-0x0000003f0000 : "rootfs_data"
[    0.520000] 0x0000003f0000-0x000000400000 : "art"
[    0.530000] 0x000000020000-0x0000003f0000 : "firmware"
[    0.880000] ag71xx_mdio: probed
[    0.880000] eth0: Atheros AG71xx at 0xb9000000, irq 4
[    1.490000] Atheros AR71xx hardware watchdog driver version 0.1.0
[    1.490000] TCP westwood registered
[    1.490000] NET: Registered protocol family 17
[    1.500000] 802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
[    1.500000] All bugs added by David S. Miller <davem@redhat.com>
[    1.520000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    1.530000] Freeing unused kernel memory: 184k freed
[    4.180000] input: gpio-keys-polled as /devices/platform/gpio-keys-polled/input/input0
[    4.360000] Button Hotplug driver version 0.4.1
- preinit -
Press the [f] key and hit [enter] to enter failsafe mode
- regular preinit -
[    7.760000] JFFS2 notice: (411) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (0 unchecked, 0 orphan) and 6 of xref (0 dead, 0 orphan) found.
switching to jffs2
- init -

Please press Enter to activate this console. [    8.830000] Compat-wireless backport release: compat-wireless-2011-11-29
[    8.830000] Backport based on wireless-testing.git master-2011-12-01
[    8.970000] cfg80211: Calling CRDA to update world regulatory domain
[    9.600000] cfg80211: World regulatory domain updated:
[    9.600000] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[    9.610000] cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    9.620000] cfg80211:     (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[    9.630000] cfg80211:     (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[    9.630000] cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    9.640000] cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    9.780000] usbcore: registered new interface driver usbfs
[    9.780000] usbcore: registered new interface driver hub
[    9.790000] usbcore: registered new device driver usb
[   10.850000] ieee80211 phy0: Atheros AR9330 Rev:1 mem=0xb8100000, irq=2
[   10.860000] cfg80211: Calling CRDA for country: US
[   11.060000] PPP generic driver version 2.4.2
[   11.100000] cfg80211: Regulatory domain changed to country: US
[   11.110000] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   11.110000] cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
[   11.120000] cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
[   11.130000] cfg80211:     (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   11.140000] cfg80211:     (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   11.140000] cfg80211:     (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   11.150000] cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)
[   11.250000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   11.410000] NET: Registered protocol family 24
[   11.600000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   11.610000] ar71xx-ehci ar71xx-ehci: Atheros AR91xx built-in EHCI controller
[   11.610000] ar71xx-ehci ar71xx-ehci: new USB bus registered, assigned bus number 1
[   11.650000] ar71xx-ehci ar71xx-ehci: irq 3, io mem 0x1b000000
[   11.670000] ar71xx-ehci ar71xx-ehci: USB 2.0 started, EHCI 1.00
[   11.670000] hub 1-0:1.0: USB hub found
[   11.670000] hub 1-0:1.0: 1 port detected
[   11.780000] nf_conntrack version 0.5.0 (461 buckets, 1844 max)
[   13.360000] device eth0 entered promiscuous mode
[   14.180000] eth0: link up (100Mbps/Full duplex)
[   14.180000] br-lan: port 1(eth0) entering forwarding state
[   14.180000] br-lan: port 1(eth0) entering forwarding state



BusyBox v1.19.3 (2011-12-14 20:31:49 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 ATTITUDE ADJUSTMENT (bleeding edge, r29522) ----------
  * 1/4 oz Vodka      Pour all ingredients into mixing
  * 1/4 oz Gin        tin with ice, strain into glass.
  * 1/4 oz Amaretto
  * 1/4 oz Triple sec
  * 1/4 oz Peach schnapps
  * 1/4 oz Sour mix
  * 1 splash Cranberry juice
 -----------------------------------------------------
root@OpenWrt:/#
cille75 wrote:

Hi!

I just want to report SUCCESS!

I have modified the latest SVN snapshot and added the MR3020 to the code base. I had to modify a couple of files.
Fortunately, it was quite easy because the WR703N was already there. So I just had to copy the parts.

Now I have to test if everything is working. Since I have only copied the code from WR703N, the GPIO for buttons and LEDs will probably be wrong.

U-Boot 1.1.4 (Aug 17 2011 - 09:25:09)

AP121-2MB (ar9330) U-boot

DRAM:  32 MB
led turning on for 1s...
id read 0x100000ff
flash size 4194304, sector count = 64
Flash:  4 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ag7240_enet_initialize...
No valid address in Flash. Using fixed address
No valid address in Flash. Using fixed address
: cfg1 0x5 cfg2 0x7114
eth0: 00:03:7f:09:0b:ad
ag7240_phy_setup
eth0 up
: cfg1 0xf cfg2 0x7214
eth1: 00:03:7f:09:0b:ad
athrs26_reg_init_lan
ATHRS26: resetting s26
ATHRS26: s26 reset done
ag7240_phy_setup
eth1 up
eth0, eth1
Autobooting in 1 seconds
## Booting image at 9f020000 ...
   Uncompressing Kernel Image ... OK

Starting kernel ...

[    0.000000] Linux version 2.6.39.4 (cille@debian) (gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08) )                                                            #1 Wed Dec 14 23:43:28 CET 2011
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR9330 rev 1
[    0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00002000
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00002000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line:  board=TL-MR3020 console=ttyATH0,115200 rootfstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 29360k/32768k available (2013k kernel code, 3408k reserved, 393k data, 184k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:80
[    0.000000] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
[    0.080000] pid_max: default: 32768 minimum: 301
[    0.080000] Mount-cache hash table entries: 512
[    0.090000] NET: Registered protocol family 16
[    0.090000] MIPS: machine is TP-LINK TL-MR3020 v1
[    0.340000] bio: create slab <bio-0> at 0
[    0.350000] Switching to clocksource MIPS
[    0.350000] NET: Registered protocol family 2
[    0.360000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.360000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.360000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.370000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.380000] TCP reno registered
[    0.380000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.390000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.390000] NET: Registered protocol family 1
[    0.410000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.420000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.430000] msgmni has been set to 57
[    0.430000] io scheduler noop registered
[    0.430000] io scheduler deadline registered (default)
[    0.440000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.440000] ar933x-uart: ttyATH0 at MMIO 0x18020000 (irq = 11) is a AR933X UART
[    0.450000] console [ttyATH0] enabled, bootconsole disabled
[    0.450000] console [ttyATH0] enabled, bootconsole disabled
[    0.460000] Atheros AR71xx SPI Controller driver version 0.2.4
[    0.470000] m25p80 spi0.0: found s25sl032a, expected m25p80
[    0.470000] m25p80 spi0.0: s25sl032a (4096 Kbytes)
[    0.480000] 5 tp-link partitions found on MTD device spi0.0
[    0.480000] Creating 5 MTD partitions on "spi0.0":
[    0.490000] 0x000000000000-0x000000020000 : "u-boot"
[    0.490000] 0x000000020000-0x000000100000 : "kernel"
[    0.500000] 0x000000100000-0x0000003f0000 : "rootfs"
[    0.510000] mtd: partition "rootfs" set to be root filesystem
[    0.510000] mtd: partition "rootfs_data" created automatically, ofs=270000, len=180000
[    0.520000] 0x000000270000-0x0000003f0000 : "rootfs_data"
[    0.520000] 0x0000003f0000-0x000000400000 : "art"
[    0.530000] 0x000000020000-0x0000003f0000 : "firmware"
[    0.880000] ag71xx_mdio: probed
[    0.880000] eth0: Atheros AG71xx at 0xb9000000, irq 4
[    1.490000] Atheros AR71xx hardware watchdog driver version 0.1.0
[    1.490000] TCP westwood registered
[    1.490000] NET: Registered protocol family 17
[    1.500000] 802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
[    1.500000] All bugs added by David S. Miller <davem@redhat.com>
[    1.520000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    1.530000] Freeing unused kernel memory: 184k freed
[    4.180000] input: gpio-keys-polled as /devices/platform/gpio-keys-polled/input/input0
[    4.360000] Button Hotplug driver version 0.4.1
- preinit -
Press the [f] key and hit [enter] to enter failsafe mode
- regular preinit -
[    7.760000] JFFS2 notice: (411) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (0 unchecked, 0 orphan) and 6 of xref (0 dead, 0 orphan) found.
switching to jffs2
- init -

Please press Enter to activate this console. [    8.830000] Compat-wireless backport release: compat-wireless-2011-11-29
[    8.830000] Backport based on wireless-testing.git master-2011-12-01
[    8.970000] cfg80211: Calling CRDA to update world regulatory domain
[    9.600000] cfg80211: World regulatory domain updated:
[    9.600000] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[    9.610000] cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    9.620000] cfg80211:     (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[    9.630000] cfg80211:     (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[    9.630000] cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    9.640000] cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    9.780000] usbcore: registered new interface driver usbfs
[    9.780000] usbcore: registered new interface driver hub
[    9.790000] usbcore: registered new device driver usb
[   10.850000] ieee80211 phy0: Atheros AR9330 Rev:1 mem=0xb8100000, irq=2
[   10.860000] cfg80211: Calling CRDA for country: US
[   11.060000] PPP generic driver version 2.4.2
[   11.100000] cfg80211: Regulatory domain changed to country: US
[   11.110000] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   11.110000] cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
[   11.120000] cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
[   11.130000] cfg80211:     (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   11.140000] cfg80211:     (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   11.140000] cfg80211:     (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   11.150000] cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)
[   11.250000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   11.410000] NET: Registered protocol family 24
[   11.600000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   11.610000] ar71xx-ehci ar71xx-ehci: Atheros AR91xx built-in EHCI controller
[   11.610000] ar71xx-ehci ar71xx-ehci: new USB bus registered, assigned bus number 1
[   11.650000] ar71xx-ehci ar71xx-ehci: irq 3, io mem 0x1b000000
[   11.670000] ar71xx-ehci ar71xx-ehci: USB 2.0 started, EHCI 1.00
[   11.670000] hub 1-0:1.0: USB hub found
[   11.670000] hub 1-0:1.0: 1 port detected
[   11.780000] nf_conntrack version 0.5.0 (461 buckets, 1844 max)
[   13.360000] device eth0 entered promiscuous mode
[   14.180000] eth0: link up (100Mbps/Full duplex)
[   14.180000] br-lan: port 1(eth0) entering forwarding state
[   14.180000] br-lan: port 1(eth0) entering forwarding state



BusyBox v1.19.3 (2011-12-14 20:31:49 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 ATTITUDE ADJUSTMENT (bleeding edge, r29522) ----------
  * 1/4 oz Vodka      Pour all ingredients into mixing
  * 1/4 oz Gin        tin with ice, strain into glass.
  * 1/4 oz Amaretto
  * 1/4 oz Triple sec
  * 1/4 oz Peach schnapps
  * 1/4 oz Sour mix
  * 1 splash Cranberry juice
 -----------------------------------------------------
root@OpenWrt:/#

you may use my shell script to find led gpio

#!/bin/ash

# made by dyq (729650915@qq.com)

echo $1 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio$1/direction
if [ $3 = "al" ]; then
        echo 1 > /sys/class/gpio/gpio$1/active_low
else
        echo 0 > /sys/class/gpio/gpio$1/active_low
fi
echo $2 > /sys/class/gpio/gpio$1/value
echo $1 > /sys/class/gpio/unexport
exit

just copy the text above and save as a file, add execute permission and run it
useage: [filename] [gpio] [0/1] ([al])

filename: the name of the file you saved
gpio(input a number): gpio number to test
0/1: 1=enable 0=disable
al(optional): active low

note:
gpio count ar9331 chipset is 30 (0-29)
modify some gpio may caused the router hang, needs reboot to restore

in other hands, it have some bother to find button gpio, you can view http://squidge.sourceforge.net/gpio/ to find the way

(Last edited by dyq on 17 Dec 2011, 19:44)

cille75 wrote:

the GPIO for buttons and LEDs will probably be wrong.

boot log wrote:

ATTITUDE ADJUSTMENT (bleeding edge, r29522) ----------

r29534 by juhosg
ar71xx: add GPIO function bit defines for AR933X

Hi there,

I have found the GPIO pin assignments for the LEDs, the push button and the sliding switch

Internet LED : 27 (al)
WLAN LED     : 0  (ah)
Ethernet LED : 17 (al)
WPS LED      : 26 (al)

WPS Button  : 11

Mode Switch : 18 20 (two GPIO pins)
- 3G    :  1  0
- WISP  :  0  1
- AP    :  1  1

GPIO 8 is busy, because it is used for USB_POWER, since I have copied the code from WR703N. Unfortunately, I do not know if this is needed on the MR3020. Could anybody explain to me what this USB_POWER on GPIO8 is used for on the WR703N?

(Last edited by cille75 on 22 Dec 2011, 13:30)

Hi cille75?

Thank you Button GPIO.
I will mr3020 firmware write wr703n, it works good.

I have a router wr703n. Whether it can be programmed by firmware from mr3020? I Want to get rid of the Chinese language.

maks740 wrote:

I have a router wr703n. Whether it can be programmed by firmware from mr3020? I Want to get rid of the Chinese language.

@maks740
Yes, you need to TTL serial cable.

(Last edited by qtchen on 28 Dec 2011, 15:21)