Scratch Register
The PMC scratch register, SCRATCH_SECURE_RSV109_SCRATCH_0
, also referred
to as SCRATCHr
, holds the Active Boot Chain and the Invalid Chain
field.
The register bit definition is as follows:
Bit | Default | Setting | Description |
---|---|---|---|
31:6 | 0 | RSVD | Do NOT modify this value. It is reserved. |
5:4 | X | ACTIVE_BOOT_CHAIN |
When cleared to 0, the Active Boot Chain is set to 0, or Boot Chain A. When set to 1, the Active Boot Chain is set to 1, or Boot Chain B. When set to 2, the Active Boot Chain is set to 2, or Boot Chain C. |
3 | 0 | RSVD | Do NOT modify this value. It is reserved. |
2 | 0 | INVALID_CHAINC |
When set to one, indicates chain is corrupted. When cleared to 0, indicates chain is not corrupt. |
1 | 0 | INVALID_CHAINB |
When set to one, indicates chain is corrupted. When cleared to 0, indicates chain is not corrupt. |
0 | 0 | INVALID_CHAINA |
When set to one, indicates chain is corrupted. When cleared to 0, indicates chain is not corrupt. |
The contents of the scratch register are retained across soft reboots.
The scratch register is written when:
- User wishes to boot a particular boot chain and the user writes the boot chain in the scratch register then issues a system reboot.
- A bootloader detects corruption and the user updates the
INVALID_CHAINx
register bit and then sets a new Active Boot Chain. - Upon a normal cold boot, the BootROM initializes the register with the selected boot chain.
The contents of the scratch register are read when:
- At any stage during boot, a bootloader reads the scratch register to find the Active Boot Chain. Once the firmware determines the Active Boot Chain, it loads the next stage firmware images in the chain.
- Before beginning a system update, the Update tool reads the value to determine whether the system has booted the desired boot chain.
All bootloaders, except the hypervisor, have read and write permissions for the scratch register. Hypervisor access permissions for the scratch register are as follows:
- Read access: The Partition Loader and Operating System Loader of each guest have read access to the scratch register. Additionally, the Monitor server has read access to the scratch register.
- Write access: The Monitor server has write access to the scratch register. The PL, and Guest OS do NOT have write access.