Skip to content

Commit

Permalink
backup mode: add documentation for the "resuming" variable
Browse files Browse the repository at this point in the history
"resuming" variable reflect the states which can be
difficult to grasp, document it.

Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
  • Loading branch information
noglitch committed Jul 13, 2017
1 parent 100ed42 commit 148142d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions driver/backup.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,24 @@ static struct at91_pm_bu {
unsigned long resume;
} *pm_bu;

/*
* resuming: static variable to reflect the state of resuming from
* Backup+Self-Refresh mode.
*
* -1: state at AT91Boostrap startup, just after SoC power-up or reset. As such
* it also applies when the system comes back from Backup+Self-Refresh mode
* 0: transient state while the resume process is being evaluated:
* - whether the DDR Backup mode is disabled: boot process can continue
* normally
* - or the DDR Backup mode is programmed but the PM status stored in
* backup SRAM is not consistent => error condition: boot process will
* continue as if the SoC have just experienced a cold boot
* 1: state where AT91Bootstrap is resuming from Backup+Self-Refresh mode
*
* This variable is modified and checked both in external ram initialization sequence
* in driver/ddramc.c and while actually starting the next level image in main.c
* (actually restarting Linux in the case of Backup+Self-Refresh mode).
* */
static int resuming = -1;

static int backup_mode(void)
Expand Down

0 comments on commit 148142d

Please sign in to comment.