Clock Control (u32 mode)
If PMU Present (core revision >= 20)
If clk
- If mode equals 0
- Set bit 2 in MMIO Register 0x1E0
- Delay 33 usec
- Spin wait for 0x20000 to be clear in MMIO Register 0x1E0, test every 10 usec, max of 1500 tries
- Warn if loop expires and bit 0x20000 in 0x1E0 is still set
- Otherwise
If (the PMU Revision is 0) and (MMIO Register 0x1E0 & 0x12 is not zero)
- Spin wait for 0x20000 to be clear in MMIO Register 0x1E0, test every 10 usec, max of 1500 tries
- Clear bit 0x2 in MMIO Register 0x1E0
- If mode equals 0
Set forcefastclk to (mode == 0)
- Otherwise
- Initialize a bool wakeup to false
- Set wakeup to true if the core revision is less than 9
If up and wakeup are both true
Call PHY Ucode Wake Override Set with 1 as argument
Call Clock Control CC with mode as argument and save result as forcefastclk
- If the core revision is less than 11
If forcefastclk
Set bit 0x10 in wake_override
- Otherwise
Clear bit 0x10 in wake_override
If up and wakeup
Call PHY Ucode Wake Override Clear with 1 as argument