RTL838xのサーマルメータと割り込み

RTL838xではSoC内にサーマルメータが内蔵されていて、レジスタを読み取ることで温度を知ることができる。1℃刻みと思われる。
このサーマルメータでは下限値と上限値を設定することができ、設定されたディレイ(恐らくms単位)毎の温度がもし設定された下限値を下回るか上限値を上回る場合は、割り込みを発生させるものと予想された。
RTL83xx/RTL93xxではSoCのレジスタには

  • SoC
  • Switch Core (swcore)

の2つのリージョンが存在しており、前者はGPIOやUART、WDTなどSoCとしてベーシックな機能が集まっている。後者はMACやPHYの他サーマルメータ等、スイッチングハブとして特化した機能が集まっている。

RTL83xxにおいては(RTL93xxはまだよく知らない)最上位の割り込みコントローラはMIPSのジェネリックなコントローラとなっており、それのみではピン数が足りないので上記のSoCリージョン内に既にLinux Kernelにドライバが有る(irq-realtek-rtl)割り込みコントローラが存在している。このコントローラ内に存在するビットの1つにswcoreがあり、どうもこれは上記Switch Core (swcore)リージョン側に存在する機能の割り込みをすべてまとめて出してくるビットである模様。

そしてSwitch Core (swcore)側にもその中の割り込みをとりまとめるコントローラが存在しているが、現状そちらのドライバは存在せず、このコントローラ内を構成する1つに過ぎないLink Change(RJ45ポートのリンクアップ/リンクダウン割り込み)のみが出て来、上位のSoCリージョン側のコントローラにあるswcoreビットに出て来るものとして扱っているようである。今のところサーマルメータのドライバは存在しないためにそれの割り込みも出て来るはずは無いので仕方無し。

その為、試しにサーマルメータを有効化して下限値を設定し下限値比較を有効にしたところ、下回った際に割り込みが発生したと思われるが、SoCリージョン側ではLink Changeとして検出してしまい、本来のサーマルメータの割り込みのstateをどうやっても解除できないために連続して大量にLink Change割り込みスレッドが呼ばれたうえで、WDTか何かによってLinux Kernelがリセットされ再起動された。
2022/01/14追記: 大量のログに埋もれて見逃していたが、WDTによってリセットされていた。

...(大量の同じログ)...
[81273.840209] RTL8380 Link change: status: 2000, ports 0
[81273.845971] RTL8380 Link change: status: 2000, ports 0
[81273.851792] RTL8380 Link change: status: 2000, ports 0
[81273.857552] RTL8380 Link change: status: 2000, ports 0
[81273.863373] RTL8380 Link change: statu

U-Boot Version 2.2.1 (Jan 18 2019 - 16:25:47)

Board: RTL838x CPU:500MHz LXB:200MHz MEM:300MHz
DRAM:  128 MB
SPI-F: 1x16 MB
Loading 65536B env. variables from offset 0x80000
Switch Model: BSH-G24MB (Port Count: 24)
Switch Chip: RTL8382M
####VERSION IS NEW ####
###START LED SETTING ###
**************************************************
#### RTL8218B config - MAC ID = 0 ####
Now External 8218B
**************************************************
#### RTL8218B config - MAC ID = 8 ####
Now Internal PHY
**************************************************
#### RTL8218B config - MAC ID = 16 ####
Now External 8218B

####-PHY POWER OFF-####

####-PHY POWER OFF-####
Net:   Net Initialization Skipped
rtl8380#0
Hit any key to stop autoboot:  0

本来Link changeログの ports はポート番号とビットの対応する形で値が現れるが、割り込みを発生させているのはLink changeではなくサーマルメータである為に、該当するポートが無くビットが立たず、0となっている。

RTL838x, RTL839x MODEL_NAME_INFO

Switch-M24eG PN28240KとSwitch-M48eG PN28480Kから取ったもの

# Switch-M24eG PN28240K

root@OpenWrt:/# devmem 0x1b0000d4 32
0x83826800
root@OpenWrt:/# devmem 0x1b0000d8 32
0x00000000
root@OpenWrt:/# devmem 0x1b000058 32 3
root@OpenWrt:/# devmem 0x1b0000d8 32 0xa0000000
root@OpenWrt:/# devmem 0x1b0000d8 32
0xA0036275

# Switch-M48eG PN28480K

root@OpenWrt:/# devmem 0x1b000ff0 32
0x83936802
root@OpenWrt:/# devmem 0x1b000ff4 32
0xA0016290
OpenWrtのrealtek targetについて

OpenWrtのrealtek targetについて

これは A:don:vent Calender こと「mstdn.maud.io Advent Calender 2021」11日目の記事です。
先週土曜日くらいまで危うく忘れかけてた

前回2020年はその年に買ったものを挙げましたが、今回は趣向を変えてOpenWrtにおける realtek target” について書いてみることにします。
前置きが長いので、本題から入りたい人は飛ばしてください

そのスイッチングハブ、何のチップが入っているかご存じですか

まず、ざっくりとスイッチングハブがどういう構成になっているかだけ書いておく。
世の中には

  • アンマネージド(ノンインテリジェント)
  • マネージド(インテリジェント)

の2つに大別されるスイッチングハブがあり、他にアンマネージドプラスとかあったりもするが、ここではマネージドにざっくり分類することとする。

アンマネージドスイッチ

ざっくりと言ってしまえば、管理機能が無く、ユーザーによる詳細な設定が不要な(できない)スイッチングハブ。
基板上の回路構成によりハードウェアの設定が自動的に行われるほか、ポートの取り扱いなどの構成情報も内部に存在するスイッチングハブチップが外部フラッシュメモリから直接読み出してそのまま適用する為、ユーザーが設定する余地は(ほぼ)無し。
できるとすれば、ループ検出機能のON/OFFくらい。

マネージドスイッチ

これもざっくり言ってしまえば、管理機能が付いていて、特に設定しなくても(大抵は)単純なスイッチングハブとして使えるものの、追加で設定することにより様々な機能が利用できるもの。
こちらの場合、大抵はスイッチングハブのチップに加えてSoCが搭載されたり、あるいはスイッチングハブ機能を持ったSoCを搭載している。
ハードウェアの構成を行うのは比較的SoCの割合が高く、また、CPUが存在することからユーザーの設定を受け付けてそれをポートの取り扱いに反映させることが可能となっている。

スイッチングハブに使われるチップ類

機種によって千差万別。ただし、上に挙げたマネージドスイッチの場合において、SoCとスイッチングハブチップの両方を搭載する場合は、SoCのベンダがスイッチングハブチップを作っていれば同じベンダで組み合わせるのが一般的。
主に(筆者が把握している範囲では)

  • Broadcom
  • Marvell
  • Realtek
  • Vitesse

などがスイッチングハブ向けSoCやスイッチングハブチップを製造している。スイッチングハブチップに限ればAtheros (Qualcomm Atheros)もあったりするが、Atherosは製品としてのスイッチングハブでの採用例は把握していないのでここでは除外。

余談: アンマネージドスイッチングハブに使用されるチップもそれ自体はVLAN等をサポートしていることが多く、海外にはアンマネージドスイッチングハブで制御用の信号線にアクセスして、VLANなどの設定を流し込めるようにしてしまった猛者もいる模様。

各スイッチングハブでの搭載チップベンダ

把握している中での例を挙げていく。ひとまずSoCを。

  • Allied Telesis x510シリーズ: Broadcom BCM53003系列 (ARM)
  • FXC FXC5010B: Vitesse VSC7390 (?)
  • FXC FXC5126: Broadcom BCM5621x系列 (MIPS)
  • Panasonic Switch-M24eG PN28240K: Realtek RTL8382M (MIPS)
  • Panasonic ZEQUO 4500DL: Marvell AlleyCat3系列 (ARM)

例 (Panasonic Switch-M24eG PN28240K):

  • RTL8382M: SoC, CPU -> MIPS 4KEc 500MHz, TP 8ポート
  • RTL8218B: SWハブ, TP 8ポート
  • RTL8218FB: SWハブ, TP 4ポート + TP/SFP 4ポート(コンボ)
    (Switch-M24eGでは2ポートのみTP/SFPで共用)

その他は wiki.taiha.net を参照。海外機については、realtek機中心であるものの models [Switches] や、全般的にはWikiDevi系サイトにいくつか掲載されている。

前置きが長くなったが、上に挙げた中でSwitch-M24eG PN28240Kの搭載するRealtek SoCが今回の主役(であるRealtek系機種)。

OpenWrtにおけるrealtek target

OpenWrtではベンダやSoCの系統で分類したものを “target” と称しており、今現在OpenWrtのmasterに存在する “realtek” targetは源流を “rtl838x” targetとするもので、早い話スイッチングハブ向けSoC用のtargetということ。
無線機向けのRealtek SoCにも今後このtargetで動かせる可能性が無いことも無いモノは存在しているものの、現時点では入ってくる予定などは無し。

realtek targetにのめり込むまでの経緯

OpenWrt Forumに突如「スイッチングハブでOpenWrt動かしてみた」が降ってくる
面白すぎるでしょ
Support for RTL838x based managed switches – For Developers – OpenWrt Forum
突如としてOpenWrt Forumに立てられたトピック。それまでRealtek SoCを搭載する無線機で動かしてみたというものはたまに立てられたり浮上してきたりということはあったものの、スイッチングハブは完全に意識の外だった。引き寄せられないはずが無かった
ベースにしているコードもOpenWrtの最新に近く、DeviceTreeでおおよそ構成できるようになっており、プラットフォームのサポートとしても、それまでたまに出てくることがあった無線機向けRealtek SoCのサポートと比べて上々。
短期間一緒にコードの改善作業をする
偶然にも、それ以前にrtl838xとは全く別件でハードオフで確保していたAML2-17GPがこれに該当するプラットフォームであることに気付き、早速トピックを立てた方のコードを利用してビルド。無事ブートして動作した。
「AML2-17GPで動かしてみたよ」というのを投稿した後、色々あって少しの間一緒にコードの改善作業をすることになり、大体以下のようなことをした。

  • Linux Kernelにおける変更をファイルの上書きからpatchへの変換
  • Kernelのオプションが多重になっていて冗長な個所をシンプル化
  • OpenWrt内でLinux Kernel 4.19から5.4への移行が進んでいた為、4.19をベースにしていたrtl838x targetのコードを5.4へ移行
トピックの様子を静観
諸事情があって一緒のコード改善作業を終わりにした後は、しばらくトピックの様子を静観していた。
それまでの無線機向けサポートと比べてコードの状態は上々ではあるものの、Linux Kernelにはサポートが無いSoCであり、OpenWrt側でプラットフォームサポートのコードを全て抱えることから、OpenWrtにマージされるかは正直わからなかった。その為、この時期はAML2-17GPもしっかりした調整は手を止めていた。
rtl838x target、マージされる
そんなこんなで若干不安視していたのは杞憂に終わり、rtl838x targetはめでたくOpenWrtにマージ。OpenWrtチームメンバーも何人かはだいぶ興味を持っているようで、PoE制御の為のユーティリティがMLに投稿されるなどしている。
マージされたことでデバイスサポートもOpenWrt公式でマージされるようになったため、ここで一気にモチベーションが爆上がりした。
この後、OpenWrt内でドライバ類が書き直されたり、最初にトピックを立てた方やその他の方などによってついにはOpenWrtの上流に位置するLinux KernelにもSoCサポートやいくつかのドライバが投げ込まれ、マージされている。
その間、個人的には中断したAML2-17GPのサポート作業を進めたり、このtargetでサポートできるスイッチングハブを探し始めたりした。

なお、rtl838x targetは後に “realtek” targetへと改名された。

これまでにrealtek targetで私がやったこと

記事執筆時点で、以下をやった。

  • INABA Abaniact AML2-17GPのサポート追加
  • realtek targetへのLinux Kernel 5.10サポート追加

AML2-17GPについては、上で書いた通りごく初期にコードを書いてしばらく中断していたため、最新のコードに合わせ調整して投げ込んでマージ。
Kernel 5.10のサポート追加については、OpenWrtに全体として5.10サポートが追加された少し後に個人的なものとして始め、Forumの上で挙げたトピックに進捗を書いたり、あるいは躓いたところを聞いてみるなどして進め、一点気になる箇所はあったものの無事マージ。その後しばらくしてtargetのKernelバージョンも5.10へ切り替えられた。

現在realtek targetでやっていること

これも記事執筆時点。

  • 機種サポート追加
    • APRESIA ApresiaLightGS120GT-SS
    • I-O DATA BSH-G24MB
    • Panasonic Switch-M8eG PN28080K
      Switch-M24eG PN28240K
      Switch-M48eG PN28480K
  • realtek targetへのLinux Kernel 5.15サポート追加

機種サポートについては、ぶっちゃけ興味があまりにも先走りすぎてしまい、ヤフオクで落札したりメルカリで確保したり、APRESIA機に至っては中古でほとんど出てこないので、新品を購入。
Switch-M24eG PN28240KとSwitch-M48eG PN28480KはSFPポートの為にRTL8218FBを搭載するものの、現在OpenWrt内に存在するドライバではサポートされておらずTPポートしか機能しない状態の為、チップのサポート追加を試行中。TP/SFPを切り替えて大体問題無く通信できる状態まで到達した。Switch-M16eG PN28160Kは中古価格が高くなりがちなので見送り中。

Linux Kernel 5.10のサポート追加が完了して一息ついていたら、あまり経たずにOpenWrt全体へ5.15サポートを追加するPRがオープンされた。プロジェクトとしては、次のリリースに5.10を使用することは決定事項であることからそのPRは次期メジャーバージョンがリリースされるまでマージされないものの、興味があったのでそのPRを利用してrealtek targetへの5.15サポート追加にトライ中。
ネットワーク周りの変更が(特にDSAサブシステム)5.10から5.15の間で大きい為、現状そこが上手く動かないほか、Switch-M8eGで不可解なトラブルが起きることを確認。


上から

  • AML2-17GP
  • BSH-G24MB
  • Switch-M8eG PN28080K
  • Switch-M24eG PN28240K
  • Switch-M48eG PN28480K

  • ApresiaLightGS120GT-SS

今後realtek targetでやること/やりそうなこと/やりたいこと

  • SoCとしてRTL839xを搭載する機種のCPUにおけるマルチスレッディング周り
  • Kernel 5.15サポート追加に際してのネットワーク周り修正
  • 国内メーカーPoE機のサポート追加

現在realtek targetに存在する機種は全てがRTL838x SoCを搭載するもののみで、マルチスレッディングに対応し見かけ上2コアを使用できるRTL839xを搭載するものや、10Gbps対応機に使用されるRTL93xxを搭載するものはまだ無い。
その為、今後上のトピックを立てた人を中心にRTL839xやRTL93xxでのマルチスレッディング対応が進められるが、それについても個人的に学習も兼ねて探ってみたい。
ちなみに、Panasonic Switch-M48eG PN28480KにはRTL839xファミリーのRTL8393Mが搭載されている。

Kernel 5.15についてはまだ猶予が十分すぎるほど存在するので、ひとまずゆっくりとDSAやドライバのコードを読み込みつつ、問題を洗い出し必要なら詳しい方に聞いて修正を進める。

既に非PoE機は複数所有しているもののPoE機は一台も無く、Kernel 5.10へのバージョン引き上げの際PoEに関連する点に気付かず、PRでコメントを受けて確認して不足に気付くなどした。もし今後可能なら、PoE機も確保することを思案中。

まとめ

とにもかくにも、スイッチングハブでOpenWrtが動くというのがあまりにも新鮮で、なおかつMediaTekやQualcomm AtherosなどのSoCとは異なり現在進行形でプラットフォームサポートの構築が進んでいる状況なので、組込ハードとLinux Kernelの両面について理解を深めるのに丁度良く、楽しみながら参加中。
スイッチングハブ内部でどのチップがどう接続されているかというのを探ったり、Kernelバージョンの引き上げ作業を通して実際に知識が付いてきているのは実感していて、以前できなかったことが時間を経てできるようになったり、多少のヒントがあれば筋道を思いつくようになるなどしていて、とても楽しい。
まだまだ興味冷めやらず、時間を作りながら参加していきたいところ。

「mstdn.maud.io Advent Calender 2021」、次の12日目は kozue 氏です。

Switch-M*eG PN28xx0K GPIO/IRQメモ

何故かPCA9539のINTではなくフロントのボタンがPCA9545のINT0(割込入力0)にも接続されている

Switch-M8eG PN28080K

led-mode (BTN) --+-- PCA9539 (IO1_7) -> PCA9539 (SDA/SCL) -- RTL8380M (GPIO1/GPIO0)
                 |                      PCA9539 (INT) ------ X (none)
                 |
                 +-- PCA9545 (INT0)  -> PCA9545 (INT) ---+-- RTL8380M (GPIO2)
                                                         |
                                        PCA9555 (INT) ---+

Switch-M24eG PN28240K

led-mode (BTN) --+-- PCA9539 (IO1_7) -> PCA9539 (SDA/SCL) -- RTL8382M (GPIO1/GPIO0)
                 |                      PCA9539 (INT) ------ X (none)
                 |
                 +-- PCA9545 (INT0)  -> PCA9545 (INT) ------ RTL8382M (GPIO2)

                                        PCA9555 (INT) ------ X (none)

Switch-M48eG PN28480K

led-mode (BTN) --+-- PCA9539 (IO1_7) -> PCA9539 (SDA/SCL) -- RTL8393M (GPIO17/GPIO16)
                 |                      PCA9539 (INT) ------ X (none)
                 |
                 +-- PCA9545 (INT0)  -> PCA9545 (INT) ------ RTL8393M (GPIO18)
 
                                        PCA9555 (INT) ------ X (none)

FutureNet NXR-G100メモ

  • D-Sub 9ピンのコンソールポート (SERIAL 0) はSoCのUART1に、RJ45のコンソールポート (SERIAL 1) はSoCのUART0に接続されている
  • D-Sub 9ピンのコンソールポートはDIPスイッチ左から3列目の上下に関わらず有効
  • RJ45のコンソールポートはCiscoケーブルとは非互換のピン配列(たぶん)
    RJ45 (SERIAL 1)
    1 (GND)
    2 (CTS)
    3 (?)
    4 (RXD)
    5 (TXD)
    6 (RTS)
    7 (?)
    8 (?)
  • RJ45を担当しているTI MAX3243Eのピン割り当ては以下の通り(一部制御系ピンは現状不明)nxr-g100_con-rj45-max3243e
  • 基板表面のコネクタは日本圧着端子製造のSHDコネクタと思われる。何が出ているかは不明

WRC-X3200GST3 stock -> OpenWrt(non-UBI)

RootFSにUBIを使用しない構成の場合

[ 2528.639914] IDPfw: Exit IDPfw
[ 2528.643092] mod epilog takes 0 jiffies
[ 2528.646865] IDPfw: Exit IDPfw
[ 2528.667556] Exit chrdev /dev/idpfw with major 191
[ 2528.695567] Exit chrdev /dev/detector with major 190
XXX Begin firmware upgrade..., size(8519775)
dump: [4D 54 37 36 32 32 5F 45 4C 45 43 4F 4D 5F 57 52 43 2D 58 33 32 30 30 47 53 54 33 ]
check_hw_id_from_last_len = 27
image hw id [MT7622_ELECOM_WRC-X3200GST3]
sys_fw_hwid [MT7622_ELECOM_WRC-X3200GST3]
dump: [4D 54 37 36 32 32 5F 45 4C 45 43 4F 4D 5F 57 52 43 2D 58 33 32 30 30 47 53 54 33 ]
XX /sbin/sysupgrade_md5.sh 8519684 /tmp/filecIssN2 XX
Done, reboot now
upgrade_allow: TRUE
allow upgrade, return count_down.html page.
XXXXXX update_firmware 375: return count_down.html
XXX sysupgrade_new -c /tmp/fw.bin 1>/dev/null XXX
[ 2535.161037] no net device found for eth0 or
[ 2535.167236] no net device found for ra1 or apcli0
[ 2535.176785] no net device found for ra2 or apcli0
[ 2535.194696] Set_HotSpot_OnOff ==> wdev[0] is already in [OFF] STATE , skip.
[ 2535.217980] no net device found for ra3 or apcli0
[ 2535.227106] no net device found for ra4 or apcli0
[ 2535.236063] no net device found for ra5 or apcli0
[ 2535.241637] no net device found for ra6 or apcli0
[ 2535.246772] no net device found for ra7 or apcli0
[ 2535.251605] no net device found for ra8 or apcli0
[ 2535.256330] no net device found for ra9 or apcli0
[ 2535.261042] no net device found for ra10 or apcli0
[ 2535.265845] no net device found for ra11 or apcli0
[ 2535.270642] no net device found for ra12 or apcli0
[ 2535.275441] no net device found for ra13 or apcli0
[ 2535.280244] no net device found for ra14 or apcli0
[ 2535.285044] no net device found for ra15 or apcli0
[ 2535.289895] no net device found for rai1 or apclii0
[ 2535.294781] no net device found for rai2 or apclii0
[ 2535.299662] no net device found for rai3 or apclii0
[ 2535.304550] no net device found for rai4 or apclii0
[ 2535.309435] no net device found for rai5 or apclii0
[ 2535.314320] no net device found for rai6 or apclii0
[ 2535.319210] no net device found for rai7 or apclii0
[ 2535.324136] no net device found for rai8 or apclii0
[ 2535.329029] no net device found for rai9 or apclii0
[ 2535.333915] no net device found for rai10 or apclii0
[ 2535.338886] no net device found for rai11 or apclii0
[ 2535.343859] no net device found for rai12 or apclii0
[ 2535.348829] no net device found for rai13 or apclii0
[ 2535.353802] no net device found for rai14 or apclii0
[ 2535.358773] no net device found for rai15 or apclii0
[ 2535.363746] no net device found for rax0 or apclix0
[ 2535.368632] no net device found for rax1 or apclix0
[ 2535.373518] no net device found for rax2 or apclix0
[ 2535.378400] no net device found for rax3 or apclix0
[ 2535.383286] no net device found for rax4 or apclix0
[ 2535.388166] no net device found for rax5 or apclix0
[ 2535.393102] no net device found for rax6 or apclix0
[ 2535.397989] no net device found for rax7 or apclix0
[ 2535.402868] no net device found for rax8 or apclix0
[ 2535.407754] no net device found for rax9 or apclix0
[ 2535.412633] no net device found for rax10 or apclix0
[ 2535.417606] no net device found for rax11 or apclix0
[ 2535.422573] no net device found for rax12 or apclix0
[ 2535.427546] no net device found for rax13 or apclix0
[ 2535.432515] no net device found for rax14 or apclix0
[ 2535.437486] no net device found for rax15 or apclix0
[ 2535.442454] no net device found for wlan0 or wlan-apcli0
[ 2535.447781] no net device found for apclix0
[ 2535.451967] no net device found for wlan-apcli0
Please press Enter to activate this console.
Please press Enter to activate this console.
dnsmasq
dnsmasq [br-lan]
[ 2540.391356] br-lan: port 1(eth0) entered disabled state
[ 2540.400019] device eth0 left promiscuous mode
[ 2540.406957] br-lan: port 1(eth0) entered disabled state
[ 2540.415424] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 2540.434125] br-lan: port 3(rai0) entered disabled state
[ 2540.439438] br-lan: port 2(ra0) entered disabled state
[ 2540.446851] device rai0 left promiscuous mode
[ 2540.451497] br-lan: port 3(rai0) entered disabled state
[ 2540.457019] device ra0 left promiscuous mode
[ 2540.461385] br-lan: port 2(ra0) entered disabled state
[ 2540.496031] mtk_soc_eth 1b100000.ethernet eth0: RX flow is programmed, LRO should keep on
[ 2540.504820] device eth0 entered promiscuous mode
[ 2540.515667] br-lan: port 1(eth0) entered forwarding state
[ 2540.521134] br-lan: port 1(eth0) entered forwarding state
[ 2540.796486] mtk_soc_eth 1b100000.ethernet: path gmac1_sgmii in set_mux_gdm1_to_gmac1_esw updated = 1
[ 2540.809031] mtk_soc_eth 1b100000.ethernet: mux mux_gmac2_gmac0_to_gephy isn't present on the SoC
[ 2540.829058] mtk_soc_eth 1b100000.ethernet: mux mux_u3_gmac2_to_qphy isn't present on the SoC
[ 2540.845738] mtk_soc_eth 1b100000.ethernet: path gmac1_sgmii in set_mux_gmac1_gmac2_to_sgmii_rgmii updated = 1
[ 2540.859046] mtk_soc_eth 1b100000.ethernet: mux mux_gmac12_to_gephy_sgmii isn't present on the SoC
[ 2540.873916] mtk_soc_eth 1b100000.ethernet: path gmac2_rgmii in set_mux_gdm1_to_gmac1_esw updated = 0
[ 2540.887211] mtk_soc_eth 1b100000.ethernet: mux mux_gmac2_gmac0_to_gephy isn't present on the SoC
[ 2540.902179] mtk_soc_eth 1b100000.ethernet: mux mux_u3_gmac2_to_qphy isn't present on the SoC
[ 2540.911766] mtk_soc_eth 1b100000.ethernet: path gmac2_rgmii in set_mux_gmac1_gmac2_to_sgmii_rgmii updated = 0
[ 2540.922566] mtk_soc_eth 1b100000.ethernet: mux mux_gmac12_to_gephy_sgmii isn't present on the SoC
[ 2541.175432] Device Instance
[ 2541.178945]  WDEV 00:, Name:ra0, Wdev(list) Idx:0
[ 2541.184506]           Idx:9
[ 2541.186699] extif_put_dev(ra0)
[ 2541.190621] mtk_ppe_dev_unregister_hook : ineterface ra0 set null (1)
[ 2541.198065]
[ 2541.200040]
[ 2541.201877]
[ 2541.203569]
[ 2541.205475]
[ 2541.207009]
[ 2541.209009]
[ 2541.210498]
[ 2541.211982]
[ 2541.213538]
[ 2541.215024]
[ 2541.218859]
[ 2541.220354]
[ 2541.221882]
[ 2541.223370]
[ 2541.300859] ra0: ===> main_virtual_if_close
[ 2541.306168] wifi_sys_linkdown(), wdev idx = 0
[ 2541.331960] bssUpdateBmcMngRate (BSS_INFO_BROADCAST_INFO), CmdBssInfoBmcRate.u2BcTransmit= 0, CmdBssInfoBmcRate.u2McTransmit = 0
[ 2541.380650] wifi_sys_close(), wdev idx = 0
[ 2541.387640] APStop(), oper(0) bssid(0)=04:ab:18:xx:xx:79
[ 2541.395334] wifi_sys_close(), wdev idx = 0
[ 2541.400316] ap_ftkd> Release FT KDP Module...
[ 2541.405500] <=== APStop()
[ 2541.417180] CmdReStartDLRsp: WiFI FW Download Success
[ 2541.423467] cut_through_token_list_destroy(): ffffffc01e3b3310,ffffffc01e3b3310
[ 2541.433522] cut_through_token_list_destroy(): ffffffc01e3b3330,ffffffc01e3b3330
[ 2541.750834] RTMP_AllTimerListRelease: Size=33
[ 2541.755200] RTMP_AllTimerListRelease: Cancel timer obj ffffff800ae66200!
[ 2541.762093] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x58/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2541.774441] RTMP_AllTimerListRelease: Cancel timer obj ffffff800ae66260!
[ 2541.781288] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x70/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2541.793632] RTMP_AllTimerListRelease: Cancel timer obj ffffff800ae6ee88!
[ 2541.800460] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x58/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2541.812887] RTMP_AllTimerListRelease: Cancel timer obj ffffff800ae6eee8!
[ 2541.819725] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x70/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2541.832072] RTMP_AllTimerListRelease: Cancel timer obj ffffff800ae77b10!
[ 2541.838900] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x58/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2541.851245] RTMP_AllTimerListRelease: Cancel timer obj ffffff800ae77b70!
[ 2541.858070] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x70/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2541.870414] RTMP_AllTimerListRelease: Cancel timer obj ffffff800ae80798!
[ 2541.877256] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x58/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2541.889604] RTMP_AllTimerListRelease: Cancel timer obj ffffff800ae807f8!
[ 2541.896429] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x70/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2541.908780] RTMP_AllTimerListRelease: Cancel timer obj ffffff800ae89420!
[ 2541.915669] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x58/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2541.928022] RTMP_AllTimerListRelease: Cancel timer obj ffffff800ae89480!
[ 2541.934863] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x70/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2541.947214] RTMP_AllTimerListRelease: Cancel timer obj ffffff800ae920a8!
[ 2541.954033] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x58/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2541.966382] RTMP_AllTimerListRelease: Cancel timer obj ffffff800ae92108!
[ 2541.973200] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x70/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2541.985553] RTMP_AllTimerListRelease: Cancel timer obj ffffff800ae9ad30!
[ 2541.992379] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x58/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2542.004729] RTMP_AllTimerListRelease: Cancel timer obj ffffff800ae9ad90!
[ 2542.011558] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x70/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2542.024012] RTMP_AllTimerListRelease: Cancel timer obj ffffff800aea39b8!
[ 2542.030921] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x58/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2542.043272] RTMP_AllTimerListRelease: Cancel timer obj ffffff800aea3a18!
[ 2542.050099] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x70/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2542.062449] RTMP_AllTimerListRelease: Cancel timer obj ffffff800aeac640!
[ 2542.069269] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x58/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2542.081619] RTMP_AllTimerListRelease: Cancel timer obj ffffff800aeac6a0!
[ 2542.088436] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x70/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2542.100794] RTMP_AllTimerListRelease: Cancel timer obj ffffff800aeb52c8!
[ 2542.107613] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x58/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2542.119962] RTMP_AllTimerListRelease: Cancel timer obj ffffff800aeb5328!
[ 2542.126831] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x70/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2542.139180] RTMP_AllTimerListRelease: Cancel timer obj ffffff800aebdf50!
[ 2542.146002] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x58/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2542.158356] RTMP_AllTimerListRelease: Cancel timer obj ffffff800aebdfb0!
[ 2542.165220] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x70/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2542.177572] RTMP_AllTimerListRelease: Cancel timer obj ffffff800aec6bd8!
[ 2542.184402] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x58/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2542.196756] RTMP_AllTimerListRelease: Cancel timer obj ffffff800aec6c38!
[ 2542.203588] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x70/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2542.215936] RTMP_AllTimerListRelease: Cancel timer obj ffffff800aecf860!
[ 2542.222762] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x58/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2542.235150] RTMP_AllTimerListRelease: Cancel timer obj ffffff800aecf8c0!
[ 2542.241979] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x70/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2542.254323] RTMP_AllTimerListRelease: Cancel timer obj ffffff800aed84e8!
[ 2542.261146] RTMP_AllTimerListRelease: Timer is allocated by RRM_CfgInit+0x58/0x128 [mt7622_mt_wifi],Valid:1,Lock:ffffff800b2ef600,State:0
[ 2542.273494] RTMP_AllTimerListRelease: Cancel timer obj ffffff800aed8548!

F0: 102B 0000
F6: 0000 0000
V0: 0000 0000 [0001]
00: 0000 0000
BP: 0000 0041 [0000]
G0: 0190 0000
T0: 0000 0369 [000F]
Jump to BL

UNIVPLL_CON0 = 0xFE000000!!!
mt_pll_init: Set pll frequency for 25M crystal
RAM_CONSOLE preloader last status: 0x0 0x0 0x0 0x0 0x0 0x0
[PMIC_WRAP]wrap_init pass,the return value=0.
[pmic_init] Preloader Start..................
[pmic_init] MT6380 CHIP Code, reg_val = 0, 1:E2  0:E3
[pmic_init] Done...................
Chip part number:7622B
MT7622 Version: 1.2.8, (iPA)
SSC OFF
mt_pll_post_init: mt_get_cpu_freq = 1350000Khz
mt_pll_post_init: mt_get_mem_freq = 1600000Khz
mt_pll_post_init: mt_get_bus_freq = 1119920Khz
[PLFM] Init I2C: OK(0)

[BLDR] Build Time: 20200518-110732
==== Dump RGU Reg ========
RGU MODE:     14
RGU LENGTH:   FFE0
RGU STA:      40000000
RGU INTERVAL: FFF
RGU SWSYSRST: 8000
==== Dump RGU Reg End ====
RGU: g_rgu_satus:2
mtk_wdt_mode_config  mode value=10, tmp:22000010
PL RGU RST: ??
SW reset with bypass power key flag
Find bypass powerkey flag
WDT NONRST=0x20000000
WDT IRQ_EN=0x300002
RGU mtk_wdt_init:MTK_WDT_DEBUG_CTL(590200F3)
[EMI] MDL number = 2
[EMI] DRAMC calibration start

[EMI] DRAMC calibration end

[EMI]rank size auto detect
[EMI]start_addr[0x40000000]=0x12345678, test_addr[0x48000000]= 0xEDCBA987
[EMI]start_addr[0x40000000]=0x12345678, test_addr[0x50000000]= 0xEDCBA987
[EMI]start_addr[0x40000000]=0xEDCBA987, test_addr[0x60000000]= 0xEDCBA987
[EMI]rank0 size: 0x20000000
[MEM] complex R/W mem test pass
RAM_CONSOLE wdt status (0x2)=0x2
[BBT] BMT.v2 is found at 0x3FF
[PLFM] Init Boot Device: OK(0)

NAND read: device 0 offset 0x2c0000, size 0x2000
8192 bytes read: OK
[do_read_image_blks] This is a FIT image,img_size = 0x39e920
[do_read_image_blks] img_blks = 0x73e
[do_read_image_blks] img_align_size = 0x39f000

NAND read: device 0 offset 0x2c0000, size 0x39f000
3796992 bytes read: OK
bootm flag=0, states=70f
## Loading kernel from FIT Image at 4007ff28 ...
Using 'config-1' configuration
Trying 'kernel-1' kernel subimage
Description:  ARM64 OpenWrt Linux-5.10.75
Type:         Kernel Image
Compression:  lzma compressed
Data Start:   0x40080010
Data Size:    3764262 Bytes = 3.6 MiB
Architecture: AArch64
OS:           Linux
Load Address: 0x44000000
Entry Point:  0x44000000
Hash algo:    crc32
Hash value:   c953efc3
Hash algo:    sha1
Hash value:   add14333f99ffe0d1601f3d11b8817e2c0c13a57
Verifying Hash Integrity ... crc32+ sha1+ OK
## Loading fdt from FIT Image at 4007ff28 ...
Using 'config-1' configuration
Trying 'fdt-1' fdt subimage
Description:  ARM64 OpenWrt elecom_wrc-x3200gst3 device tree blob
Type:         Flat Device Tree
Compression:  uncompressed
Data Start:   0x4041717c
Data Size:    29055 Bytes = 28.4 KiB
Architecture: AArch64
Hash algo:    crc32
Hash value:   447d446b
Hash algo:    sha1
Hash value:   6e08d95ed7635841b7deaa0b12cc233173d49d14
Verifying Hash Integrity ... crc32+ sha1+ OK
Booting using the fdt blob at 0x4041717c
Uncompressing Kernel Image ... OK
Loading Device Tree to 5cf45000, end 5cf4f17e ... OK

Starting kernel ...

[ATF][     7.799388]save kernel info
[ATF][     7.802325]Kernel_EL2
[ATF][     7.804995]Kernel is 64Bit
[ATF][     7.808083]pc=0x44000000, r0=0x5cf45000, r1=0x0
INFO:    BL3-1: Preparing for EL3 exit to normal world, Kernel
INFO:    BL3-1: Next image address = 0x44000000
INFO:    BL3-1: Next image spsr = 0x3c9
[ATF][     7.825781]el3_exit
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.10.75 (musashino205@TAIHA.NET) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 11.2.0 r0+17885-1cf1f6a9e0) 11.2.0, GNU ld (GNU Binutils) 2.37) #0 SMP Sat Oct 30 07:47:02 2021
[    0.000000] Machine model: ELECOM WRC-X3200GST3
[    0.000000] earlycon: uart8250 at MMIO32 0x0000000011002000 (options '')
[    0.000000] printk: bootconsole [uart8250] enabled
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x000000005fffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x0000000042ffffff]
[    0.000000]   node   0: [mem 0x0000000043000000-0x000000004302ffff]
[    0.000000]   node   0: [mem 0x0000000043030000-0x000000005fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000005fffffff]
[    0.000000] On node 0 totalpages: 131072
[    0.000000]   DMA zone: 2048 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 131072 pages, LIFO batch:31
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv0.2 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: Trusted OS migration not required
[    0.000000] percpu: Embedded 20 pages/cpu s43800 r8192 d29928 u81920
[    0.000000] pcpu-alloc: s43800 r8192 d29928 u81920 alloc=20*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: ARM erratum 845719
[    0.000000] CPU features: kernel page table isolation disabled by kernel configuration
[    0.000000] CPU features: detected: ARM erratum 843419
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129024
[    0.000000] Kernel command line: earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8 swiotlb=512
[    0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 493800K/524288K available (7870K kernel code, 856K rwdata, 2140K rodata, 448K init, 289K bss, 30488K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GIC: GICv2 detected, but range too small and irqchip.gicv2_force_probe not set
[    0.000000] random: get_random_bytes called from start_kernel+0x340/0x484 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 12.50MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x2e2049cda, max_idle_ns: 440795202628 ns
[    0.000003] sched_clock: 56 bits at 12MHz, resolution 80ns, wraps every 4398046511080ns
[    0.008210] Calibrating delay loop (skipped), value calculated using timer frequency.. 25.00 BogoMIPS (lpj=125000)
[    0.018605] pid_max: default: 32768 minimum: 301
[    0.023307] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.030649] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.039366] rcu: Hierarchical SRCU implementation.
[    0.044278] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[    0.052145] smp: Bringing up secondary CPUs ...
[    0.057009] Detected VIPT I-cache on CPU1
[    0.057052] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.057110] smp: Brought up 1 node, 2 CPUs
[    0.071785] SMP: Total of 2 processors activated.
[    0.076501] CPU features: detected: 32-bit EL0 Support
[    0.081657] CPU features: detected: CRC32 instructions
[    0.086904] CPU: All CPU(s) started at EL2
[    0.091015] alternatives: patching kernel code
[    0.098665] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.108559] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    0.115453] pinctrl core: initialized pinctrl subsystem
[    0.121132] NET: Registered protocol family 16
[    0.126216] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.133341] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.141129] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.149411] thermal_sys: Registered thermal governor 'fair_share'
[    0.149414] thermal_sys: Registered thermal governor 'bang_bang'
[    0.155528] thermal_sys: Registered thermal governor 'step_wise'
[    0.161573] thermal_sys: Registered thermal governor 'user_space'
[    0.167837] ASID allocator initialised with 65536 entries
[    0.179980] pstore: Registered ramoops as persistent store backend
[    0.186195] ramoops: using 0x10000@0x42ff0000, ecc: 0
[    0.217166] SCSI subsystem initialized
[    0.221035] libata version 3.00 loaded.
[    0.225028] usbcore: registered new interface driver usbfs
[    0.230590] usbcore: registered new interface driver hub
[    0.235939] usbcore: registered new device driver usb
[    0.242701] clocksource: Switched to clocksource arch_sys_counter
[    0.249485] NET: Registered protocol family 2
[    0.253980] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.261569] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.269968] TCP established hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.277773] TCP bind hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    0.284988] TCP: Hash tables configured (established 4096 bind 4096)
[    0.291427] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.298001] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.305072] NET: Registered protocol family 1
[    0.309456] PCI: CLS 0 bytes, default 64
[    0.314348] workingset: timestamp_bits=46 max_order=17 bucket_order=0
[    0.323345] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.329201] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.375749] mt-pmic-pwrap 10001000.pwrap: unexpected interrupt int=0x1
[    0.390134] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    0.397216] printk: console [ttyS0] disabled
[    0.401557] 11002000.serial: ttyS0 at MMIO 0x11002000 (irq = 21, base_baud = 1562500) is a 16550A
[    0.410539] printk: console [ttyS0] enabled
[    0.410539] printk: console [ttyS0] enabled
[    0.418907] printk: bootconsole [uart8250] disabled
[    0.418907] printk: bootconsole [uart8250] disabled
[    0.429453] mtk_rng 1020f000.rng: registered RNG driver
[    0.432858] random: fast init done
[    0.438211] random: crng init done
[    0.442405] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.450707] loop: module loaded
[    0.454678] mtk-snand 1100d000.snfi: chip is W25N01GV, size 128MB, page size 2048, oob size 64
[    0.464580] [BBT] BMT.v2 is found at 0x3ff
[    0.468848] 10 fixed-partitions partitions found on MTD device 1100d000.snfi
[    0.475896] Creating 10 MTD partitions on "1100d000.snfi":
[    0.481374] 0x000000000000-0x000000080000 : "Preloader"
[    0.487429] 0x000000080000-0x0000000c0000 : "ATF"
[    0.492609] 0x0000000c0000-0x000000140000 : "u-boot"
[    0.498300] 0x000000140000-0x0000001c0000 : "u-boot-env"
[    0.504336] 0x0000001c0000-0x0000002c0000 : "factory"
[    0.510611] 0x0000002c0000-0x000001bc0000 : "firmware"
[    0.541038] 2 fit-fw partitions found on MTD device firmware
[    0.546697] Creating 2 MTD partitions on "firmware":
[    0.551653] 0x000000000000-0x0000003a0000 : "kernel"
[    0.560417] 0x0000003a0000-0x000001900000 : "rootfs"
[    0.586806] mtd: device 7 (rootfs) set to be root filesystem
[    0.592598] 1 squashfs-split partitions found on MTD device rootfs
[    0.598780] 0x000000820000-0x000001900000 : "rootfs_data"
[    0.621120] 0x000001bc0000-0x0000020c0000 : "tm_pattern"
[    0.631675] 0x0000020c0000-0x0000021c0000 : "tm_key"
[    0.637897] 0x0000021c0000-0x0000030c0000 : "user_data"
[    0.658204] 0x0000030c0000-0x000008000000 : "reserved"
[    0.663343] mtd: partition "reserved" extends beyond the end of device "1100d000.snfi" -- size truncated to 0x4500000
[    0.760024] libphy: Fixed MDIO Bus: probed
[    0.787933] libphy: mdio: probed
[    0.792429] mtk_soc_eth 1b100000.ethernet eth0: mediatek frame engine at 0xffffffc0117c0000, irq 28
[    0.801966] i2c /dev entries driver
[    0.806393] mtk-wdt 10212000.watchdog: Watchdog enabled (timeout=31 sec, nowayout=0)
[    0.817087] NET: Registered protocol family 10
[    0.822283] Segment Routing with IPv6
[    0.825996] NET: Registered protocol family 17
[    0.830548] 8021q: 802.1Q VLAN Support v1.8
[    0.836026] pstore: Using crash dump compression: deflate
[    0.850510] mtk-pcie 1a143000.pcie: host bridge /pcie@1a143000 ranges:
[    0.857082] mtk-pcie 1a143000.pcie: Parsing ranges property...
[    0.862919] mtk-pcie 1a143000.pcie:      MEM 0x0020000000..0x0027ffffff -> 0x0020000000
[    0.897485] mtk-pcie 1a143000.pcie: PCI host bridge to bus 0000:00
[    0.903674] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.909153] pci_bus 0000:00: root bus resource [mem 0x20000000-0x27ffffff]
[    0.916028] pci_bus 0000:00: scanning bus
[    0.920071] pci 0000:00:00.0: [14c3:3258] type 01 class 0x060400
[    0.926101] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.935009] pci_bus 0000:00: fixups for bus
[    0.939188] pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 0
[    0.945887] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.953900] pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 1
[    0.960683] pci_bus 0000:01: scanning bus
[    0.964899] pci 0000:01:00.0: [14c3:7915] type 00 class 0x000280
[    0.971076] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit pref]
[    0.978399] pci 0000:01:00.0: reg 0x18: [mem 0x00000000-0x00003fff 64bit pref]
[    0.985722] pci 0000:01:00.0: reg 0x20: [mem 0x00000000-0x00000fff 64bit pref]
[    0.993676] pci 0000:01:00.0: supports D1 D2
[    0.997937] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    1.004570] pci 0000:01:00.0: PME# disabled
[    1.009049] pci 0000:01:00.0: 2.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s PCIe x1 link at 0000:00:00.0 (capable of 4.000 Gb/s with 5.0 GT/s PCIe x1 link)
[    1.053891] pci_bus 0000:01: fixups for bus
[    1.058069] pci_bus 0000:01: bus scan returning with max=01
[    1.063647] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    1.070257] pci_bus 0000:00: bus scan returning with max=01
[    1.075842] pci 0000:00:00.0: BAR 0: no space for [mem size 0x200000000 64bit pref]
[    1.083493] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x200000000 64bit pref]
[    1.091489] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x201fffff]
[    1.098275] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit pref]
[    1.106097] pci 0000:01:00.0: BAR 2: assigned [mem 0x20100000-0x20103fff 64bit pref]
[    1.113921] pci 0000:01:00.0: BAR 4: assigned [mem 0x20104000-0x20104fff 64bit pref]
[    1.121738] pci 0000:00:00.0: PCI bridge to [bus 01]
[    1.126704] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x201fffff]
[    1.133560] pcieport 0000:00:00.0: of_irq_parse_pci: failed with rc=-22
[    1.140165] pcieport 0000:00:00.0: assign IRQ: got 0
[    1.145135] pcieport 0000:00:00.0: enabling device (0000 -> 0002)
[    1.151237] pcieport 0000:00:00.0: enabling bus mastering
[    1.157068] mtk_hsdma 1b007000.dma-controller: Using 3 as missing dma-requests property
[    1.165258] mtk_hsdma 1b007000.dma-controller: MediaTek HSDMA driver registered
[    1.209027] libphy: dsa slave smi: probed
[    1.214094] mt7530 mdio-bus:00 wan (uninitialized): PHY [dsa-0.0:00] driver [Generic PHY] (irq=POLL)
[    1.224524] mt7530 mdio-bus:00 lan4 (uninitialized): PHY [dsa-0.0:01] driver [Generic PHY] (irq=POLL)
[    1.234939] mt7530 mdio-bus:00 lan3 (uninitialized): PHY [dsa-0.0:02] driver [Generic PHY] (irq=POLL)
[    1.245342] mt7530 mdio-bus:00 lan2 (uninitialized): PHY [dsa-0.0:03] driver [Generic PHY] (irq=POLL)
[    1.255740] mt7530 mdio-bus:00 lan1 (uninitialized): PHY [dsa-0.0:04] driver [Generic PHY] (irq=POLL)
[    1.265856] mt7530 mdio-bus:00: configuring for fixed/2500base-x link mode
[    1.273424] mt7530 mdio-bus:00: Link is Up - 2.5Gbps/Full - flow control rx/tx
[    1.274028] DSA: tree 0 setup
[    1.289339] VFS: Mounted root (squashfs filesystem) readonly on device 31:14.
[    1.296691] Freeing unused kernel memory: 448K
[    1.322904] Run /sbin/init as init process
[    1.326991]   with arguments:
[    1.329948]     /sbin/init
[    1.332645]   with environment:
[    1.335783]     HOME=/
[    1.338132]     TERM=linux
[    1.605832] init: Console is alive
[    1.609327] init: - watchdog -
[    2.005894] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    2.079275] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    2.095763] init: - preinit -
[    2.456736] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[    2.465263] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[    2.474072] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    2.481000] mt7530 mdio-bus:00 lan1: configuring for phy/gmii link mode
[    2.488126] 8021q: adding VLAN 0 to HW filter on device lan1
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
[    6.534746] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[    6.542019] overlayfs: "xino" feature enabled using 2 upper inode bits.
[    6.549650] urandom-seed: Seed file not found (/etc/urandom.seed)
[    6.637548] procd: - early -
[    6.640492] procd: - watchdog -
[    7.198790] procd: - watchdog -
[    7.265580] procd: - ubus -
[    7.324867] procd: - init -
Please press Enter to activate this console.
[    7.641507] urngd: v1.0.2 started.
[    7.684419] kmodloader: loading kernel modules from /etc/modules.d/*
[    7.761961] Loading modules backported from Linux version v5.15-rc6-0-g519d81956ee2
[    7.769661] Backport generated by backports.git v5.15-rc6-1-0-gd44432d6
[    7.785432] xt_time: kernel timezone is -0000
[    7.839784] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[    7.850093] mt7915e 0000:01:00.0: assign IRQ: got 136
[    7.855249] pci 0000:00:00.0: enabling bus mastering
[    7.860231] mt7915e 0000:01:00.0: enabling device (0000 -> 0002)
[    7.866320] mt7915e 0000:01:00.0: enabling bus mastering
[    7.942125] mt7622-wmac 18000000.wmac: HW/SW Version: 0x8a108a10, Build Time: 20190801210006a
[    7.942125]
[    8.026812] mt7915e 0000:01:00.0: HW/SW Version: 0x8a108a10, Build Time: 20201105222230a
[    8.026812]
[    8.120658] mt7622-wmac 18000000.wmac: N9 Firmware Version: 2.0, Build Time: 20200131180931
[    8.318387] mt7915e 0000:01:00.0: WM Firmware Version: ____000000, Build Time: 20201105222304
[    8.425716] mt7915e 0000:01:00.0: WA Firmware Version: DEV_000000, Build Time: 20201105222323
[    8.556902] PPP generic driver version 2.4.2
[    8.562068] NET: Registered protocol family 24
[    8.572583] kmodloader: done loading kernel modules from /etc/modules.d/*
[   14.046128] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[   14.075671] jffs2_build_filesystem(): unlocking the mtd device...
[   14.075678] done.
[   14.083784] jffs2_build_filesystem(): erasing all blocks after the end marker...
[   14.418603] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[   14.435902] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[   14.444995] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[   14.454002] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   14.461546] mt7530 mdio-bus:00 lan1: configuring for phy/gmii link mode
[   14.469359] 8021q: adding VLAN 0 to HW filter on device lan1
[   14.477482] br-lan: port 1(lan1) entered blocking state
[   14.482749] br-lan: port 1(lan1) entered disabled state
[   14.488343] device lan1 entered promiscuous mode
[   14.493015] device eth0 entered promiscuous mode
[   14.506058] mt7530 mdio-bus:00 lan2: configuring for phy/gmii link mode
[   14.513249] 8021q: adding VLAN 0 to HW filter on device lan2
[   14.521232] br-lan: port 2(lan2) entered blocking state
[   14.526622] br-lan: port 2(lan2) entered disabled state
[   14.534906] device lan2 entered promiscuous mode
[   14.547103] mt7530 mdio-bus:00 lan3: configuring for phy/gmii link mode
[   14.554601] 8021q: adding VLAN 0 to HW filter on device lan3
[   14.563954] br-lan: port 3(lan3) entered blocking state
[   14.569183] br-lan: port 3(lan3) entered disabled state
[   14.575504] device lan3 entered promiscuous mode
[   14.588488] mt7530 mdio-bus:00 lan4: configuring for phy/gmii link mode
[   14.595796] 8021q: adding VLAN 0 to HW filter on device lan4
[   14.603760] br-lan: port 4(lan4) entered blocking state
[   14.608981] br-lan: port 4(lan4) entered disabled state
[   14.615090] device lan4 entered promiscuous mode
[   14.626159] mt7530 mdio-bus:00 wan: configuring for phy/gmii link mode
[   14.633233] 8021q: adding VLAN 0 to HW filter on device wan
[   14.637546] mt7530 mdio-bus:00 wan: Link is Up - 1Gbps/Full - flow control rx/tx
[   14.646642] IPv6: ADDRCONF(NETDEV_CHANGE): wan: link becomes ready
[   15.710598] done.
[   15.712545] jffs2: notice: (1842) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[   15.761757] overlayfs: upper fs does not support tmpfile.
[   15.769453] overlayfs: "xino" feature enabled using 32 upper inode bits.
[   19.636069] mt7530 mdio-bus:00 lan1: Link is Up - 1Gbps/Full - flow control off
[   19.643425] br-lan: port 1(lan1) entered blocking state
[   19.648643] br-lan: port 1(lan1) entered forwarding state
[   19.654912] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   20.673969] mt7530 mdio-bus:00 lan1: Link is Down
[   20.678775] br-lan: port 1(lan1) entered disabled state
[   22.756065] mt7530 mdio-bus:00 lan1: Link is Up - 1Gbps/Full - flow control off
[   22.763417] br-lan: port 1(lan1) entered blocking state
[   22.768635] br-lan: port 1(lan1) entered forwarding state

BusyBox v1.34.1 (2021-10-30 07:47:02 UTC) built-in shell (ash)

_______                     ________        __
|       |.-----.-----.-----.|  |  |  |.----.|  |_
|   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
|__| W I R E L E S S   F R E E D O M
-----------------------------------------------------
OpenWrt SNAPSHOT, r0+17889-b1c65e4a83
-----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/#

ApresiaLightGS120GT-SS RTL8231メモ

各SFPのI2Cもどこかに居るはずだけど未だ不明
4組全て見つかった
“LOOP” LEDと未使用のLEDはピン番号それらしきもの判明しているものの反応せず
RTL8231の初期化手順が足りていないのが原因だった
realtek: ensure output drivers are enabled in RTL8231 – Patchwork

I/O	0
I/O	1	SFP		18F I2C (SDA)
I/O	2	SFP		18F I2C (SCL)
I/O	3	SFP		18F MOD0
I/O	4	SFP		18F LOS
I/O	5
I/O	6	SFP		17F I2C (SDA)
I/O	7	SFP		17F I2C (SCL)
I/O	8	SFP		17F MOD0
I/O	9	SFP		17F LOS
I/O	10	LED		"LOOP"
I/O	11	SFP		20F I2C (SDA)
I/O	12	SFP		20F I2C (SCL)
I/O	13	SFP		20F MOD0
I/O	14	SFP		20F LOS
I/O	15
I/O	16
I/O	17
I/O	18
I/O	19
I/O	20
I/O	21
I/O	22	SFP		19F I2C (SDA)
I/O	23	SFP		19F I2C (SCL)
I/O	24	SFP		19F MOD0
OUT	25	SFP		19F LOS
OUT	26
OUT	27
OUT	28
OUT	29
OUT	30
OUT	31
I/O	32
I/O	33	button	"RESET"
I/O	34	SYS		SoC RESET?
I/O	35
I/O	36	LED		unused LED

DGS-1210-28 F1 ファームウェアメモ

APRESIA Systems ApresiaLightGSシリーズも恐らく同じ
DGS-1210-28 F1のGPL tar内のMakefile, plfmake.h、 host/tools/ のツール類から

ヘッダ

ApresiaLightGSシリーズだと0x17に1byte何かが居る
    0x0                 0x4                 0x8                 0xC
     +-------------------+-------------------+-------------------+-------------------+
 0x0 |    Checksum *1    |                                  Model Name             ->|
     +-------------------+-------------------+-------------------+-------------------+
0x10 |->         (Model Name)                |               Signature             ->|
     +-------------------+-------------------+----+----+----+----+-------------------+ 
0x20 |->         (Signature)                 | *3 | *4 | *5 | *6 |   Board Version   |
     +-------------------+-------------------+----+----+----+----+-------------------+
0x30 |    Data Length    |                    Entry Point (text)                     |
     +-------------------+-------------------+-------------------+-------------------+

*1: Checksum
      data without block header (unit: 1byte, (addr 0x0) + (addr 0x1) + ...)
*2: Signature
      Kernel            -> "os"
      RootFS (SquashFS) -> "squashfs"
*3: Partition Index
*4: Header Length??
*5: Encrypted
*6: Customer Signature

フッタ

    0x0                 0x4                 0x8                 0xC
     +-------------------+-------------------+-------------------+-------------------+
 0x0 |                               FW Version (text)                               |
     +-------------------+-------------------+-------------------+-------------------+
0x10 |'C'  'A'  'M'  'E'  'O'  'T'  'A'  'G' |     OS Version    |    Checksum *1    |
     +-------------------+-------------------+-------------------+-------------------+ 

1: Checksum
     data without block header and last 4bytes of checksum
     (unit: 1byte, (addr 0x0) + (addr 0x1) + ...)

フッタのChecksumに、それを1byte分ずつ足したものがヘッダのChecksumになる
例:

  • ヘッダ: 0x07953DD6
  • フッタ: 0x07953C7F

0x07953C7F + 0x07 + 0x95 + 0x3C + 0x7F = 0x7953DD6

imghdr (APRESIA)実行結果

ApresiaLightGS120GT-SSのGPLソースコードとしてAPRESIA Systemsから提供を受けたもの

使用方法のメッセージと実際の引数の順番で、customer_sig と encrypted が入れ替わっている模様

tofu@Tofu-B450HVUB16:~/apresia⟫ ./imghdr aplgsR10104_blk_os_nohead.bin aplgsR10104_blk_os.hex.new APRESIA os 3 0 2 4
Usage: imghdr src dest model signature partition customer_sig encrypted board_ver os_dump
255
tofu@Tofu-B450HVUB16:~/apresia⟫ ./imghdr aplgsR10104_blk_os_nohead.bin aplgsR10104_blk_os.hex.new APRESIA os 3 0 2 4 vmlinux.dump
[imghdr]:Linux start address:0x80562f38
[imghdr]:hdr_len is 64
[imghdr]:model name: APRESIA
[imghdr]:signatue: os
[imghdr]:partition is 3
[imghdr]:encrypted is 0
[imghdr]:customer signature is 2
[imghdr]:board version is 67108864(4)
[imghdr]:aplgsR10104_blk_os_nohead.bin len is 936272
[imghdr]:checksum = 7953dd6

os_dumpはOpenWrtの適当なvmlinuxを用いた為stockと異なる

tofu@Tofu-B450HVUB16:~/apresia⟫ hexdump -n 64 -C aplgsR10104_blk_os.hex.new
00000000  07 95 3d d6 41 50 52 45  53 49 41 00 00 00 00 00  |..=.APRESIA.....|
00000010  00 00 00 00 00 00 00 02  6f 73 00 00 00 00 00 00  |........os......|
00000020  00 00 00 00 00 00 00 00  03 40 00 02 00 00 00 04  |.........@......|
00000030  00 0e 49 50 30 78 38 30  35 36 32 66 33 38 00 00  |..IP0x80562f38..|
00000040

imgtag (APRESIA)実行結果

tofu@Tofu-B450HVUB16:~/apresia⟫ ./imgtag aplgsR10104_blk_os_nohead_notag.bin 1 1.00.010
[imgtag]:src len is 936240
[imgtag]:success write FW 1.00.010 to aplgsR10104_blk_os_nohead_notag.bin!!
[imgtag]:success to create CAMEOTAG!!
[imgtag]:success to create version 1!!

imgtagの後にgenTotalChecksumを実行することでCAMEOTAG行末尾にチェックサムが付加される

tofu@Tofu-B450HVUB16:~/apresia⟫ hexdump -n 256 -C -s $((0xE48B0)) aplgsR10104_blk_os_nohead_notag.bin
000e48b0  5f fa f0 c3 7e ff 27 86  fe f6 fc a6 ee a6 aa 37  |_...~.'........7|
000e48c0  5a 56 7b df de 72 64 49  69 a9 bb f3 b2 4d a3 5b  |ZV{..rdIi....M.[|
000e48d0  fe b9 e4 3d bb 4a ef 4b  fc b2 fb 4b 07 3f 7b f9  |...=.J.K...K.?{.|
000e48e0  37 ae ff c8 a5 1f 79 3c  fa 91 85 e7 fe e8 f6 8e  |7.....y<........|
000e48f0  fe 2f fc e3 39 3b 5f bb  f9 e2 3d ff 73 e9 9f ff  |./..9;_...=.s...|
000e4900  5c 7b e8 33 95 a5 07 1e  6b 2a bb 36 bc ac 79 70  |\{.3....k*.6..yp|
000e4910  fb a3 9b 6f 1b 1c 1a aa  71 13 7e ef 6f b9 e8 10  |...o....q.~.o...|
000e4920  98 b5 ff 1b 06 ef 8a 95  86 d0 23 00 00 00 00 00  |..........#.....|
000e4930  31 2e 30 30 2e 30 31 30  00 00 00 00 00 00 00 00  |1.00.010........|
000e4940  43 41 4d 45 4f 54 41 47  00 00 00 01              |CAMEOTAG....|
000e494c

ApresiaLightGS120GT-SS

例によってRTL83xx系SoCを搭載するスイッチングハブを様々なメーカーで調べた際に見つけたもの。APRESIA SystemsのApresiaLightGSシリーズは全モデル通してファームウェアが共通である為、この記事の120以外も全て同様にRealtek SoCを搭載していると思われる。
弄っていくのでメモ。

U-Boot

help

APLGS120GTSS # help
?       - alias for 'help'
base    - print or set address offset
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
cmp     - memory compare
cp      - memory copy
crc32   - checksum calculation
dhcp    - boot image via network using DHCP/TFTP protocol
env     - environment handling commands
erase   - erase FLASH memory
flinfo  - print FLASH memory information
go      - start application at address 'addr'
help    - print command description/usage
iminfo  - print header information for application image
loadb   - load binary file over serial line (kermit mode)
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
md      - memory display
mdram_test- mdram_test   - do DRAM test.
mflash_test- mflash_test   - do flash test.
mm      - memory modify (auto-incrementing address)
mtest   - simple RAM read/write test
mw      - memory write (fill)
nm      - memory modify (constant address)
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
printenv2- print environment variables
protect - enable or disable FLASH write protection
reset   - Perform RESET of the CPU
rtk     - rtk     - Realtek commands

run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
saveenv2- save environment variables to persistent storage
setenv  - set environment variables
setenv2 - set environment variables
sf      - SPI flash sub-system
sleep   - delay execution for some time
tftpboot- boot image via network using TFTP protocol
version - print monitor, compiler and linker version

version

APLGS120GTSS # version

U-Boot 2011.12.(2.1.5.67086)-Candidate1 (Apr 21 2020 - 16:39:05)
1.00.013
mips-linux-gcc (GCC) 3.4.4 mipssde-6.03.00-20051020
GNU ld (Linux/GNU Binutils) 2.18.50.0.1.20070908

printenv

APLGS120GTSS # printenv
Board_Id=602131615488
Board_Version=4
Boot_Version=1.00.013
Serial_Number=************
addargs=setenv bootargs console=$(console_device),$(baudrate) mem=$(memsize) noinitrd root=$(image) rw rootfstype=squashfs
baudrate=115200
boardmodel=RTL8382M_8218B_INTPHY_8214FC_DEMO
boardversion=V1.0R
bootcmd=bootm 0xb4100000
bootdelay=2
console_device=ttyS0
ethact=rtl8380#0
ethaddr=FC:6D:D1:xx:xx:EA
gatewayip=192.168.10.254
hw_version=A1
image=/dev/mtdblock4
ipaddr=192.168.10.200
memsize=254M
netmask=255.255.255.0
serverip=192.168.10.20
stderr=serial
stdin=serial
stdout=serial

Environment size: 619/262140 bytes

printenv2

APLGS120GTSS # printenv2
Image_Id=1

Environment size: 14/262140 bytes

help rtk

APLGS120GTSS # help rtk
rtk - rtk     - Realtek commands

Usage:
rtk object action
- SOC commands.
rtk network on
- Enable the networking function
rtk netowkr off
- Disable the networking function
rtk testmode [mode] [port]
- Set default value for specific testing
rtk ext-pinGet [pinNum]
- get external 8231 GPIO pin status
rtk ext-pinSet [pinNum] [status]
- set external 8231 GPIO pin status
rtk smi list
- list all smi group
rtk smi init [group_id] [sck_pin] [sda_pin] [8/16 access type] [chipid] [delay] [name]
- create a smi group and init
rtk smi read [group_id] [reg]
rtk smi write [group_id] [reg] [data]
rtk pinGet [pinNum]
- get internal GPIO pin status
rtk pinSet [pinNum] [status]
- set internal GPIO pin status
rtk ledtest [port] [led_index]
- led test
rtk ledtest-bank [round]
- led back on/off test
rtk loopback ext [port-start] [port-end] [round]
- port traffic external loopback test
rtk loopback int [port-start] [port-end] [round]
- port traffic internal loopback test
rtk txportpkt [port-id] [round]
- tx packet from CPU to specific port test
rtk ldps [port] [ on | off ]
- Enable/Disable link-down power saving (LDPS) of PHY
rtk green [port] [ on | off ]
- Enable/Disable green feature of PHY
rtk cross-over [port] [ auto | mdi | mdix ]
- Configure cross-over mode as Auto, Force-MDI, or Force-MDIX of PHY.

rtk smi list

APLGS120GTSS # rtk smi list

Index SCK_DEV SCK_PIN SDA_DEV SDA_PIN TYPE   ID   Delay Name
=================================================================

tftpboot

APLGS120GTSS # tftpboot
*** Warning: no boot file name; using 'C80AA8C0.img'
Using rtl8380#0 device
TFTP from server 192.168.10.20; our IP address is 192.168.10.200
Filename 'C80AA8C0.img'.
Load address: 0xb4100000
Loading: *

Kernel

bootlog


U-Boot 2011.12.(2.1.5.67086)-Candidate1 (Apr 21 2020 - 16:39:05)
1.00.013

Board: RTL838x CPU:500MHz LXB:200MHz MEM:300MHz
DRAM:  256 MB
SPI-F: 1x32 MB
Loading 262144B env. variables from offset 0x80000
Magic ID = 00004001 Board ID = 00000001
Switch Model: RTL8382M_8218B_INTPHY_8214FC_DEMO (Port Count: 20)
Switch Chip: RTL8382
**************************************************
#### RTL8218B config - MAC ID = 0 ####
Now External 8218B
**************************************************
#### RTL8218B config - MAC ID = 8 ####
Now Internal PHY
**************************************************
**** RTL8214FC config - MAC ID = 24 ****
Now External 8214FC
Net:   Net Initialization Skipped
rtl8380#0
Hit Esc key to stop autoboot:  0
Verifying Checksum for Image 1 ...
BOOT:...OK
OS:...OK
FS:...OK

Loading Runtime Image ...
## Booting kernel from Legacy Image at b4100000 ...
Image Name:
Created:      2020-04-21  16:38:46 UTC
Image Type:   MIPS Linux Kernel Image (gzip compressed)
Data Size:    936172 Bytes = 914.2 KB
Load Address: 80000000
Entry Point:  80224000
Verifying Checksum ... OK
Force port28 link down

Uncompressing Kernel Image ... OK

Starting kernel ...

Linux version 2.6.19 (lemon@SW3) (gcc version 3.4.4 mipssde-6.03.00-20051020) #6 PREEMPT Tue Apr 21 16:38:45 CST 2020
CPU revision is: 00019070
Determined physical RAM map:
memory: 07e00000 @ 00000000 (usable)
User-defined physical RAM map:
memory: 0fe00000 @ 00000000 (usable)
Built 1 zonelists.  Total pages: 64516
Kernel command line: console=ttyS0,115200 mem=254M noinitrd root=/dev/mtdblock4 rw rootfstype=squashfs imgid=1 failover=0 csb=0x014EDB69 cso=0x0795D885
csf=0x5A4A8562 ethaddr=FC:6D:D1:08:56:EA magicid=0x00004001
Primary instruction cache 16kB, physically tagged, 4-way, linesize 16 bytes.
Primary data cache 16kB, 2-way, linesize 16 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).
PID hash table entries: 1024 (order: 10, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 255360k/260096k available (1793k kernel code, 4628k reserved, 394k data, 104k init, 0k highmem)
Mount-cache hash table entries: 512
Checking for 'wait' instruction...  available.
NET: Registered protocol family 16
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 8192 bind 4096)
TCP reno registered
squashfs: version 3.3 (2007/10/31) Phillip Lougher
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver $Revision: 1.90 $ 1 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0x0 (irq = 31) is a 16550A
Probe: SPI CS1 Flash Type MX25L25635F
Creating 8 MTD partitions on "Total SPI FLASH":
0x00000000-0x00080000 : "BOOT"
0x00080000-0x000c0000 : "BDINFO"
0x000c0000-0x00100000 : "BDINFO2"
0x00100000-0x00280000 : "KERNEL1"
0x00280000-0x00f80000 : "ROOTFS1"
0x00f80000-0x01100000 : "KERNEL2"
0x01100000-0x01e00000 : "ROOTFS2"
0x01e00000-0x02000000 : "JFFS2"
cdd_crash load
memmap_pid load
Init CAMEO Debug Trace Driver Module....OK
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
VFS: Mounted root (squashfs filesystem) readonly.
Freeing unused kernel memory: 104k freed
init started:  BusyBox v1.00 (2020.04.09-03:38+0000) multi-call binary
Starting pid 14, console : '/etc/rc'
Init RTCORE Driver Module....OK
route: not found
SIOCSIFADDR: No such device
Magic ID: 0x00004001
------------------------------------------------------------
Dynamic data initialization:
Model id: 1 Model Name: APLGS120GTSS
MaxDevicePort: 20 MaxTrunk: 8
Combo Port Layout dynamic data: u2PortNum: 4 u2PortStart: 17
Fiber Port Layout dynamic data: u2PortNum: 0 u2PortStart: 128
------------------------------------------------------------

MAC Address : FC-6D-D1-xx-xx-EA
RTK.0> H/W Version : A1

Smart Management Switch

APLGS120GTSS login:

WN-DX2033GR bootnum, debugflagメモ

bootnum, debugflag いずれも格納場所はサポート済みのWN-DX1167R, WN-AX1167GR2と同じ。

root@WN-DX2033GR:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 07f80000 00020000 "ALL"
mtd1: 00100000 00020000 "Bootloader"
mtd2: 00100000 00020000 "Ubootenv"
mtd3: 00100000 00020000 "Factory"
mtd4: 03200000 00020000 "firmware"
mtd5: 0307687e 00020000 "rootfs"
mtd6: 00100000 00020000 "Config"
mtd7: 03200000 00020000 "firmware_2"
mtd8: 00100000 00020000 "Config_2"
mtd9: 00100000 00020000 "persist"
mtd10: 00100000 00020000 "idmkey"
mtd11: 01380000 00020000 "Backup"
mtd12: 00100000 00020000 "SecondBoot"

bootnum

0x4 (persist)

root@WN-DX2033GR:~# mstc_persist read bootnum
1
root@WN-DX2033GR:~# hexdump -n 128 -C /dev/mtd9
00000000  1b 05 ce 17 01 01 00 00  1a 4c 00 00 67 86 07 53  |.........L..g..S|
00000010  1a 4c 00 00 67 86 07 53  00 00 00 00 00 00 00 00  |.L..g..S........|
00000020  00 00 00 00 00 00 00 00  ff ff ff ff ff ff ff ff  |................|
00000030  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
*
00000080
root@WN-DX2033GR:~# mstc_persist write bootnum 2
Unlocking persist ...
root@WN-DX2033GR:~# hexdump -n 128 -C /dev/mtd9
00000000  1b 05 ce 17 02 01 00 00  1a 4c 00 00 67 86 07 53  |.........L..g..S|
00000010  1a 4c 00 00 67 86 07 53  00 00 00 00 00 00 00 00  |.L..g..S........|
00000020  00 00 00 00 00 00 00 00  ff ff ff ff ff ff ff ff  |................|
00000030  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
*
00000080

debugflag

0xFE75 (Factory)

root@WN-DX2033GR:~# sys debugflag
DebugFlag: 0
root@WN-DX2033GR:~# hexdump -n $((0x100)) -v -C -s $((0xFE00)) /dev/mtd3
0000fe00  4d 69 74 72 61 73 74 61  72 00 54 65 63 68 6e 6f  |Mitrastar.Techno|
0000fe10  6c 6f 67 79 20 43 6f 72  70 2e 00 00 00 00 00 00  |logy Corp.......|
0000fe20  4d 69 43 41 50 2d 33 33  34 30 43 00 00 00 00 00  |MiCAP-3340C.....|
0000fe30  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0000fe40  31 39 35 36 30 35 32 37  00 00 00 00 00 00 00 00  |19560527........|
0000fe50  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0000fe60  53 30 39 30 59 30 30 30  30 30 30 30 30 00 00 13  |S090Y00000000...|
0000fe70  49 55 aa 00 04 00 ff ff  5a 59 ff ff 00 00 00 00  |IU......ZY......|
0000fe80  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0000fe90  00 00 00 00 00 00 00 00  00 01 18 06 12 09 20 16  |.............. .|
0000fea0  10 20 37 4d 69 43 41 50  2d 33 33 34 30 43 00 00  |. 7MiCAP-3340C..|
0000feb0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0000fec0  00 00 00 41 30 42 00 00  00 00 00 00 00 00 00 00  |...A0B..........|
0000fed0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0000fee0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0000fef0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0000ff00
root@WN-DX2033GR:~# sys debugflag 1
PASS
root@WN-DX2033GR:~# hexdump -n $((0x100)) -v -C -s $((0xFE00)) /dev/mtd3
0000fe00  4d 69 74 72 61 73 74 61  72 00 54 65 63 68 6e 6f  |Mitrastar.Techno|
0000fe10  6c 6f 67 79 20 43 6f 72  70 2e 00 00 00 00 00 00  |logy Corp.......|
0000fe20  4d 69 43 41 50 2d 33 33  34 30 43 00 00 00 00 00  |MiCAP-3340C.....|
0000fe30  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0000fe40  31 39 35 36 30 35 32 37  00 00 00 00 00 00 00 00  |19560527........|
0000fe50  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0000fe60  53 30 39 30 59 30 30 30  30 30 30 30 30 00 00 13  |S090Y00000000...|
0000fe70  49 55 aa 00 04 01 ff ff  5a 59 ff ff 00 00 00 00  |IU......ZY......|
0000fe80  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0000fe90  00 00 00 00 00 00 00 00  00 01 18 06 12 09 20 16  |.............. .|
0000fea0  10 20 37 4d 69 43 41 50  2d 33 33 34 30 43 00 00  |. 7MiCAP-3340C..|
0000feb0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0000fec0  00 00 00 41 30 42 00 00  00 00 00 00 00 00 00 00  |...A0B..........|
0000fed0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0000fee0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0000fef0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0000ff00