タグ: WG300HP

WG300HP

OSC 2019 Tokyo/Spring 2日目、帰り支度中に偶然お借りすることができたので、弄っていくメモ。
SoCはAR9342でath9kチップを追加搭載しないものの、その他の構成はおおよそWR8750Nなどと同じではないかと予想。

Switch

zone WAN LAN
port
(WG300HP)
WAN LAN1 LAN2 LAN3 LAN4
port
(QCA8337)
port1 port2 port3 port4 port5

MAC

  • LAN: 10:66:82:xx:xx:A8 (config, 0x6 (hex))
  • WAN: 10:66:82:xx:xx:A9 (config, 0xc (hex))
  • 2.4G: 10:66:82:xx:xx:AA (config, 0x0 (hex))

Bootloader

chiron

  • help
    boot> help
    support commands ...
    load             load module
    boot             boot loaded module
    tftpd            start tftpd [tftpd [IP] [bfn]]
    dlmode           set tftpd download mode [bfn]
    reboot           reboot system
    help             help command
    macaddr          macaddr read/write
    configid         configid read/write
    randomkey        randomkey read/write
    serial           serial number read/write
    pkg_info         show package information
    presetid         preset id read/write
    version          show boot version
    mhx              mhx utility
    tp               test program
    errorlog         errorlog command
    additional       additional command
    rf-serial        rf-serial command
    time             Time command
    debug            debug command
    ?                help command
    

  • version
    boot> version
    boot version: 1.0.0
    system version: 2.91.5
    TP Version = 1.0.0
    

  • pkg_info
    boot> pkg_info
    phy0.1: "Atheros/AR8327(SW)"
    phy0.0: "Atheros/AR8327(phy)"
    active ch:0
      PKG NAME : PAVO-HP
      CPU   : Atheros/AR9342
      RAM   : 64Mbyte
      Flash : 4Mbyte
        Device         : MX25L3205DMI(Macronix)
        Top Address    : 0xbf000000
        Config Address : 0xbf020000
        System Address : 0xbf040000
      Ether PHY : Atheros/AR8327(SW)
      DIPSW : 0x1
    

  • debug ?
    boot> debug ?
    support commands ...
    memory           memory read/write
    flash            flash driver r/w
    fs               file system r/w
    load             load test (calc chksum)
    exception        exception
    register         display register
    watchdog         do watchdog reset
    tlb              tlb register
    cache            cache control
    mii              mii control
    l2sw             l2sw control
    ether            ether control
    btimer_start     test btimer
    btimer_stop      test btimer
    

  • debug fs ls
    boot> debug fs ls
    Firmware            3485416 bytes
    config.har             2080 bytes
    total 3932160, avail 327360 bytes
    

  • debug l2sw register dump ?
    boot> debug l2sw register dump ?
    PHY:
    00 1000 1000 1000 1000 1000 
    01 7949 7949 7949 7949 7949 
    02 004d 004d 004d 004d 004d 
    03 d036 d036 d036 d036 d036 
    04 1de1 1de1 1de1 1de1 1de1 
    05 0000 0000 0000 0000 0000 
    06 0004 0004 0004 0004 0004 
    07 2801 2801 2801 2801 2801 
    08 0000 0000 0000 0000 0000 
    09 0200 0200 0200 0200 0200 
    0a 0000 0000 0000 0000 0000 
    0b 0000 0000 0000 0000 0000 
    0c 0000 0000 0000 0000 0000 
    0d 0000 0000 0000 0000 0000 
    0e 0000 0000 0000 0000 0000 
    0f 2000 2000 2000 2000 2000 
    10 0862 0862 0862 0862 0862 
    11 0010 0010 0010 0010 0010 
    12 0000 0000 0000 0000 0000 
    13 0000 0000 0000 0000 0000 
    14 082c 082c 082c 082c 082c 
    15 0000 0000 0000 0000 0000 
    16 2400 2400 2400 2400 2400 
    17 0000 0000 0000 0000 0000 
    18 3200 3200 3200 3200 3200 
    19 1000 1000 1000 1000 1000 
    1a 0000 0000 0000 0000 0000 
    1b 0000 0000 0000 0000 0000 
    1c 0000 0000 0000 0000 0000 
    1d 0000 0000 0000 0000 0000 
    1e 02ee 02ee 02ee 02ee 02ee 
    1f 0000 0000 0000 0000 0000 
    
    DEBUG:
    00 02ee 02ee 02ee 02ee 02ee 
    01 01b1 02b2 02b2 01b1 02b2 
    02 3220 3220 3220 3220 3110 
    03 3e22 3e11 3e11 3e11 3e11 
    04 fbbb fbbb fbbb fbbb fbbb 
    05 1c47 1c47 1c47 1c47 1c47 
    06 0000 0000 0000 0000 0000 
    07 0000 0000 0000 0000 0000 
    08 1c00 1c00 1c00 1c00 1c00 
    09 8000 8000 8000 8000 8000 
    0a 3000 3000 3000 3000 3000 
    0b bc40 bc40 bc40 bc40 bc40 
    0c 6001 6001 6001 6001 6001 
    0d 2820 2820 a820 2820 2820 
    0e 0003 0003 0003 0003 0003 
    0f 0030 0030 0030 0030 0030 
    10 0000 0000 0000 0000 0000 
    11 7552 7552 7552 7552 7552 
    12 4c04 4c04 4c04 4c04 4c04 
    13 c01b c01b c01b c01b c01b 
    14 0752 0752 0752 0752 0752 
    15 b220 b220 b220 b220 b220 
    16 8000 8000 8000 8000 8000 
    17 0000 0000 0000 0000 0000 
    18 62ea 62ea 62ea 62ea 62ea 
    19 01f4 01f4 01f4 01f4 01f4 
    1a 01d7 01d7 01d7 01d7 01d7 
    1b 0176 0176 0176 0176 0176 
    1c 3cbb 3cbb 3cbb 3cbb 3cbb 
    1d 00ec 00ec 00ec 00ec 00ec 
    1e 0076 0076 0076 0076 0076 
    1f 0000 0000 0000 0000 0000 
    20 0000 0000 0000 0000 0000 
    21 2d15 2d15 2d15 2d15 2d15 
    22 1f6a 1f6a 1f6a 1f6a 1f6a 
    23 a200 a200 a200 a200 a200 
    24 1000 1000 1000 1000 1000 
    25 0000 0000 0000 0000 0000 
    26 002c 0000 0012 0000 0000 
    27 1000 1000 1000 1000 1000 
    28 0000 0000 0000 0000 0000 
    29 36dd 36dd 36dd 36dd 36dd 
    2a 0000 0000 0000 0000 0000 
    2b 3a98 3a98 3a98 3a98 3a98 
    2c 0000 0000 0000 0000 0000 
    2d 0000 0000 0000 0000 0000 
    2e 0000 0000 0000 0000 0000 
    2f 0000 0000 0000 0000 0000 
    30 0000 0000 0000 0000 0000 
    31 0000 0000 0000 0000 0000 
    32 2200 2200 2200 2200 2200 
    33 2200 2200 2200 2200 2200 
    34 2200 2200 2200 2200 2200 
    35 0000 0000 0000 0000 0000 
    36 e1ec e1ec e1ec e1ec e1ec 
    37 6000 6000 6000 6000 6000 
    38 1111 1111 1111 1111 1111 
    39 7359 7359 7359 7359 7359 
    3a ee6b ee6b ee6b ee6b ee6b 
    3b 5a5a 5a5a 5a5a 5a5a 5a5a 
    3c 5a5a 5a5a 5a5a 5a5a 5a5a 
    3d 6860 6860 6860 6860 6860 
    3e e0d8 e0d8 e0d8 e0d8 e0d8 
    3f 8000 8000 8000 8000 8000 
    
    L2SW:
    0000 00011302 07a00000 00000000 00000000 
    0010 00261320 f0107650 00002587 00003f1f 
    0020 3f500000 0001007e 00000000 00000000 
    0030 80000701 00000000 0f000000 00000000 
    0040 00700000 00000000 000088a8 00000000 
    0050 cc36cc36 ca36ca36 c936c936 03ffff00 
    0060 00000001 00000000 00000000 00000000 
    0070 b00ee060 03707f07 000005ee 0000004e 
    0080 00000200 00000200 00000200 00000200 
    0090 00000200 00001080 00000000 00000000 
    00a0 00000000 00000000 00000000 00000000 
    00b0 00000000 00000000 00000000 00000000 
    00c0 00000000 00000000 80901040 00000000 
    00d0 fffbff7e 00000001 00000100 000303ff 
    00e0 c70164c0 0002a545 2dc11c9c 00000000 
    00f0 ff000083 00000000 a0000000 0000d600 
    0100 00001550 00000000 00000000 00000000 
    0110 00000000 00000000 00000000 00000000 
    0120 00240024 00000000 00240024 00000000 
    0130 00240024 00000000 00240024 00000000 
    0140 00240024 00000000 00240024 00000000 
    0150 00240024 00000000 00240024 00000000 
    0160 00240024 00000000 00240024 00000000 
    0170 00000000 00000000 00000000 00000000 
    0180 00000000 00000000 00000000 00000000 
    0190 00000000 00000000 00000000 00000000 
    01a0 00000000 00000000 00000000 00000000 
    01b0 00000000 00000000 00000000 00000000 
    01c0 00000000 00000000 00000000 00000000 
    01d0 00000000 00000000 00000000 00000000 
    01e0 00000000 00000000 00000000 00000000 
    01f0 00000000 00000000 00000000 00000000 
    0200 00000001 00005000 00400040 00000000 
    0210 00000000 00000000 00000000 00000000 
    0220 00000000 00000000 00000000 00000000 
    0230 00000000 00000000 00000000 00000000 
    0240 00000000 00000000 00000000 00000000 
    0250 00000000 00000000 00000000 00000000 
    0260 00000000 00000000 00000000 00000000 
    0270 0000000f 00000000 00000000 00000000 
    0280 00000000 00000000 00000000 00000000 
    0290 00000000 00000000 00000000 00000000 
    02a0 00000000 00000000 00000000 00000000 
    02b0 00000000 00000000 00000000 00000000 
    02c0 00000000 00000000 00000000 00000000 
    02d0 00000000 00000000 00000000 00000000 
    02e0 00000000 00000000 00000000 00000000 
    02f0 00000000 00000000 00000000 00000000 
    0400 00000000 00000000 00000000 00000000 
    0410 00000000 00000000 00000000 00000000 
    0420 00010001 00002040 00020001 00001040 
    0430 00010001 00001040 00010001 00001040 
    0440 00010001 00001040 00010001 00001040 
    0450 00010001 00003040 00000000 00000000 
    0460 00000000 00000000 00000000 00000000 
    0470 c0a80000 ffff0000 00000000 00000000 
    0480 00000000 00000000 00000000 00000000 
    0490 00000000 00000000 00000000 00000000 
    04a0 00000000 00000000 00000000 00000000 
    04b0 00000000 00000000 00000000 00000000 
    04c0 00000000 00000000 00000000 00000000 
    04d0 00000000 00000000 00000000 00000000 
    04e0 00000000 00000000 00000000 00000000 
    04f0 00000000 00000000 00000000 00000000 
    0600 00000000 00000000 00000000 00000001 
    0610 00000000 00000002 d0e8002b 00000000 
    0620 001000f0 003f3f3f 00000000 00000000 
    0630 00000000 11111111 22222222 33333333 
    0640 44444444 55555555 66666666 77777777 
    0650 76543210 00000000 00000000 00000000 
    0660 0014027e 00000018 00007000 0004027d 
    0670 00000018 00007000 0014027b 00000018 
    0680 00007000 00140277 00000018 00007000 
    0690 0014026f 00000018 00007000 0014025f 
    06a0 00000018 00007000 00000000 00000018 
    06b0 00007000 00000000 00000000 00000000 
    06c0 00000000 00000000 00000000 00000000 
    06d0 00000000 00000000 00000000 00000000 
    06e0 00000000 00000000 00000000 00000000 
    06f0 00000000 00000000 00000000 00000000 
    0800 01200188 00000000 007f000e 00000000 
    0810 54332201 33221100 00000000 00000000 
    0820 00000000 00000000 00000000 00000000 
    0830 10841041 00041041 00041041 00041041 
    0840 00041041 10841041 10841041 00000000 
    0850 00000000 00000000 00000000 00000000 
    0860 00000000 00000000 00000000 00000000 
    0870 00000000 00000000 00000000 00000000 
    0880 00000000 00000000 00000000 00000000 
    0890 7fff7fff 7fff7fff 7fff7fff 7fff7fff 
    08a0 7fff7fff 7fff7fff 00000000 00000002 
    08b0 7fff7fff 7fff7fff 7fff7fff 7fff7fff 
    08c0 7fff7fff 7fff7fff 00000000 00000002 
    08d0 7fff7fff 7fff7fff 7fff7fff 7fff7fff 
    08e0 7fff7fff 7fff7fff 00000000 00000002 
    08f0 7fff7fff 7fff7fff 7fff7fff 7fff7fff 
    0c00 00000000 00000000 00000000 00000000 
    0c10 00000000 00000000 00000000 00000000 
    0c20 00000000 00000000 00000000 00000000 
    0c30 00000000 05000000 00000000 00000000 
    0c40 00000000 00000000 00000000 00000000 
    0c50 00000000 00000000 00000000 00000000 
    0c60 00000000 00000000 00000000 00000000 
    0c70 00010001 00010001 00010001 00000001 
    0c80 00000000 00000000 00000000 00000000 
    0c90 00000000 00000000 00000000 00000000 
    0ca0 00000000 00000000 00000000 00000000 
    0cb0 00000000 00000000 00000000 00000000 
    0cc0 00000000 00000000 00000000 00000000 
    0cd0 00000000 00000000 00000000 00000000 
    0ce0 00000000 00000000 00000000 00000000 
    0cf0 00000000 00000000 00000000 00000000 
    0e00 00072401 00000000 00000000 007f0000 
    0e10 00000000 00000000 00000000 00000000 
    0e20 00000000 00000000 00000000 00000000 
    0e30 00000000 00000000 00200a53 00000000 
    0e40 00000000 00000000 00000000 00000000 
    0e50 00000000 00000000 00000000 00000000 
    0e60 00000000 00000000 00000000 00000000 
    0e70 00000000 00000000 00000000 00000000 
    0e80 00000000 00000000 00000000 00000000 
    0e90 00000000 00000000 00000000 00000000 
    0ea0 00000000 00000000 00000000 00000000 
    0eb0 00000000 00000000 00000000 00000000 
    0ec0 00000000 00000000 00000000 00000000 
    0ed0 00000000 00000000 00000000 00000000 
    0ee0 00000000 00000000 00000000 00000000 
    0ef0 00000000 00000000 00000000 00000000 
    
    VTU:
    0: 001b55e0 00010005
    1: 001bff60 00020005
    
    ATU:
    

  • debug memory read 0xb8040000 70
    (switch uninitialized)

    boot> debug memory read 0xb8040000 70
    b8040000:00000b07 00022e3f 00026018 00000000 .......?..`.....
    b8040010:00000000 00000000 00000000 00000000 ................
    b8040020:00000000 00000000 000f8000 00000000 ................
    b8040030:0b0a0900 00180000 2f2e0000 00000000 ......../.......
    b8040040:00000000 00000908 00000000 00000000 ................
    b8040050:00000c0b 00000000 00000000 00000000 ................
    b8040060:00000000 0d0f110e 00000000 00000002 ................
    

    (switch initialized)

    boot> debug memory read 0xb8040000 70
    b8040000:00000b07 00022e3f 00026018 00000000 .......?..`.....
    b8040010:00000000 00000000 00000000 00000000 ................
    b8040020:00000000 00000000 000f8000 00000000 ................
    b8040030:0b0a0900 00180000 2f2e0000 00000000 ......../.......
    b8040040:00000000 00000908 00000000 00000000 ................
    b8040050:00000c0b 00000000 00000000 00000000 ................
    b8040060:00000000 0d0f110e 00000000 00000002 ................
    

  • debug memory read 0xb805002c 4
    boot> debug memory read 0xb805002c 4
    b805002c:06000000                            ....
    

  • debug memory read 0xb8070000 4
    boot> debug memory read 0xb8070000 4
    b8070000:00000001                            ....
    

  • debug memory read 0xb8060000 c0
    (before tp usb)

    boot> debug memory read 0xb8060000 c0
    b8060000:00000000 00000000 00000003 098961cc ..............a.
    b8060010:00000701 00000000 00000020 24846830 ........... $.h0
    b8060020:00000000 00000000 00000000 00000000 ................
    b8060030:00000000 00000000 00000000 00000000 ................
    b8060040:00000000 00000000 00000000 00000000 ................
    b8060050:00000000 00000000 00000000 00000000 ................
    b8060060:00000000 00000000 00000000 00000000 ................
    b8060070:00000000 00000000 00000000 00000000 ................
    b8060080:00000000 00000000 00000000 00000000 ................
    b8060090:00011123 00000000 00000000 00000000 ...#............
    b80600a0:00000000 00000000 00000000 00000000 ................
    b80600b0:00bf0576 00000000 00000000 00086000 ...v..........`.
    

    (after tp usb)

    boot> debug memory read 0xb8060000 c0
    b8060000:00000000 00000000 00000003 09895ec4 ..............^.
    b8060010:00000701 00000000 00000020 24846008 ........... $.`.
    b8060020:00000000 00000000 00000000 00000000 ................
    b8060030:00000000 00000000 00000000 00000000 ................
    b8060040:00000000 00000000 00000000 00000000 ................
    b8060050:00000000 00000000 00000000 00000000 ................
    b8060060:00000000 00000000 00000000 00000000 ................
    b8060070:00000000 00000000 00000000 00000000 ................
    b8060080:00000000 00000000 00000000 00000000 ................
    b8060090:00011123 00000000 00000000 00000000 ...#............
    b80600a0:00000000 00000000 00000000 00000000 ................
    b80600b0:00bf0576 00000000 00000000 00086000 ...v..........`.
    

Kernel (NetBSD)

  • Bootlog
    IPL:HARD-RESET
    memory test ... ok
    flinstall OK
    
    boot version: 1.0.0
    
    PKG "PAVO-HP"
    CPU "Atheros/AR9342"
    Revision 112.3 CLOCK 560.0 MHz
    HEAP MEMORY 262144 bytes
    Boot:InitFilesystem
    phy0.1: "Atheros/AR8327(SW)"
    phy0.0: "Atheros/AR8327(phy)"
    active ch:0
    post start
    DRAM Test ..... PASS
    Timer test .... PASS
    FLASH CHKSUM .. PASS
    LAN Test ..... 
    LoopBack count 0 .. 
    phy0.1: "Atheros/AR8327(SW)"
    phy0.0: "Atheros/AR8327(phy)"
    active ch:0
    active ch:1
    phy0.1: "Atheros/AR8327(SW)"
    phy0.0: "Atheros/AR8327(phy)"
    active ch:0
    PASS
    Package TYPE = 0x00
    post success
    now booting Firmware ...
    loaded Firmware
    config=0x80208483 status=0x00000000
    mips_pdcache_write_through=0
    mips_picache_line_size=32 mips_pdcache_line_size=32
      pagemask: 0x00000000
      status: 0x00000000
      config: 0x80208483
      cause: 0x00000000
    load memory 0x1972000, 0x268e000
    load memory 0x1000, 0x5f000
    Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002
        The NetBSD Foundation, Inc.  All rights reserved.
    Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
    
    NetBSD 1.6.1 (PAVO.tmp) #0: 2013-06-07 09:52:40 JST
        ******@***-**-*****:/home/******/pavo/git/hituji/build/pavo/kernel-obj/PAVO.tmp
    
    total memory = 65536 KB
    avail memory = 34336 KB
    using 1024 buffers containing 4096 KB of memory
    mainbus0 (root)
    cpu0 at mainbus0: MIPS 74Kc (0x1974c) Rev. 76 with software emulated floating point
    cpu0: 64KB/32B 4-way set-associative L1 Instruction cache, 32 TLB entries
    cpu0: 32KB/32B 4-way set-associative write-back L1 Data cache
    arspi0 at mainbus0
    arflash0 at mainbus0 addr 0xbf000000 size 4194304 bytes
    flash: id 0xc2 type 0x15 addr 0xbf000000 size 4194304 bytes
    pfmg: carrier mode 0 pkgid 0xb00 configid 0xff
    arrtc0 at mainbus0
    argiu0 at mainbus0
    arled0 at argiu0
    btnu0 at argiu0 port 0
    btnu1 at argiu0 port 2
    btnu2 at argiu0 port 1
    athq0 at mainbus0
    athq0: WLAN MAC ADDRESS (10:66:82:4d:9f:aa)
    Restoring Cal data from Flash
    dfs_attach: use DFS enhancements
    DFS min filter rssiThresh = 18
    DFS max pulse dur = 151 ticks
    ath_get_caps[5308] rx chainmask mismatch actual 3 sc_chainmak 0
    ath_get_caps[5283] tx chainmask mismatch actual 3 sc_chainmak 0
    athq0: LSDK-9.2.0_U10.1020 mac 768.0 phy 64.13 radio 0.0
     chan  Freq     HT                       DFS
     1     2412nbg  HT20 HT40PLUS            N
     2     2417nbg  HT20 HT40PLUS            N
     3     2422nbg  HT20 HT40PLUS            N
     4     2427nbg  HT20 HT40PLUS            N
     5     2432nbg  HT20 HT40PLUS HT40MINUS  N
     6     2437nbg  HT20 HT40PLUS HT40MINUS  N
     7     2442nbg  HT20 HT40PLUS HT40MINUS  N
     8     2447nbg  HT20 HT40PLUS HT40MINUS  N
     9     2452nbg  HT20 HT40PLUS HT40MINUS  N
     10    2457nbg  HT20          HT40MINUS  N
     11    2462nbg  HT20          HT40MINUS  N
     12    2467nbg  HT20          HT40MINUS  N
     13    2472nbg  HT20          HT40MINUS  N
    athq0: Atheros 9340: memt=0x8036a860, memh=0xb8100000 
    com0 at mainbus0: ns16550a, working fifo
    com0: console
    ehci0 at mainbus0ehci0: EHCI version 1.0
    usb0 at ehci0: USB revision 2.0
    uhub0 at usb0
    uhub0: AR7100 EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
    uhub0: 1 port with 1 removable, self powered
    ageth0 at mainbus0
    ath27swlphy0 at ageth0 phy 1: Atheros QCA8337 10/100/1000 L2SW, rev. 6
    ath27swlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, auto, 1000baseT-FDX FLAG0, 1000baseT-FDX FLAG1
    ageth1 at mainbus0
    ath27swsphy0 at ageth1 phy 0: Atheros QCA8337 10/100/1000 L2SW, rev. 6
    ath27swsphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, auto
    rtc: CLOCK INITIALIZED 
    kevt0: 
    logbuf: using 655360 bytes logging area
    md0: internal 21504 KB image area
    uhub1 at uhub0 port 1
    uhub1: vendor 0x0409 product 0x005a, class 9/0, rev 2.00/1.00, addr 2
    uhub1: single transaction translator
    uhub1: 4 ports with 4 removable, self powered
    boot device: 
    root on md0a dumps on md0b
    root file system type: ffs
    Tue Jan  1 00:00:02 JST 2013
    Setting tty flags.
    Building databases...
    wlan_vap_create : enter. devhandle=0x8194abe0, opmode=IEEE80211_M_HOSTAP, flags=0x1
    wlan_vap_create : exit. devhandle=0x8194abe0, opmode=IEEE80211_M_HOSTAP, flags=0x1.
    wlan_vap_create : enter. devhandle=0x8194abe0, opmode=IEEE80211_M_HOSTAP, flags=0x1
    wlan_vap_create : exit. devhandle=0x8194abe0, opmode=IEEE80211_M_HOSTAP, flags=0x1.
    Starting wificonfig
    encrypt key mode AES
    Starting evtmgr.
    Starting dlnamgr.
    Starting clid.
    Starting inetd.
    Starting procmon.
    Starting wzcm.
    Tue Jan  1 00:00:07 JST 2013
    
    NetBSD/messimips (Amnesiac) (console)
    
    login: 
    
広告