1*4882a593Smuzhiyun======================================================= 2*4882a593SmuzhiyunFrequently asked questions about the sunxi clock system 3*4882a593Smuzhiyun======================================================= 4*4882a593Smuzhiyun 5*4882a593SmuzhiyunThis document contains useful bits of information that people tend to ask 6*4882a593Smuzhiyunabout the sunxi clock system, as well as accompanying ASCII art when adequate. 7*4882a593Smuzhiyun 8*4882a593SmuzhiyunQ: Why is the main 24MHz oscillator gatable? Wouldn't that break the 9*4882a593Smuzhiyun system? 10*4882a593Smuzhiyun 11*4882a593SmuzhiyunA: The 24MHz oscillator allows gating to save power. Indeed, if gated 12*4882a593Smuzhiyun carelessly the system would stop functioning, but with the right 13*4882a593Smuzhiyun steps, one can gate it and keep the system running. Consider this 14*4882a593Smuzhiyun simplified suspend example: 15*4882a593Smuzhiyun 16*4882a593Smuzhiyun While the system is operational, you would see something like:: 17*4882a593Smuzhiyun 18*4882a593Smuzhiyun 24MHz 32kHz 19*4882a593Smuzhiyun | 20*4882a593Smuzhiyun PLL1 21*4882a593Smuzhiyun \ 22*4882a593Smuzhiyun \_ CPU Mux 23*4882a593Smuzhiyun | 24*4882a593Smuzhiyun [CPU] 25*4882a593Smuzhiyun 26*4882a593Smuzhiyun When you are about to suspend, you switch the CPU Mux to the 32kHz 27*4882a593Smuzhiyun oscillator:: 28*4882a593Smuzhiyun 29*4882a593Smuzhiyun 24Mhz 32kHz 30*4882a593Smuzhiyun | | 31*4882a593Smuzhiyun PLL1 | 32*4882a593Smuzhiyun / 33*4882a593Smuzhiyun CPU Mux _/ 34*4882a593Smuzhiyun | 35*4882a593Smuzhiyun [CPU] 36*4882a593Smuzhiyun 37*4882a593Smuzhiyun Finally you can gate the main oscillator:: 38*4882a593Smuzhiyun 39*4882a593Smuzhiyun 32kHz 40*4882a593Smuzhiyun | 41*4882a593Smuzhiyun | 42*4882a593Smuzhiyun / 43*4882a593Smuzhiyun CPU Mux _/ 44*4882a593Smuzhiyun | 45*4882a593Smuzhiyun [CPU] 46*4882a593Smuzhiyun 47*4882a593SmuzhiyunQ: Were can I learn more about the sunxi clocks? 48*4882a593Smuzhiyun 49*4882a593SmuzhiyunA: The linux-sunxi wiki contains a page documenting the clock registers, 50*4882a593Smuzhiyun you can find it at 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun http://linux-sunxi.org/A10/CCM 53*4882a593Smuzhiyun 54*4882a593Smuzhiyun The authoritative source for information at this time is the ccmu driver 55*4882a593Smuzhiyun released by Allwinner, you can find it at 56*4882a593Smuzhiyun 57*4882a593Smuzhiyun https://github.com/linux-sunxi/linux-sunxi/tree/sunxi-3.0/arch/arm/mach-sun4i/clock/ccmu 58