大破ログ

日々大破、それと側転少々。PC関連その他、気になったことなどをつらつらと。

Aterm WR8750N/WR9500N/WG600HP(進捗報告2)

2023/03/12 追記: これらのデバイスのサポート作業については完全に中止とし、実機は全て処分しました。今後再開する可能性は限りなく低いです

以前書いた1つ目の進捗報告に続き、2つ目です。
またある程度進んだこと、OSCが近くなってきたことから書き留めておきます。

仕様

前回の記事振り返り。今回は記事タイトルにもある通り、3機種についてまとめます。
これらはいずれもAtheros AR9344を搭載し、内部の基板設計やその他仕様に大きな違いはありません。

Model WR8750N WR9500N WG600HP
SoC Atheros AR9344
RAM DDR2 128MB
Flash SPI-NOR 8MB SPI-NOR 16MB SPI-NOR 8MB
WAN/LAN (switch) 1000Mbps x1 / 1000Mbps x4 (AR8327)
WLAN Atheros AR9382 Atheros AR9380 Atheros AR9382
USB USB 2.0 Type-A x1
Bootloader original ?
OS NetBSD based

サポート作業状況

repo: devadd/wg600hp in musashino-build/openwrt
2020/09/08 追記: BSDAtermの作業終了に伴い、上記ブランチは削除し bsd-aterm ブランチに他のBSDAtermも取りまとめた上で移動しました。

現状動作するもの
  • initramfsファームでのブート(NECのBootloader上)
  • Flashからのsysupgradeファームでのブート(U-Boot上)
  • イーサネット(有線)
  • 無線 (2.4/5G) 認識(動作未確認)
  • LED
  • ボタン, スライドスイッチ
現状動作するが問題があるもの
  • USBポート

作業状況詳細

前回の記事で既に正常動作しているものについては省きます。

sysupgradeファームのブート
前回の記事で書いた通り、メーカーファームでは3機種いずれもFlash0x40000 以降の "Firmware" 領域で不明な形式のファイルシステムが形成されており、OpenWrtをFlash内からブートできるようにするにはこのファイルシステムを同じように形成できるようにする必要があり、Flash内からOpenWrtファームをブートできるようにするのは非常に困難。
このため、Bootloaderを置き換えてしまうことでこの問題を解決することにした。
U-Bootについての知識はほとんど無いため、U-Boot公式の現行コードからこの3機種のためのバイナリを生成することは早々に諦め、代わりに pepe2k/u-boot_mod を利用した。(フォーク: musashino-build/u-boot_mod
このリポジトリでは各種コードがかなり整理されており、SoCごとに必要なconfigもわかりやすく、デバイスのサポートを追加するにあたって非常に楽に追加が行えた。
OpenWrtのtoolchainを利用してCross-Compileを行い、NECのBootloaderからブートしたinitramfs上で mtd erase u-boot && mtd write u-boot.bin u-boot を実行してブートローダ領域 (0x0 - 0x20000)を書き換え、厳重にチェックしたうえで再起動し、U-Bootが起動してOpenWrtを起動できることを確認した。
なお、U-BootのCross-CompileはWSLでも行うことができ、そのバイナリでも正常にブートできた。
USBポートのFull-Speed問題
3機種とも、外に出ているUSB物理ポートはAR9344の下にぶら下がるHigh-Speed対応のHubチップに接続されている。前回の記事の通りこのHubチップがAR9344にFull-Speedでしか接続されず、この解決に手間取った。
結果としては、ath79のOpenWrtではAR9344のUSB phyの初期化が完全には行われておらず、レジスタで "0" が設定されるべきビットが "1" のままであることが原因だった。(アドレス: 0x1806001c, bit 11
  • 誤: 0x24044808 (0010 0100 0000 0100 0100 1000 0000 1000)
  • 正: 0x24044008 (0010 0100 0000 0100 0100 0000 0000 1000)
ar71xxではこのビットも正しく処理されており、恐らくこの問題は発生しない。
対処としては、恐らくOpenWrt本体でドライバとDTSの実装を修正するのが最適解であるものの自信が持てないため、NECのBootloader用initramfsファームではLinux Kernelのロードと実行を行うLZMA-Loader内で手動でこのビットを "0" に設定してしまうことにした。(ここ
一方、U-Bootに置き換えた後にFlashからのブートに使用するsysupgradeファームではOpenWrt本体では前述の理由から対処できないため、u-boot_mod内で3機種に対して CONFIG_USB オプションを有効化することでU-Boot内でUSB周りの初期化を予め実施してしまい、OpenWrtで問題が発生しないように対処した。ただし、pepe2k/u-boot_modではAR934x SoCは CONFIG_USB を有効にした際のUSBの初期化がサポートされていなかったため、レジスタのアドレス等問題無いか確認したうえでAR9344のサポートを追加し、初期化が実行されるように修正した。
diff --git a/u-boot/cpu/mips/ar7240/qca_usb.c b/u-boot/cpu/mips/ar7240/qca_usb.c
index 07f21fb5..9e7acb0e 100644
--- a/u-boot/cpu/mips/ar7240/qca_usb.c
+++ b/u-boot/cpu/mips/ar7240/qca_usb.c
@@ -13,7 +13,8 @@</a>

<a style="font-size:10.5pt;"> void usb_init(void)
{
-#if (SOC_TYPE &amp; QCA_QCA953X_SOC)
+#if (SOC_TYPE &amp; QCA_QCA953X_SOC) || \
+    (SOC_TYPE &amp; QCA_AR934X_SOC)
u32 val;

    /* Select REFCLK USB PLL input */
なお、後に実験としてドライバの修正にトライし、以下の変更を行った。
ath79: add missing USB_PHY_ARESET for AR934x devices · musashino-build/openwrt@688e18d (commit内のpatch 27行目はミスで、恐らくassertであるべき。)
上記の変更でcompileと実機でのテストを行い、U-Bootで件のビットを "1" にした状態でブートしても正常にHubがHigh-Speedで接続されることを確認した。
USBポートの認識タイミング問題
前述の通り、WR8750N/WR9500N/WG600HPではAR9344のUSB機能の下にHubチップが接続されており、その下に物理ポートが接続されている。このうち、Hubチップのresetラインに3機種ともath9kチップ (Atheros AR9380/AR9382) のGPIOが使用されてしまっており、OpenWrtをブートした場合ath9kドライバがロードされるまでこのGPIOがコントロールできない。つまり、BootloaderでこのGPIOがHIGHに設定されない場合、ath9kドライバがロードされるまでresetラインに接続されたGPIOがLOWのままであり、Hubチップはreset状態に入ったままでデバイスとして機能しない。
この結果、NECのBootloaderからOpenWrtをブートした場合はこのBootloaderがPCIeとath9kチップの初期化とGPIOのコントロールを行う機能を持っているためHubチップはOpenWrtでUSB関連のドライバがロードされると同時に使用可能になるものの、置き換えたU-BootではPCIeの初期化は可能なものの、ath9kチップの初期化機能を持っておらず、OpenWrtのブート中最後の方にath9kドライバがロードされ、その時点で初めてHubが認識され、USB物理ポートが使用可能になる。
NECのBootloaderからのブート、U-Bootからのブートの2つの場合のログは以下の通り。反転した個所がHubが認識されるタイミング。 NECのBootloaderからブートした場合 (WR8750N):
IPL:HARD-RESET
memory test ... ok
flinstall OK</a>

<a style="font-size:10.5pt;">boot version: 1.0.0</a>

<a style="font-size:10.5pt;">PKG "Orthos-HP"
CPU "Atheros/AR9344"
Revision 212.1 CLOCK 560.0 MHz
HEAP MEMORY 262144 bytes
Boot:InitFilesystem

welcome to boot console
Password:
boot&gt; tftpd
phy0.1: "Atheros/AR8327(SW)"
phy0.0: "Atheros/AR8327(phy)"
active ch:0
tftpd start 192.168.0.1
boot&gt; start tftp load openwrt-ath79-tiny-nec_wr8750n-i
end tftp load length = 3439548
start memory load ...
memory load complete
begin  : 0x80060000
length : 3439524
startup: 0x80060000
boot
begin  : 0x80060000
length : 3439524
startup: 0x80060000
option: 0x0

OpenWrt kernel loader for AR7XXX/AR9XXX
Copyright (C) 2011 Gabor Juhos
Decompressing kernel... done!
Starting kernel at 80060000...

</a><a style="font-size:10.5pt;"></a><a style="font-size:10.5pt;">[    0.000000] Linux version 4.14.98 (musashino205@Taiha.Net) (gcc version 7.4.0 (OpenWrt GCC 7.4.0 r0+9245-e163387b7a)) #0 Tue Feb 12 07:50:40 2019
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[    0.000000] MIPS: machine is NEC Aterm WR8750N
[    0.000000] SoC: Atheros AR9344 rev 1
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 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-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] random: get_random_bytes called from 0x8045972c with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,9600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 117812K/131072K available (3451K kernel code, 137K rwdata, 472K rodata, 7388K init, 195K bss, 13260K 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: 560.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6825930166 ns
[    0.000010] sched_clock: 32 bits at 280MHz, resolution 3ns, wraps every 7669584382ns
[    0.092708] Calibrating delay loop... 278.93 BogoMIPS (lpj=1394688)
[    0.237624] pid_max: default: 32768 minimum: 301
[    0.293072] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.372217] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.461309] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.579000] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.651951] pinctrl core: initialized pinctrl subsystem
[    0.715411] NET: Registered protocol family 16
[    0.769303] Can't analyze schedule() prologue at 803ba89c
[    0.836261] PCI host bridge /ahb/apb/pcie-controller@180c0000 ranges:
[    0.913366]  MEM 0x0000000010000000..0x0000000013ffffff
[    0.975823]   IO 0x0000000000000000..0x0000000000000000
[    1.059597] PCI host bridge to bus 0000:00
[    1.108574] pci_bus 0000:00: root bus resource [mem 0x10000000-0x13ffffff]
[    1.190792] pci_bus 0000:00: root bus resource [io  0x0000]
[    1.257456] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    1.338679] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    1.433988] pci 0000:00:00.0: BAR 0: assigned [mem 0x10000000-0x1001ffff 64bit]
[    1.521450] pci 0000:00:00.0: BAR 6: assigned [mem 0x10020000-0x1002ffff pref]
[    1.608450] clocksource: Switched to clocksource MIPS
[    1.670035] NET: Registered protocol family 2
[    1.722982] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    1.806318] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    1.882305] TCP: Hash tables configured (established 1024 bind 1024)
[    1.958443] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    2.028225] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    2.103446] NET: Registered protocol family 1
[    2.300340] Crashlog allocated RAM at address 0x3f00000
[    2.364247] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    2.446274] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    2.516094] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    2.707379] io scheduler noop registered
[    2.754259] io scheduler deadline registered (default)
[    2.816014] ar7200-usb-phy usb-phy: phy reset is missing
[    2.881823] pinctrl-single 1804002c.pinmux: 544 pins at pa b804002c size 68
[    2.966287] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    3.043089] console [ttyS0] disabled
[    3.085849] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 8, base_baud = 2500000) is a 16550A
[    3.188865] console [ttyS0] enabled
[    3.188865] console [ttyS0] enabled
[    3.272140] bootconsole [early0] disabled
[    3.272140] bootconsole [early0] disabled
[    3.374357] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    3.432804] 4 fixed-partitions partitions found on MTD device spi0.0
[    3.508848] Creating 4 MTD partitions on "spi0.0":
[    3.566162] 0x000000000000-0x000000020000 : "u-boot"
[    3.626378] 0x000000020000-0x000000030000 : "config"
[    3.686578] 0x000000030000-0x000000040000 : "art"
[    3.743685] 0x000000040000-0x000000800000 : "firmware"
[    3.815441] libphy: Fixed MDIO Bus: probed
[    4.198843] libphy: ag71xx_mdio: probed
[    4.269060] switch0: Atheros AR8327 rev. 2 switch registered on mdio-bus.0
[    5.339627] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:00 [uid=004dd033, driver=Atheros AR8216/AR8236/AR8316]
[    5.468284] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII
[    5.543217] NET: Registered protocol family 10
[    5.600101] Segment Routing with IPv6
[    5.644018] NET: Registered protocol family 17
[    5.697546] 8021q: 802.1Q VLAN Support v1.8
[    5.785804] Freeing unused kernel memory: 7388K
[    5.840025] This architecture does not have kernel memory protection.
[    5.930905] init: Console is alive
[    5.971841] init: - watchdog -
[    6.030723] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    6.123663] usbcore: registered new interface driver usbfs
[    6.189368] usbcore: registered new interface driver hub
[    6.253005] usbcore: registered new device driver usb
[    6.319590] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    6.399570] ehci-platform: EHCI generic platform driver
[    6.462375] ehci-platform 1b000000.usb: EHCI Host Controller
[    6.530073] random: fast init done
[    6.570750] ehci-platform 1b000000.usb: new USB bus registered, assigned bus number 1
[    6.664514] ehci-platform 1b000000.usb: irq 3, io mem 0x1b000000
[    6.758495] ehci-platform 1b000000.usb: USB 2.0 started, EHCI 1.00
[    6.833315] hub 1-0:1.0: USB hub found
[    6.878687] hub 1-0:1.0: 1 port detected
[    6.927290] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    7.024142] init: - preinit -
[    7.280452] random: jshn: uninitialized urandom read (4 bytes read)
[    7.355499] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    7.532818] random: jshn: uninitialized urandom read (4 bytes read)
[    7.719998] random: procd: uninitialized urandom read (4 bytes read)
[    7.796514] hub 1-1:1.0: USB hub found
[    7.888507] hub 1-1:1.0: 4 ports detected
[    8.346202] urandom_read: 4 callbacks suppressed
[    8.346211] random: jshn: uninitialized urandom read (4 bytes read)
[    9.246228] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    9.316149] IPv6: ADDRCONF(NETDEV_UP): eth0.1: link is not ready
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[   10.449727] eth0: link up (1000Mbps/Full duplex)
[   10.506490] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   10.585993] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.1: link becomes ready
[   12.652929] eth0: link down
[   12.705676] procd: - early -
[   12.740566] procd: - watchdog -
[   13.324351] procd: - watchdog -
[   13.362290] procd: - ubus -
[   13.402733] random: ubusd: uninitialized urandom read (4 bytes read)
[   13.479935] random: ubusd: uninitialized urandom read (4 bytes read)
[   13.557580] procd: - init -
Please press Enter to activate this console.
[   13.782902] kmodloader: loading kernel modules from /etc/modules.d/*
[   13.863171] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   13.938767] Loading modules backported from Linux version v4.19.7-0-g61c68f2a2af0
[   14.028285] Backport generated by backports.git v4.19.7-1-0-g148b072d
[   14.108369] ip_tables: (C) 2000-2006 Netfilter Core Team
[   14.180574] nf_conntrack version 0.5.0 (2048 buckets, 8192 max)
[   14.309214] xt_time: kernel timezone is -0000
[   14.417245] PPP generic driver version 2.4.2
[   14.470953] NET: Registered protocol family 24
[   14.584127] ieee80211 phy0: Atheros AR9340 Rev:1 mem=0xb8100000, irq=11
[   14.667515] ath9k 0000:00:00.0: Direct firmware load for ath9k-eeprom-pci-0000:00:00.0.bin failed with error -2
[   14.788328] ath9k 0000:00:00.0: Falling back to user helper
[   15.282941] ieee80211 phy1: Atheros AR9300 Rev:3 mem=0xb0000000, irq=13
[   15.468873] kmodloader: done loading kernel modules from /etc/modules.d/*
[   27.342735] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   27.413930] eth0: link up (1000Mbps/Full duplex)
[   27.610014] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   27.718839] br-lan: port 1(eth0.1) entered blocking state
[   27.783432] br-lan: port 1(eth0.1) entered disabled state
[   27.848326] device eth0.1 entered promiscuous mode
[   27.905619] device eth0 entered promiscuous mode
[   28.289885] br-lan: port 1(eth0.1) entered blocking state
[   28.354492] br-lan: port 1(eth0.1) entered forwarding state
[   28.421318] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   28.493681] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
U-Bootからブートした場合 (WG600HP):
***************************************
*     U-Boot 1.1.4-e3a51521-clean     *
*          Build: 2019-02-02          *
***************************************</a>

<a style="font-size:10.5pt;">  BOARD: NEC Aterm WG600HP
SOC: AR9344 rev. 1
CPU: MIPS 74Kc
RAM: 128 MB DDR2 32-bit CL3-4-4-10
FLASH: 8 MB Macronix MX25L64
PCIe: 168C:0030
MAC: A4:12:42:78:82:A0
CLOCKS: CPU/RAM/AHB/SPI/REF
550/400/200/ 25/ 40 MHz</a>

<a style="font-size:10.5pt;">Hit any key to stop booting:  0

Booting image from 0x9F040000...

Image name:    MIPS OpenWrt Linux-4.14.98
Build date:    2019-02-12 09:20:07 UTC
Architecture:  MIPS
OS/image type: Linux Kernel
Compression:   LZMA
Data size:     1.3 MB (1380277 bytes)
Load address:  0x80060000
Entry point:   0x80060000

Header CRC...  OK!
Data CRC...    skipped

Uncompressing Kernel... OK!
Starting kernel...

</a><a style="font-size:10.5pt;"></a><a style="font-size:10.5pt;">[    0.000000] Linux version 4.14.98 (musashino205@Taiha.Net) (gcc version 7.4.0 (OpenWrt GCC 7.4.0 r0+9245-e163387b7a)) #0 Tue Feb 12 09:20:07 2019
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[    0.000000] MIPS: machine is NEC Aterm WG600HP
[    0.000000] SoC: Atheros AR9344 rev 1
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 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-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] random: get_random_bytes called from 0x8045b72c with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,9600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 123956K/131072K available (3457K kernel code, 139K rwdata, 472K rodata, 1236K init, 195K bss, 7116K 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: 550.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6950037990 ns
[    0.000011] sched_clock: 32 bits at 275MHz, resolution 3ns, wraps every 7809031678ns
[    0.092712] Calibrating delay loop... 274.02 BogoMIPS (lpj=1370112)
[    0.237623] pid_max: default: 32768 minimum: 301
[    0.293072] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.372218] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.461567] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.579209] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.652168] pinctrl core: initialized pinctrl subsystem
[    0.715672] NET: Registered protocol family 16
[    0.769557] Can't analyze schedule() prologue at 803bc13c
[    0.836521] PCI host bridge /ahb/apb/pcie-controller@180c0000 ranges:
[    0.913578]  MEM 0x0000000010000000..0x0000000013ffffff
[    0.976032]   IO 0x0000000000000000..0x0000000000000000
[    1.059869] PCI host bridge to bus 0000:00
[    1.108890] pci_bus 0000:00: root bus resource [mem 0x10000000-0x13ffffff]
[    1.191103] pci_bus 0000:00: root bus resource [io  0x0000]
[    1.257767] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    1.338990] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    1.434287] pci 0000:00:00.0: BAR 0: assigned [mem 0x10000000-0x1001ffff 64bit]
[    1.521766] pci 0000:00:00.0: BAR 6: assigned [mem 0x10020000-0x1002ffff pref]
[    1.608789] clocksource: Switched to clocksource MIPS
[    1.670391] NET: Registered protocol family 2
[    1.723344] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    1.806632] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    1.882620] TCP: Hash tables configured (established 1024 bind 1024)
[    1.958769] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    2.028644] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    2.103896] NET: Registered protocol family 1
[    2.161650] Crashlog allocated RAM at address 0x3f00000
[    2.225564] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    2.307950] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    2.377782] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    2.504166] io scheduler noop registered
[    2.551041] io scheduler deadline registered (default)
[    2.612888] ar7200-usb-phy usb-phy: phy reset is missing
[    2.678741] pinctrl-single 1804002c.pinmux: 544 pins at pa b804002c size 68
[    2.763263] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    2.840106] console [ttyS0] disabled
[    2.882948] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 8, base_baud = 2500000) is a 16550A
[    2.985961] console [ttyS0] enabled
[    2.985961] console [ttyS0] enabled
[    3.069241] bootconsole [early0] disabled
[    3.069241] bootconsole [early0] disabled
[    3.171887] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    3.230321] 4 fixed-partitions partitions found on MTD device spi0.0
[    3.306365] Creating 4 MTD partitions on "spi0.0":
[    3.363678] 0x000000000000-0x000000020000 : "u-boot"
[    3.423951] 0x000000020000-0x000000030000 : "config"
[    3.484152] 0x000000030000-0x000000040000 : "art"
[    3.541234] 0x000000040000-0x000000800000 : "firmware"
[    3.606934] 2 uimage-fw partitions found on MTD device firmware
[    3.677784] Creating 2 MTD partitions on "firmware":
[    3.737150] 0x000000000000-0x000000160000 : "kernel"
[    3.797320] 0x000000160000-0x0000007c0000 : "rootfs"
[    3.857539] mtd: device 5 (rootfs) set to be root filesystem
[    3.925338] 1 squashfs-split partitions found on MTD device rootfs
[    3.999224] 0x000000610000-0x0000007c0000 : "rootfs_data"
[    4.065306] libphy: Fixed MDIO Bus: probed
[    4.449189] libphy: ag71xx_mdio: probed
[    4.497959] switch0: Atheros AR8327 rev. 4 switch registered on mdio-bus.0
[    5.569973] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:00 [uid=004dd034, driver=Atheros AR8216/AR8236/AR8316]
[    5.698668] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII
[    5.773656] NET: Registered protocol family 10
[    5.830763] Segment Routing with IPv6
[    5.874702] NET: Registered protocol family 17
[    5.928245] 8021q: 802.1Q VLAN Support v1.8
[    5.987338] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    6.078169] Freeing unused kernel memory: 1236K
[    6.132375] This architecture does not have kernel memory protection.
[    6.598803] random: fast init done
[    7.762528] init: Console is alive
[    7.803499] init: - watchdog -
[    9.924106] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[   10.590050] usbcore: registered new interface driver usbfs
[   10.655745] usbcore: registered new interface driver hub
[   10.719394] usbcore: registered new device driver usb
[   10.819504] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   10.907647] SCSI subsystem initialized
[   10.958023] ehci-platform: EHCI generic platform driver
[   11.020812] ehci-platform 1b000000.usb: EHCI Host Controller
[   11.088542] ehci-platform 1b000000.usb: new USB bus registered, assigned bus number 1
[   11.182285] ehci-platform 1b000000.usb: irq 3, io mem 0x1b000000
[   11.278839] ehci-platform 1b000000.usb: USB 2.0 started, EHCI 1.00
[   11.353723] hub 1-0:1.0: USB hub found
[   11.399032] hub 1-0:1.0: 1 port detected
[   11.452095] usbcore: registered new interface driver usb-storage
[   11.524713] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[   11.621582] init: - preinit -
[   12.848544] random: jshn: uninitialized urandom read (4 bytes read)
[   13.373844] random: jshn: uninitialized urandom read (4 bytes read)
[   13.725277] random: jshn: uninitialized urandom read (4 bytes read)
[   13.862027] random: jshn: uninitialized urandom read (4 bytes read)
[   14.030600] random: jshn: uninitialized urandom read (4 bytes read)
[   14.164776] random: jshn: uninitialized urandom read (4 bytes read)
[   16.577351] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   16.647212] IPv6: ADDRCONF(NETDEV_UP): eth0.1: link is not ready
Press the [f] ke[   16.801492] urandom_read: 1 callbacks suppressed
y and hit [enter[   16.801501] random: procd: uninitialized urandom read (4 bytes read)
] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[   17.730072] eth0: link up (1000Mbps/Full duplex)
[   17.785330] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   17.863188] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.1: link becomes ready
[   20.661100] mount_root: loading kmods from internal overlay
[   20.772284] kmodloader: loading kernel modules from //etc/modules-boot.d/*
[   20.855793] kmodloader: done loading kernel modules from //etc/modules-boot.d/*
[   21.139795] jffs2: notice: (425) jffs2_build_xattr_subsystem: complete building xattr subsystem, 3 of xdatum (2 unchecked, 1 orphan) and 14 of xref (1 dead, 0 orphan) found.
[   21.325616] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
[   21.411599] block: extroot: not configured
[   21.506293] jffs2: notice: (423) jffs2_build_xattr_subsystem: complete building xattr subsystem, 3 of xdatum (2 unchecked, 1 orphan) and 14 of xref (1 dead, 0 orphan) found.
[   21.692736] mount_root: loading kmods from internal overlay
[   21.796964] kmodloader: loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
[   21.900191] kmodloader: done loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
[   22.159934] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
[   22.244415] block: extroot: not configured
[   22.294457] mount_root: switching to jffs2 overlay
[   22.391443] overlayfs: upper fs does not support tmpfile.
[   22.461972] urandom-seed: Seeding with /etc/urandom.seed
[   22.563402] eth0: link down
[   22.617035] procd: - early -
[   22.652531] procd: - watchdog -
[   23.619803] procd: - watchdog -
[   23.689236] procd: - ubus -
[   24.097751] random: ubusd: uninitialized urandom read (4 bytes read)
[   24.177267] random: ubusd: uninitialized urandom read (4 bytes read)
[   24.255722] procd: - init -
Please press Enter to activate this console.
[   25.025471] kmodloader: loading kernel modules from /etc/modules.d/*
[   25.151113] nat46: module (version 683fbd2b765506332a1af141545652bf58f03166) loaded.
[   25.343410] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   25.433422] Loading modules backported from Linux version v4.19.7-0-g61c68f2a2af0
[   25.522997] Backport generated by backports.git v4.19.7-1-0-g148b072d
[   25.606751] ip_tables: (C) 2000-2006 Netfilter Core Team
[   25.682536] nf_conntrack version 0.5.0 (2048 buckets, 8192 max)
[   25.812843] usbcore: registered new interface driver ums-alauda
[   25.889802] usbcore: registered new interface driver ums-cypress
[   25.963941] usbcore: registered new interface driver ums-datafab
[   26.037910] usbcore: registered new interface driver ums-freecom
[   26.112025] usbcore: registered new interface driver ums-isd200
[   26.185170] usbcore: registered new interface driver ums-jumpshot
[   26.260236] usbcore: registered new interface driver ums-karma
[   26.332731] usbcore: registered new interface driver ums-sddr09
[   26.405878] usbcore: registered new interface driver ums-sddr55
[   26.479368] usbcore: registered new interface driver ums-usbat
[   26.579778] xt_time: kernel timezone is -0000
[   26.704024] PPP generic driver version 2.4.2
[   26.758002] NET: Registered protocol family 24
[   26.879037] ieee80211 phy0: Atheros AR9340 Rev:1 mem=0xb8100000, irq=11
[   26.958594] PCI: Enabling device 0000:00:00.0 (0000 -&gt; 0002)
[   27.423435] ieee80211 phy1: Atheros AR9300 Rev:3 mem=0xb0000000, irq=13
[   27.512366] kmodloader: done loading kernel modules from /etc/modules.d/*
[   27.888906] usb 1-1: new high-speed USB device number 2 using ehci-platform
[   28.601180] hub 1-1:1.0: USB hub found
[   28.702532] hub 1-1:1.0: 4 ports detected
[   46.999933] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   47.071071] eth0: link up (1000Mbps/Full duplex)
[   47.281229] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   47.709221] br-lan: port 1(eth0.1) entered blocking state
[   47.773800] br-lan: port 1(eth0.1) entered disabled state
[   47.838704] device eth0.1 entered promiscuous mode
[   47.895993] device eth0 entered promiscuous mode
[   48.033781] br-lan: port 1(eth0.1) entered blocking state
[   48.098385] br-lan: port 1(eth0.1) entered forwarding state
[   48.165350] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   49.089009] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
213行目でphy1 (ath9k, AR938x)が認識された後のタイミングでHubが認識されている。本来は150行目周辺で認識されるべき。 もしUSBストレージをマウントしていたり、何らかのデバイスを接続したまま再起動を挟む場合何らかのトラブルが発生する恐れが多分にあり、問題。 しかしながらath9kドライバのロードされるタイミングが遅い関係上OpenWrt内ではどうしようもなく、U-Boot内で対処する必要が出てくる。ただ、PCI (PCIe)周りの知識は殊更に皆無で、今のところ対処方法は全く以て不明。

今後

現状USBポート以外の機能はほぼ全て正常に動作するため、今現在抱えている他の一般的なLinuxベースのファームを搭載する機種のPRが片付いたらAtermのPRを試して、U-Bootの書き換えが必要ながらOpenWrtへ取り込んでもらえないか試してみる。
しかしながら、残りのUSBの問題について、それ以降も対処法を探っていく形になる。現状、前述の通りPCIeについては知識が不足しすぎており、どう扱えばGPIOのコントロールをU-Bootで行うことができるのかが全く不明。
少しずつこれらの機種以外も触りつつ知識を付けて、試行錯誤していく形になりそう。