clocks.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * File: include/asm-blackfin/mach-common/clocks.h
  3. * Based on: include/asm-blackfin/mach-bf537/bf537.h
  4. * Author: Robin Getz <rgetz@blackfin.uclinux.org>
  5. *
  6. * Created: 25Jul07
  7. * Description: Common Clock definitions for various kernel files
  8. *
  9. * Modified:
  10. * Copyright 2004-2007 Analog Devices Inc.
  11. *
  12. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, see the file COPYING, or write
  26. * to the Free Software Foundation, Inc.,
  27. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  28. */
  29. #ifndef _BFIN_CLOCKS_H
  30. #define _BFIN_CLOCKS_H
  31. #ifdef CONFIG_CCLK_DIV_1
  32. # define CONFIG_CCLK_ACT_DIV CCLK_DIV1
  33. # define CONFIG_CCLK_DIV 1
  34. #endif
  35. #ifdef CONFIG_CCLK_DIV_2
  36. # define CONFIG_CCLK_ACT_DIV CCLK_DIV2
  37. # define CONFIG_CCLK_DIV 2
  38. #endif
  39. #ifdef CONFIG_CCLK_DIV_4
  40. # define CONFIG_CCLK_ACT_DIV CCLK_DIV4
  41. # define CONFIG_CCLK_DIV 4
  42. #endif
  43. #ifdef CONFIG_CCLK_DIV_8
  44. # define CONFIG_CCLK_ACT_DIV CCLK_DIV8
  45. # define CONFIG_CCLK_DIV 8
  46. #endif
  47. #ifndef CONFIG_PLL_BYPASS
  48. # ifndef CONFIG_CLKIN_HALF
  49. # define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)
  50. # else
  51. # define CONFIG_VCO_HZ ((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)/2)
  52. # endif
  53. # define CONFIG_CCLK_HZ (CONFIG_VCO_HZ/CONFIG_CCLK_DIV)
  54. # define CONFIG_SCLK_HZ (CONFIG_VCO_HZ/CONFIG_SCLK_DIV)
  55. #else
  56. # define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ)
  57. # define CONFIG_CCLK_HZ (CONFIG_CLKIN_HZ)
  58. # define CONFIG_SCLK_HZ (CONFIG_CLKIN_HZ)
  59. # define CONFIG_VCO_MULT 0
  60. #endif
  61. #endif