しばらく前に某フリマサイトで見つけ、QCA9563と思われることから購入したものです。デバイス自体のサポートはあまり時間が掛からず完了していましたが、factoryファームの生成に手間取り遅くなりました。
最近になってようやく解決できた為、PRを出してマージされました。まとめます。
仕様
今回は初めてとなるQCA9563搭載機。無線は2.4GHz帯オンリーで、SoC内蔵の無線機能を使用するのみで完結しています。
- SoC: Qualcomm Atheros QCA9563 (775MHz, 1C1T)
- RAM: DDR2 SDRAM 64MB (NT5TU32M16EG-AC)
- Flash: SPI Flash 8MB (MX25L6406E)
- WAN/LAN: 1000Mbps x1 / 1000Mbps x4
- UART: 115200bps(RJ45側からTX, GND, RX, Vcc)
その他ハードウェアやKernel等細かい点の詳細については、雑記ブログにメモしてあるのでそちらを参照。
OpenWrt化
WRC-300GHBK2-Iではメーカーファームでのアップデート時の挙動の関係上、squashfsは使えずinitramfsイメージでfactoryファームを生成しています。
このため、factory投入後sysupgradeファームを書き込む必要があります。
- WRC-300GHBK2-Iを起動
WRC-300GHBK2-Iに電源ケーブルを接続し、普通に起動。 - WebUIにアクセス
PCとWRC-300GHBK2-IをLANケーブルで接続し、http://192.168.2.1/
のファームウェア更新ページにアクセス - ファーム更新
WRC-300GHBK2-I用のfactoryファームを選択し、アップデートを実行 - sysupgradeを実行
factory投入後initramfsファームで起動してくるので、
sysupgrade openwrt-ath79-generic-elecom_wrc-300ghbk2-i-squashfs-sysupgrade.bin
を実行しsysupgradeファームをFlashに書き込む - 完了
Flashへの書き込みが完了後再起動され、OpenWrtが起動してくれば完了
備考
- factoryの生成に手間取ったのは、Edimaxヘッダに持たせる各種情報の数値形式が原因。
- また、WRC-300GHBK2-Iではメーカーファームのファーム更新機能でファームを投げ込んだ場合、ELECOM独自のヘッダとEdimaxヘッダが消去されず、そのまま全部Flashに書き込まれた。
"firmware" パーティションのdump: [sourcecode language="bash"] root@OpenWrt:/# hexdump -n 128 -C /dev/mtd3 00000000 45 4c 45 43 4f 4d 00 00 57 52 43 2d 33 30 30 47 |ELECOM..WRC-300G| 00000010 48 42 4b 32 2d 49 00 00 00 00 00 00 00 00 00 00 |HBK2-I..........| 00000020 00 00 00 00 00 00 00 00 30 2e 30 30 00 00 00 00 |........0.00....| 00000030 00 00 00 00 00 00 00 00 43 53 59 53 01 10 00 00 |........CSYS....| 00000040 00 07 00 00 52 4e 35 31 00 4e fd 0c 27 05 19 56 |....RN51.N..'..V| 00000050 75 47 29 79 5b 8e 80 73 00 4e fc ca 80 06 00 00 |uG)y[..s.N......| 00000060 80 06 00 00 87 59 31 00 05 05 02 03 4d 49 50 53 |.....Y1.....MIPS| 00000070 20 4f 70 65 6e 57 72 74 20 4c 69 6e 75 78 2d 34 | OpenWrt Linux-4| 00000080 [/sourcecode] この関係上squashfsイメージを使用してfactoryファームを生成し投げ込んだ場合、mtd-split("firmware" 領域からKernelとRootfsを分離するプログラム)が機能せずにKernelがRootfsを見つけられず、Kernel Panicした。
ログ: [sourcecode] starting pid 1063, tty '': '/etc/shutdown' cannot run '/etc/shutdown': No such file or directory The system is going down NOW! Sending SIGTERM to all processes Sending SIGKILL to all processes Requesting system reboot U-Boot 1.1.4 (Jun 8 2015 - 17:12:13) ap152 - Dragonfly 1.0DRAM: sri ath_ddr_initial_config(283): (ddr2 init) ath_sys_frequency: cpu 775 ddr 650 ahb 258 Tap values = (0x11, 0x11, 0x11, 0x11) 64 MB Top of RAM usable for U-Boot at: 84000000 Reserving 206k for U-Boot at: 83fcc000 Reserving 192k for malloc() at: 83f9c000 Reserving 44 Bytes for Board Info at: 83f9bfd4 Reserving 36 Bytes for Global Data at: 83f9bfb0 Reserving 128k for boot params() at: 83f7bfb0 Stack Pointer at: 83f7bf98 Now running in RAM - U-Boot at: 83fcc000 Flash Manuf Id 0xc2, DeviceId0 0x20, DeviceId1 0x17 flash size 8MB, sector count = 128 Flash: 8 MB *** Warning *** : PCIe WLAN Module not found !!! In: serial Out: serial Err: serial Net: ath_gmac_enet_initialize... Fetching MAC Address from 0x83fee72c ath_gmac_enet_initialize: reset mask:c02200 athr_mgmt_init ::done Dragonfly ----> S17 PHY * athrs17_reg_init: complete SGMII in forced mode athr_gmac_sgmii_setup SGMII done : cfg1 0x80000000 cfg2 0x7114 eth0: 00:00:00:00:00:00 eth0 up eth0 Setting 0x181162c0 to 0x40802100 EDX wan_power_down! Hit any key to stop autoboot: 0 ## Booting image at bf070000 ... Image Name: MIPS OpenWrt Linux-4.14.67 Created: 2018-09-03 18:05:27 UTC Image Type: MIPS Linux Kernel Image (lzma compressed) Data Size: 1587567 Bytes = 1.5 MB Load Address: 80060000 Entry Point: 80060000 Verifying Checksum at 0xbf07008c ...OK Uncompressing Kernel Image ... OK No initrd ## Transferring control to Linux (at address 80060000) ... ## Giving linux memsize in bytes, 67108864 Starting kernel ... [ 0.000000] Linux version 4.14.67 (musashino205@Taiha.Net) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r0+7999-c87e672578)) #0 Mon Sep 3 18:05:27 2018 [ 0.000000] bootconsole [early0] enabled [ 0.000000] CPU0 revision is: 00019750 (MIPS 74Kc) [ 0.000000] MIPS: machine is ELECOM WRC-300GHBK2-I [ 0.000000] SoC: Qualcomm Atheros QCA956X ver 1 rev 0 [ 0.000000] Determined physical RAM map: [ 0.000000] memory: 04000000 @ 00000000 (usable) [ 0.000000] Initrd not found or empty - disabling initrd [ 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] Zone ranges: [ 0.000000] Normal [mem 0x0000000000000000-0x0000000003ffffff] [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000000000-0x0000000003ffffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff] [ 0.000000] random: get_random_bytes called from start_kernel+0x8c/0x474 with crng_init=0 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 16256 [ 0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,jffs2 [ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes) [ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) [ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) [ 0.000000] Writing ErrCtl register=00000000 [ 0.000000] Readback ErrCtl register=00000000 [ 0.000000] Memory: 58332K/65536K available (3704K kernel code, 151K rwdata, 896K rodata, 1192K init, 212K bss, 7204K reserved, 0K cma-reserved) [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] NR_IRQS: 51 [ 0.000000] CPU clock: 775.000 MHz [ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4932285024 ns [ 0.000007] sched_clock: 32 bits at 387MHz, resolution 2ns, wraps every 5541893118ns [ 0.008222] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216) [ 0.074769] pid_max: default: 32768 minimum: 301 [ 0.079793] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.086772] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.097648] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 0.108043] futex hash table entries: 256 (order: -1, 3072 bytes) [ 0.114536] pinctrl core: initialized pinctrl subsystem [ 0.120863] NET: Registered protocol family 16 [ 0.145119] clocksource: Switched to clocksource MIPS [ 0.151356] NET: Registered protocol family 2 [ 0.156593] TCP established hash table entries: 1024 (order: 0, 4096 bytes) [ 0.163950] TCP bind hash table entries: 1024 (order: 0, 4096 bytes) [ 0.170695] TCP: Hash tables configured (established 1024 bind 1024) [ 0.177523] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 0.183688] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 0.190567] NET: Registered protocol family 1 [ 0.198675] Crashlog allocated RAM at address 0x3f00000 [ 0.205311] workingset: timestamp_bits=30 max_order=14 bucket_order=0 [ 0.216152] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.222294] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc. [ 0.240103] io scheduler noop registered [ 0.244234] io scheduler deadline registered (default) [ 0.251259] pinctrl-single 1804002c.pinmux: 512 pins at pa b804002c size 64 [ 0.259529] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled [ 0.266858] console [ttyS0] disabled [ 0.270657] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 8, base_baud = 1562500) is a 16550A [ 0.279789] console [ttyS0] enabled [ 0.279789] console [ttyS0] enabled [ 0.287342] bootconsole [early0] disabled [ 0.287342] bootconsole [early0] disabled [ 0.301194] m25p80 spi0.0: mx25l6405d (8192 Kbytes) [ 0.306324] 6 fixed-partitions partitions found on MTD device spi0.0 [ 0.312884] Creating 6 MTD partitions on "spi0.0": [ 0.317852] 0x000000000000-0x000000040000 : "u-boot" [ 0.323665] 0x000000040000-0x000000050000 : "u-boot-env" [ 0.329863] 0x000000050000-0x000000070000 : "nvram" [ 0.335610] 0x000000070000-0x0000007e0000 : "firmware" [ 0.362560] 0x0000007e0000-0x0000007f0000 : "hwconfig" [ 0.368549] 0x0000007f0000-0x000000800000 : "ART" [ 0.374902] libphy: Fixed MDIO Bus: probed [ 0.715479] libphy: ag71xx_mdio: probed [ 0.722442] switch0: Atheros AR8337 rev. 2 switch registered on mdio-bus.0 [ 1.716281] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:00 [uid=004dd036, driver=Atheros AR8216/AR8236/AR8316] [ 1.727871] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:SGMII [ 1.736002] NET: Registered protocol family 10 [ 1.744078] Segment Routing with IPv6 [ 1.748001] NET: Registered protocol family 17 [ 1.752631] 8021q: 802.1Q VLAN Support v1.8 [ 1.759053] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6 [ 1.766824] Please append a correct "root=" boot option; here are the available partitions: [ 1.775464] 1f00 256 mtdblock0 [ 1.775468] (driver?) [ 1.782213] 1f01 64 mtdblock1 [ 1.782216] (driver?) [ 1.788969] 1f02 128 mtdblock2 [ 1.788971] (driver?) [ 1.795726] 1f03 7616 mtdblock3 [ 1.795729] (driver?) [ 1.802479] 1f04 64 mtdblock4 [ 1.802482] (driver?) [ 1.809236] 1f05 64 mtdblock5 [ 1.809239] (driver?) [ 1.815990] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) [ 1.825043] Rebooting in 1 seconds.. [/sourcecode] このため、initramfsイメージを使用して生成する必要があった。
ただしU-Bootはヘッダのチェックは全くしていないようで、これらのヘッダが無くても普通に起動できる。 - Kernel 4.14からOpenWrtでサポートされた "Netfilter Flow Offloading" がどんなものかとこの機種で検証したところ、オフ時に平均400Mbps、オン時に平均700Mbpsを記録した。
これまでのath79機と同様に公式buildbotでは現時点ではビルドされないため、自ビルドの要あり。-> source-onlyフラグが削除されて公式buildbotでのビルドが開始され、公式のダウンロードページ (downloads.openwrt.org) での提供が開始されました。
当方のビルドは taiha.net/jenkins に有(自己責任で使用すること)。
色々
今回は上記の事情に絡んで色々とツッコミどころが多い(と予想する)PRだったものの、しばらく反応が無い期間が続いた後GitHubから通知が来たので見に行ったら "merged, thanks!" というメッセージのみでマージされていて、驚くとともに変な笑いが出てしまった。
Flashは8MBと若干少なめながらもoffloadingを併用すればある程度出るため、ルータとして基本的な使い方をするには良い機種かなぁとも。中古価格も安め。