Sunday, January 26, 2014

MLW221 technical information

MLW221 Hardware

Here is the hardware information I have extracted from the original image + a little bit of information from my first try at booting OpenWrt on the device.
I haven't bothered to verify information or clean out private information from the logs, so if you see anything that should be private please just pretend it's not there. I just thought I should share it, in case anyone else could have some use for it.

Main SoC:
Mediatec
MT7620N

RAM:
SK Hynix
M5PS5182GFR-S6C

Flash:
Spansio
S25FL128S?

GPIO:
Output 7 Power
Output 11 WIFI
Output 43 Status
Input 1 Reset


MT7620 # printenv
bootcmd=tftp
bootdelay=1
baudrate=57600
ethaddr="00:AA:BB:CC:DD:10"
ipaddr=10.10.10.123
serverip=10.10.10.3
stdin=serial
stdout=serial
stderr=serial

Environment size: 149/4092 bytes


# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00030000 00010000 "Bootloader"
mtd1: 00010000 00010000 "Config"
mtd2: 00010000 00010000 "Factory"
mtd3: 00f60000 00010000 "Kernel"
mtd4: 00050000 00010000 "User_CFG"

# cat /proc/partitions
major minor  #blocks  name

  31        0        192 mtdblock0
  31        1         64 mtdblock1
  31        2         64 mtdblock2
  31        3      15744 mtdblock3
  31        4        320 mtdblock4

# cat cpuinfo
system type        : Ralink SoC
processor        : 0
cpu model        : MIPS 24Kc V5.0
BogoMIPS        : 386.04
wait instruction    : yes
microsecond timers    : yes
tlb_entries        : 32
extra interrupt vector    : yes
hardware watchpoint    : yes, count: 4, address/irw mask: [0x0ff8, 0x0ff8, 0x06d3, 0x0ff8]
ASEs implemented    : mips16 dsp
shadow register sets    : 1
core            : 0
VCED exceptions        : not available
VCEI exceptions        : not available

# cat cmdline
console=ttyS1,57600n8 root=/dev/ram0 console=ttyS0

# cat mounts
rootfs / rootfs rw 0 0
proc /proc proc rw,relatime 0 0
none /var ramfs rw,relatime 0 0
none /tmp ramfs rw,relatime 0 0
none /media ramfs rw,relatime 0 0
none /sys sysfs rw,relatime 0 0
none /dev/pts devpts rw,relatime,mode=600 0 0
none /proc/bus/usb usbfs rw,relatime 0 0
none /etc ramfs rw,relatime 0 0
mdev /dev ramfs rw,relatime 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
/dev/mtdblock4 /etc/config jffs2 rw,relatime 0 0

# cat modules
tntfs 490768 0 - Live 0xc0388000 (P)
texfat 151536 0 - Live 0xc02ab000 (P)

# cat version
Linux version 2.6.36+ (root@CVS2) (gcc version 3.4.2) #15 Tue Sep 3 11:17:59 CST 2013

// Stock image
Creating 5 MTD partitions on "raspi":
0x000000000000-0x000000030000 : "Bootloader"
0x000000030000-0x000000040000 : "Config"
0x000000040000-0x000000050000 : "Factory"
0x000000050000-0x000000fb0000 : "Kernel"
0x000000fb0000-0x000001000000 : "User_CFG" // jffs2

// OpenWRT
[    2.280000] m25p80 spi32766.0: found s25fl129p1, expected mx25l6405d
[    2.290000] m25p80 spi32766.0: s25fl129p1 (16384 Kbytes)
[    2.310000] 4 ofpart partitions found on MTD device spi32766.0
[    2.320000] Creating 4 MTD partitions on "spi32766.0":
[    2.330000] 0x000000000000-0x000000030000 : "u-boot"
[    2.340000] 0x000000030000-0x000000040000 : "u-boot-env"
[    2.350000] 0x000000040000-0x000000050000 : "factory"
[    2.360000] 0x000000050000-0x000000800000 : "firmware"
[    2.380000] 0x0000004a6074-0x000000800000 : "rootfs"

Boot messages from original firmware

U-Boot 1.1.3 (Apr 10 2013 - 15:50:37)

Board: Ralink APSoC DRAM:  64 MB

relocate_code Pointer at: 83fb4000
enable ephy clock...done. rf reg 29 = 5
SSC disabled.
spi_wait_nsec: 29
spi device id: 1 20 18 4d 1 (20184d01)
find flash: S25FL129P
raspi_read: from:30000 len:1000
*** Warning - bad CRC, using default environment

============================================
Ralink UBoot Version: 4.1.1.0
--------------------------------------------
ASIC 7620_MP (Port5<->None)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:Apr 10 2013  Time:15:50:37
============================================
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768

 ##### The CPU freq = 580 MHZ ####
 estimate memory size =64 Mbytes

Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.
 0
  
3: System Boot system code via Flash.
## Booting image at bc050000 ...
raspi_read: from:50000 len:40
   Image Name:   Linux Kernel Image
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    4546612 Bytes =  4.3 MB
   Load Address: 80000000
   Entry Point:  8000c310
raspi_read: from:50040 len:456034
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 8000c310) ...
## Giving linux memsize in MB, 64

Starting kernel ...


LINUX started...

 THIS IS ASIC
Linux version 2.6.36+ (root@CVS2) (gcc version 3.4.2) #15 Tue Sep 3 11:17:59 CST 2013

 The CPU feqenuce set to 580 MHz
 PCIE: bypass PCIe DLL.
 PCIE: Elastic buffer control: Addr:0x68 -> 0xB4
 disable all power about PCIe
 PCIE: PLL power down for MT7620N
CPU revision is: 00019650 (MIPS 24Kc)
Determined physical RAM map:
 memory: 04000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00004000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00004000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: console=ttyS1,57600n8 root=/dev/ram0 console=ttyS0
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
Writing ErrCtl register=0007d577
Readback ErrCtl register=0007d577
Memory: 56328k/65536k available (4731k kernel code, 9208k reserved, 852k data, 2808k init, 0k highmem)
NR_IRQS:128
console [ttyS1] enabled
Calibrating delay loop... 386.04 BogoMIPS (lpj=772096)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
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
Switching to clocksource MIPS
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RT3xxx EHCI/OHCI init.
JFFS2 version 2.2 (NAND) (SUMMARY) (ZLIB) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
fuse init (API version 7.15)
msgmni has been set to 110
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
io scheduler noop registered (default)
Ralink gpio driver initialized
led=43, on=5, off=5, blinks,=4000, reset=1, time=4000
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0x10000500 (irq = 37) is a 16550A
serial8250: ttyS1 at MMIO 0x10000c00 (irq = 12) is a 16550A
brd: module loaded
flash0: started
deice id : 1 20 18 4d 1 (20184d01)
S25FL129P(01 20184d01) (16384 Kbytes)
mtd .name = raspi, .size = 0x01000000 (0M) .erasesize = 0x00000010 (0K) .numeraseregions = 65536
Creating 5 MTD partitions on "raspi":
0x000000000000-0x000000030000 : "Bootloader"
0x000000030000-0x000000040000 : "Config"
0x000000040000-0x000000050000 : "Factory"
0x000000050000-0x000000fb0000 : "Kernel"
0x000000fb0000-0x000001000000 : "User_CFG"
rdm_major = 253
SMACCR1 -- : 0x0000000c
SMACCR0 -- : 0x43762077
Ralink APSoC Ethernet Driver Initilization. v3.0  256 rx/tx descriptors allocated, mtu = 1500!
SMACCR1 -- : 0x0000000c
SMACCR0 -- : 0x43762077
PROC INIT OK!
PPP generic driver version 2.4.2
PPP MPPE Compression module registered
NET: Registered protocol family 24
PPTP driver version 0.8.5


=== pAd = c0198000, size = 807960 ===

<-- RTMPAllocTxRxRingMemory, Status=0
<-- RTMPAllocAdapterBlock, Status=0
AP Driver version-2.7.1.2
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
rt3xxx-ehci rt3xxx-ehci: Ralink EHCI Host Controller
rt3xxx-ehci rt3xxx-ehci: new USB bus registered, assigned bus number 1
rt3xxx-ehci rt3xxx-ehci: irq 18, io mem 0x101c0000
rt3xxx-ehci rt3xxx-ehci: USB 0.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
rt3xxx-ohci rt3xxx-ohci: RT3xxx OHCI Controller
rt3xxx-ohci rt3xxx-ohci: new USB bus registered, assigned bus number 2
rt3xxx-ohci rt3xxx-ohci: irq 18, io mem 0x101c1000
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
MTK MSDC device init.
mtk-sd: MediaTek MT6575 MSDC Driver
nf_conntrack version 0.5.0 (880 buckets, 3520 max)
IPVS: Registered protocols ()
IPVS: Connection hash table configured (size=4096, memory=32Kbytes)
IPVS: ipvs loaded.
GRE over IPv4 demultiplexor driver
gre: can't add protocol
ip_tables: (C) 2000-2006 Netfilter Core Team, Type=Restricted Cone
TCP cubic registered
NET: Registered protocol family 10
NET: Registered protocol family 17
L2TP core driver, V2.0
PPPoL2TP kernel driver, V2.0
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
msdc0 -> ops_get_cd return<0> <- msdc_ops_get_cd() : L<2273> PID<kworker/u:1><0x16>
Freeing unused kernel memory: 2808k freed
init started: BusyBox v1.12.1 (2013Algorithmics/MIPS FPU Emulator v1.5
-09-03 11:14:23 CST)
starting pid 31, tty '': '/etc_ro/rcS'texfat: module license 'Commercial. For support email exfat-support@tuxera.com' taints kernel.

Disabling lock debugging due to kernel taint
Tuxera exFAT driver 3013.2.7.2 [Flags: R/W MODULE].
Tuxera NTFS driver 3013.2.5 [Flags: R/W MODULE].
usb 1-1: new high speed USB device using rt3xxx-ehci and address 2
devpts: called with bogus options
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 3 ports detected
Welcome to
    _______  _______  ___     __  ____   _  _   ___
    |  ___  \|   __  ||   |   |__||    \ | || | /  /
    | |___| ||  |__| ||   |__  __ |     \| || |/  /
    |   _   /|   _   ||      ||  || |\     ||     \
    |__| \__\|__| |__||______||__||_| \____||_|\___\

                    =System Architecture Department=

[check_jffs]80 : JFFS_OK
led=11, on=1, off=4000, blinks,=1, reset=1, time=4000
semget err:: No such led=7, on=1, off=4000, blinks,=1, reset=1, time=4000
file or directory
Set: phy[0].reg[0] = 3100
Set: phy[1].reg[0] = 3100
Set: phy[2].reg[0] = 3100
Set: phy[3].reg[0] = 3100
Set: phy[4].reg[0] = 3100
nvram_init: INFO=>nvram MAC initialized successfully!
==>shm_init()!!
check_shm_hash: Check shm hash value
nvram_init: INFO=>nvram conf initialized successfully!
nvram_init: INFO=> RAM CONF successful created!
nvram_init: INFO=> RC.CONF successful created!
---------------- Get WLAN MAC 00:26:b7:05:ff:fe---------------
switch reg write offset=94, value=1000
switch reg write offset=2004, value=ff0003
switch reg write offset=2104, value=ff0003
switch reg write offset=2204, value=ff0003
switch reg write offset=2304, value=ff0003
switch reg write offset=2404, value=ff0003
switch reg write offset=2504, value=ff0003
switch reg write offset=2010, value=810000c0
switch reg write offset=2110, value=810000c0
switch reg write offset=2210, value=810000c0
switch reg write offset=2310, value=810000c0
switch reg write offset=2410, value=810000c0
switch reg write offset=2510, value=810000c0
switch reg write offset=2610, value=81000000
switch reg write offset=2710, value=81000000
switch reg write offset=2604, value=20ff0003
switch reg write offset=2704, value=20ff0003
Special Tag Disabled
switch reg write offset=2610, value=81000000
switch reg wRaeth v3.0 (riTasklette,SkbRecycle o)
ffset
phy_tx_ring = 0x028f7000, tx_ring = 0xa28f7000

phy_rx_ring0 = 0x028f8000, rx_ring0 = 0xa28f8000
SMACCR1 -- : 0x00000026
SMACCR0 -- : 0xb705fffe
=2CDMA_CSG_CFG = 81000000
01GDMA1_FWD_CFG = 20710000
4, value=10001
switch reg write offset=2114, value=10001
switch reg write offset=2214, value=10001
switch reg write offset=2314, value=10001
switch reg write offset=2414, value=10002
switch reg write offset=2514, value=10001
REG_ESW_WT_MAC_ATC is 0x7ff0002
done.
ifconfig: SIOCSIFHWADDR: No such device
ifconfig: ioctl 0x8913 failed: No such device
device vlan0001 entered promiscuous mode
device eth2 entered promiscuous mode
input_access=[3]
echo 3 > /proc/lan_wlan_access_controller
sh: can't create /proc/lan_wlan_access_controllebr0: port 1(vlan0001) entering learning state
r:br0: port 1(vlan0001) entering learning state
 nonexistent directory
Fri Jan  1 00:00:00 GMT 2010
/etc_ro/rcS: line 138: wd_keepalive: not found
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
Using intrapositioned negation (`--option ! this`) is deprecated in favor of extrapositioned (`! --option this`).
Using intrapositioned negation (`--option ! this`) is deprecated in favor of extrapositioned (`! --option this`).
iptables v1.4.10:
The "nat" table is not intended for filtering, the use of DROP is therefore inhibited.


Try `iptables -h' or 'iptables --help' for more information.
ifconfig: ioctl 0x8913 failed: No such device
interface ra2 does not exist!
ifconfig: ioctl 0x8913 failed: No such device
interface ra2 does not exist!
[Enter Test] in wlan_led_ctrl.c main()
.killall: ap_client_run: no process killed
insmod: ipv6passthru.ko: module not found
/usr/shell/dnsmasq.sh stop ok
dnsmasq: read /etc/hosts - 2 addresses
dnsmasq: read /etc/hosts - 2 addresses
dnsmasq: [truncated] m
/usr/shell/dnsmasq.sh start ok
sh: /usr/sbin/miniupnpd: not found
/usr/shell/udhcpd.sh config ok
/usr/shell/udhcpd.sh start ok

***** g_wl_interface = ra0 ******

MAX_NUM_SESSIONS : 5; NUM_SEES: 64
ls: /dev/sd*: No such file or directory
aa
killall: wifidetect: no process killed


===wifidetect start===

killall: udhcpc.sh: no process killed
/etc_ro/rcS: line 242: /usr/local/apache2/bin/htpasswd: not found
killall: udhcpc: no process killed
ls: /media/*/mlwfw_v*.*.*.bin: No such file or directory
killall: DMS: no process killed
killall: smbd: no process killed
killall: nmbd: no process killed
kill samba server firsthello, samba!
startsmbfilepwent_internal: file /tmp/samba/private/smbpasswd did not exist. File successfully created.
User guest password set to none.
new GPIO mode
ls: /media/*/gemtek_easytest.txt: No such file or directory
main(205) ::
DMS_Create()
DLNA DMS: UUID=[aaab4c54-ea1b-1885-b390-0026b705fffe]
starting pid 8225, tty '/dev/ttyS1': '/bin/sh'
IP Address List: 192.168.200.254


BusyBox v1.12.1 (2013-09-03 11:14:23 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

#

Monday, January 20, 2014

Time to start working on the port again

I have been out traveling, and therefore unable work on this little project for some time now. The last status before I left was that I booted OpenWrt and wrote a quick draft with all the hardware specifications. I will try to clean things up a little bit and publish things.

While I were away, a "reader" called Larry has picked the project up and ported it as well. The last status update from him were that things were booting, but WiFi were missing. So I guess I will merge the changes, and see where we are at. I will also find out how to share the code, if it should be pushed to OpenWrt, or branched somewhere first.

Stay tuned, and there should be a bootable image in not to long.