Files
Blanton_TTL_Script/docs/release-notes/v1.0.11.md
T
etwenandClaude Opus 5 4854da8518 feat(margin): Save every LTC2977 in one command, and stop lying about failures
margin_save discarded the result of every write, so a NACK printed
"Change Saved" exactly like a successful store. For the one permanent
operation in this tool that is the worst place to stay quiet. Each store
is now checked, named on failure, and reflected in the exit code.

STORE_USER_ALL also went out as 0x15 followed by a dummy 0x00 - an SMBus
write-byte where the command is a send-byte. The LTC2977 tolerated it,
but tolerance is not correctness. Now i2cset ... 0x15 c on the native
path and a no-data cb_pmbus_write on the FPGA path.

Two new subcommands:

  margin_save all      - all nine boards in settings/, then re-init
                         whichever board was loaded beforehand so a
                         following margin_status still reports the board
                         you were looking at. Does not stop on the first
                         failure; a half-saved set is harder to reason
                         about than a fully-attempted one.

  margin_save blanton  - this platform exposes the CB FPGA F3 I2C
                         channels as native Linux i2c buses (Ch6->13,
                         Ch7->14, Ch8->15, Ch9->16; CB stays on bus 4),
                         so all 18 LTC2977 can be stored with plain
                         i2cset: no margin_init, no FPGA channel setup,
                         no pcimem. 18 commands instead of 42.

The 18 raw commands were verified on the DUT 2026-08-27; the wrapper was
tested against stubbed hardware only. Release notes say so.

Board list is MARGIN_BLANTON_STORE at the top of margin.sh - comment out
what this DUT does not have rather than letting it talk to absent boards.
Missing bus and unresponsive chip are reported as distinct failures.

MARGIN_STORE_SETTLE (0.5s) sits between stores because nothing here polls
the part's busy bit, and blanton fires 18 in a row.

Script A -> V1.0.11.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-28 08:39:31 +08:00

4.9 KiB

v1.0.11 — Saving the margin settings to NVM is now one command, and the command is correct

New features

margin_save blanton — all 18 LTC2977 in one go

  • On this platform the CB FPGA's I2C channels are also exposed as ordinary Linux i2c buses, so every margin controller on the box — CB and both switch boards — can be reached with plain i2cset. margin_save blanton walks all 18 of them from one flat list: no margin_init, no FPGA channel setup, no pcimem.
  • The channel-to-bus mapping it relies on (F3 Ch6 → bus 13, Ch7 → 14, Ch8 → 15, Ch9 → 16; CB is bus 4 as before) is now written down in ARCHITECTURE.md and the margin README, not just known at the bench.
  • A partly-populated DUT is a normal build. Comment out the lines you do not have in MARGIN_BLANTON_STORE at the top of margin.sh rather than letting the tool talk to boards that are not there.
  • Missing bus and unresponsive chip are reported as two different failures. /dev/i2c-16 does not exist means the FPGA's i2c adapters did not enumerate; i2cset failed (NACK/busy) means the board is absent or the address is wrong. Chasing the second when you have the first wastes an afternoon.

margin_save all — every board in settings/

  • Runs margin_init + margin_save across all nine boards, then puts back whichever board you had loaded, so a following margin_status still reports the board you were looking at.
  • It does not stop at the first failure: a half-saved set is harder to reason about than a fully-attempted one. The summary names the boards that failed.

Both print a per-chip line and a N saved, M failed tally, and both return a non-zero exit code when anything failed.

🐛 Bug fixes

A failed NVM write still reported success

  • margin_save discarded the result of every write, so a NACK printed Change Saved exactly like a successful store. For the one operation in this tool that is permanent, that is the worst place to stay quiet. Each store is now checked and named if it fails.

STORE_USER_ALL was sent with a data byte it should not have

  • The command went out as 0x15 followed by a dummy 0x00 — an SMBus write-byte, where STORE_USER_ALL is a send-byte. The LTC2977 tolerated it, but tolerance is not correctness. It is now i2cset ... 0x15 c on the native path and a no-data cb_pmbus_write on the FPGA path.

📦 Downloads

File Contents
Script_ABC_Blanton_V1.0.11.zip The full Tera Term working directory, including Blanton_Script/ to copy onto the DUT

After copying to the DUT:

chmod +x ~/Blanton_Script/*.sh      # see below
grep -rlU $'\r' ~/Blanton_Script    # expect no output

mgmt_ping_monitor.sh and port_prbs_monitor.sh launch their workers through bash, so those two run without the execute bit. bmc_monitor.sh and usb_target.sh still need it, and neither git (mode 100644) nor a Windows/USB copy carries it. Without the chmod, start fails with Permission denied and the later cat finds nothing: the section ends up empty and nothing reports an error.

⚠️ Before you run

  • margin_save in any form writes NVM permanently. A power cycle does not undo it. margin_save all and margin_save blanton do it to all 18 controllers at once. Run margin_status_all.sh first and never call any of them during a test run — the macros do not, and should not be made to.
  • The 18 raw commands were verified on the DUT; the wrapper was not. margin_save blanton issues exactly the sequence that was run by hand at the bench, and the packaging was tested against stubbed hardware, but the function itself has not been run on a DUT yet. Watch the per-chip lines the first time.
  • Declare the switch population. SWB_UNIT0 / SWB_UNIT1 in config.ttl say which switch units this DUT has; traffic and the readiness gate both follow them.
  • Set FAN_SPEED. It is applied at the start of every run.
  • Management connectivity is in use, not preserved. Both management NICs are up and pinging — drive the run from the serial console.
  • PRBS is still not wired into the macros. Run port_prbs_monitor.sh by hand if you want it; the calls in A/B/C remain commented out.
  • Two settings persist to config_db.json and survive a reboot: LLDP is left disabled and the 100G uplinks are left configured. Restore them before the DUT moves on.

Full changelog: V1.0.10...V1.0.11