Compare commits

...
Author SHA1 Message Date
etwenandClaude Opus 5.5 f02ba22924 feat(ttl): Read the FDR counters in every Script B soak round
Script B runs blanton_fdr.sh rdcnt after the Tray ID stress in each
round, so the FDR counters started before the loop are logged through
the soak, not only at Script C. The call is not gated by SWB_UNIT0 /
SWB_UNIT1. Recorded under V1.2.6 in Script A's history and the release
note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0131orciRKrejchsuDk6UpXk
2026-10-21 22:55:09 +08:00
etwenandClaude Opus 5.5 738f1dd1c6 docs: Record V1.2.6 in Script A's history and add the release note
Script A: header to V1.2.6; entries for blanton_fdr.sh, the unused
lanes off in Script A, and the FDR hooks in Script A, B and C, with
notes on the unverified STOp keyword, the lanes never being turned
back on, the both-units-only gating and the exec bits.

CLAUDE.md / ARCHITECTURE.md: status and release to V1.2.6, FDR and the
unused lanes in the overview, the Script A flow, the tree and the
commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0131orciRKrejchsuDk6UpXk
2026-10-21 22:50:25 +08:00
etwenandClaude Opus 5.5 0407bbe04f feat(ttl): Run FDR around the traffic test and turn off unused lanes
When both switch units are enabled, Script A wraps its traffic baseline
in blanton_fdr.sh start / clear / rdcnt / stop and runs the traffic for
40 s instead of 15 s, so the counters are read after the first 30 s
interval is published. Script B starts and clears FDR with the traffic
setup before the soak loop, and Script C reads and stops it around the
traffic stop, so the counters cover the whole soak. The single-unit
branches are unchanged.

Script A runs unused_lanes.sh off before the BER baseline. Nothing turns
the lanes back on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0131orciRKrejchsuDk6UpXk
2026-10-21 22:50:25 +08:00
etwenandClaude Opus 5.5 319ee07de3 feat(fdr): Add blanton_fdr.sh for phydiag fdrstat
start / clear / rdcnt / stop send fdrstat STArt bin_group=both
Interval=30 / clear / Counters / STOp through bcmcmd on ports
'1-259,270-565', unit 0 then unit 1, and print the output as is. -u
picks one unit, -i sets the interval, -n is a dry run, FDR_PORTS
overrides the port list.

The STOp keyword is inferred from prbsstat STOp and has not been
checked on the bench.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0131orciRKrejchsuDk6UpXk
2026-10-21 22:50:25 +08:00
etwenandClaude Opus 5.5 16da1c68f2 docs: Record V1.2.5 in Script A's history and add the release note
Script A: header to V1.2.5 / 2026-10-21; entries for
blanton_ber_debug.sh, retimer_lanes.sh, unused_lanes.sh, the PMON power
readback, the --force on the USB stress, the boot cycle title and the
fast boot cycle, with notes on p=p31 vs blanton_ber.sh's p=3, the
missing port 268, the double read in Script 4, the exec bits and the
EN_Cold_Warm_boot = 0 hang.

CLAUDE.md / ARCHITECTURE.md: status and release to V1.2.5, the new
scripts in the overview, the tree and the commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0131orciRKrejchsuDk6UpXk
2026-10-21 09:01:55 +08:00
etwenandClaude Opus 5.5 f378340f41 feat(boot): Add a fast boot cycle and show the count in the title
5_1_Blanton_Script_Boot_Cycle_Fast.ttl is Script 5 with the traffic run
removed from Check Pt8; only 'blanton_traffic_linespeed ps' is left,
for a shorter cycle when the boot count is what matters.

Script 5 sets the window title to 'Reboot Cycle Test : n' or 'Power
Cycle Test : n' every round. Script B and Script 5 pass --force to
qfx5252-stress-usb.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0131orciRKrejchsuDk6UpXk
2026-10-21 09:01:55 +08:00
etwenandClaude Opus 5.5 fd2282d34b feat(pwr): Read switch-board rail power in every PMON snapshot
setup_pmon.ttl now calls TH6_SWB0/1_power_readback.sh after show
platform current, so Script A, B, C, 4 and 5 all log the 19 rails of
each switch board. Script 4 still calls both readbacks in its own loop
as well, so it reads them twice per round.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0131orciRKrejchsuDk6UpXk
2026-10-21 09:01:55 +08:00
etwenandClaude Opus 5.5 aed2be66b2 feat(retimer): Add tools to turn off TX on unused lanes
retimer_lanes.sh turns TX off / on, or shows the state, for a lane map
of one Agera3 retimer on both the sys and the line side, by TX squelch
(default) or lane power-down. It refuses 'off' on lanes with RX PMD
lock unless --force is given, and reads the state back to print PASS
or FAIL.

unused_lanes.sh applies that to a built-in table of 14 retimer rows and
one direct-TH6 row (TSC31) on each switch board; TH6 rows go through
'port ... enable=' in the syncd container. --asic, --th6, --only and
--force select what it touches; it ends with ok / refused / failed
counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0131orciRKrejchsuDk6UpXk
2026-10-21 09:01:55 +08:00
etwenandClaude Opus 5.5 b652ec8072 feat(ber): Add a raw BER run with p=p31 and sleep 40
blanton_ber_debug.sh runs the hand-pasted flow from tools/BER_Test.txt
as one command: prbs set p=p31, prbs get twice, prbsstat STArt
Interval=30, sleep 40, Ber, STOp, prbs clear. Every bcmcmd output is
printed as is under a timestamped header; there is no parsing, no
PASS/FAIL and no summary. -u 0 / -u 1 picks one switch unit, both by
default. The port list is the 200G ports without 268, as in
BER_Test.txt; BER_PORTS, BER_POLY, BER_INTERVAL and BER_WAIT can be
overridden. blanton_ber.sh is left unchanged.

BER_Test.txt: p=3 -> p=p31 (verified on the bench), plus a unit 1
block, a both-units block and port en=0/1 for every cabled port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0131orciRKrejchsuDk6UpXk
2026-10-21 09:01:55 +08:00
etwenandClaude Opus 5.5 4db9b45ce7 docs: Record V1.2.4 in Script A's history and add the release note
Script A: header to V1.2.4 / 2026-10-01; entries for tray_id_stress.sh,
the Script A and Script B hooks, and 6_Blanton_Script_BER_Cycle.ttl,
with notes on the exec bit, the sleep-vs-Interval rule, the hard-coded
BDF, the hostname, the SONiC-only fan setting and the placeholder
password.

CLAUDE.md: status and last release to V1.2.4; the Tray ID stress and the
BER cycle in the overview; a commands block for tray_id_stress.sh; a
gotcha that prbsstat Ber must be read after the first interval is
published, and that Script A / C's own BER (Interval=30, sleep 30) sits
on that edge and has not been verified.

ARCHITECTURE.md: Script A ref and the tag checkbox to V1.2.4; Script 5's
current file name and the new macro 6 in the tree; tray_id_stress.sh in
the tree.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UniUXkxgCG2Ty74advL8Pd
2026-10-01 13:32:14 +08:00
etwenandClaude Opus 5.5 7937ade30e feat(ttl): Add the Diag / SONiC BER cycle macro
6_Blanton_Script_BER_Cycle.ttl is a standalone macro, not part of A/B/C.
Each cycle measures PRBS BER on unit 0 in the Diag OS, cold-boots into
SONiC by writing the CB FPGA, measures again, and cold-boots back; while
1, no end. The boot target is chosen in the BIOS Boot Manager ("USB
Device" = Diag, "Hard Drive" = SONiC) and confirmed by the boot
signature. The log goes to Logs\Blanton_BER_Cycle_<ts>.log.

prbsstat runs with Interval=30 and the BER is read after sleep 40. The
sleep has to be longer than the interval: checked against the error
counts 'prbs get' reports in the same cycle, sleep 10 read Diag ~60x and
SONiC ~40x low, and sleep 30 still read Diag ~60x low because its Ber is
sent 30.15 s after STArt, before the first interval is published.
Interval=30 + sleep 40 matched on both sides over 73 cycles.

Known limits: the SONiC -> Diag boot writes a hard-coded BDF
(0000:05:00.0); the prompts assume the hostname 'sonic'; the fan is set
to 30 % on the SONiC side only; the password is the placeholder.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UniUXkxgCG2Ty74advL8Pd
2026-10-01 13:32:14 +08:00
etwenandClaude Opus 5.5 ebb2260798 feat(i2c): Add a Tray ID I2C stress and run it in Script A and B
tray_id_stress.sh writes 0xA5 and 0x5A to register 0x02 of device 0x70
on buses 34, 35, 38 and 39, reading each back and comparing. The two
patterns put every bit in both states. It prints one PASS / FAIL / ERROR
line per step and a per-bus Summary with a single RESULT line; exit 0 is
all PASS, 1 is any FAIL or I2C error, 2 is bad arguments. FAIL (wrong
value read) and ERROR (i2cset / i2cget failed) are counted apart.

The original value is read first and written back at the end, verified
by a read; -R skips that, -n N repeats the sequence. Buses, address,
register and patterns are editable at the top of the file.

Script A runs one pass after show_dmesg as the baseline. Script B runs
one pass in every soak round, before the sleep 60.

The script is called by path and needs the exec bit on the DUT.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UniUXkxgCG2Ty74advL8Pd
2026-10-01 13:32:14 +08:00
18 changed files with 1728 additions and 12 deletions
+11 -4
View File
@@ -161,7 +161,9 @@ Blanton_TTL_Script/
└── Script_ABC_Blanton/ # ← Tera Term 的工作目錄(整包給測試員) └── Script_ABC_Blanton/ # ← Tera Term 的工作目錄(整包給測試員)
│ │
├── 4_Blanton_Script_thermal_safety.ttl # 熱 / 安規:獨立跑,不接 A→B→C ├── 4_Blanton_Script_thermal_safety.ttl # 熱 / 安規:獨立跑,不接 A→B→C
├── 5_Blanton_Script_Reboot_Cycle.ttl # 重開機循環:獨立跑,while 1 無止境(未上機驗證) ├── 5_Blanton_Script_Boot_Cycle.ttl # 開機循環(warm / cold,EN_Cold_Warm_boot):獨立跑,while 1 無止境
├── 5_1_Blanton_Script_Boot_Cycle_Fast.ttl # 同 Script 5,但 Check Pt8 只跑 traffic ps(不打流量),循環較短
├── 6_Blanton_Script_BER_Cycle.ttl # Diag ↔ SONiC 冷開機循環,兩邊各量一次 unit 0 BER:獨立跑,while 1
├── config.ttl # 全域設定:testcase 名、EN_Margin / EN_TX_FIR / EN_log / EN_timestamp、 ├── config.ttl # 全域設定:testcase 名、EN_Margin / EN_TX_FIR / EN_log / EN_timestamp、
│ # 風扇與 SWB 宣告、SSD/USB/BMC_USB 壓力秒數、三個 prompt 字串 │ # 風扇與 SWB 宣告、SSD/USB/BMC_USB 壓力秒數、三個 prompt 字串
├── hammer/ # 🚫 gitignored — mlucas ELF binary(~99 MB),DUT image 自帶, ├── hammer/ # 🚫 gitignored — mlucas ELF binary(~99 MB),DUT image 自帶,
@@ -204,6 +206,8 @@ Blanton_TTL_Script/
│ # ⚠️ V1.1.9 起 A/B/C 內註解掉的呼叫已整段刪除,只剩手動執行 │ # ⚠️ V1.1.9 起 A/B/C 內註解掉的呼叫已整段刪除,只剩手動執行
├── blanton_ber.sh # 全機 SerDes BER 掃描(phydiag prbs / prbsstat) ├── blanton_ber.sh # 全機 SerDes BER 掃描(phydiag prbs / prbsstat)
│ # V1.2.2 起含 port 268(100G ce0),summary 每 unit 分 200G/100G/TOTAL │ # V1.2.2 起含 port 268(100G ce0),summary 每 unit 分 200G/100G/TOTAL
├── blanton_ber_debug.sh # BER 原始輸出(p=p31、sleep 40、-u 0|1),不判定
├── blanton_fdr.sh # FDR 統計(phydiag fdrstat start/clear/Counters/STOp),A/B/C 夾住流量
├── bcm_100g_dsc_cycle.sh # 100G link down/up 循環 + 每輪 DSC 與 retimer TX/RX 讀回(未驗證) ├── bcm_100g_dsc_cycle.sh # 100G link down/up 循環 + 每輪 DSC 與 retimer TX/RX 讀回(未驗證)
├── bcm_dsc_scan.sh # 全機 SerDes DSC dump(phydiag <port> dsc,~445 port × 2 unit) ├── bcm_dsc_scan.sh # 全機 SerDes DSC dump(phydiag <port> dsc,~445 port × 2 unit)
│ # 由 EN_TX_FIR 控制,A 與 C 各掃一次;單次約 10 分鐘 │ # 由 EN_TX_FIR 控制,A 與 C 各掃一次;單次約 10 分鐘
@@ -215,10 +219,13 @@ Blanton_TTL_Script/
├── blanton_tr518.sh # TR518 封包測試,量功耗前的負載來源 ├── blanton_tr518.sh # TR518 封包測試,量功耗前的負載來源
├── TH6_SWB0_power_readback.sh # SWB0 19 條軌 V×I + 總功耗 ├── TH6_SWB0_power_readback.sh # SWB0 19 條軌 V×I + 總功耗
├── TH6_SWB1_power_readback.sh # SWB1 同上 ├── TH6_SWB1_power_readback.sh # SWB1 同上
│ # ⚠️ 已納入交付,但 A/B/C 的呼叫仍註解掉(bring-up 中) │ # V1.2.5 起由 utils/setup_pmon.ttl 呼叫,每個 PMON 快照都有
├── ddr5_temp.sh # DDR5 DIMM 溫度(SPD5118 @ i2c-5 0x50/0x51,reg 0x31) ├── ddr5_temp.sh # DDR5 DIMM 溫度(SPD5118 @ i2c-5 0x50/0x51,reg 0x31)
├── hsc_temp_readback.sh # LTC4287 HSC 溫度(i2c-28 0x40/0x45,內/外部感溫) ├── hsc_temp_readback.sh # LTC4287 HSC 溫度(i2c-28 0x40/0x45,內/外部感溫)
├── avt_pmpower.sh # AMD CPU 封裝功耗(AVTCMD pmm get_pmdata;AVT 是 NDA,不隨包) ├── avt_pmpower.sh # AMD CPU 封裝功耗(AVTCMD pmm get_pmdata;AVT 是 NDA,不隨包)
├── tray_id_stress.sh # Tray ID I2C stress(bus 34/35/38/39 0x70 reg 0x02,寫 0xA5/0x5A 讀回)
├── retimer_lanes.sh # 單顆 Agera3 retimer 的 lane TX off/on/status(sys + line side)
├── unused_lanes.sh # 依內建表把沒接線的 retimer lane / TH6 port 關掉(呼叫 retimer_lanes.sh)
├── usb_target.sh # 偵測 USB 裝置節點/掛載點(排除系統碟) ├── usb_target.sh # 偵測 USB 裝置節點/掛載點(排除系統碟)
├── bmc_monitor.sh # BMC 監控:free -m + I2C 寫入/讀回圖樣測試 ├── bmc_monitor.sh # BMC 監控:free -m + I2C 寫入/讀回圖樣測試
├── bmc_monitor_ddr.sh # ⚠️ 已停用:V1.1.9 起 B/C 內的註解區塊已刪除,DDR 壓力走 bgctl + bmc-manager ├── bmc_monitor_ddr.sh # ⚠️ 已停用:V1.1.9 起 B/C 內的註解區塊已刪除,DDR 壓力走 bgctl + bmc-manager
@@ -381,7 +388,7 @@ PROFILE_CHANNELS=( "0:high:8" "1:low:8" ... ) # "channel:operation:change_perc
| 模組 | 進入點 | 功能 | | 模組 | 進入點 | 功能 |
|------|--------|------| |------|--------|------|
| **Script A(Pre-test)** | `1_Blanton_Script_A.ttl` V1.2.3 | root 登入 → `date -s` 對時 → 清 job log → **收掉前一輪殘留**(`hw-test-session finish` → `bgctl reset --yes` → `bgctl stop --all` → `bgctl list` 確認清空)→ `hw-test-session start` → **設定風扇轉速** → **等資料面就緒**(`wait_init.ttl`)→ DUT 清單(boot/version/fwutil/syseeprom/ssdhealth/TPM/NVMe)→ BMC enroll + version/status → source bash 工具 → 清/讀 7 組 PCIe AER + `ras-mc-ctl --summary` → `lspci` → margin → PMON → dmesg → **10G/1G 管理網路 ping** → **NFC 基線**(start → 30s → stop → report)→ 100G uplink 設定與狀態 → **BER 基線掃描**(依 `SWB_UNIT`,V1.2.1 新增)→ **一輪流量基線** → **SerDes DSC 基線**(`EN_TX_FIR`)→ `show uptime` | | **Script A(Pre-test)** | `1_Blanton_Script_A.ttl` V1.2.6 | root 登入 → `date -s` 對時 → 清 job log → **收掉前一輪殘留**(`hw-test-session finish` → `bgctl reset --yes` → `bgctl stop --all` → `bgctl list` 確認清空)→ `hw-test-session start` → **設定風扇轉速** → **等資料面就緒**(`wait_init.ttl`)→ DUT 清單(boot/version/fwutil/syseeprom/ssdhealth/TPM/NVMe)→ BMC enroll + version/status → source bash 工具 → 清/讀 7 組 PCIe AER + `ras-mc-ctl --summary` → `lspci` → margin → PMON → dmesg → **10G/1G 管理網路 ping** → **NFC 基線**(start → 30s → stop → report)→ 100G uplink 設定與狀態 → **`unused_lanes.sh off`**(V1.2.6)→ **BER 基線掃描**(依 `SWB_UNIT`,V1.2.1 新增)→ **一輪流量基線**(V1.2.6 起兩 unit 時夾 FDR,sleep 40) → **SerDes DSC 基線**(`EN_TX_FIR`)→ `show uptime` |
| **Script B(Stress)** | `2_Blanton_Script_B.ttl` | **V1.1.8 起 `mlucas-avx2 -cpu 0:15` 由 `systemd-run --unit=mlucas-amm`(`Type=exec`、`Restart=always`)啟動,不再是 shell 的 `&` 背景 job** + `bgctl run` 的 `memtester` / SSD / USB 壓力(v1.1.7 起 SSD/USB 的 `--runtime`/`--passes` 讀 `config.ttl` 的 `SSD_RUNTIME`/`SSD_COUNT`、`USB_RUNTIME`/`USB_COUNT`;BMC memtester 不帶次數 = 跑到被停) + BMC DDR(`bmc-manager run memtester`)→ BMC USB net test(探測 cdc_ncm 介面,`systemd-run` 掛 `BMC_USB_RUNTIME` 秒的 ping,V1.1.8 前寫死 4 小時)→ 啟動 mgmt ping 監控 → **啟動 NFC 輪詢** → `jobs` / `systemctl is-active mlucas-amm` / `bgctl list` → traffic(依 `SWB_UNIT`)→ `while 1` 每輪 PMON + `bgctl list`/`jobs`/`systemctl is-active mlucas-amm` + `sleep 60`(**V1.1.4 起 margin 不在迴圈內**;V1.2.0 起等待走 DUT 端 `sleep` 而非 macro 端 `pause`)| | **Script B(Stress)** | `2_Blanton_Script_B.ttl` | **V1.1.8 起 `mlucas-avx2 -cpu 0:15` 由 `systemd-run --unit=mlucas-amm`(`Type=exec`、`Restart=always`)啟動,不再是 shell 的 `&` 背景 job** + `bgctl run` 的 `memtester` / SSD / USB 壓力(v1.1.7 起 SSD/USB 的 `--runtime`/`--passes` 讀 `config.ttl` 的 `SSD_RUNTIME`/`SSD_COUNT`、`USB_RUNTIME`/`USB_COUNT`;BMC memtester 不帶次數 = 跑到被停) + BMC DDR(`bmc-manager run memtester`)→ BMC USB net test(探測 cdc_ncm 介面,`systemd-run` 掛 `BMC_USB_RUNTIME` 秒的 ping,V1.1.8 前寫死 4 小時)→ 啟動 mgmt ping 監控 → **啟動 NFC 輪詢** → `jobs` / `systemctl is-active mlucas-amm` / `bgctl list` → traffic(依 `SWB_UNIT`)→ `while 1` 每輪 PMON + `bgctl list`/`jobs`/`systemctl is-active mlucas-amm` + `sleep 60`(**V1.1.4 起 margin 不在迴圈內**;V1.2.0 起等待走 DUT 端 `sleep` 而非 macro 端 `pause`)|
| **Script C(Post-test)** | `3_Blanton_Script_C.ttl` | `kill $(jobs -p)` + **`systemctl stop mlucas-amm`**(systemd unit 不是 shell job,`jobs -p` 抓不到)+ `bgctl stop --all` / `reset` + 停 BMC USB unit、mgmt ping 與 **NFC 輪詢** → PMON + dmesg → 7 組 AER + `ras-mc-ctl` → BMC USB `journalctl` **寫進 `log/bmc_usb_net.log`**(不再印在 console) → `ip -s link show eth0/eth1` → `cat` mlucas log(並 `cp` 進 job 目錄一起帶走)→ **NFC `report`** → traffic `stop` + `report` → **SerDes DSC 收尾**(`EN_TX_FIR`)→ **BER 掃描**(依 `SWB_UNIT`)→ NVMe 健康 → `show reboot-cause` → **margin 掃描**(`EN_Margin`,V1.1.4 由 Script B 移來)→ `uptime` → **job log 複製到 USB(帶時戳)** → `exit` + wait『Script done』→ `hw-test-session finish` | | **Script C(Post-test)** | `3_Blanton_Script_C.ttl` | `kill $(jobs -p)` + **`systemctl stop mlucas-amm`**(systemd unit 不是 shell job,`jobs -p` 抓不到)+ `bgctl stop --all` / `reset` + 停 BMC USB unit、mgmt ping 與 **NFC 輪詢** → PMON + dmesg → 7 組 AER + `ras-mc-ctl` → BMC USB `journalctl` **寫進 `log/bmc_usb_net.log`**(不再印在 console) → `ip -s link show eth0/eth1` → `cat` mlucas log(並 `cp` 進 job 目錄一起帶走)→ **NFC `report`** → traffic `stop` + `report` → **SerDes DSC 收尾**(`EN_TX_FIR`)→ **BER 掃描**(依 `SWB_UNIT`)→ NVMe 健康 → `show reboot-cause` → **margin 掃描**(`EN_Margin`,V1.1.4 由 Script B 移來)→ `uptime` → **job log 複製到 USB(帶時戳)** → `exit` + wait『Script done』→ `hw-test-session finish` |
| **Script 4(Thermal / Safety)** | `4_Blanton_Script_thermal_safety.ttl` | **獨立腳本,不接 A→B→C。** Script A 式的環境建立(登入 / session / 風扇 / `wait_init` / DUT 清單 / BMC / PCIe 清除 / `pcie_bus` / PMON / dmesg)→ **滿載**(`mlucas-avx2 -cpu 0:15`,V1.1.8 起與 Script B 同樣掛成 `mlucas-amm` systemd unit + `blanton_tr518.sh start`)→ `while 1`:PMON + `TH6_SWB0/1_power_readback.sh` + `avt_pmpower.sh`(CPU 封裝功耗,V1.2.3)+ `bgctl list` / `jobs` / `systemctl is-active mlucas-amm`,`pause 60`。**沒有收尾段** —— 中斷後 DUT 仍在 `port cd lb=mac` / `l2 learn off` / `test mode nr=yes`,且 CPU 仍滿載,要手動 `blanton_tr518.sh stop` + `systemctl stop mlucas-amm` | | **Script 4(Thermal / Safety)** | `4_Blanton_Script_thermal_safety.ttl` | **獨立腳本,不接 A→B→C。** Script A 式的環境建立(登入 / session / 風扇 / `wait_init` / DUT 清單 / BMC / PCIe 清除 / `pcie_bus` / PMON / dmesg)→ **滿載**(`mlucas-avx2 -cpu 0:15`,V1.1.8 起與 Script B 同樣掛成 `mlucas-amm` systemd unit + `blanton_tr518.sh start`)→ `while 1`:PMON + `TH6_SWB0/1_power_readback.sh` + `avt_pmpower.sh`(CPU 封裝功耗,V1.2.3)+ `bgctl list` / `jobs` / `systemctl is-active mlucas-amm`,`pause 60`。**沒有收尾段** —— 中斷後 DUT 仍在 `port cd lb=mac` / `l2 learn off` / `test mode nr=yes`,且 CPU 仍滿載,要手動 `blanton_tr518.sh stop` + `systemctl stop mlucas-amm` |
@@ -812,7 +819,7 @@ margin status、全部 VRM 軌的 Vin/Vout/Iout/Temp、CB + ICB 溫感讀值,
- [ ] `CHANGELOG.md`:延續三支腳本頂端的 Version History,集中成一份 - [ ] `CHANGELOG.md`:延續三支腳本頂端的 Version History,集中成一份
- [ ] 三支腳本的 header 版號與 `CHANGELOG.md` 對齊,`config.ttl` 加 `script_version` 並寫進 log 開頭 - [ ] 三支腳本的 header 版號與 `CHANGELOG.md` 對齊,`config.ttl` 加 `script_version` 並寫進 log 開頭
- [ ] `docs/TTL_Script_Blanton_Status_*.xlsx` 更新為全 OK,或把剩餘項目移進 Future Extensions - [ ] `docs/TTL_Script_Blanton_Status_*.xlsx` 更新為全 OK,或把剩餘項目移進 Future Extensions
- [x] 打 git tag,push `nas` + `gitea`(已至 `V1.2.3`;`publish/` 依 Script A 檔頭版號打包) - [x] 打 git tag,push `nas` + `gitea`(已至 `V1.2.6`;`publish/` 依 Script A 檔頭版號打包)
**驗收條件:** 從 zip 解壓到一台乾淨的測試 NB,照 README 操作,不看原始碼就能完成一輪 A→B→C **驗收條件:** 從 zip 解壓到一台乾淨的測試 NB,照 README 操作,不看原始碼就能完成一輪 A→B→C
並產出 summary;`publish/` 內容與 git tag 一致。 並產出 summary;`publish/` 內容與 git tag 一致。
+44 -2
View File
@@ -9,7 +9,7 @@ DUT 端的取數能力由一組 **bash 工具庫** 提供(CB FPGA `pcimem` →
完整架構見 [ARCHITECTURE.md](ARCHITECTURE.md)。 完整架構見 [ARCHITECTURE.md](ARCHITECTURE.md)。
**目前狀態(2026-09-23)**:Script A 為 **V1.2.3**(A 集中記錄所有 TTL 的變更)。涵蓋 **目前狀態(2026-10-21)**:Script A 為 **V1.2.6**(A 集中記錄所有 TTL 的變更)。涵蓋
PCIe AER / DDR EDAC / PMON+TPM / 電壓 margin(9 顆 LTC2980)/ SWB loopback 線速流量 / PCIe AER / DDR EDAC / PMON+TPM / 電壓 margin(9 顆 LTC2980)/ SWB loopback 線速流量 /
10G+1G 管理網路 ping / BMC DDR 與 USB / NVMe 健康,壓力層走平台的 `bgctl`。 10G+1G 管理網路 ping / BMC DDR 與 USB / NVMe 健康,壓力層走平台的 `bgctl`。
switch unit 數量由 `config.ttl` 的 `SWB_UNIT0` / `SWB_UNIT1` 宣告,風扇轉速由 `FAN_SPEED` 指定 switch unit 數量由 `config.ttl` 的 `SWB_UNIT0` / `SWB_UNIT1` 宣告,風扇轉速由 `FAN_SPEED` 指定
@@ -36,11 +36,21 @@ NFC tag 讀取由 `nfc_polling.sh` 背景輪詢(A 做基線、B 起、C 停並
取 PMON + 兩片 SWB 的軌功耗 + **AMD CPU 封裝功耗**(`avt_pmpower.sh`,V1.2.3);**沒有收尾段**,中斷後要手動 `blanton_tr518.sh stop`)。 取 PMON + 兩片 SWB 的軌功耗 + **AMD CPU 封裝功耗**(`avt_pmpower.sh`,V1.2.3);**沒有收尾段**,中斷後要手動 `blanton_tr518.sh stop`)。
**V1.2.3 起 PMON 快照(`utils/setup_pmon.ttl`)多了 DDR5 DIMM 溫度(`ddr5_temp.sh`)與 LTC4287 HSC 溫度 **V1.2.3 起 PMON 快照(`utils/setup_pmon.ttl`)多了 DDR5 DIMM 溫度(`ddr5_temp.sh`)與 LTC4287 HSC 溫度
(`hsc_temp_readback.sh`)**,A/B/C/4/5 全部吃到;HSC 那支每次約 +4 秒。 (`hsc_temp_readback.sh`)**,A/B/C/4/5 全部吃到;HSC 那支每次約 +4 秒。
**V1.2.4 新增 Tray ID I2C stress(`tray_id_stress.sh`)**:Script A 跑一次當基線、Script B 每輪 soak 跑一次。
另新增 **`6_Blanton_Script_BER_Cycle.ttl`**(Diag ↔ SONiC 冷開機循環量 BER,**獨立跑不接 A→B→C**),
操作與分析見 `tmp/BER_Test_Cycle/runbook.md`(tmp 不進 git)。
**V1.2.5 起 PMON 快照也帶兩片 SWB 的軌功耗**(`TH6_SWB{0,1}_power_readback.sh` 搬進 `setup_pmon.ttl`),
⚠️ Script 4 迴圈原本就自己讀一次,現在**每輪讀兩次**。V1.2.5 另有 `blanton_ber_debug.sh`(BER 原始輸出、`p=p31`、`sleep 40`)、
`retimer_lanes.sh` / `unused_lanes.sh`(把沒接線的 retimer lane / TH6 port 關 TX),以及
`5_1_Blanton_Script_Boot_Cycle_Fast.ttl`(Script 5 拿掉流量那段,只留 `ps`)。
**V1.2.6 起 FDR 統計(`blanton_fdr.sh`,`phydiag fdrstat`)接進流量**:A 包住流量基線(sleep 15→40)、
B 在 soak 前 start、每輪 rdcnt、C 收尾 rdcnt + stop,**只在兩個 unit 都開時才跑**。Script A 另在 BER 前先 `unused_lanes.sh off`,
⚠️ **沒有任何地方再 `on` 回來**。
以及 **`5_Blanton_Script_Boot_Cycle.ttl`**(重開機循環,**獨立跑不接 A→B→C**:登入 → 風扇 → 以及 **`5_Blanton_Script_Boot_Cycle.ttl`**(重開機循環,**獨立跑不接 A→B→C**:登入 → 風扇 →
Check Pt1~Pt13 → `reboot` → `wait "Booting in blind mode"`,`cnt_cycle` 每輪遞增,`while 1` 無止境, Check Pt1~Pt13 → `reboot` → `wait "Booting in blind mode"`,`cnt_cycle` 每輪遞增,`while 1` 無止境,
要停就關 Tera Term 的 macro)。**尚未上機驗證**。 要停就關 Tera Term 的 macro)。**尚未上機驗證**。
流程圖:`docs/Blanton_Test_Flow.drawio`。 流程圖:`docs/Blanton_Test_Flow.drawio`。
最後一次發布是 **V1.2.3**;SWB 的 I2C 通道與位址已於 2026-08-19 上機驗證。 最後一次發布是 **V1.2.6**;SWB 的 I2C 通道與位址已於 2026-08-19 上機驗證。
margin 的 `VNOM` 已於 2026-08-30 改為 Blanton 實測中位數(144 條軌中 86 條上調 0.8~2.5%)。 margin 的 `VNOM` 已於 2026-08-30 改為 Blanton 實測中位數(144 條軌中 86 條上調 0.8~2.5%)。
交付用 `./publish/publish.sh` 打包。 交付用 `./publish/publish.sh` 打包。
@@ -140,6 +150,12 @@ bash ~/Blanton_Script/port_prbs_monitor.sh stop # 收尾會跑 prbsstat
# ⚠️ AVT 是 NDA,不在交付包裡:DUT 上要先解壓到 ~/AVT_Linux_NDA_2.8.37/,沒有就每輪 exit 2 # ⚠️ AVT 是 NDA,不在交付包裡:DUT 上要先解壓到 ~/AVT_Linux_NDA_2.8.37/,沒有就每輪 exit 2
# ⚠️ 數值是 SMU telemetry 不是量測,要準就對照 VR 的 PMBus READ_POUT # ⚠️ 數值是 SMU telemetry 不是量測,要準就對照 VR 的 PMBus READ_POUT
# ── Tray ID I2C stress(V1.2.4,Script A / B 已接)────
~/Blanton_Script/tray_id_stress.sh # bus 34/35/38/39,0x70 reg 0x02:寫 0xA5/0x5A 讀回比對 → Summary
~/Blanton_Script/tray_id_stress.sh -n 100 # 重複 100 輪
~/Blanton_Script/tray_id_stress.sh -R # 跑完不還原(預設會寫回原值並讀回確認)
# exit 0 = 全 PASS、1 = 有 FAIL(讀回不符)或 ERROR(i2cset/i2cget 本身失敗)、2 = 參數錯
# ── PDB / CPB power brick 讀值 ────────────────────── # ── PDB / CPB power brick 讀值 ──────────────────────
./Blanton_Script/pwr_brick.sh show # Vin/Iin/Vout/Iout/Temp × 5 顆 ./Blanton_Script/pwr_brick.sh show # Vin/Iin/Vout/Iout/Temp × 5 顆
./Blanton_Script/pwr_brick.sh show -r # 多印 raw word ./Blanton_Script/pwr_brick.sh show -r # 多印 raw word
@@ -169,6 +185,27 @@ sleep 30 # 至少等一個 interval 再 rep
# -u 0 / -u 1 單邊;-c 1e-9 換門檻;-F 只列失敗;-f <log> 離線重解 # -u 0 / -u 1 單邊;-c 1e-9 換門檻;-F 只列失敗;-f <log> 離線重解
# ⚠️ 不能跟 blanton_traffic_linespeed / blanton_tr518 同時跑(都會接管同一批 port) # ⚠️ 不能跟 blanton_traffic_linespeed / blanton_tr518 同時跑(都會接管同一批 port)
# ── BER 原始輸出(V1.2.5,不判定、不 summary,TTL 未接)──
./Blanton_Script/blanton_ber_debug.sh # unit 0+1:set p=p31 → get×2 → STArt 30 → sleep 40 → Ber → STOp → clear
./Blanton_Script/blanton_ber_debug.sh -u 0 # 單一 unit
# 清單同 tools/BER_Test.txt,不含 268;BER_PORTS="...,268" 可加
# ⚠️ 這支是 p=p31(已上機驗證),blanton_ber.sh 仍是 p=3 —— 兩者量的碼型可能不同
# ── FDR 統計(V1.2.6,A/B/C 已接,只在 SWB_UNIT0=SWB_UNIT1=1)──
~/Blanton_Script/blanton_fdr.sh start # fdrstat STArt bin_group=both Interval=30,unit 0 → 1
~/Blanton_Script/blanton_fdr.sh clear # fdrstat clear
~/Blanton_Script/blanton_fdr.sh rdcnt # fdrstat Counters(Interval 結算後才讀,A 用 sleep 40)
~/Blanton_Script/blanton_fdr.sh stop # fdrstat STOp ⚠️ 關鍵字是類推的,未上機驗證
# -u 0|1 單邊;-i <sec> 改 Interval;-n dry-run。ports 預設 '1-259,270-565'(FDR_PORTS 可改)
# ── 沒接線的 retimer lane / TH6 port 關 TX(V1.2.5;V1.2.6 起 Script A 會 off,沒人 on 回來)──
./Blanton_Script/unused_lanes.sh status # 兩 unit 全部列出 rx_lock / tx_off
./Blanton_Script/unused_lanes.sh off [--asic 0] [--th6] # 預設 TX squelch;--th6 連 retimer 後面的 TH6 port 一起關
./Blanton_Script/unused_lanes.sh on
./Blanton_Script/retimer_lanes.sh 0 0x102 0xff status # 單顆 retimer:<asic> <addr> <lane_map> <off|on|status>
# ⚠️ lane 有 RX lock(有訊號進來)時 off 會被拒絕(exit 2),--force 才會硬關
# ⚠️ unused_lanes.sh 會檢查同目錄的 retimer_lanes.sh 有沒有 exec bit —— 兩支都要 chmod +x
# ── SerDes DSC 擷取(TX_FIR / RXFFE / DFE / EYE / SNR)── # ── SerDes DSC 擷取(TX_FIR / RXFFE / DFE / EYE / SNR)──
./Blanton_Script/bcm_dsc_scan.sh # unit 0+1 全掃,約 10 分鐘 ./Blanton_Script/bcm_dsc_scan.sh # unit 0+1 全掃,約 10 分鐘
./Blanton_Script/bcm_dsc_scan.sh -u 0 # 只掃一個 unit(時間減半) ./Blanton_Script/bcm_dsc_scan.sh -u 0 # 只掃一個 unit(時間減半)
@@ -357,6 +394,11 @@ Tera Term 連 COM port (115200-8-N-1)
- ⚠️ **`stress_hhmd.py` / `stress_pcie.py` 已於 2026-08-17 由 KC 移除**(Status 表 ScriptB #5/#7)。 - ⚠️ **`stress_hhmd.py` / `stress_pcie.py` 已於 2026-08-17 由 KC 移除**(Status 表 ScriptB #5/#7)。
Script B 現在是 **8 個背景 job**(1 mlucas + 5 mem + ssd + usb),不是 10 個。 Script B 現在是 **8 個背景 job**(1 mlucas + 5 mem + ssd + usb),不是 10 個。
I2C/PCIe 的持續讀取壓力目前沒有替代品。 I2C/PCIe 的持續讀取壓力目前沒有替代品。
- ⚠️ **`prbsstat Ber` 要等第一個 interval 結算之後才讀:sleep 必須「大於」Interval**(2026-09-30 驗證)。
`6_Blanton_Script_BER_Cycle.ttl` 用 `Interval=30` + `sleep 40`。拿同一輪 `prbs get` 的錯誤數交叉比對:sleep 10 時 Diag 低 ~60×、
SONiC 低 ~40×;sleep 30(= Interval)時 Diag 仍低 ~60×(Ber 在 STArt 後 30.15 s 送出,剛好在結算前)。
⚠️ **Script A / C 的 BER 也是 `blanton_ber.sh start`(Interval=30)→ TTL `sleep 30` → `report`**,跑在 SONiC 上 —— 正是「sleep = Interval」的邊界情況,
能不能趕上第一個 interval 結算**未驗證**。建議改成 `sleep 40`(或 `BER_INTERVAL` 調小),並用 `validate_prbsget.py` 的方法驗證一次
- ⚠️ **`pause` 是停 macro,`sleep` 是停 DUT**(V1.2.0 起 A/B/C 一律用後者):`pause N` 期間 macro 不理會 - ⚠️ **`pause` 是停 macro,`sleep` 是停 DUT**(V1.2.0 起 A/B/C 一律用後者):`pause N` 期間 macro 不理會
DUT,shell 是閒著的,等於用猜的估上一個指令跑多久;`sendln "sleep N"` + `wait prompt_sonic_root` DUT,shell 是閒著的,等於用猜的估上一個指令跑多久;`sendln "sleep N"` + `wait prompt_sonic_root`
把等待放到 DUT 上,prompt 回來才繼續,兩邊不會走散,而且這一段會帶時戳進 log。 把等待放到 DUT 上,prompt 回來才繼續,兩邊不會走散,而且這一段會帶時戳進 log。
+54
View File
@@ -0,0 +1,54 @@
# v1.2.4 — Tray ID I2C stress in Script A and B, and a Diag / SONiC BER cycle that reads the BER correctly
## ✨ New features
**`tray_id_stress.sh` — Tray ID I2C write / read-back stress**
* Buses `34` / `35` / `38` / `39`, device `0x70`, register `0x02`. Each bus gets `0xA5` written and read back, then `0x5A` written and read back — the two patterns put every bit in both states.
* One line per step (`PASS` / `FAIL` / `ERROR`), then a per-bus **Summary** table and a single `Tray ID stress RESULT: PASS|FAIL` line. Exit `0` = all PASS, `1` = any FAIL or I2C error, `2` = bad arguments.
* `FAIL` (the read worked but returned the wrong value) and `ERROR` (`i2cset` / `i2cget` itself failed) are counted separately, because they point at different faults.
* The original register value is read first and **written back at the end**, verified by a read. `-R` skips that; `-n N` repeats the whole sequence N times. Buses, address, register and patterns are editable at the top of the file.
**Script A and Script B run it**
* **Script A** runs one pass after `show_dmesg` as the baseline.
* **Script B** runs one pass in every soak round, before `sleep 60` — 12 writes per round, registers restored each time.
**`6_Blanton_Script_BER_Cycle.ttl` — Diag ↔ SONiC BER cycle (standalone)**
* Each cycle measures PRBS BER on unit 0 in the Diag OS, cold-boots into SONiC, measures again, and cold-boots back to Diag. `while 1`, no end. The boot target is picked in the BIOS Boot Manager (`USB Device` = Diag, `Hard Drive` = SONiC).
* Log: `Logs\Blanton_BER_Cycle_<ts>.log`, timestamps always on.
## 🐛 Bug fixes
**`prbsstat Ber` was read before the first interval had been published — BER read 40–60× low**
* The BER cycle originally read `prbsstat Ber` 10 s after `prbsstat STArt Interval=30`. Checked against the error counts that `prbs get` reports in the same cycle, that read **Diag ~60× low and SONiC ~40× low**.
* Moving to `sleep 30` (equal to the interval) fixed SONiC but **not Diag**: its `Ber` goes out 30.15 s after `STArt`, just before the first interval is published. SONiC's `bcmcmd` adds ~0.3 s and just makes it.
* The macro now uses **`Interval=30` + `sleep 40`**. Over 73 cycles both sides agree with the `prbs get` estimate to within 0.1 decade. The rule: **the sleep must be longer than the interval.**
## 📦 Downloads
| File | Contents |
|---|---|
| `Script_ABC_Blanton_V1.2.4.zip` | The full Tera Term working directory, including `Blanton_Script/` to copy onto the DUT |
```bash
chmod +x ~/Blanton_Script/*.sh
grep -rlU $'\r' ~/Blanton_Script # expect no output
```
## ⚠️ Before you run
* **`chmod +x` after deploying.** Script A and B call `tray_id_stress.sh` by path; without the exec bit every call is `Permission denied` and the round carries on without the check.
* **Any BER log taken before 2026-09-30 14:13 reads 40–60× low** (BER cycle with `sleep ≤ Interval`). Relative Diag-vs-SONiC trends are usable; absolute values are not.
* **Script A / C's BER is the same edge case**: `blanton_ber.sh start` (Interval=30) → `sleep 30` → `report`, on SONiC. Whether it catches the first interval has **not been verified**. Lengthening that sleep to 40 is the safe change.
* **The BER cycle's SONiC → Diag boot writes a hard-coded BDF** (`pcimem /sys/bus/pci/devices/0000:05:00.0/resource0 0x480`). Check the CB FPGA BDF on every unit before running it.
* **The BER cycle expects the hostname `sonic`.** A unit with another hostname (e.g. `Margin02`) needs `prompt_sonic` / `prompt_sonic_root` edited, or the macro waits forever.
* **The BER cycle sets the fan to 30 % on the SONiC side only** — SONiC runs ~11 °C hotter than Diag, a variable in any Diag-vs-SONiC comparison.
* **Its SONiC password is the `YourPaSsWoRd` placeholder**, and it does not read `config.ttl` or `secret/`.
* **Script 4 has no teardown**: finish it with `blanton_tr518.sh stop` **and** `systemctl stop mlucas-amm`.
* **`FAN_SPEED` is 100.**
## 🔗 Links
* [ARCHITECTURE.md](https://etgit.et-wen.com/etwen/Blanton_TTL_Script/src/branch/main/ARCHITECTURE.md) — test flow, data models, constraints
* [CLAUDE.md](https://etgit.et-wen.com/etwen/Blanton_TTL_Script/src/branch/main/CLAUDE.md) — commands and the bench gotchas
**Full changelog:** [V1.2.3...V1.2.4](https://etgit.et-wen.com/etwen/Blanton_TTL_Script/compare/V1.2.3...V1.2.4)
+56
View File
@@ -0,0 +1,56 @@
# v1.2.5 — Switch-board rail power in every snapshot, a raw BER run, and tools to turn off unused lanes
## ✨ New features
**PMON snapshots now carry the switch-board rail power**
* `utils/setup_pmon.ttl` calls `TH6_SWB0_power_readback.sh` and `TH6_SWB1_power_readback.sh` right after `show platform current` — the 19 rails of each switch board with V × I and a `TOTAL POWER` line.
* `setup_pmon` is shared, so this lands in Script A, B, C, 4 and 5 alike.
**`blanton_ber_debug.sh` — the hand-run BER flow as one command**
* Runs exactly what `tools/BER_Test.txt` does: `prbs set p=p31` → `prbs get` twice → `prbsstat STArt Interval=30` → `sleep 40` → `prbsstat Ber` → `STOp` → `prbs clear`.
* Every `bcmcmd` output is printed **as is**, under a `### [time] unit N: ...` header — no parsing, no PASS/FAIL, no summary. For looking at the raw output on the bench; `blanton_ber.sh` remains the judged version.
* `-u 0` / `-u 1` for one switch unit; both by default. `BER_POLY`, `BER_INTERVAL`, `BER_WAIT` and `BER_PORTS` can be overridden from the environment.
**`retimer_lanes.sh` / `unused_lanes.sh` — turn off TX on lanes nothing is cabled to**
* `retimer_lanes.sh <asic> <addr> <lane_map> <off|on|status>` acts on one Agera3 retimer, sys **and** line side. `--method squelch` (default, TX squelch, lanes stay powered) or `--method power` (TX+RX power-down, needs an `agera3` that has the `power` command). It reads the state back afterwards and prints `PASS` / `FAIL`.
* `unused_lanes.sh <off|on|status>` applies that to a built-in table — 14 retimer rows and one direct-TH6 row (TSC31, `cd112-cd115`) — on both switch boards. `--asic 0|1|all`, `--th6` to also disable the TH6 ports behind the retimer rows, `--only <target>` for a single row. Ends with `ok / refused / failed` counts.
* **`off` is refused on a lane that receives a signal** (RX PMD lock, or link up on a TH6 port) unless `--force` is given.
**`5_1_Blanton_Script_Boot_Cycle_Fast.ttl` — the boot cycle without the traffic run (standalone)**
* Identical to Script 5, except Check Pt8 only runs `blanton_traffic_linespeed ps` — no `init` / `start` / 15 s / `stop` / `report`. A shorter cycle when the point is the number of boots.
**Boot cycle shows its count in the window title**
* Script 5 and 5_1 set the Tera Term title to `Reboot Cycle Test : n` or `Power Cycle Test : n` each round.
## 🐛 Bug fixes
**`qfx5252-stress-usb` now runs with `--force`** in Script B and in the boot cycles.
## 📦 Downloads
| File | Contents |
|---|---|
| `Script_ABC_Blanton_V1.2.5.zip` | The full Tera Term working directory, including `Blanton_Script/` to copy onto the DUT |
```bash
chmod +x ~/Blanton_Script/*.sh
grep -rlU $'\r' ~/Blanton_Script # expect no output
```
## ⚠️ Before you run
* **`chmod +x` after deploying.** The power readbacks are called by path from every PMON snapshot, and `unused_lanes.sh` refuses to start unless `retimer_lanes.sh` next to it is executable.
* **Script 4 now reads the switch-board power twice per round** — once inside `setup_pmon`, once from its own loop. Harmless, but the log carries both.
* **`blanton_ber_debug.sh` uses `p=p31` (verified on the bench); `blanton_ber.sh`, and so Script A / C, still sets `p=3`.** The two may not be measuring the same pattern — do not compare their BER directly until that is settled.
* **`blanton_ber_debug.sh` leaves out port 268**, the same list as `BER_Test.txt`. Add it with `BER_PORTS="...,268"`.
* **`EN_Cold_Warm_boot = 0` (the `config.ttl` default) hangs Script 5 and 5_1.** Set it to `1` (reboot) or `2` (power cycle).
* **Script 5 and 5_1 are two copies of the same macro** — a fix to one has to be made to the other.
* **Script 4 has no teardown**: finish it with `blanton_tr518.sh stop` **and** `systemctl stop mlucas-amm`.
* **`FAN_SPEED` is 100.**
## 🔗 Links
* [ARCHITECTURE.md](https://etgit.et-wen.com/etwen/Blanton_TTL_Script/src/branch/main/ARCHITECTURE.md) — test flow, data models, constraints
* [CLAUDE.md](https://etgit.et-wen.com/etwen/Blanton_TTL_Script/src/branch/main/CLAUDE.md) — commands and the bench gotchas
**Full changelog:** [V1.2.4...V1.2.5](https://etgit.et-wen.com/etwen/Blanton_TTL_Script/compare/V1.2.4...V1.2.5)
+47
View File
@@ -0,0 +1,47 @@
# v1.2.6 — FDR statistics around the traffic run, and unused lanes turned off before the baseline
## ✨ New features
**`blanton_fdr.sh` — FDR statistics through `phydiag fdrstat`**
* Four sub-commands, each run on unit 0 then unit 1, over ports `'1-259,270-565'`:
`start` (`fdrstat STArt bin_group=both Interval=30`), `clear` (`fdrstat clear`), `rdcnt` (`fdrstat Counters`), `stop` (`fdrstat STOp`).
* Output is printed as is, under a `### [time] unit N: ...` header — no parsing, no PASS/FAIL.
* `-u 0` / `-u 1` for one switch unit, `-i <sec>` for the interval, `-n` for a dry run. `FDR_PORTS` overrides the port list.
**FDR runs alongside the traffic test in Script A, B and C**
* **Script A** wraps its traffic baseline: `fdr start` after `init`, `fdr clear` after `clear`, `fdr rdcnt` after the run, `fdr stop` after the traffic stop. The traffic run is now **40 s instead of 15 s**, so the counters are read after the first 30 s interval has been published — the same rule as `prbsstat Ber`.
* **Script B** starts and clears FDR with the traffic setup, before the soak loop — the counters run for the whole soak — and reads them (`rdcnt`) in every soak round, after the Tray ID stress.
* **Script C** reads them (`rdcnt`) before stopping the traffic and stops FDR after it — the closing read of the counters Script B started.
**Script A turns off the unused lanes before the BER baseline**
* `unused_lanes.sh off` — TX squelch on the unused retimer lanes and TSC31 (`cd112-cd115`) disabled on the TH6, on both switch boards.
## 📦 Downloads
| File | Contents |
|---|---|
| `Script_ABC_Blanton_V1.2.6.zip` | The full Tera Term working directory, including `Blanton_Script/` to copy onto the DUT |
```bash
chmod +x ~/Blanton_Script/*.sh
grep -rlU $'\r' ~/Blanton_Script # expect no output
```
## ⚠️ Before you run
* **`chmod +x` after deploying.** `blanton_fdr.sh`, `unused_lanes.sh` and `retimer_lanes.sh` are all called by path; `unused_lanes.sh` also refuses to start if `retimer_lanes.sh` is not executable.
* **`blanton_fdr.sh stop` sends `fdrstat STOp` — that keyword is inferred from `prbsstat STOp` and has not been checked on the bench.** `bcmcmd` exits 0 even when the BCM shell rejects a command, so if it is wrong, FDR keeps running and only the log shows it. Check the first run.
* **FDR only runs when both switch units are enabled** (`SWB_UNIT0 = SWB_UNIT1 = 1`). The single-unit branches have no FDR, and Script A's single-unit traffic run is still 15 s.
* **Script B's per-round `fdr rdcnt` is not gated by the unit settings** — with one unit enabled, FDR was never started and each round just logs whatever `fdrstat Counters` returns.
* **Nothing turns the unused lanes back on.** Script C has no `unused_lanes.sh on`; run it by hand when the DUT is needed in its normal state. Whether a reboot clears it has not been checked.
* **`unused_lanes.sh off` is not gated by `SWB_UNIT0` / `SWB_UNIT1`** — it always acts on both boards.
* **`blanton_ber.sh` (Script A / C) still uses `p=3` and `sleep 30`**; see v1.2.5.
* **Script 4 has no teardown**: finish it with `blanton_tr518.sh stop` **and** `systemctl stop mlucas-amm`.
* **`FAN_SPEED` is 100.**
## 🔗 Links
* [ARCHITECTURE.md](https://etgit.et-wen.com/etwen/Blanton_TTL_Script/src/branch/main/ARCHITECTURE.md) — test flow, data models, constraints
* [CLAUDE.md](https://etgit.et-wen.com/etwen/Blanton_TTL_Script/src/branch/main/CLAUDE.md) — commands and the bench gotchas
**Full changelog:** [V1.2.5...V1.2.6](https://etgit.et-wen.com/etwen/Blanton_TTL_Script/compare/V1.2.5...V1.2.6)
+160 -3
View File
@@ -1,7 +1,7 @@
; ============================================================================= ; =============================================================================
; Script A for Blanton ; Script A for Blanton
; Version : V1.2.3 ; Version : V1.2.6
; Date : 2026-09-23 ; Date : 2026-10-21
; Author : ETWen ; Author : ETWen
; ============================================================================= ; =============================================================================
; Version History: ; Version History:
@@ -740,6 +740,147 @@
; !! without -q the full PM table is printed every round, and ; !! without -q the full PM table is printed every round, and
; Script 4 loops once a minute - the log grows by one full ; Script 4 loops once a minute - the log grows by one full
; table per minute ; table per minute
; V1.2.4 2026-10-01 Blanton_Script/tray_id_stress.sh Created v1.0.0 - Tray ID I2C write / read-back stress
; Buses 34 / 35 / 38 / 39, device 0x70, register 0x02. Each
; bus: write 0xA5, read back, compare; write 0x5A, read back,
; compare - the two patterns put every bit in both states
; One line per step (PASS / FAIL / ERROR), then a per-bus
; Summary table and 'Tray ID stress RESULT: PASS|FAIL'
; Exit 0 = all PASS, 1 = any FAIL or I2C error, 2 = usage
; -n N repeats the sequence N times; buses / addr / reg /
; patterns are editable at the top of the file
; The original value is read first and written back at the
; end (verified by a read). -R leaves the register at 0x5A
; !! FAIL = the read worked but returned the wrong value;
; ERROR = i2cset / i2cget itself failed. They are counted
; apart because they point at different faults
; !! a bus whose original value cannot be read is NOT
; restored (there is nothing to restore to) - the line
; says so
; !! called by path, so it needs the exec bit on the DUT:
; chmod +x ~/Blanton_Script/*.sh
; ScriptA Add Tray ID stress after show_dmesg (one pass, baseline)
; ScriptB Add Tray ID stress to every soak round, before sleep 60
; Each round now writes 0xA5 / 0x5A to four Tray ID
; registers and restores them - 12 writes per round
; 6_Blanton_Script_BER_Cycle.ttl Added - Diag / SONiC BER cycle, a STANDALONE macro (not A/B/C)
; Each cycle: PRBS BER on unit 0 in the Diag OS, cold boot
; into SONiC, the same PRBS BER again, cold boot back to
; Diag; while 1, no end. Boot selection drives the BIOS
; Boot Manager ('USB Device' = Diag, 'Hard Drive' = SONiC)
; Log: Logs\Blanton_BER_Cycle_<ts>.log, timestamps always on
; Report tools (not shipped): tmp/BER_Test_Cycle/
; parse_multi.py, gen_multi_html.py, validate_prbsget.py
; prbsstat STArt Interval=30, then sleep 40, then Ber
; !! the sleep MUST be longer than the Interval. Checked
; against the error counts that 'prbs get' reports in the
; same cycle: with sleep 10 Diag read ~60x low and SONiC
; ~40x low; with sleep 30 (= Interval) Diag was still
; ~60x low - its Ber is sent 30.15 s after STArt, just
; before the first interval is published. Interval=30 +
; sleep 40 matched on both sides over 73 cycles. Every
; BER log taken before 2026-09-30 14:13 is low by 40-60x
; !! SONiC -> Diag cold boot writes pcimem
; /sys/bus/pci/devices/0000:05:00.0/resource0 0x480 with a
; hard-coded BDF (the Diag side uses fpga_switch.sh, which
; finds the FPGA itself). Check the BDF on every unit
; !! the SONiC password is the YourPaSsWoRd placeholder and
; the macro does not include config.ttl or secret/
; !! prompt_sonic_root is 'root@sonic:~#'. A unit whose
; hostname is not 'sonic' (M02 = Margin02) needs the
; prompts edited or the macro waits forever
; !! fan-speed-control.sh 30 is set on the SONiC side only;
; SONiC runs ~11 C hotter than Diag, a variable in any
; Diag vs SONiC comparison
; !! measures unit 0 only, port 268 not in the list, yet
; wait_init still waits for BOTH units (SWB_UNIT0/1 = 1)
; V1.2.5 2026-10-21 Blanton_Script/blanton_ber_debug.sh Created v1.0.0 - raw BER run of tools/BER_Test.txt
; prbs set p=p31, prbs get x2, prbsstat STArt Interval=30,
; sleep 40, Ber, STOp, prbs clear. Every bcmcmd output is
; printed as is under a '### [time] unit N: ...' header - no
; parsing, no PASS/FAIL, no summary. -u 0 / -u 1, default both
; BER_POLY / BER_INTERVAL / BER_WAIT / BER_PORTS overridable
; !! the port list is the 200G ports only, no 268 - same as
; BER_Test.txt. BER_PORTS="...,268" adds the 100G uplink
; !! p=p31 is verified on the bench. blanton_ber.sh (and so
; Script A / C) still sets p=3 - the two runs do not measure
; the same pattern unless p=3 is PRBS31 as well
; !! standalone, no TTL calls it
; Blanton_Script/retimer_lanes.sh Created - TX off / on / status for lanes of one Agera3 retimer
; retimer_lanes.sh <asic 0|1> <addr> <lane_map> <off|on|status>
; Acts on the sys AND the line side. --method squelch (default,
; TX squelch, lanes stay powered) or power (TX+RX power-down,
; needs an agera3 with the 'power' command - exit 4 if not)
; Reads back after the change: PASS / FAIL, exit 3 on mismatch
; !! 'off' is REFUSED (exit 2) on a lane with RX PMD lock, i.e.
; one that receives a signal. --force overrides
; !! runs agera3 through sudo, 30 s timeout per call
; Blanton_Script/unused_lanes.sh Created - apply off / on / status to every unused lane
; Table at the top: 14 retimer rows (7 fully unused, 7 with
; lanes 4,5 unused) and 1 direct-TH6 row (TSC31, cd112-cd115),
; the same rows on both switch boards. Retimer rows go through
; retimer_lanes.sh, TH6 rows through 'port ... enable=' in
; syncdN's bcmcmd. --asic 0|1|all; --th6 also turns off the TH6
; ports behind the retimer rows; --only <target> for one row
; Ends with ok / refused / failed counts, exit 1 if any failed
; !! calls retimer_lanes.sh from its own directory and checks
; its exec bit - chmod +x both after deploying
; !! bash only (mapfile, [[ =~ ]]), not sh
; utils/setup_pmon.ttl Add TH6_SWB0 / TH6_SWB1 power readback after show platform current
; Every PMON snapshot (A / B / C / 4 / 5) now has the 19 rails
; of each switch board with V x I and TOTAL POWER
; !! Script 4 already called both readbacks in its loop right
; after setup_pmon - it now reads them TWICE per round
; !! every Script B soak round gets longer by both readbacks
; ScriptB Add --force to qfx5252-stress-usb
; 5_.._Boot_Cycle.ttl Window title shows the cycle count every round
; 'Reboot Cycle Test : n' (EN_Cold_Warm_boot = 1) or
; 'Power Cycle Test : n' (= 2), set with settitle
; Add --force to qfx5252-stress-usb, same as Script B
; 5_1_Blanton_Script_Boot_Cycle_Fast.ttl Added - Script 5 without the traffic run, a STANDALONE macro
; Identical to 5_.._Boot_Cycle.ttl except that Check Pt8 runs
; only 'blanton_traffic_linespeed ps' - no init / clear / show
; / start / pause 15 / stop / report. A shorter cycle when the
; point is the number of boots
; !! a second copy of the same macro: a fix to one has to be
; made to the other as well
; !! EN_Cold_Warm_boot = 0 (the config.ttl default) hangs it,
; same as Script 5
; tools/BER_Test.txt p=3 -> p=p31; add a unit 1 block, a both-units block and
; port en=0 / en=1 for all cabled ports on each unit
; V1.2.6 2026-10-21 Blanton_Script/blanton_fdr.sh Created v1.0.0 - FDR statistics through phydiag fdrstat
; start / clear / rdcnt / stop on ports '1-259,270-565':
; fdrstat STArt bin_group=both Interval=30 / clear / Counters /
; STOp. bcmcmd output printed as is, no parsing or PASS/FAIL
; -u 0 / -u 1 (default both), -i <sec> Interval, -n dry run
; !! 'stop' sends 'fdrstat STOp', by analogy with prbsstat STOp
; - NOT verified on the bench. If the BCM shell rejects it,
; FDR keeps running and only the log shows it (bcmcmd exits 0)
; !! called by path - chmod +x ~/Blanton_Script/*.sh
; ScriptA Turn off unused lanes before the BER baseline
; unused_lanes.sh off - both units, TX squelch on the unused
; retimer lanes and TSC31 (cd112-cd115) disabled on the TH6
; !! nothing turns them back on: no 'unused_lanes.sh on' in
; Script C. They stay off until 'unused_lanes.sh on' is run
; by hand (whether a reboot clears them is not checked)
; !! not gated by SWB_UNIT0 / SWB_UNIT1 - always both units
; !! needs the exec bit on unused_lanes.sh AND retimer_lanes.sh
; ScriptA FDR around the traffic baseline (SWB_UNIT0 = SWB_UNIT1 = 1 only)
; init -> fdr start -> clear -> fdr clear -> ... -> start ->
; sleep 40 -> fdr rdcnt -> traffic stop -> fdr stop -> report
; Traffic sleep 15 -> 40 so rdcnt reads after the first 30 s
; Interval is published (same rule as prbsstat Ber)
; !! the single-unit branches have no FDR and still sleep 15
; ScriptB fdr start + fdr clear with the traffic setup, before the loop
; (SWB_UNIT0 = SWB_UNIT1 = 1 only) - the counters run for the
; whole soak
; fdr rdcnt in every soak round, after the Tray ID stress
; !! not gated by SWB_UNIT0 / SWB_UNIT1, unlike the start -
; with one unit enabled FDR was never started, and the
; round just logs whatever fdrstat Counters returns
; ScriptC fdr rdcnt before traffic stop, fdr stop after it
; (SWB_UNIT0 = SWB_UNIT1 = 1 only) - the closing read of the
; counters Script B started, bracketing the soak
; ============================================================================= ; =============================================================================
include "config.ttl" include "config.ttl"
@@ -897,6 +1038,10 @@ endif
include "utils/setup_pmon.ttl" include "utils/setup_pmon.ttl"
include "utils/show_dmesg.ttl" include "utils/show_dmesg.ttl"
; ========== Tray ID Stress Test ==========
wait prompt_sonic_root
sendln "~/Blanton_Script/tray_id_stress.sh"
;include "utils/xxx.ttl" ;include "utils/xxx.ttl"
;wait prompt_sonic_root ;wait prompt_sonic_root
;flushrecv ;flushrecv
@@ -949,6 +1094,10 @@ sendln "config feature state lldp disabled"
wait prompt_sonic_root wait prompt_sonic_root
sendln "config save -y" sendln "config save -y"
; ========== Turn off unused lanes ==========
wait prompt_sonic_root
sendln "~/Blanton_Script/unused_lanes.sh off"
; ========== BER ========== ; ========== BER ==========
; Baseline sweep, taken BEFORE the traffic run - ScriptC takes the closing ; Baseline sweep, taken BEFORE the traffic run - ScriptC takes the closing
; one after its traffic report, so the pair brackets the soak. ; one after its traffic report, so the pair brackets the soak.
@@ -1005,18 +1154,26 @@ if SWB_UNIT0 = 1 && SWB_UNIT1 = 1 then
wait prompt_sonic_root wait prompt_sonic_root
sendln "blanton_traffic_linespeed init" sendln "blanton_traffic_linespeed init"
wait prompt_sonic_root wait prompt_sonic_root
sendln "~/Blanton_Script/blanton_fdr.sh start"
wait prompt_sonic_root
sendln "blanton_traffic_linespeed clear" sendln "blanton_traffic_linespeed clear"
wait prompt_sonic_root wait prompt_sonic_root
sendln "~/Blanton_Script/blanton_fdr.sh clear"
wait prompt_sonic_root
sendln "sleep 5" sendln "sleep 5"
wait prompt_sonic_root wait prompt_sonic_root
sendln "blanton_traffic_linespeed show" sendln "blanton_traffic_linespeed show"
wait prompt_sonic_root wait prompt_sonic_root
sendln "blanton_traffic_linespeed start" sendln "blanton_traffic_linespeed start"
wait prompt_sonic_root wait prompt_sonic_root
sendln "sleep 15" sendln "sleep 40"
wait prompt_sonic_root
sendln "~/Blanton_Script/blanton_fdr.sh rdcnt"
wait prompt_sonic_root wait prompt_sonic_root
sendln "blanton_traffic_linespeed stop" sendln "blanton_traffic_linespeed stop"
wait prompt_sonic_root wait prompt_sonic_root
sendln "~/Blanton_Script/blanton_fdr.sh stop"
wait prompt_sonic_root
sendln "blanton_traffic_linespeed report" sendln "blanton_traffic_linespeed report"
elseif SWB_UNIT0 = 1 && SWB_UNIT1 = 0 then elseif SWB_UNIT0 = 1 && SWB_UNIT1 = 0 then
wait prompt_sonic_root wait prompt_sonic_root
+14 -1
View File
@@ -60,7 +60,7 @@ usb_dev = groupmatchstr1
wait prompt_sonic_root wait prompt_sonic_root
;sprintf2 cmd "bgctl run qfx5252-stress-usb %s 256M --runtime 86400 --passes 1 --write --log /host/hw-eval/jobs/qfx5252-stress-usb.log" usb_dev ;sprintf2 cmd "bgctl run qfx5252-stress-usb %s 256M --runtime 86400 --passes 1 --write --log /host/hw-eval/jobs/qfx5252-stress-usb.log" usb_dev
sprintf2 cmd "bgctl run qfx5252-stress-usb %s 256M --runtime %d --passes %d --write --log /host/hw-eval/jobs/qfx5252-stress-usb.log" usb_dev USB_RUNTIME USB_COUNT sprintf2 cmd "bgctl run qfx5252-stress-usb %s 256M --runtime %d --passes %d --write --log /host/hw-eval/jobs/qfx5252-stress-usb.log --force" usb_dev USB_RUNTIME USB_COUNT
sendln cmd sendln cmd
;wait prompt_sonic_root ;wait prompt_sonic_root
@@ -138,8 +138,12 @@ if SWB_UNIT0 = 1 && SWB_UNIT1 = 1 then
wait prompt_sonic_root wait prompt_sonic_root
sendln "blanton_traffic_linespeed init" sendln "blanton_traffic_linespeed init"
wait prompt_sonic_root wait prompt_sonic_root
sendln "~/Blanton_Script/blanton_fdr.sh start"
wait prompt_sonic_root
sendln "blanton_traffic_linespeed clear" sendln "blanton_traffic_linespeed clear"
wait prompt_sonic_root wait prompt_sonic_root
sendln "~/Blanton_Script/blanton_fdr.sh clear"
wait prompt_sonic_root
sendln "sleep 5" sendln "sleep 5"
wait prompt_sonic_root wait prompt_sonic_root
sendln "blanton_traffic_linespeed show" sendln "blanton_traffic_linespeed show"
@@ -186,6 +190,15 @@ while 1
sendln "jobs" sendln "jobs"
wait prompt_sonic_root wait prompt_sonic_root
sendln "systemctl is-active mlucas-amm" sendln "systemctl is-active mlucas-amm"
; ========== Tray ID Stress Test ==========
wait prompt_sonic_root
sendln "~/Blanton_Script/tray_id_stress.sh"
; ========== FDR Counter Read ==========
wait prompt_sonic_root
sendln "~/Blanton_Script/blanton_fdr.sh rdcnt"
wait prompt_sonic_root wait prompt_sonic_root
sendln "sleep 60" sendln "sleep 60"
endwhile endwhile
@@ -85,9 +85,13 @@ sendln "show interfaces status Ethernet513,Ethernet514"
; ========== CHECK Traffic counters ========== ; ========== CHECK Traffic counters ==========
if SWB_UNIT0 = 1 && SWB_UNIT1 = 1 then if SWB_UNIT0 = 1 && SWB_UNIT1 = 1 then
wait prompt_sonic_root
sendln "~/Blanton_Script/blanton_fdr.sh rdcnt"
wait prompt_sonic_root wait prompt_sonic_root
sendln "blanton_traffic_linespeed stop" sendln "blanton_traffic_linespeed stop"
wait prompt_sonic_root wait prompt_sonic_root
sendln "~/Blanton_Script/blanton_fdr.sh stop"
wait prompt_sonic_root
sendln "blanton_traffic_linespeed report" sendln "blanton_traffic_linespeed report"
elseif SWB_UNIT0 = 1 && SWB_UNIT1 = 0 then elseif SWB_UNIT0 = 1 && SWB_UNIT1 = 0 then
wait prompt_sonic_root wait prompt_sonic_root
@@ -0,0 +1,412 @@
include "config.ttl"
flushrecv
;================================================================
; Log File Creation
;================================================================
gettime str_starttime "%Y%m%d-%H%M%S"
getdir mdir
if EN_log = 1 then
if EN_Cold_Warm_boot = 1 then
sprintf2 filename '%s\Logs\%s_%s_%s.log' mdir project_name "Reboot_Cycle" str_starttime
logopen filename 0 1 1 1
elseif EN_Cold_Warm_boot = 2 then
sprintf2 filename '%s\Logs\%s_%s_%s.log' mdir project_name "Power_Cycle" str_starttime
logopen filename 0 1 1 1
else
endif
endif
cnt_cycle = 0
while 1
cnt_cycle = cnt_cycle + 1
if EN_Cold_Warm_boot = 1 then
sprintf2 log_cycle_msg 'Reboot Cycle Test : %d' cnt_cycle
settitle log_cycle_msg
elseif EN_Cold_Warm_boot = 2 then
sprintf2 log_cycle_msg 'Power Cycle Test : %d' cnt_cycle
settitle log_cycle_msg
else
endif
; ========== Root Login ==========
wait prompt_login
sendln "admin"
wait "Password:"
sendln "YourPaSsWoRd"
wait prompt_sonic
sendln "sudo -i"
wait prompt_sonic_root
sendln "sleep 10"
if EN_Cold_Warm_boot = 1 then
wait prompt_sonic_root
sprintf2 strTitle "echo -e '\033[1;32mReboot Cycle : %d \033[0m'" cnt_cycle
sendln strTitle
elseif EN_Cold_Warm_boot = 2 then
wait prompt_sonic_root
sprintf2 strTitle "echo -e '\033[1;32mPower Cycle : %d \033[0m'" cnt_cycle
sendln strTitle
else
endif
; ========== Pre Setting ==========
; Make log directory
wait prompt_sonic_root
sendln "mkdir ./logs"
; Setting System Time
getdate datestr
gettime timestr
sprintf2 cmd 'sudo date -s "%s %s"' datestr timestr
sendln cmd
; ========== FAN SPEED ==========
wait prompt_sonic_root
sendln "echo 18-0020 > /sys/bus/i2c/drivers/max31790/unbind"
wait prompt_sonic_root
sendln "sleep .5"
wait prompt_sonic_root
sendln "echo 18-0020 > /sys/bus/i2c/drivers/max31790/bind"
wait prompt_sonic_root
sendln "echo 25-0020 > /sys/bus/i2c/drivers/max31790/unbind"
wait prompt_sonic_root
sendln "sleep .5"
wait prompt_sonic_root
sendln "echo 25-0020 > /sys/bus/i2c/drivers/max31790/bind"
wait prompt_sonic_root
sprintf2 fan_ctrl_cmd 'fan-speed-control.sh %d' FAN_SPEED
sendln fan_ctrl_cmd
wait "Set all configured fan channels to"
sendln "y"
; ========== Wait DUT Init ==========
include "utils/wait_init.ttl"
; ========== DUT Info ==========
wait prompt_sonic_root
sprintf2 strCKPt1 "echo -e '\033[36mCheck Pt1 : DUT Info\033[0m'"
sendln strCKPt1
wait prompt_sonic_root
sendln "show boot"
wait prompt_sonic_root
sendln "show version"
wait prompt_sonic_root
sendln "fwutil show status"
wait prompt_sonic_root
sendln "show system-memory"
wait prompt_sonic_root
sendln "show service"
wait prompt_sonic_root
sendln "show platform syseeprom"
wait prompt_sonic_root
sendln "show platform ssdhealth"
wait prompt_sonic_root
sendln "qfx5252-tpm-version"
wait prompt_sonic_root
sendln "/usr/sbin/nvme smart-log -H /dev/nvme0"
wait prompt_sonic_root
sendln "/usr/sbin/smartctl -x /dev/nvme0"
; ========== BMC version ==========
wait prompt_sonic_root
sprintf2 strCKPt2 "echo -e '\033[36mCheck Pt2 : BMC Info\033[0m'"
sendln strCKPt2
wait prompt_sonic_root
sendln "bmc-first-enroll"
wait prompt_sonic_root
sendln "bmc-manager version"
wait prompt_sonic_root
sendln "bmc-manager status"
; ========== Load Shell Script ==========
wait prompt_sonic_root
sendln "source ~/Blanton_Script/blanton_fpga_pcimem.sh"
wait prompt_sonic_root
sendln "source ~/Blanton_Script/blanton_cb_i2c.sh"
wait prompt_sonic_root
sendln "source ~/Blanton_Script/blanton_icb_vi2c.sh"
wait prompt_sonic_root
sendln "source ~/Blanton_Script/blanton_pwr_data.sh"
wait prompt_sonic_root
sendln "source ~/Blanton_Script/blanton_traffic_linespeed.sh"
wait prompt_sonic_root
sendln "source ~/Blanton_Script/LTC2980_Margin_Script/margin.sh"
; ========== CLEAR PCIE Error ==========
include "utils/show_pcie_error_reg_TH6_SWB0.ttl"
include "utils/show_pcie_error_reg_TH6_SWB1.ttl"
include "utils/show_pcie_error_reg_FPGA.ttl"
include "utils/show_pcie_error_reg_BMC.ttl"
include "utils/show_pcie_error_reg_DDR.ttl"
include "utils/show_pcie_error_reg_I210.ttl"
include "utils/show_pcie_error_reg_SSD.ttl"
wait prompt_sonic_root
sendln "/usr/sbin/ras-mc-ctl --summary"
; ========== Check PCIE tree + PCIE link status + GET PCIE bandwidth Test ==========
include "utils/pcie_bus.ttl"
; ========== TAKE DATA ==========
include "utils/setup_pmon.ttl"
include "utils/show_dmesg.ttl"
; ========== 10G/1G MGMT Ping Test ==========
wait prompt_sonic_root
sprintf2 strCKPt3 "echo -e '\033[36mCheck Pt3 : Mgmt Ping Test\033[0m'"
sendln strCKPt3
wait prompt_sonic_root
sendln "./Blanton_Script/mgmt_ping_monitor.sh start"
wait prompt_sonic_root
pause 30
sendln "~/Blanton_Script/mgmt_ping_monitor.sh stop"
wait prompt_sonic_root
sendln "cat ~/Blanton_Script/log/mgmt_ping.log"
wait prompt_sonic_root
sendln "~/Blanton_Script/mgmt_ping_monitor.sh clear"
; ========== NFC Test ==========
wait prompt_sonic_root
sprintf2 strCKPt4 "echo -e '\033[36mCheck Pt4 : NFC Test\033[0m'"
sendln strCKPt4
wait prompt_sonic_root
sendln "~/Blanton_Script/nfc_polling.sh start"
wait prompt_sonic_root
sendln "~/Blanton_Script/nfc_polling.sh status"
wait prompt_sonic_root
sendln "sleep 20"
wait prompt_sonic_root
sendln "~/Blanton_Script/nfc_polling.sh stop"
wait prompt_sonic_root
sendln "~/Blanton_Script/nfc_polling.sh report"
; ========== SSD read/write ==========
wait prompt_sonic_root
sprintf2 strCKPt5 "echo -e '\033[36mCheck Pt5 : SSD Test\033[0m'"
sendln strCKPt5
wait prompt_sonic_root
sendln "rm -rf /host/hw-eval/jobs/qfx5252-stress-ssd.log"
wait prompt_sonic_root
sendln "qfx5252-stress-ssd 1G --runtime 30 --passes 2 --write --force --log /host/hw-eval/jobs/qfx5252-stress-ssd.log"
wait prompt_sonic_root
sendln "cat /host/hw-eval/jobs/qfx5252-stress-ssd.log"
; ========== USB read/write ==========
wait prompt_sonic_root
sprintf2 strCKPt6 "echo -e '\033[36mCheck Pt6 : USB Test\033[0m'"
sendln strCKPt6
; ---- Get USB partition node -> usb_dev ----
usb_dev = ''
wait prompt_sonic_root
sendln 'D=$(bash ~/Blanton_Script/usb_target.sh -o dev 2>/dev/null); echo "<<D""EV=${D:-NONE}>>"'
waitregex '<<DEV=([^>]*)>>'
usb_dev = groupmatchstr1
wait prompt_sonic_root
sendln "rm -rf /host/hw-eval/jobs/qfx5252-stress-usb.log"
wait prompt_sonic_root
sprintf2 cmd "qfx5252-stress-usb %s 256M --runtime 30 --passes 2 --write --log /host/hw-eval/jobs/qfx5252-stress-usb.log --force" usb_dev
sendln cmd
wait prompt_sonic_root
sendln "cat /host/hw-eval/jobs/qfx5252-stress-usb.log"
; ========== BMC USB Test ==========
wait prompt_sonic_root
sprintf2 strCKPt7 "echo -e '\033[36mCheck Pt7 : BMC USB Test\033[0m'"
sendln strCKPt7
wait prompt_sonic_root
sendln 'echo "NCMIF=$(ls -d /sys/bus/usb/drivers/cdc_ncm/*/net/* 2>/dev/null | head -n 1 | xargs -r basename)"'
; timeout is GLOBAL and sticky: left at 15, every 'wait' below gives up after
; 15 s instead of blocking, the macro runs ahead of the DUT and the whole
; cycle desynchronises. Restore it BEFORE the branch so both paths are
; covered - the ping block below waits on 'sleep 10', which is already two
; thirds of the 15 s cap on a loaded DUT.
timeout = 15
waitregex 'NCMIF=[A-Za-z0-9_-]+'
ncm_found = result ; hold it: 'result' is reused below
timeout = 0 ; restore, both paths
if ncm_found = 0 then
messagebox 'cdc_ncm interface not found. Ping test skipped.' 'ERROR'
goto skip_ping
endif
strlen matchstr
cut_len = result - 6 ; 'NCMIF=' = 6 chars
strcopy matchstr 7 cut_len ncm_if ; -> ncm_if = "eth2" / "eth3"
sprintf2 cmd 'ip -br link show %s' ncm_if
wait prompt_sonic_root
sendln cmd
wait prompt_sonic_root
sendln 'systemctl stop qfx5252-bmc-usb-net-test.service 2>/dev/null || true'
wait prompt_sonic_root
sendln 'systemctl reset-failed qfx5252-bmc-usb-net-test.service 2>/dev/null || true'
sprintf2 cmd 'systemd-run --unit=qfx5252-bmc-usb-net-test --property=Type=exec /usr/bin/ping -I %s -i 1 -W 2 -w 14400 192.168.200.200' ncm_if
wait prompt_sonic_root
sendln cmd
wait prompt_sonic_root
sendln "sleep 10"
wait prompt_sonic_root
sendln "systemctl stop qfx5252-bmc-usb-net-test.service"
wait prompt_sonic_root
sendln "journalctl -u qfx5252-bmc-usb-net-test.service --no-pager"
:skip_ping
timeout = 0 ; backstop, same as Script B
; ========== 100G Port Setting ==========
wait prompt_sonic_root
sendln "sudo sfputil lpmode off Ethernet513"
wait prompt_sonic_root
sendln "sudo sfputil lpmode off Ethernet514"
wait prompt_sonic_root
sendln "config interface -n asic0 startup Ethernet513"
wait prompt_sonic_root
sendln "config interface -n asic1 startup Ethernet514"
wait prompt_sonic_root
sendln "config save -y"
; ========== First Traffic Test ==========
; Silent MAC
wait prompt_sonic_root
sendln "config feature state lldp disabled"
wait prompt_sonic_root
sendln "config save -y"
; ========== 100G Port Status ==========
wait prompt_sonic_root
sprintf2 strCKPt8 "echo -e '\033[36mCheck Pt8 : Port Status and 15sec Traffic \033[0m'"
sendln strCKPt8
wait prompt_sonic_root
sendln "show interfaces status Ethernet513,Ethernet514"
; ========== Traffic Test ==========
if SWB_UNIT0 = 1 && SWB_UNIT1 = 1 then
wait prompt_sonic_root
sendln "blanton_traffic_linespeed ps"
elseif SWB_UNIT0 = 1 && SWB_UNIT1 = 0 then
wait prompt_sonic_root
sendln "blanton_traffic_linespeed ps -u 0"
elseif SWB_UNIT0 = 0 && SWB_UNIT1 = 1 then
wait prompt_sonic_root
sendln "blanton_traffic_linespeed ps -u 1"
else
endif
; ========== BER ==========
; PRBS takes the SerDes out of normal operation, so this runs AFTER the
; traffic report. sleep 30 matches blanton_ber.sh BER_INTERVAL - reporting
; earlier reads an interval that has not finished accumulating.
wait prompt_sonic_root
sprintf2 strCKPt8 "echo -e '\033[36mCheck Pt9 : BER Test \033[0m'"
sendln strCKPt8
if SWB_UNIT0 = 1 && SWB_UNIT1 = 1 then
wait prompt_sonic_root
sendln "./Blanton_Script/blanton_ber.sh init"
wait prompt_sonic_root
sendln "./Blanton_Script/blanton_ber.sh start"
wait prompt_sonic_root
sendln "sleep 30"
wait prompt_sonic_root
sendln "./Blanton_Script/blanton_ber.sh report"
wait prompt_sonic_root
sendln "./Blanton_Script/blanton_ber.sh stop"
wait prompt_sonic_root
sendln "./Blanton_Script/blanton_ber.sh clear"
elseif SWB_UNIT0 = 1 && SWB_UNIT1 = 0 then
wait prompt_sonic_root
sendln "./Blanton_Script/blanton_ber.sh init -u 0"
wait prompt_sonic_root
sendln "./Blanton_Script/blanton_ber.sh start -u 0"
wait prompt_sonic_root
sendln "sleep 30"
wait prompt_sonic_root
sendln "./Blanton_Script/blanton_ber.sh report -u 0"
wait prompt_sonic_root
sendln "./Blanton_Script/blanton_ber.sh stop -u 0"
wait prompt_sonic_root
sendln "./Blanton_Script/blanton_ber.sh clear -u 0"
elseif SWB_UNIT0 = 0 && SWB_UNIT1 = 1 then
wait prompt_sonic_root
sendln "./Blanton_Script/blanton_ber.sh init -u 1"
wait prompt_sonic_root
sendln "./Blanton_Script/blanton_ber.sh start -u 1"
wait prompt_sonic_root
sendln "sleep 30"
wait prompt_sonic_root
sendln "./Blanton_Script/blanton_ber.sh report -u 1"
wait prompt_sonic_root
sendln "./Blanton_Script/blanton_ber.sh stop -u 1"
wait prompt_sonic_root
sendln "./Blanton_Script/blanton_ber.sh clear -u 1"
else
endif
; ========== NVME Err Info ==========
wait prompt_sonic_root
sprintf2 strCKPt9 "echo -e '\033[36mCheck Pt10 : NVME Err Info \033[0m'"
sendln strCKPt9
wait prompt_sonic_root
sendln "/usr/sbin/nvme smart-log -H /dev/nvme0"
wait prompt_sonic_root
sendln "/usr/sbin/smartctl -x /dev/nvme0"
; ========== TAKE DATA ==========
wait prompt_sonic_root
sprintf2 strCKPt10 "echo -e '\033[36mCheck Pt11 : Platform Data \033[0m'"
sendln strCKPt10
include "utils/setup_pmon.ttl"
wait prompt_sonic_root
sprintf2 strCKPt12 "echo -e '\033[36mCheck Pt12 : Dmesg_i2c \033[0m'"
sendln strCKPt12
include "utils/show_dmesg.ttl"
; ========== Check PCIE error counters ==========
wait prompt_sonic_root
sprintf2 strCKPt13 "echo -e '\033[36mCheck Pt13 : PCIE Error Counters \033[0m'"
sendln strCKPt13
include "utils/show_pcie_error_reg_TH6_SWB0.ttl"
include "utils/show_pcie_error_reg_TH6_SWB1.ttl"
include "utils/show_pcie_error_reg_FPGA.ttl"
include "utils/show_pcie_error_reg_BMC.ttl"
include "utils/show_pcie_error_reg_DDR.ttl"
include "utils/show_pcie_error_reg_I210.ttl"
include "utils/show_pcie_error_reg_SSD.ttl"
wait prompt_sonic_root
sendln "/usr/sbin/ras-mc-ctl --summary"
; ========== Show Power on uptime ==========
wait prompt_sonic_root
sendln "show uptime"
; ========== Show Power on uptime ==========
if EN_Cold_Warm_boot = 1 then
wait prompt_sonic_root
sendln "reboot"
elseif EN_Cold_Warm_boot = 2 then
wait prompt_sonic_root
sendln "pcimem /sys/bus/pci/devices/0000:05:00.0/resource0 0x480 w 0xD0000"
else
endif
wait "Booting in blind mode"
endwhile
@@ -22,6 +22,14 @@ cnt_cycle = 0
while 1 while 1
cnt_cycle = cnt_cycle + 1 cnt_cycle = cnt_cycle + 1
if EN_Cold_Warm_boot = 1 then
sprintf2 log_cycle_msg 'Reboot Cycle Test : %d' cnt_cycle
settitle log_cycle_msg
elseif EN_Cold_Warm_boot = 2 then
sprintf2 log_cycle_msg 'Power Cycle Test : %d' cnt_cycle
settitle log_cycle_msg
else
endif
; ========== Root Login ========== ; ========== Root Login ==========
wait prompt_login wait prompt_login
sendln "admin" sendln "admin"
@@ -207,7 +215,7 @@ while 1
wait prompt_sonic_root wait prompt_sonic_root
sendln "rm -rf /host/hw-eval/jobs/qfx5252-stress-usb.log" sendln "rm -rf /host/hw-eval/jobs/qfx5252-stress-usb.log"
wait prompt_sonic_root wait prompt_sonic_root
sprintf2 cmd "qfx5252-stress-usb %s 256M --runtime 30 --passes 2 --write --log /host/hw-eval/jobs/qfx5252-stress-usb.log" usb_dev sprintf2 cmd "qfx5252-stress-usb %s 256M --runtime 30 --passes 2 --write --log /host/hw-eval/jobs/qfx5252-stress-usb.log --force" usb_dev
sendln cmd sendln cmd
wait prompt_sonic_root wait prompt_sonic_root
sendln "cat /host/hw-eval/jobs/qfx5252-stress-usb.log" sendln "cat /host/hw-eval/jobs/qfx5252-stress-usb.log"
@@ -0,0 +1,315 @@
;================================================================
; Prompt Definitions
;================================================================
prompt_login = "sonic login:"
prompt_sonic = "admin@sonic:~$"
prompt_sonic_root = "root@sonic:~#"
prompt_diag = "root@(none):~#"
; ============================================================
; [1] Config
; ============================================================
SWB_UNIT0 = 1 ; 1 = this DUT has switch unit 0, wait for it ; 0 = skip
SWB_UNIT1 = 1 ; 1 = this DUT has switch unit 1, wait for it ; 0 = skip
bb_post_hotkey = 'Post Code>>:0226' ; 看到此 POST code 後開始送 ESC
bb_esc_ack = 'Esc is pressed' ; BIOS 收到 ESC 的回應訊息
bb_fp_continue = 'continue to booting' ; Front Page:Continue 反白時的說明欄(同一 row 內的字串)
bb_fp_bootmgr = 'you to the Boot Manager' ; Front Page:Boot Manager 反白時的說明欄
bb_bm_header = 'EFI Boot Devices' ; Boot Manager 清單標題
bb_bm_footer = 'ESC to exit' ; Boot Manager 頁面最後一段文字(畫完判定)
bb_key_esc = #27
bb_key_down = #27'[B'
bb_key_enter = #13
;diag_tok = 'KINGSHARKS' ; EFI USB Device (KINGSHARKS-ANTU04)
;sonic_tok = 'J983670007' ; EFI Hard Drive (J983670007-TS2TMTE712P-VS2)
diag_tok = 'USB Device' ; EFI USB Device (KINGSHARKS-ANTU04)
sonic_tok = 'Hard Drive' ; EFI Hard Drive (J983670007-TS2TMTE712P-VS2)
diag_sig = 'ast1813b_diag' ; EFI Shell 執行 startup.nsh 載入的 diag kernel
sonic_sig = 'SONiC-OS' ; SONiC GRUB entry 名稱(請依實際 GRUB 畫面確認)
gettime str_starttime "%Y%m%d-%H%M%S"
getdir mdir
sprintf2 filename '%s\Logs\%s_%s_%s.log' mdir "Blanton" "BER_Cycle" str_starttime
; logopen <file> <binary> <append> <PlainText> <timestamp>
; binary=0 text mode, so PlainText / timestamp are honoured
; append=1 keep earlier cycles, do not overwrite
; PlainText=1 strip the ANSI colour codes SONiC emits
logopen filename 0 1 1 1
test_cycle = 0
while 1
test_cycle = test_cycle + 1
flushrecv
logwrite ''#13#10
sprintf2 log_cycle_msg 'BER Diag/SONiC Cycle Test : %d'#13#10 test_cycle
logwrite '#####################################'#13#10
logwrite log_cycle_msg
logwrite '#####################################'#13#10
settitle log_cycle_msg
; ============================================================
; [2] Call : Script where switching is needed
; ============================================================
; ====== Diag Test ======
wait prompt_diag
sendln 'swutil 0:dsh -c "phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs set p=3"'
wait prompt_diag
sendln 'swutil 0:dsh -c "phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs get"'
wait prompt_diag
sendln 'swutil 0:dsh -c "phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs get"'
wait prompt_diag
sendln 'swutil 0:dsh -c "phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat STArt Interval=30"'
wait prompt_diag
sendln "sleep 40"
wait prompt_diag
sendln 'swutil 0:dsh -c "phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat Ber"'
wait prompt_diag
sendln 'swutil 0:dsh -c "phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat STOp"'
wait prompt_diag
sendln 'swutil 0:dsh -c "phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs clear"'
wait prompt_diag
sendln 'swutil 0:dsh -c "phydiag 256-259 dsc"'
wait prompt_diag
sendln 'swutil 0:show temp'
wait prompt_diag
sendln "swutil *:extphy core_diag all"
wait prompt_diag
; ---- Diag -> SONiC ----
sendln 'fpga_switch.sh cb 0 0x480 0xD0000'
bb_target_tok = sonic_tok
bb_sig_target = sonic_sig
bb_sig_other = diag_sig
call bb_boot_to
if bb_ok = 0 then
sprintf2 bb_msg 'Boot to SONiC failed: %s' bb_err
messagebox bb_msg 'bios_boot'
end
endif
; ========== SONiC Test ==========
wait prompt_login
sendln "admin"
wait "Password:"
sendln "YourPaSsWoRd"
wait prompt_sonic
sendln "sudo -i"
wait prompt_sonic_root
sendln "sleep 10"
; ========== FAN SPEED ==========
wait prompt_sonic_root
sendln "echo 18-0020 > /sys/bus/i2c/drivers/max31790/unbind"
wait prompt_sonic_root
sendln "sleep .5"
wait prompt_sonic_root
sendln "echo 18-0020 > /sys/bus/i2c/drivers/max31790/bind"
wait prompt_sonic_root
sendln "echo 25-0020 > /sys/bus/i2c/drivers/max31790/unbind"
wait prompt_sonic_root
sendln "sleep .5"
wait prompt_sonic_root
sendln "echo 25-0020 > /sys/bus/i2c/drivers/max31790/bind"
wait prompt_sonic_root
sprintf2 fan_ctrl_cmd 'fan-speed-control.sh %d' 30
sendln fan_ctrl_cmd
wait "Set all configured fan channels to"
sendln "y"
; ========== Wait DUT Init ==========
include "utils/wait_init.ttl"
wait prompt_sonic_root
sendln 'bcmcmd -n 0 -c " dsh -c ' 39 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs set p=3' 39 ' "'
wait prompt_sonic_root
sendln 'bcmcmd -n 0 -c " dsh -c ' 39 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs get' 39 ' "'
wait prompt_sonic_root
sendln 'bcmcmd -n 0 -c " dsh -c ' 39 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs get' 39 ' "'
wait prompt_sonic_root
sendln 'bcmcmd -n 0 -c " dsh -c ' 39 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat STArt Interval=30' 39 ' "'
wait prompt_sonic_root
sendln "sleep 40"
wait prompt_sonic_root
sendln 'bcmcmd -n 0 -c " dsh -c ' 39 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat Ber' 39 ' "'
wait prompt_sonic_root
sendln 'bcmcmd -n 0 -c " dsh -c ' 39 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat STOp' 39 ' "'
wait prompt_sonic_root
sendln 'bcmcmd -n 0 -c " dsh -c ' 39 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs clear' 39 ' "'
wait prompt_sonic_root
sendln 'bcmcmd -n 0 -c "dsh -c ' 39 'phydiag 256-259 dsc' 39 '"'
wait prompt_sonic_root
sendln 'show plat temperature'
; ---- SONiC -> Diag ----
wait prompt_sonic_root
sendln 'pcimem /sys/bus/pci/devices/0000:05:00.0/resource0 0x480 w 0xD0000'
bb_target_tok = diag_tok
bb_sig_target = diag_sig
bb_sig_other = sonic_sig
call bb_boot_to
if bb_ok = 0 then
sprintf2 bb_msg 'Boot to Diag failed: %s' bb_err
messagebox bb_msg 'bios_boot'
end
endif
endwhile
logclose
end
; ============================================================
; [3] Subroutine
; ============================================================
:bb_boot_to
bb_saved_to = timeout
call bb_run
timeout = bb_saved_to
mtimeout = 0
return
:bb_run
bb_ok = 0
bb_err = ''
call bb_enter_bios
if bb_ok = 0 return
call bb_goto_bootmgr
if bb_ok = 0 return
call bb_find_idx
if bb_ok = 0 return
call bb_select
call bb_verify
return
; ------------------------------------------------------------
; 等 POST 0226,之後連送 ESC 直到 BIOS 回應 'Esc is pressed'
; ------------------------------------------------------------
:bb_enter_bios
bb_ok = 0
flushrecv ; 清掉 reboot 前的舊資料,避免誤比對
timeout = 300
mtimeout = 0
wait bb_post_hotkey
if result = 0 then
bb_err = 'timeout waiting POST code 0226'
return
endif
timeout = 0
mtimeout = 300
for bb_i 1 200 ; 300 ms x 200 = 最多約 60 秒
send bb_key_esc
wait bb_esc_ack
if result > 0 then
bb_ok = 1
break ; 收到 ack 立即停送,避免多餘 ESC 把 Front Page 退掉
endif
next
mtimeout = 0
if bb_ok = 0 bb_err = 'no ESC ack from BIOS'
return
; ------------------------------------------------------------
; Front Page:預設反白在 Continue,按一次 Down 到 Boot Manager
; 以右側說明欄文字確認反白位置,再按 Enter
; ------------------------------------------------------------
:bb_goto_bootmgr
bb_ok = 0
timeout = 30
wait bb_fp_continue
if result = 0 then
bb_err = 'Front Page not shown'
return
endif
mpause 500
send bb_key_down
timeout = 5
wait bb_fp_bootmgr
if result = 0 then
bb_err = 'cannot highlight Boot Manager'
return
endif
mpause 300
send bb_key_enter
timeout = 15
wait bb_bm_header
if result = 0 then
bb_err = 'Boot Manager page not shown'
return
endif
bb_ok = 1
return
; ------------------------------------------------------------
; 解析 Boot Manager 清單,計算目標 entry 的 index(0-based)
; 每個 entry 以 'EFI '(含 UEFI)或 'SVOS' 開頭計數,命中目標字串即停止
; ------------------------------------------------------------
:bb_find_idx
bb_ok = 0
bb_idx = -1
bb_cnt = 0
timeout = 0
mtimeout = 3000
for bb_i 1 20
wait 'EFI ' 'SVOS' bb_target_tok
if result = 0 break ; 清單畫完仍未命中
if result = 3 then
bb_idx = bb_cnt - 1 ; 目標字串前的 'EFI ' 屬於目標 entry 本身
break
endif
bb_cnt = bb_cnt + 1
next
mtimeout = 0
if bb_idx < 0 then
bb_err = 'target entry not found in Boot Manager'
return
endif
timeout = 5
wait bb_bm_footer ; 等整頁畫完才開始按鍵
bb_ok = 1
return
; ------------------------------------------------------------
; 預設反白在第一個 entry,往下移 bb_idx 格後按 Enter
; ------------------------------------------------------------
:bb_select
mpause 300
if bb_idx > 0 then ; TTL 的 for 1 0 會倒數執行,必須先擋掉
for bb_i 1 bb_idx
send bb_key_down
timeout = 3
wait bb_bm_footer ; BIOS 每按一次會整頁重畫,畫完再按下一次
mpause 200
next
endif
send bb_key_enter
; 之後不可再送任何按鍵:Diag 走 EFI Shell,
; 任何按鍵都會被當成「跳過 / 中斷 startup.nsh」
return
; ------------------------------------------------------------
; 同時等目標與另一個 image 的特徵字串
; ------------------------------------------------------------
:bb_verify
bb_ok = 0
timeout = 300
wait bb_sig_target bb_sig_other
if result = 1 then
bb_ok = 1
elseif result = 2 then
bb_err = 'booted into wrong image'
else
bb_err = 'timeout waiting boot signature'
endif
return
@@ -0,0 +1,100 @@
#!/usr/bin/env bash
# =============================================================================
# blanton_ber_debug.sh -- SerDes BER, raw run of tools/BER_Test.txt
# =============================================================================
# Version History:
# V1.0.0 2026-10-07 First version. Runs the hand-pasted BER flow end to end
# (prbs set p=p31 / prbs get x2 / STArt / sleep 40 / Ber /
# STOp / clear) and prints every bcmcmd output as is --
# no parsing, no PASS/FAIL, no summary. blanton_ber.sh is
# the judged version; this one is for looking at the raw
# output on the bench.
#
# Order of operations (per step, unit 0 first, then unit 1):
# phydiag <ports> prbs set p=p31
# phydiag <ports> prbs get twice: the 1st clears the sticky
# phydiag <ports> prbs get "unlocked since last call", the 2nd
# is the current lock state
# phydiag <ports> prbsstat STArt Interval=30
# sleep 40 MUST be > Interval, or Ber is read
# before the first interval settles
# phydiag <ports> prbsstat Ber
# phydiag <ports> prbsstat STOp
# phydiag <ports> prbs clear releases the lanes back to normal
#
# ⚠️ Links show DOWN while PRBS runs -- that is expected.
# ⚠️ Do not run together with blanton_ber.sh / blanton_traffic_linespeed.sh /
# blanton_tr518.sh -- they all take over the same ports.
#
# Usage:
# ./blanton_ber_debug.sh # unit 0 and 1
# ./blanton_ber_debug.sh -u 0 # unit 0 only
# ./blanton_ber_debug.sh -u 1 # unit 1 only
#
# Env overrides:
# BCMCMD_CMD=bcmcmd BER_POLY=p=p31 BER_INTERVAL=30 BER_WAIT=40
# BER_PORTS="1-24,..." (default: the 200G ports, no 268 -- same as
# tools/BER_Test.txt; add ",268" for the 100G uplink)
# =============================================================================
BCMCMD_CMD="${BCMCMD_CMD:-bcmcmd}"
BER_UNITS="0 1"
BER_PORTS="${BER_PORTS:-1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565}"
BER_POLY="${BER_POLY:-p=p31}"
BER_INTERVAL="${BER_INTERVAL:-30}"
BER_WAIT="${BER_WAIT:-40}"
usage() {
sed -n '/^# Usage:/,/^# =====/p' "$0" | sed '$d; s/^# \{0,1\}//'
}
while [ $# -gt 0 ]; do
case "$1" in
-u|--unit)
case "$2" in
0|1) BER_UNITS="$2" ;;
*) echo "[ERR ] invalid unit '$2' (use 0 or 1)" >&2; exit 2 ;;
esac
shift 2 ;;
-h|--help) usage; exit 0 ;;
*) echo "[ERR ] unknown option '$1'" >&2; usage >&2; exit 2 ;;
esac
done
# bcmcmd reads stdin -- keep it on /dev/null (see blanton_traffic_linespeed.sh V0.3.1)
_bcm() {
local unit="$1"; shift
local cmd="dsh -c 'phydiag ${BER_PORTS} $*'"
echo
echo "### [$(date '+%F %T')] unit $unit: phydiag <ports> $*"
"$BCMCMD_CMD" -n "$unit" -c " ${cmd} " </dev/null 2>&1
}
for u in $BER_UNITS; do
_bcm "$u" "prbs set ${BER_POLY}"
_bcm "$u" "prbs get"
_bcm "$u" "prbs get"
done
for u in $BER_UNITS; do
_bcm "$u" "prbsstat STArt Interval=${BER_INTERVAL}"
done
echo
echo "### [$(date '+%F %T')] sleep ${BER_WAIT}"
sleep "$BER_WAIT"
for u in $BER_UNITS; do
_bcm "$u" "prbsstat Ber"
done
for u in $BER_UNITS; do
_bcm "$u" "prbsstat STOp"
done
for u in $BER_UNITS; do
_bcm "$u" "prbs clear"
done
echo
echo "### [$(date '+%F %T')] BER_DEBUG_DONE units: $BER_UNITS"
@@ -0,0 +1,98 @@
#!/usr/bin/env bash
# =============================================================================
# blanton_fdr.sh -- SerDes FDR statistics (phydiag fdrstat), raw output
# =============================================================================
# Version History:
# V1.0.0 2026-10-21 First version. start / clear / rdcnt / stop over
# 'phydiag <ports> fdrstat ...' through bcmcmd, the same
# way blanton_ber_debug.sh drives prbsstat. Every bcmcmd
# output is printed as is -- no parsing, no PASS/FAIL.
#
# Sub-commands (each one runs on unit 0, then unit 1):
# start phydiag '<ports>' fdrstat STArt bin_group=both Interval=30
# clear phydiag '<ports>' fdrstat clear
# rdcnt phydiag '<ports>' fdrstat Counters
# stop phydiag '<ports>' fdrstat STOp
#
# ⚠️ 'stop' sends 'fdrstat STOp', by analogy with 'prbsstat STOp'. It has
# not been checked on the bench -- if the BCM shell rejects it, look at
# 'phydiag help' (or 'fdrstat' with no argument) for the right keyword.
# ⚠️ bcmcmd exits 0 even when the BCM shell refuses a command, so this
# script cannot tell success from failure. Read the output.
#
# Usage:
# ./blanton_fdr.sh <start|clear|rdcnt|stop> [-u 0|1] [-i <sec>] [-n]
# -u 0 | -u 1 one switch unit only (default: both, 0 then 1)
# -i <sec> start: fdrstat Interval (default 30)
# -n dry run: print the bcmcmd lines, do not run them
#
# Env overrides:
# BCMCMD_CMD=bcmcmd FDR_PORTS=1-259,270-565 FDR_INTERVAL=30
# FDR_BIN_GROUP=both
# =============================================================================
BCMCMD_CMD="${BCMCMD_CMD:-bcmcmd}"
FDR_UNITS="0 1"
FDR_PORTS="${FDR_PORTS:-1-259,270-565}"
FDR_INTERVAL="${FDR_INTERVAL:-30}"
FDR_BIN_GROUP="${FDR_BIN_GROUP:-both}"
FDR_DRY_RUN=0
usage() {
sed -n '/^# Usage:/,/^# =====/p' "$0" | sed '$d; s/^# \{0,1\}//'
}
[ $# -ge 1 ] || { usage >&2; exit 2; }
ACT=$1; shift
case "$ACT" in
start|clear|rdcnt|stop) ;;
-h|--help|help) usage; exit 0 ;;
*) echo "[ERR ] unknown sub-command '$ACT'" >&2; usage >&2; exit 2 ;;
esac
while [ $# -gt 0 ]; do
case "$1" in
-u|--unit)
case "$2" in
0|1) FDR_UNITS="$2" ;;
*) echo "[ERR ] invalid unit '$2' (use 0 or 1)" >&2; exit 2 ;;
esac
shift 2 ;;
-i|--interval)
case "$2" in
''|*[!0-9]*) echo "[ERR ] invalid interval '$2'" >&2; exit 2 ;;
*) FDR_INTERVAL="$2" ;;
esac
shift 2 ;;
-n|--dry-run) FDR_DRY_RUN=1; shift ;;
-h|--help) usage; exit 0 ;;
*) echo "[ERR ] unknown option '$1'" >&2; usage >&2; exit 2 ;;
esac
done
# bcmcmd reads stdin -- keep it on /dev/null (see blanton_traffic_linespeed.sh V0.3.1)
_bcm() {
local unit="$1"; shift
local cmd="dsh -c \"phydiag '${FDR_PORTS}' fdrstat $*\""
echo
echo "### [$(date '+%F %T')] unit $unit: phydiag '${FDR_PORTS}' fdrstat $*"
if [ "$FDR_DRY_RUN" = "1" ]; then
echo "[DRY ] $BCMCMD_CMD -n $unit -c ' ${cmd} '"
return 0
fi
"$BCMCMD_CMD" -n "$unit" -c " ${cmd} " </dev/null 2>&1
}
case "$ACT" in
start) SUB="STArt bin_group=${FDR_BIN_GROUP} Interval=${FDR_INTERVAL}" ;;
clear) SUB="clear" ;;
rdcnt) SUB="Counters" ;;
stop) SUB="STOp" ;;
esac
for u in $FDR_UNITS; do
_bcm "$u" "$SUB"
done
echo
echo "### [$(date '+%F %T')] FDR_${ACT^^}_DONE units: $FDR_UNITS"
@@ -0,0 +1,98 @@
#!/bin/bash
# Turn TX off/on, or show state, for lanes of one Agera3 retimer on the sys and line side.
usage() {
cat <<USAGE
Usage: $0 <asic 0|1> <retimer-addr> <lane_map> <off|on|status> [--method squelch|power] [--force]
squelch TX squelch on sys and line side; lanes stay powered (works with the installed agera3)
power TX+RX lane power-down, the call SONiC makes on admin down; needs an agera3 with 'power'
--force allow 'off' on lanes that receive a signal
USAGE
exit 1
}
[ $# -ge 4 ] || usage
ASIC=$1; ADDR=$2; MAP=$3; ACT=$4; shift 4
METHOD=squelch; FORCE=0
while [ $# -gt 0 ]; do
case $1 in
--method) METHOD=$2; shift 2 ;;
--force) FORCE=1; shift ;;
*) usage ;;
esac
done
case $ASIC in 0|1) ;; *) usage ;; esac
case $ACT in off|on|status) ;; *) usage ;; esac
case $METHOD in squelch|power) ;; *) usage ;; esac
[[ $ADDR =~ ^0x[0-9a-fA-F]+$ && $MAP =~ ^0x[0-9a-fA-F]{1,2}$ ]] || usage
MAPV=$((MAP))
[ "$MAPV" -ge 1 ] || usage
ag() { sudo timeout 30 agera3 "$ASIC" "$ADDR" --no-cleanup "$@" </dev/null 2>&1; }
if [ "$METHOD" = power ] && ! sudo agera3 -h 2>&1 | grep -q -E '^\s+power '; then
echo "agera3 on this system has no 'power' command; use --method squelch"
exit 4
fi
lock_mask() {
ag rx-pmd-lock get side "$1" lane_map=0xff | awk '$2=="|" && $3=="LOCKED" {m += 2^$1} END {printf "%d", m}'
}
lane_tx() {
local lm
lm=$(printf '0x%02x' $((1 << $2)))
if [ "$METHOD" = squelch ]; then
ag squelch get tx "$1" lane_map=$lm | sed -n 's/.*squelch is \([A-Z]*\).*/\1/p' | awk '{print ($1 == "CLEAR") ? "on" : "off"}'
else
ag power get "$1" lane_map=$lm | awk -v l="$2" '$1 == l && $2 == "|" {print $3}'
fi
}
txoff_mask() {
local m=0 l s
for l in 0 1 2 3 4 5 6 7; do
[ $((MAPV >> l & 1)) = 1 ] || continue
s=$(lane_tx "$1" $l)
case $s in
off) m=$((m | 1 << l)) ;;
on) ;;
*) echo "unknown"; return ;;
esac
done
printf '0x%02x' $m
}
report() {
local side
for side in sys line; do
printf 'asic%s %-6s %-4s lane_map=0x%02x rx_lock=0x%02x tx_off=%s (%s)\n' \
"$ASIC" "$ADDR" "$side" "$MAPV" "$(lock_mask $side)" "$(txoff_mask $side)" "$METHOD"
done
}
[ "$ACT" = status ] && { report; exit 0; }
if [ "$ACT" = off ] && [ $FORCE = 0 ]; then
live=$(( ($(lock_mask sys) | $(lock_mask line)) & MAPV ))
if [ $live != 0 ]; then
printf 'REFUSED: asic%s %s lanes 0x%02x receive a signal; use --force to override\n' "$ASIC" "$ADDR" $live
exit 2
fi
fi
for side in sys line; do
if [ "$METHOD" = squelch ]; then
ag squelch set tx $side lane_map=$MAP $([ $ACT = off ] && echo enable || echo disable)
else
ag power set $side lane_map=$MAP $ACT
fi | grep -E 'FAIL|Error'
done
want=0x00; [ "$ACT" = off ] && want=$(printf '0x%02x' $MAPV)
rc=0
for side in sys line; do
got=$(txoff_mask $side)
printf 'asic%s %-6s %-4s lane_map=0x%02x tx_off=%s expected=%s (%s)\n' "$ASIC" "$ADDR" "$side" "$MAPV" "$got" "$want" "$METHOD"
[ "$got" = "$want" ] || rc=3
done
[ $rc = 0 ] && echo "PASS" || echo "FAIL"
exit $rc
@@ -0,0 +1,155 @@
#!/bin/bash
#==============================================================================
# Author : ETWen
# Date : 20261001
# Purpose : Tray ID I2C stress - write a pattern to the Tray ID register on each
# bus, read it back and compare. Patterns 0xA5 and 0x5A exercise every
# bit in both states (1010_0101 / 0101_1010).
# Usage : ./tray_id_stress.sh [-n loops] [-R] [-h]
# -n N repeat the whole sequence N times (default 1)
# -R do NOT restore the original register value at the end
# -h help
# Buses / address / register / patterns are set in the block below.
#
# Exit : 0 = all PASS, 1 = any FAIL or I2C error, 2 = usage
#
# Version History:
# V1.0.0 20261001 Initial Version
#==============================================================================
#------------------------------------------------------------------------------
# Settings - edit here
#------------------------------------------------------------------------------
BUSES=(34 35 38 39) # i2c buses, one Tray ID device each
ADDR=0x70 # device address
REG=0x02 # Tray ID register
PATTERNS=(0xa5 0x5a) # written in this order, each read back and compared
RESTORE=1 # 1 = write the original value back when done
LOOPS=1
usage() {
sed -n '/^# Usage/,/^# Exit/p' "$0" | sed 's/^# \{0,1\}//'
}
while getopts ":n:Rh" opt; do
case "$opt" in
n) LOOPS="$OPTARG" ;;
R) RESTORE=0 ;;
h) usage; exit 0 ;;
:) echo "ERROR: -$OPTARG needs a value" >&2; usage >&2; exit 2 ;;
\?) echo "ERROR: unknown option -$OPTARG" >&2; usage >&2; exit 2 ;;
esac
done
if ! [[ "$LOOPS" =~ ^[1-9][0-9]*$ ]]; then
echo "ERROR: -n must be a positive integer (got '$LOOPS')" >&2; exit 2
fi
for t in i2cset i2cget; do
command -v "$t" >/dev/null 2>&1 || { echo "ERROR: $t not found" >&2; exit 2; }
done
# Counters per bus
declare -A N_PASS N_FAIL N_ERR ORIG
for b in "${BUSES[@]}"; do N_PASS[$b]=0; N_FAIL[$b]=0; N_ERR[$b]=0; ORIG[$b]=""; done
# Read one byte; prints the value (0xNN) on success, returns 1 on failure.
rd() {
local out
out=$(i2cget -f -y "$1" "$ADDR" "$REG" 2>&1)
if [[ $? -ne 0 || ! "$out" =~ ^0x[0-9a-fA-F]{1,2}$ ]]; then
echo "$out"; return 1
fi
echo "$out"
}
TS() { date '+%Y-%m-%d %H:%M:%S'; }
echo "=========================================================="
echo " Tray ID I2C stress $(TS)"
echo " buses: ${BUSES[*]} addr $ADDR reg $REG"
echo " patterns: ${PATTERNS[*]} loops: $LOOPS restore: $RESTORE"
echo "=========================================================="
#------------------------------------------------------------------------------
# Original values (so they can be put back)
#------------------------------------------------------------------------------
for b in "${BUSES[@]}"; do
if v=$(rd "$b"); then
ORIG[$b]="$v"
printf "[bus %-2s %s reg %s] original value: %s\n" "$b" "$ADDR" "$REG" "$v"
else
printf "[bus %-2s %s reg %s] original value: READ ERROR (%s)\n" "$b" "$ADDR" "$REG" "$v"
fi
done
echo "----------------------------------------------------------"
#------------------------------------------------------------------------------
# Write / read-back
#------------------------------------------------------------------------------
for (( loop = 1; loop <= LOOPS; loop++ )); do
(( LOOPS > 1 )) && echo "--- loop $loop / $LOOPS ---"
for b in "${BUSES[@]}"; do
for p in "${PATTERNS[@]}"; do
tag=$(printf "[bus %-2s %s reg %s]" "$b" "$ADDR" "$REG")
if ! werr=$(i2cset -f -y "$b" "$ADDR" "$REG" "$p" 2>&1); then
N_ERR[$b]=$(( N_ERR[$b] + 1 ))
echo "$tag write $p -> WRITE ERROR (${werr:-no message}) ERROR"
continue
fi
if ! got=$(rd "$b"); then
N_ERR[$b]=$(( N_ERR[$b] + 1 ))
echo "$tag write $p -> READ ERROR (${got:-no message}) ERROR"
continue
fi
if (( got == p )); then
N_PASS[$b]=$(( N_PASS[$b] + 1 ))
echo "$tag write $p -> read $got PASS"
else
N_FAIL[$b]=$(( N_FAIL[$b] + 1 ))
echo "$tag write $p -> read $got FAIL"
fi
done
done
done
#------------------------------------------------------------------------------
# Restore
#------------------------------------------------------------------------------
if (( RESTORE )); then
echo "----------------------------------------------------------"
for b in "${BUSES[@]}"; do
o=${ORIG[$b]}; v=""
if [[ -z "$o" ]]; then
printf "[bus %-2s] restore skipped: original value was not readable\n" "$b"
continue
fi
if i2cset -f -y "$b" "$ADDR" "$REG" "$o" >/dev/null 2>&1 && v=$(rd "$b") && (( v == o )); then
printf "[bus %-2s] restored %s\n" "$b" "$o"
else
printf "[bus %-2s] RESTORE FAILED: wanted %s, read %s\n" "$b" "$o" "${v:-?}"
N_ERR[$b]=$(( N_ERR[$b] + 1 ))
fi
done
fi
#------------------------------------------------------------------------------
# Summary
#------------------------------------------------------------------------------
per_bus=$(( LOOPS * ${#PATTERNS[@]} ))
tp=0; tf=0; te=0
echo
echo "=========================== Summary =========================="
printf "%-6s %-6s %-6s %8s %6s %6s %6s %s\n" "BUS" "ADDR" "REG" "CHECKS" "PASS" "FAIL" "ERROR" "RESULT"
for b in "${BUSES[@]}"; do
p=${N_PASS[$b]}; f=${N_FAIL[$b]}; e=${N_ERR[$b]}
tp=$(( tp + p )); tf=$(( tf + f )); te=$(( te + e ))
r=PASS; (( f > 0 || e > 0 || p != per_bus )) && r=FAIL
printf "%-6s %-6s %-6s %8s %6s %6s %6s %s\n" "$b" "$ADDR" "$REG" "$per_bus" "$p" "$f" "$e" "$r"
done
total=$(( per_bus * ${#BUSES[@]} ))
overall=PASS; (( tf > 0 || te > 0 || tp != total )) && overall=FAIL
printf "%-6s %-6s %-6s %8s %6s %6s %6s %s\n" "TOTAL" "" "" "$total" "$tp" "$tf" "$te" "$overall"
echo "=============================================================="
echo "Tray ID stress RESULT: $overall ($(TS))"
[[ "$overall" == PASS ]] && exit 0 || exit 1
@@ -0,0 +1,103 @@
#!/bin/bash
# Apply off/on/status to the unused retimer lanes and TH6 ports listed below, on each ASIC.
# Same rows apply to both switch boards. lanes: retimer lane_map, sys and line side.
# tsc: TH6 TSC as in HW docs and the "#TSCn" labels in th6-helios.config.yml.
# th6_ports: BCM shell port name or range; used by th6 rows, and by retimer rows with --th6.
UNUSED=$(cat <<'TABLE'
# kind target lanes refdes tsc th6_ports note
retimer 0x102 0xff U22 23 cd80-cd83 no used ports
retimer 0x142 0xff U32 38 cd148-cd151 no used ports
retimer 0x21 0xff U39 7 cd16-cd19 no used ports
retimer 0x240 0xff U67 54 cd212-cd215 no used ports
retimer 0x264 0xff U73 62 cd244-cd247 no used ports
retimer 0x48 0xff U82 15 cd48-cd51 no used ports
retimer 0x202 0xff U92 46 cd180-cd183 no used ports
retimer 0x122 0x30 U18 27 cd111 lanes 4,5 unused
retimer 0x248 0x30 U63 58 cd235 lanes 4,5 unused
retimer 0x2 0x30 U70 3 cd15 lanes 4,5 unused
retimer 0x40 0x30 U75 11 cd47 lanes 4,5 unused
retimer 0x162 0x30 U80 42 cd171 lanes 4,5 unused
retimer 0x222 0x30 U87 50 cd203 lanes 4,5 unused
retimer 0x62 0x30 U96 19 cd79 lanes 4,5 unused
th6 TSC31 - - 31 cd112-cd115 direct TH6 TSC, no retimer
# th6 TSC34 - - 34 cd139 direct TH6 TSC34 lanes 6,7; down and unused in full rack, not in HW list
TABLE
)
DIR=$(cd "$(dirname "$0")" && pwd)
usage() {
cat <<USAGE
Usage: $0 <off|on|status> [--asic 0|1|all] [--method squelch|power] [--th6] [--only <target>] [--force]
retimer rows: retimer lanes on sys and line side, via retimer_lanes.sh
th6 rows : TH6 ports in the th6_ports column, via the BCM shell
--th6 : also act on the th6_ports of retimer rows (TH6 ports feeding those retimer lanes)
--only : act on one row, matched by its target column (e.g. 0x102 or TSC31)
USAGE
exit 1
}
[ $# -ge 1 ] || usage
ACT=$1; shift
ASICS="0 1"; METHOD=squelch; TH6=0; ONLY=""; FORCE=""
while [ $# -gt 0 ]; do
case $1 in
--asic) case $2 in all) ASICS="0 1" ;; 0|1) ASICS=$2 ;; *) usage ;; esac; shift 2 ;;
--method) METHOD=$2; shift 2 ;;
--th6) TH6=1; shift ;;
--only) ONLY=$2; shift 2 ;;
--force) FORCE=--force; shift ;;
*) usage ;;
esac
done
case $ACT in off|on|status) ;; *) usage ;; esac
[ -x "$DIR/retimer_lanes.sh" ] || { echo "retimer_lanes.sh not found next to $0"; exit 1; }
bcm() { docker exec "syncd$1" bcmcmd -t 60 "$2" </dev/null 2>&1 | tr -d '\r'; }
ps_state() { bcm "$1" "ps $2" | sed -E 's/\( +/(/' | awk '$1 ~ /^cd[0-9]+\(/ {print $1, $2}'; }
th6_ports() {
local a=$1 act=$2 ports=$3 st
st=$(ps_state "$a" "$ports")
[ -n "$st" ] || { echo "asic$a th6 $ports: no such ports"; return 3; }
if [ "$act" = status ]; then
echo "$st" | sed "s/^/asic$a th6 /"
return 0
fi
if [ "$act" = off ] && [ -z "$FORCE" ] && echo "$st" | awk '$2 == "up"' | grep -q .; then
echo "REFUSED: asic$a th6 $ports has link up: $(echo "$st" | awk '$2 == "up" {printf "%s ", $1}')"
return 2
fi
bcm "$a" "port $ports enable=$([ "$act" = off ] && echo false || echo true)" >/dev/null
sleep 1
st=$(ps_state "$a" "$ports")
echo "$st" | sed "s/^/asic$a th6 /"
if [ "$act" = off ]; then
echo "$st" | awk '$2 != "!ena"' | grep -q . && return 3
else
echo "$st" | awk '$2 == "!ena"' | grep -q . && return 3
fi
return 0
}
mapfile -t ROWS < <(grep -v -E '^[[:space:]]*(#|$)' <<<"$UNUSED")
ok=0; refused=0; failed=0
for a in $ASICS; do
for row in "${ROWS[@]}"; do
read -r kind target lanes refdes tsc ports note <<<"$row"
[ -n "$ONLY" ] && [ "$target" != "$ONLY" ] && continue
echo "== asic$a $kind $target refdes=$refdes TSC$tsc th6=$ports: $note"
rc=0
case $kind in
retimer)
"$DIR/retimer_lanes.sh" "$a" "$target" "$lanes" "$ACT" --method "$METHOD" $FORCE; rc=$?
if [ $TH6 = 1 ] && [ "$ports" != "-" ] && [ $rc != 2 ]; then
th6_ports "$a" "$ACT" "$ports" || rc=$?
fi ;;
th6) th6_ports "$a" "$ACT" "$ports"; rc=$? ;;
*) echo "unknown kind '$kind'"; rc=1 ;;
esac
case $rc in 0) ok=$((ok + 1)) ;; 2) refused=$((refused + 1)) ;; *) failed=$((failed + 1)) ;; esac
done
done
echo "== $ACT done: ok=$ok refused=$refused failed=$failed"
[ $failed = 0 ]
@@ -15,6 +15,10 @@ sendln "show platform voltage"
wait prompt_sonic_root wait prompt_sonic_root
sendln "show platform current" sendln "show platform current"
wait prompt_sonic_root wait prompt_sonic_root
sendln "~/Blanton_Script/TH6_SWB0_power_readback.sh"
wait prompt_sonic_root
sendln "~/Blanton_Script/TH6_SWB1_power_readback.sh"
wait prompt_sonic_root
sendln "show platform ssdhealth" sendln "show platform ssdhealth"
wait prompt_sonic_root wait prompt_sonic_root
sendln "show platform leak status" sendln "show platform leak status"
+44 -1
View File
@@ -1,4 +1,4 @@
bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs set p=3' " bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs set p=p31' "
bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs get' " bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs get' "
bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat STArt Interval=30' " bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat STArt Interval=30' "
@@ -7,6 +7,49 @@ bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-
bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat STOp' " bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat STOp' "
bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs clear' " bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs clear' "
bcmcmd -n 1 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs set p=p31' "
bcmcmd -n 1 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs get' "
bcmcmd -n 1 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat STArt Interval=30' "
bcmcmd -n 1 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat Ber' "
bcmcmd -n 1 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat STOp' "
bcmcmd -n 1 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs clear' "
//BER SWB0/1
bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs set p=p31' "
bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs get' "
bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs get' "
bcmcmd -n 1 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs set p=p31' "
bcmcmd -n 1 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs get' "
bcmcmd -n 1 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs get' "
bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat STArt Interval=30' "
bcmcmd -n 1 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat STArt Interval=30' "
bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat Ber' "
bcmcmd -n 1 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat Ber' "
bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat STOp' "
bcmcmd -n 1 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbsstat STOp' "
bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs clear' "
bcmcmd -n 1 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs clear' "
bcmcmd -n 0 "port 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 en=0"
bcmcmd -n 0 "port 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 en=1"
bcmcmd -n 1 "port 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 en=0"
bcmcmd -n 1 "port 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 en=1"
root@sonic:~# bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs set p=3' " root@sonic:~# bcmcmd -n 0 -c " dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs set p=3' "
dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs set p=3' dsh -c 'phydiag 1-24,40-96,112-168,184-240,256-259,270-308,310-327,342-380,382-399,414-452,454-471,486-524,526-543,558-565 prbs set p=3'
drivshell> drivshell>