タグ: AR7240

Corega CG-WLR300NM

何となく行ったハードオフ花小金井店で、偶然ジャンクで見つけて安かったので購入。
事前にファームから搭載SoC等を調べていなかったものの、まあどうにかなるだろうと買ってしまった。

U-Boot

起動時に表示されるU-Bootの選択肢が以下の2つしかなく、コンソールに入れない可能性あり。
WN-G300DGRなどsenaoのU-Bootでは表示されていない番号も機能するものの、CG-WLR300NMではダメだった。

     1: Load system code then write to Flash via TFTP. 
     2: Boot system code via Flash.

Kernel

  • uname -a
    # uname -a
    Linux CG-WLR300NM 2.6.15--LSDK-7.3.0.304 #1 Fri Mar 5 17:06:04 CST 2010 mips unknown
    

  • cat /proc/version
    # cat /proc/version
    Linux version 2.6.15--LSDK-7.3.0.304 (root@********) (gcc version 3.4.4) #1 Fri Mar 5 17:06:04 CST 2010
    

  • cat /proc/cpuinfo
    # cat /proc/cpuinfo
    system type             : Atheros AR7240 (Python)
    processor               : 0
    cpu model               : MIPS 24K V7.4
    BogoMIPS                : 259.07
    wait instruction        : yes
    microsecond timers      : yes
    tlb_entries             : 16
    extra interrupt vector  : yes
    hardware watchpoint     : yes
    ASEs implemented        : mips16
    VCED exceptions         : not available
    VCEI exceptions         : not available
    

  • cat /proc/meminfo
    # cat /proc/meminfo
    MemTotal:        30364 kB
    MemFree:         17332 kB
    Buffers:          1972 kB
    Cached:           4632 kB
    SwapCached:          0 kB
    Active:           4652 kB
    Inactive:         3424 kB
    HighTotal:           0 kB
    HighFree:            0 kB
    LowTotal:        30364 kB
    LowFree:         17332 kB
    SwapTotal:           0 kB
    SwapFree:            0 kB
    Dirty:               0 kB
    Writeback:           0 kB
    Mapped:           3032 kB
    Slab:             3332 kB
    CommitLimit:     15180 kB
    Committed_AS:     3456 kB
    PageTables:        280 kB
    VmallocTotal:  1048560 kB
    VmallocUsed:      1080 kB
    VmallocChunk:  1047276 kB
    

  • cat /proc/mtd
    # cat /proc/mtd
    dev:    size   erasesize  name
    mtd0: 00040000 00010000 "Bootloader (256K)"
    mtd1: 00010000 00010000 "Board Config (64K)"
    mtd2: 00390000 00010000 "Firmware (3648K)"
    mtd3: 002d0000 00010000 "Filesystem (2880K)"
    mtd4: 00010000 00010000 "User Config (64K)"
    mtd5: 00010000 00010000 "Calibration Data (64K)"
    

  • cat /etc/default_config
    # cat /etc/default_config     
    [signature]
    number                               = router_CG-WLR300NM_1.00
    
    [system]
    name                                 = CG-WLR300NM
    preoperation mode                    = gateway
    operation mode                       = gateway
    gateway opmode                       = router
    routeroff mode                       = disable
    stp state                            = disable
    traffic separate                     = disable
    security level                       = medium
    
    [lan (router)]
    ip type                              = static
    ip address                           = 192.168.1.1
    ip netmask                           = 255.255.255.0
    ip gateway                           = 192.168.1.254
    ip dns server                        =
    urlhome                              = corega.home
    
    [lan (access point)]
    ip type                              = static
    ip address                           = 192.168.1.220
    ip netmask                           = 255.255.255.0
    ip gateway                           = 0.0.0.0
    ip dns server                        =
    urlhome                              = corega.home
    
    [wan]
    port speed                           = auto
    mdi type                             = auto
    ip type                              = dhcp
    static ip address                    =
    static ip netmask                    =
    static ip gateway                    =
    dhcp domainname                      =
    dhcp hostname                        = corega
    dhcp dns server type                 = auto
    mtu                                  = 1500
    dns server1                          =
    dns server2                          =
    pppoe session1 account               = 0
    pppoe session2 account               = 0
    clone mac state                      = disable
    clone mac address                    = 00-00-00-00-00-00
    
    [pppoe account 1]
    name                                 = Account-1
    username                             =
    password                             =
    connect type                         = always
    timeout                              = 5
    auto mtu                             = enable
    mtu                                  = 1454
    service type                         = normal
    lan type ip address                  =
    lan type netmask                     =
    dns server type                      = auto
    dns server1                          =
    dns server2                          =
    
    [pppoe account 2]
    name                                 = Account-2
    username                             =
    password                             =
    connect type                         = always
    timeout                              = 5
    auto mtu                             = enable
    mtu                                  = 1454
    service type                         = normal
    lan type ip address                  =
    lan type netmask                     =
    dns server type                      = auto
    dns server1                          =
    dns server2                          =
    
    [pppoe account 3]
    name                                 = Account-3
    username                             =
    password                             =
    connect type                         = always
    timeout                              = 5
    auto mtu                             = enable
    mtu                                  = 1454
    service type                         = normal
    lan type ip address                  =
    lan type netmask                     =
    dns server type                      = auto
    dns server1                          =
    dns server2                          =
    
    [pppoe account 4]
    name                                 = Account-4
    username                             =
    password                             =
    connect type                         = always
    timeout                              = 5
    auto mtu                             = enable
    mtu                                  = 1454
    service type                         = normal
    lan type ip address                  =
    lan type netmask                     =
    dns server type                      = auto
    dns server1                          =
    dns server2                          =
    
    [pppoe account 5]
    name                                 = Account-5
    username                             =
    password                             =
    connect type                         = always
    timeout                              = 5
    auto mtu                             = enable
    mtu                                  = 1454
    service type                         = normal
    lan type ip address                  =
    lan type netmask                     =
    dns server type                      = auto
    dns server1                          =
    dns server2                          =
    
    [management]
    http port                            = 80
    http timeout                         = 5
    allow ping state                     = disable
    front led state                      = enable
    web redirect state                   = enable
    masquerade period                    = 10
    
    [remote management]
    policy                               = deny all
    http port                            = 8080
    grant ip address 1                   =
    grant ip address 2                   =
    
    [administrator account]
    username                             = root
    password                             =
    
    [time]
    operation type                       = auto
    timezone                             = JST-09:00
    timestring                           =
    
    [ntp]
    state                                = disable
    server type                          = domain
    server domain name                   =
    server ip address                    =
    interval                             = 24
    
    [nat]
    vpn passthrough state                = enable
    ipv6 passthrough state               = enable
    pppoe passthrough state              = disable
    
    [dhcp server]
    state                                = enable
    lease limit                          = enable
    lease                                = 172800
    start ip address                     = 192.168.1.21
    end ip address                       = 192.168.1.50
    primary dns server                   = 192.168.1.1
    secondary dns server                 =
    
    [upnp]
    state                                = enable
    
    [mac filter]
    policy                               = disable
    
    [ip filter]
    policy                               = disable
    
    [syslog]
    remote state                         = disable
    remote server ip address             =
    
    [ddns]
    state                                = disable
    server                               = dyndns
    hostname                             =
    username                             =
    password                             =
    e-mail address                       =
    ip update interval                   = 3600
    last update time                     = 2000/01/01 00:00:00
    last update ip                       = 0.0.0.0
    
    [wlan]
    wsc device pin                       =
    
    [wlan primary radius server]
    state                                = disable
    ip address                           =
    authentication port                  = 1812
    shared secret                        =
    
    [wlan radio 1]
    state                                = enable
    operation mode                       = access point
    
    [wlan radio 1 (ap)]
    mode                                 = 11ng
    channel                              = auto
    channel width mode                   = ht20
    shortgi state                            = disable
    beacon interval                      = 100
    dtim                                 = 1
    frag threshold                       = 2346
    rts threshold                        = 2346
    tx power                             = 20
    tx rate                              = 10000
    g protect state                      = enable
    slot time 11a                        = 10
    ack timeout 11a                      = 23
    cts timeout 11a                      = 23
    slot time 11na                       = 10
    ack timeout 11na                     = 23
    cts timeout 11na                     = 23
    slot time 11g                        = 10
    ack timeout 11g                      = 23
    cts timeout 11g                      = 23
    slot time 11ng                       = 10
    ack timeout 11ng                     = 23
    cts timeout 11ng                     = 23
    tx chain mask                        = 5
    rx chain mask                        = 5
    wmm state                            = enable
    wmm uapsd state                      = disable
    wmm ap ac_be cwmin                   = 4
    wmm ap ac_be cwmax                   = 6
    wmm ap ac_be aifs                    = 3
    wmm ap ac_be txoplimit 11b           = 0
    wmm ap ac_be txoplimit 11ag          = 0
    wmm ap ac_be acm state               = disable
    wmm ap ac_be ack-policy state        = disable
    wmm ap ac_bk cwmin                   = 4
    wmm ap ac_bk cwmax                   = 10
    wmm ap ac_bk aifs                    = 7
    wmm ap ac_bk txoplimit 11b           = 0
    wmm ap ac_bk txoplimit 11ag          = 0
    wmm ap ac_bk acm state               = disable
    wmm ap ac_bk ack-policy state        = disable
    wmm ap ac_vi cwmin                   = 3
    wmm ap ac_vi cwmax                   = 4
    wmm ap ac_vi aifs                    = 1
    wmm ap ac_vi txoplimit 11b           = 6016
    wmm ap ac_vi txoplimit 11ag          = 3008
    wmm ap ac_vi acm state               = disable
    wmm ap ac_vi ack-policy state        = disable
    wmm ap ac_vo cwmin                   = 2
    wmm ap ac_vo cwmax                   = 3
    wmm ap ac_vo aifs                    = 1
    wmm ap ac_vo txoplimit 11b           = 3264
    wmm ap ac_vo txoplimit 11ag          = 1504
    wmm ap ac_vo acm state               = disable
    wmm ap ac_vo ack-policy state        = disable
    wmm station ac_be cwmin              = 4
    wmm station ac_be cwmax              = 10
    wmm station ac_be aifs               = 3
    wmm station ac_be txoplimit 11b      = 0
    wmm station ac_be txoplimit 11ag     = 0
    wmm station ac_be acm state          = disable
    wmm station ac_bk cwmin              = 4
    wmm station ac_bk cwmax              = 10
    wmm station ac_bk aifs               = 7
    wmm station ac_bk txoplimit 11b      = 0
    wmm station ac_bk txoplimit 11ag     = 0
    wmm station ac_bk acm state          = disable
    wmm station ac_vi cwmin              = 3
    wmm station ac_vi cwmax              = 4
    wmm station ac_vi aifs               = 2
    wmm station ac_vi txoplimit 11b      = 6016
    wmm station ac_vi txoplimit 11ag     = 3008
    wmm station ac_vi acm state          = disable
    wmm station ac_vo cwmin              = 2
    wmm station ac_vo cwmax              = 3
    wmm station ac_vo aifs               = 2
    wmm station ac_vo txoplimit 11b      = 3264
    wmm station ac_vo txoplimit 11ag     = 1504
    wmm station ac_vo acm state          = disable
    global roaming state                 = enable
    privacy state                        = disable
    wds state                            = enable
    preamble                             = auto
    mcastenhance                         = enable
    
    [wlan radio 1 bss 1 (ap)]
    state                                = enable
    ssid                                 =
    ssid suppress state                  = disable
    security policy                      = wpa-psk-auto
    default shared key                   = 1
    shared key 1 method                  = wep64 hexadecimal
    shared key 1 value                   =
    shared key 2 method                  = wep64 hexadecimal
    shared key 2 value                   =
    shared key 3 method                  = wep64 hexadecimal
    shared key 3 value                   =
    shared key 4 method                  = wep64 hexadecimal
    shared key 4 value                   =
    8021x rekey state                    = enable
    8021x rekey length                   = 5
    8021x rekey interval                 = 0
    wpa-psk passphrase                   =
    wpa-psk cipher                       = auto
    wpa-psk group key interval           = 300
    wpa cipher                           = auto
    wpa group key interval               = 300
    wpa2-psk passphrase                  =
    wpa2-psk cipher                      = auto
    wpa2-psk group key interval          = 300
    wpa2 cipher                          = auto
    wpa2 group key interval              = 300
    wpa-psk-auto passphrase              =
    wpa-psk-auto cipher                  = auto
    wpa-psk-auto group key interval      = 300
    wpa-auto cipher                      = auto
    wpa-auto group key interval          = 300
    wsc state                            = enable
    wsc config                           = enable
    wsc method                           = pbc
    wsc pin                              =
    multicast data rate                  = 24000
    
    [wlan radio 1 bss 2 (ap)]
    state                                = enable
    ssid                                 = CG-Guest
    ssid suppress state                  = disable
    security policy                      = none
    default shared key                   = 1
    shared key 1 method                  = wep64 hexadecimal
    shared key 1 value                   =
    shared key 2 method                  = wep64 hexadecimal
    shared key 2 value                   =
    shared key 3 method                  = wep64 hexadecimal
    shared key 3 value                   =
    shared key 4 method                  = wep64 hexadecimal
    shared key 4 value                   =
    8021x rekey state                    = enable
    8021x rekey length                   = 5
    8021x rekey interval                 = 0
    wpa-psk passphrase                   =
    wpa-psk cipher                       = auto
    wpa-psk group key interval           = 300
    wpa cipher                           = auto
    wpa group key interval               = 300
    wpa2-psk passphrase                  =
    wpa2-psk cipher                      = auto
    wpa2-psk group key interval          = 300
    wpa2 cipher                          = auto
    wpa2 group key interval              = 300
    wpa-psk-auto passphrase              =
    wpa-psk-auto cipher                  = auto
    wpa-psk-auto group key interval      = 300
    wpa-auto cipher                      = auto
    wpa-auto group key interval          = 300
    wsc state                            = disable
    wsc config                           = disable
    wsc method                           = pbc
    wsc pin                              =
    multicast data rate                  = 24000
    

  • bootlog
    U-Boot 1.1.4 (Aug 24 2009 - 14:47:37)
    
    AP93 (ar7240) U-boot
    DRAM:  
    sri
    ar7240_ddr_initial_config(145): python ddr init
    #### TAP VALUE 1 = 9, 2 = 9
    32 MB
    Top of RAM usable for U-Boot at: 82000000
    Reserving 253k for U-Boot at: 81fc0000
    Reserving 192k for malloc() at: 81f90000
    Reserving 44 Bytes for Board Info at: 81f8ffd4
    Reserving 36 Bytes for Global Data at: 81f8ffb0
    Reserving 128k for boot params() at: 81f6ffb0
    Stack Pointer at: 81f6ff98
    Now running in RAM - U-Boot at: 81fc0000
    id read 0x100000ff
    flash size 4194304, sector count = 64
    Flash:  4 MB
    *** Warning - bad CRC, using default environment
    
    In:    serial
    Out:   serial
    Err:   serial
    Net:   ag7240_enet_initialize...
    : cfg1 0xf cfg2 0x7014
    eth0: 00:03:7f:09:0b:ad
    eth0 up
    : cfg1 0xf cfg2 0x7214
    eth1: 00:03:7f:09:0b:ad
    ATHRS26: resetting s26
    ATHRS26: s26 reset done
    eth1 up
    eth0, eth1
    
    
          ============================================ 
            CG-WLR300NM Boot Loader Interface 
            V1.03  2009-08-24(195MHz)  
          ============================================ 
    
      Please choose the operation: 
         1: Load system code then write to Flash via TFTP. 
         2: Boot system code via Flash.
    0
    ## Booting image at 9f050000 ...
       Verifying Checksum ... OK
       Uncompressing Kernel Image ... OK
    No initrd
    ## Transferring control to Linux (at address 801e6000) ...
    ## Giving linux memsize in bytes, 33554432
    
    Starting kernel ...
    
    Booting AR7240(Python)...
    Linux version 2.6.15--LSDK-7.3.0.304 (root@delis.wnc) (gcc version 3.4.4) #1 Fri Mar 5 17:06:04 CST 2010
    flash_size passed from bootloader = 4
    arg 1: console=ttyS0,115200
    arg 2: root=31:03
    arg 3: rootfstype=cramfs
    arg 4: init=/sbin/init
    arg 5: mem=32M
    CPU revision is: 00019374
    Determined physical RAM map:
     memory: 02000000 @ 00000000 (usable)
    User-defined physical RAM map:
     memory: 02000000 @ 00000000 (usable)
    Built 1 zonelists
    Kernel command line: console=ttyS0,115200 root=31:03 rootfstype=cramfs init=/sbin/init mem=32M 
    Primary instruction cache 64kB, physically tagged, 4-way, linesize 32 bytes.
    Primary data cache 32kB, 4-way, linesize 32 bytes.
    Synthesized TLB refill handler (20 instructions).
    Synthesized TLB load handler fastpath (32 instructions).
    Synthesized TLB store handler fastpath (32 instructions).
    Synthesized TLB modify handler fastpath (31 instructions).
    Cache parity protection disabled
    PID hash table entries: 256 (order: 8, 4096 bytes)
    Using 195.000 MHz high precision timer.
    Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
    Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
    Memory: 30220k/32768k available (1597k kernel code, 2532k reserved, 334k data, 128k init, 0k highmem)
    Mount-cache hash table entries: 512
    Checking for 'wait' instruction...  available.
    NET: Registered protocol family 16
    PCI init:ar7240_pcibios_init
    Returning IRQ 48
    AR7240 GPIOC major 0
    Initializing Cryptographic API
    io scheduler noop registered
    io scheduler deadline registered
    Serial: 8250/16550 driver $Revision: #1 $ 1 ports, IRQ sharing disabled
    serial8250.0: ttyS0 at MMIO 0x0 (irq = 19) is a 16550A
    PPP generic driver version 2.4.2
    NET: Registered protocol family 24
    tun: Universal TUN/TAP device driver, 1.6
    tun: (C) 1999-2004 Max Krasnyansky 
    AR7240 Flash: Using static MTD partitions.
    Creating 6 MTD partitions on "ar7240-nor0":
    0x00000000-0x00040000 : "Bootloader (256K)"
    0x00040000-0x00050000 : "Board Config (64K)"
    0x00050000-0x003e0000 : "Firmware (3648K)"
    0x00110000-0x003e0000 : "Filesystem (2880K)"
    0x003e0000-0x003f0000 : "User Config (64K)"
    0x003f0000-0x00400000 : "Calibration Data (64K)"
    NET: Registered protocol family 2
    IP route cache hash table entries: 512 (order: -1, 2048 bytes)
    TCP established hash table entries: 2048 (order: 1, 8192 bytes)
    TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    TCP: Hash tables configured (established 2048 bind 2048)
    TCP reno registered
    ip_conntrack version 2.4 (256 buckets, 2048 max) - 228 bytes per conntrack
    ip_conntrack_pptp version 3.1 loaded
    ip_nat_pptp version 3.0 loaded
    ip_tables: (C) 2000-2002 Netfilter core team
    ipt_time loading
    TCP bic registered
    NET: Registered protocol family 1
    NET: Registered protocol family 17
    Ebtables v2.0 registered
    802.1Q VLAN Support v1.8 Ben Greear 
    All bugs added by David S. Miller 
    arch/mips/ar7240/gpio.c (ar7240_simple_config_init) Smith Test
    arch/mips/ar7240/gpio.c (create_simple_config_led_proc_entry) Smith Test
    ar7240wdt_init: Registering WDT success
    VFS: Mounted root (cramfs filesystem) readonly.
    Freeing unused kernel memory: 128k freed
    init started:  BusyBox v1.01 (2010.03.05-09:06+0000) multi-call binary
    led: module license 'unspecified' taints kernel.
    CG-WLR300NM ledctrl module init...
    AG7240: Length per segment 1536
    AG7240: Max segments per packet 1
    AG7240: Max tx descriptor count    80
    AG7240: Max rx descriptor count    252
    AG7240: fifo cfg 3 01f00140
    AG7240CHH: Mac address for unit 1
    AG7240CHH: 00:26:87:09:4b:68 
    AG7240CHH: Mac address for unit 0
    AG7240CHH: 00:26:87:09:4b:69 
    ag7240_ring_alloc Allocated 1280 at 0x80302800
    ag7240_ring_alloc Allocated 4032 at 0x811cd000
    Setting PHY...
    ag7240_ring_alloc Allocated 1280 at 0x803ea000
    ag7240_ring_alloc Allocated 4032 at 0x803ed000
    ATHRS26: resetting s26
    ATHRS26: s26 reset done
    Setting PHY...
    Ctrlbtn Modules OK!
    
    
    BusyBox v1.01 (2010.03.05-09:06+0000) Built-in shell (ash)
    Enter 'help' for a list of built-in commands.
    
    Erasing 64 Kibyte @ 0 -- 100 percent complete.
    Writing 64 Kibyte @ 3cea -- 100 percent complete.
    device eth0 entered promiscuous mode
    device eth1 entered promiscuous mode
    ath_hal: 0.9.17.1 (AR5416, DEBUG, REGOPS_FUNC, WRITE_EEPROM, 11D)
    wlan: 0.8.4.2 (Atheros/multi-bss)
    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_pci: 0.9.4.5 (Atheros/multi-bss)
    Current Country Code = 392 
    wifi0: Atheros 9280: mem=0x10000000, irq=48 hw_base=0xb0000000
    wlan: mac acl policy registered
    wlan_me: Version 0.1
    Copyright (c) 2008 Atheros Communications, Inc. All Rights Reserved
    device ath0 entered promiscuous mode
    lan: port 3(ath0) entering learning state
    lan: topology change detected, propagating
    lan: port 3(ath0) entering forwarding state
    device ath1 entered promiscuous mode
    lan: port 4(ath1) entering learning state
    lan: topology change detected, propagating
    lan: port 4(ath1) entering forwarding state
    lan: port 3(ath0) entering disabled state
    lan: port 4(ath1) entering disabled state
    Country ie is JP 
    lan: port 3(ath0) entering learning state
    Country ie is JP 
    lan: port 4(ath1) entering learning state
    lan: topology change detected, propagating
    lan: port 3(ath0) entering forwarding state
    lan: topology change detected, propagating
    lan: port 4(ath1) entering forwarding state
    
    

広告

WHR-G301Nとmtd

メーカーファームに戻したところ、OpenWrtのmtdパーティション定義と異なっていたのでメモ。

  • OpenWrt (ar71xx)

    0x3F0000 - 0x400000 が未定義。ただし、MACアドレスはこの 0x10000 の領域から取得されている。

    0x0 – 0x3E000 0x3E000 – 0x40000 0x40000 – 0x3E0000 0x3E0000 – 0x3F0000 0x3F0000 – 0x400000
    mtd mtd0 mtd1 mtd2 mtd6 (none)
    name u-boot u-boot-env firmware art (none)
    (mtd) mtd3 mtd4 mtd5 (none)
    (name) kernel rootfs rootfs_data (none)
  • stock firmware

    0x3F0000 - 0x400000 が “ART” として定義されている。

    0x0 – 0x3E000 0x3E000 – 0x40000 0x40000 – 0x3E0000 0x3E0000 – 0x3F0000 0x3F0000 – 0x400000
    mtd mtd0 mtd1 mtd6 mtd4 mtd5
    name u-boot u-boot_environ firmware user_property ART
    (mtd) mtd2 mtd3
    (name) kernel rootfs