Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gpio straps doc #25971

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marcelocarvalhoLowRisc
Copy link

Documentation adjustments for GPIO Straps feature.

Signed-off-by: Marcelo Carvalho Faleiro de Almeida <[email protected]>
@@ -111,6 +111,7 @@
package: "",
desc: '''
This signal is pulsed high by the power manager after reset in order to sample the HW straps.
It can only be pulsed high one-time after reset. The following pulses will not be taken into consideration.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this sounds like a requirement on the integrator. Don't we want something more like "This will only have an effect the first time it goes high after reset" ? (And I'm not sure about "pulse" in the line: we probably don't have an opinion about whether it has to drop again)

@@ -390,7 +391,14 @@
],
},
{ name: "HW_STRAPS_DATA_IN",
desc: "GPIO Input data sampled as straps during cold boot read value",
desc: '''
GPIO input data that was sampled as straps as the block came out of reset.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I'd avoid the double "as" with something like "... sampled as straps when the block ..."

desc: '''
GPIO input data that was sampled as straps as the block came out of reset.

This register depends on the GpioAsHwStrapsEn parameter.
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess the register exists either way, so maybe "The behaviour of this register depends ..." ?

Comment on lines +399 to +400
- If the parameter is true then GPIO input data is sampled on the first cycle after reset
where the strap_en_i input is high. That sampled data is stored in this register.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest reordering this to "... is sampled after reset on the first cycle where the strap_en_i input is high."

That avoids it sounding like we only do this for special sorts of reset.

The snapshot value of the GPIO inputs is available in the [`HW_STRAPS_DATA_IN`](../data/gpio.hjson#hw_straps_data_in) register for firmware read out
Note that all 32 bits of input data to the GPIO controller are sampled in this mode regardless of the gpio output enable status

The GPIO controller includes an optional feature to sample GPIO input values as hardware configuration straps. After the reset (cold boot), when the strap_en signal is asserted, the GPIO detects the rising edge of the signal and triggers the sampling of GPIO input values one clock cycle later. These sampled values are stored in the HW_STRAPS_DATA_IN register.
Copy link
Contributor

Choose a reason for hiding this comment

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

A couple of style nits:

  • The line is really long because there are missing newlines after the full stops.
  • As with my comment on the hjson change, I think you might need to reorder things to avoid it sounding like "a reset when strap_en is asserted", which isn't what we want.
  • And the sentence that starts "After the reset..." is rather long. Probably worth breaking.
  • I'd also avoid talking about "After the reset...". Can't this be more operational? "After each reset, on the first cycle when strap_en is asserted, ..." ?
  • Also "rising edge" is dangerous: it sounds a bit like we're talking about a clock.
  • Don't talk about "cold boot" in this bit: that's a system-level concern. (I realise that the previous text did so, but we can do better!)


The GPIO controller includes an optional feature to sample GPIO input values as hardware configuration straps. After the reset (cold boot), when the strap_en signal is asserted, the GPIO detects the rising edge of the signal and triggers the sampling of GPIO input values one clock cycle later. These sampled values are stored in the HW_STRAPS_DATA_IN register.

The strap_en signal is driven by the power manager (pwrmgr) and is expected to toggle only once after the reset process. Sampling occurs only during this period, and subsequent changes to the GPIO input configuration will not be captured.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this chunk actually necessary? I think I'd be inclined to drop it, since that's very much a concern of stuff outside of the block.

@rswarbrick
Copy link
Contributor

Nuts: I clicked in the wrong place and didn't leave a summary note!

Thanks for documenting this carefully: I think it looks like a great improvement. Once it's stable, we can get someone from Rivos to check it matches the design they intended.

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.

3 participants