Skip to content

powman_configure_wakeup_state() broken #2511

Open
@eightycc

Description

@eightycc

Power Manager function powman_configure_wakeup_state() should do the following:

  • Validate that the requested sleep state and the wake-up state adhere to the rules outlined in section 6.2.3 "Power State Transitions" of the RP2350 Datasheet.
  • Configure the power sequencer SEQ_CFG register bits HW_PWRUP_SRAM0 and HW_PWRUP_SRAM1 to power the SRAM power domains when waking up as specified by the wakeup_state argument.

The current implementation has these issues:

  • It will reject valid power state transitions such as P0.0 -> P1.7 -> P0.0, where the current state is P0.0, the sleep state is P1.7, and the wake-up state is P0.0.
  • It does not take the current state into consideration when validating the sleep state.
  • It does not validate that the sleep state is one of the P1.x states, or that the wake-up state is one of the P0.x states.
  • It takes only the sleep state into consideration when setting SEQ_CFG register bits HW_PWRUP_SRAM0 and HW_PWRUP_SRAM1. Since these bits are defined: 0 for power-up and 1 for no change, both the sleep state and the wake-up state must be considered to set them correctly.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions