184.108.40.206. HPS Method 2: Processor Standby Modes and Dynamic Clock Gating
The Cortex-A9 processor can utilize clock-gating logic throughout the MPU subsystem.
Check that the following are enabled/set prior to placing cores in a clock-gated mode:
- Enable dynamic clock gating in the processor cores. Use a CP15 (co-processor) assembly command to access the "Power Control Register".
asm volatile("mcr p15,0,%0,c15,c0,0"::"r"(0x701));Note: The code is GCC specific. Similar syntax can be used with other compliers.
- Ensure the IRQ controller and SCU can take advantage of clock-gated mode. Both IRQ and SCU are set/controlled in the SCU control register:
- Bit 6 disables the IRQ Controller clock when no IRQs are pending
- Bit 5 puts the SCU into standby mode when all processors are clock-gated
volatile uint32 *scucr = (volatile uint32*) 0xFFFEC000; *scucr |= 0x60;
- Enable L2 clock-gating and standby mode. In the Power Control register of the L2-310 Cache Controller, ensure that dynamic clock gating and standby mode are both enabled:
- Dynamic Clock Gating: Set bit1 of pwr_ctrl register
- Standby Mode: Set bit0 of pwr_ctrl register
volatile uint32 *reg15_power_control = (volatile uint32*) 0xFFFEFF80; reg15_power_control |= 0x03;
Please refer to the AMBA Level 2 Cache Controller Technical Reference Manual and Cortex-A9 MPCore Technical Reference Manual for detailed descriptions of the CP15 register, Snoop Control Unit's (SCU's) control register, and the cache controller's power control register.
After ensuring that dynamic clock gating is used within the MPU subsystem, you can put one or both of the Cortex A-9 processor CPUs into clock gating mode by issuing a WFI (wait for interrupt) or WFE (wait for event) assembly instructions. Which one you choose depends on the required system behavior.
Bare-metal design examples illustrating the usage of WFI/WFE and the standby mode (dynamic clock gating) that it enables are included in a companion ZIP file (Power_Optimization.zip). Unzip this file to see two examples. In one of the these designs, one CPU is configured to be in and out of standby mode using the SEV instruction. The other design uses pushbutton IRQs to wake the CPU from the WFI mode.
Did you find the information on this page useful?