Skip to content

Conversation

@labbott
Copy link
Collaborator

@labbott labbott commented Jan 8, 2026

These have been vetted to be safe to dump

These have been vetted to be safe to dump
Comment on lines 93 to 102
pub const TOFINO_DEBUG_REGS: [(DirectBarSegment, TofinoPcieRegs); 2] = [
(
DirectBarSegment::Bar0,
TofinoPcieRegs::Bar0(TofinoBar0Registers::PcieDevInfo),
),
(
DirectBarSegment::Bar0,
TofinoPcieRegs::Bar0(TofinoBar0Registers::SoftwareReset),
),
];
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is where we need to fill out the rest of the registers

@labbott
Copy link
Collaborator Author

labbott commented Jan 9, 2026

laura@lurch ~ $ FAUX_MGS=~/faux-mgs pilot sp exec -e 'component-details tofino' BRM44220006
Jan 09 14:08:43.009 INFO creating SP handle on interface axf2, component: faux-mgs
Jan 09 14:08:43.011 INFO initial discovery complete, addr: [fe80::aa40:25ff:fe05:500%3]:11111, interface: axf2, socket: control-plane-agent, component: faux-mgs
Pcie(PcieRegisterRead { bar: 0x0 offset: 0x10 reg_result: Ok(0x5cb034ad)) })
Pcie(PcieRegisterRead { bar: 0x0 offset: 0x180 reg_result: Ok(0x215f)) })
Pcie(PcieRegisterRead { bar: 0x0 offset: 0x1a0 reg_result: Ok(0xe300)) })
Pcie(PcieRegisterRead { bar: 0x0 offset: 0x1b4 reg_result: Ok(0x0)) })
Pcie(PcieRegisterRead { bar: 0x0 offset: 0x80000 reg_result: Ok(0xf3fc000)) })
Pcie(PcieRegisterRead { bar: 0x0 offset: 0x80004 reg_result: Ok(0x70000a8)) })
Pcie(PcieRegisterRead { bar: 0x0 offset: 0x8000c reg_result: Ok(0x7fa1b18)) })
Pcie(PcieRegisterRead { bar: 0x0 offset: 0x80038 reg_result: Ok(0xc000c)) })
Pcie(PcieRegisterRead { bar: 0x0 offset: 0x8003c reg_result: Ok(0xc000c)) })
Pcie(PcieRegisterRead { bar: 0x0 offset: 0x80040 reg_result: Ok(0x10261028)) })
Pcie(PcieRegisterRead { bar: 0x0 offset: 0x80044 reg_result: Ok(0x261028)) })
Pcie(PcieRegisterRead { bar: 0x20000000 offset: 0x0 reg_result: Ok(0xe20f03)) })

@labbott labbott requested a review from hawkw January 9, 2026 14:36
Copy link
Contributor

@rmustacc rmustacc left a comment

Choose a reason for hiding this comment

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

Thanks for putting this together @labbott.

.debug_port
.read_direct(segment, offset)
.map_err(SeqError::from)?)
) -> Result<u32, RequestError<FpgaError>> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

given this is a separate API just returning the raw FPGA error seemed much cleaner/more useful

SpComponent::SP5_HOST_CPU => Ok(2),
// The SP3 CPU can report GPIO toggle counts
SpComponent::SP3_HOST_CPU => Ok(1),

Copy link
Member

Choose a reason for hiding this comment

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

spurious whitespace change?

let bounded = if (index.0 as usize)
> drv_sidecar_seq_api::TOFINO_DEBUG_REGS.len()
{
panic!("index out of bounds");
Copy link
Member

Choose a reason for hiding this comment

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

this should be unreachable, due to the higher level code for enumerating components, right? perhaps this should be more explicit here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was going off of the example in mgs_compute_sled.rs but I'll tweak the wording to say this should be unreachable:

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.

4 participants