clock.txt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. Clock scaling
  2. -------------
  3. The kernel supports scaling of CLCK.CMODE, CLCK.CM and CLKC.P0 clock
  4. registers. If built with CONFIG_PM and CONFIG_SYSCTL options enabled, four
  5. extra files will appear in the directory /proc/sys/pm/. Reading these files
  6. will show:
  7. p0 -- current value of the P0 bit in CLKC register.
  8. cm -- current value of the CM bits in CLKC register.
  9. cmode -- current value of the CMODE bits in CLKC register.
  10. On all boards, the 'p0' file should also be writable, and either '1' or '0'
  11. can be rewritten, to set or clear the CLKC_P0 bit respectively, hence
  12. controlling whether the resource bus rate clock is halved.
  13. The 'cm' file should also be available on all boards. '0' can be written to it
  14. to shift the board into High-Speed mode (normal), and '1' can be written to
  15. shift the board into Medium-Speed mode. Selecting Low-Speed mode is not
  16. supported by this interface, even though some CPUs do support it.
  17. On the boards with FR405 CPU (i.e. CB60 and CB70), the 'cmode' file is also
  18. writable, allowing the CPU core speed (and other clock speeds) to be
  19. controlled from userspace.
  20. Determining current and possible settings
  21. -----------------------------------------
  22. The current state and the available masks can be found in /proc/cpuinfo. For
  23. example, on the CB70:
  24. # cat /proc/cpuinfo
  25. CPU-Series: fr400
  26. CPU-Core: fr405, gr0-31, BE, CCCR
  27. CPU: mb93405
  28. MMU: Prot
  29. FP-Media: fr0-31, Media
  30. System: mb93091-cb70, mb93090-mb00
  31. PM-Controls: cmode=0xd31f, cm=0x3, p0=0x3, suspend=0x9
  32. PM-Status: cmode=3, cm=0, p0=0
  33. Clock-In: 50.00 MHz
  34. Clock-Core: 300.00 MHz
  35. Clock-SDRAM: 100.00 MHz
  36. Clock-CBus: 100.00 MHz
  37. Clock-Res: 50.00 MHz
  38. Clock-Ext: 50.00 MHz
  39. Clock-DSU: 25.00 MHz
  40. BogoMips: 300.00
  41. And on the PDK, the PM lines look like the following:
  42. PM-Controls: cm=0x3, p0=0x3, suspend=0x9
  43. PM-Status: cmode=9, cm=0, p0=0
  44. The PM-Controls line, if present, will indicate which /proc/sys/pm files can
  45. be set to what values. The specification values are bitmasks; so, for example,
  46. "suspend=0x9" indicates that 0 and 3 can be written validly to
  47. /proc/sys/pm/suspend.
  48. The PM-Controls line will only be present if CONFIG_PM is configured to Y.
  49. The PM-Status line indicates which clock controls are set to which value. If
  50. the file can be read, then the suspend value must be 0, and so that's not
  51. included.