Skip to content

Commit

Permalink
hpr: Add FW upgrade support for PMM and BBU
Browse files Browse the repository at this point in the history
Summary:
(1) Add config to support hpr_pmm. For BBU we are reusing ORv3 panasonic
    vendor since it works unchanged.
(2) Add retry for verify status.
(3) Pass address to suppress_monitoring to make use of PMM monitoring
    pause (used for BBU). This would be a no-op for non-hpr devices.
As title, add vendor config

Test Plan:
HPR AEI PMM PSU: P1558678624
```
orv3-device-update-mailbox.py --addr 32 --vendor hpr_pmm ./AEI/PMM/HPR_PMM_v0001G2_FW_TEST.bin
```

HPR PANA PMM PSU: P1558656240
```
orv3-device-update-mailbox.py --addr 16 --vendor hpr_pmm ./PANA/PMM/HPR-PMM_v0A.01.16.bin
```

HPR PANA BBU: P1558829532
```
orv3-device-update-mailbox.py --addr 48 --vendor panasonic ./PANA/BBU/HPR-BBU_vA2.19.15_0x9914_FW_TEST.bin
```

Reviewed By: doranand

Differential Revision: D62052669

fbshipit-source-id: 877466dbf0f2cc37c34d363dc3142dabbf368b36
  • Loading branch information
amithash authored and facebook-github-bot committed Sep 3, 2024
1 parent 77d68f6 commit 0b97d87
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"block_wait": True,
"hw_workarounds": ["WRITE_BLOCK_CRC_EXPECTED"],
},
"hpr_pmm": {"block_size": 68, "boot_mode": 0xAA55, "block_wait": True},
}

parser = get_parser()
Expand Down Expand Up @@ -94,16 +95,18 @@ def boot_mode(addr, boot_mode):
finally:
time.sleep(10.0)
exit_boot_mode(addr)
time.sleep(10.0)
time.sleep(16.0)
verify_firmware_status(addr, NORMAL_OPERATION_MODE)


@retry(5, delay=1.0)
def verify_firmware_status(addr, expected_status):
# ensure 0x302 register contains expected status
a = rmd.read(addr, 0x302, timeout=1000)[0]
if a != expected_status:
raise ValueError(
"Bad firmware state: ", int(a), " expected: ", int(expected_status)
"Bad firmware state: 0x%02x expected: 0x%02x"
% (int(a), int(expected_status))
)


Expand Down Expand Up @@ -192,7 +195,7 @@ def main():
if args.block_size is not None:
params["block_size"] = args.block_size
print("Upgrade Parameters: ", params)
with suppress_monitoring():
with suppress_monitoring(args.addr):
try:
update_device(args.addr, args.file, params)
except Exception as e:
Expand Down

0 comments on commit 0b97d87

Please sign in to comment.