Skip to content

Conversation

@mkeeter
Copy link
Collaborator

@mkeeter mkeeter commented Sep 25, 2025

Fixes #2244

We would like to be able to read the LAST_POST_CODE register from the FPGA. This PR adds it as a ComponentDetail to the SP5_HOST_CPU component.

The MGS side is oxidecomputer/management-gateway-service#451, so this is marked as a draft (but can still be reviewed).

There are two interesting changes:

  • Inventory::num_component_details now returns 1 for the SP5_HOST_CPU component
  • Inventory::component_details now accepts a closure to handle any components in OUR_DEVICES

The rest of the PR is mostly plumbing, e.g. adding modules to the generated FMC code (because otherwise we have name collisions between espi and sequencer registers).

I tested this on the bench with a Grapefruit, and it "works":

➜  management-gateway-service jj:(zq) cargo run -pfaux-mgs -- --interface=en10 component-details sp5-host-cpu
   Compiling gateway-messages v0.1.0 (/Users/mjk/oxide/management-gateway-service/gateway-messages)
   Compiling gateway-sp-comms v0.1.1 (/Users/mjk/oxide/management-gateway-service/gateway-sp-comms)
   Compiling faux-mgs v0.1.1 (/Users/mjk/oxide/management-gateway-service/faux-mgs)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 7.01s
     Running `target/debug/faux-mgs --interface=en10 component-details sp5-host-cpu`
Sep 25 15:41:12.950 INFO creating SP handle on interface en10, component: faux-mgs
Sep 25 15:41:12.954 INFO initial discovery complete, addr: [fe80::c1d:8cff:fec0:e208%26]:11111, interface: en10, socket: control-plane-agent, component: faux-mgs
LastPostCode(LastPostCode(0))

I've also tested the Sequencer.last_post_code function on a Cosmo through humility hiffy. I would like to do an end-to-end test, but Cosmos with network connectivity are in high demand (see https://github.com/oxidecomputer/meta/issues/761)

@mkeeter
Copy link
Collaborator Author

mkeeter commented Sep 26, 2025

I tested this on London without any issues:

Sep 26 17:33:27.145 INFO creating SP handle on interface london_sw0tp0, component: faux-mgs
Sep 26 17:33:27.146 INFO initial discovery complete, addr: [fe80::aa40:25ff:fe04:402%3]:11111, interface: london_sw0tp0, socket: control-plane-agent, component: faux-mgs
LastPostCode(LastPostCode(3925950469))
matt@castle ~ $ ./faux-mgs --discovery-addr='[fe80::aa40:25ff:fe04:402%3]:11111' --interface=london_sw0tp0 component-details sp5-host-cpu
Sep 26 17:34:07.478 INFO creating SP handle on interface london_sw0tp0, component: faux-mgs
Sep 26 17:34:07.480 INFO initial discovery complete, addr: [fe80::aa40:25ff:fe04:402%3]:11111, interface: london_sw0tp0, socket: control-plane-agent, component: faux-mgs
LastPostCode(LastPostCode(3925938431))

These are 0xea014005 and 0xea0110ff, which are both reasonable values.

The image is in /staff/dock/london/cosmo-sp-test and is flashed on BRM13250012.

Copy link
Collaborator

@labbott labbott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM I'll give it another look when you are ready for final review

@mkeeter
Copy link
Collaborator Author

mkeeter commented Sep 26, 2025

@labbott Final review is pending oxidecomputer/management-gateway-service#451 ; I tagged @jgallagher but you're welcome to look as well!

@mkeeter mkeeter force-pushed the mkeeter/last-post-code branch from c09f337 to 3d9bad9 Compare October 1, 2025 14:00
@mkeeter mkeeter marked this pull request as ready for review October 1, 2025 14:00
@mkeeter mkeeter force-pushed the mkeeter/last-post-code branch from 3d9bad9 to bcd6efc Compare October 1, 2025 15:38
@mkeeter mkeeter enabled auto-merge (squash) October 1, 2025 15:40
@mkeeter mkeeter merged commit 9ff60a0 into master Oct 1, 2025
135 checks passed
@mkeeter mkeeter deleted the mkeeter/last-post-code branch October 1, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cosmo: Provide mechanism to retrieve latest POST code via management network

3 participants