091-sun6i-sync-PLL1-multdiv-with-Boot1.patch 1001 B

1234567891011121314151617181920212223242526272829303132
  1. From a58eb20fb80f478038243e9e0f30f6984725e265 Mon Sep 17 00:00:00 2001
  2. From: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
  3. Date: Tue, 6 Jan 2015 15:47:18 +0100
  4. Subject: sun6i: Sync PLL1 multipliers/dividers with Boot1
  5. This change syncs up the multipliers and dividers used to initialize
  6. PLL1 (i.e. the fast clock driving the ARM cores) with the values used
  7. in Allwinner's Boot1 on sun6i.
  8. More specifically, the following settings are now used:
  9. * up to 768MHz: mul=2, div=2 (was: mul=1, div=1)
  10. * up to 1152MHz: mul=3, div=2 (unchanged)
  11. * above 1152MHz: mul=4, div=2 (was: mul=2, div=1)
  12. --- a/arch/arm/mach-sunxi/clock_sun6i.c
  13. +++ b/arch/arm/mach-sunxi/clock_sun6i.c
  14. @@ -91,11 +91,12 @@ void clock_set_pll1(unsigned int clk)
  15. struct sunxi_ccm_reg * const ccm =
  16. (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
  17. const int p = 0;
  18. - int k = 1;
  19. - int m = 1;
  20. + int k = 2;
  21. + int m = 2;
  22. if (clk > 1152000000) {
  23. - k = 2;
  24. + k = 4;
  25. + m = 2;
  26. } else if (clk > 768000000) {
  27. k = 3;
  28. m = 2;