connectTheSignalSlot.c 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * AM33XX Clock data
  3. *
  4. * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
  5. * Vaibhav Hiremath <hvaibhav@ti.com>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation version 2.
  10. *
  11. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  12. * kind, whether express or implied; without even the implied warranty
  13. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. */
  16. #include <linux/kernel.h>
  17. #include <linux/list.h>
  18. #include <linux/clk-private.h>
  19. #include <linux/clkdev.h>
  20. #include <linux/io.h>
  21. #include "am33xx.h"
  22. #include "soc.h"
  23. #include "iomap.h"
  24. #include "clock.h"
  25. #include "control.h"
  26. #include "cm.h"
  27. #include "cm33xx.h"
  28. #include "cm-regbits-33xx.h"
  29. #include "prm.h"
  30. /* Modulemode control */
  31. #define AM33XX_MODULEMODE_HWCTRL_SHIFT 0
  32. #define AM33XX_MODULEMODE_SWCTRL_SHIFT 1
  33. /*LIST_HEAD(clocks);*/
  34. /* Root clocks */
  35. /* RTC 32k */
  36. DEFINE_CLK_FIXED_RATE(clk_32768_ck, CLK_IS_ROOT, 32768, 0x0);
  37. /* On-Chip 32KHz RC OSC */
  38. DEFINE_CLK_FIXED_RATE(clk_rc32k_ck, CLK_IS_ROOT, 32000, 0x0);
  39. /* Crystal input clks */
  40. DEFINE_CLK_FIXED_RATE(virt_19200000_ck, CLK_IS_ROOT, 19200000, 0x0);
  41. DEFINE_CLK_FIXED_RATE(virt_24000000_ck, CLK_IS_ROOT, 24000000, 0x0);
  42. DEFINE_CLK_FIXED_RATE(virt_25000000_ck, CLK_IS_ROOT, 25000000, 0x0);
  43. DEFINE_CLK_FIXED_RATE(virt_26000000_ck, CLK_IS_ROOT, 26000000, 0x0);
  44. /* Oscillator clock */
  45. /* 19.2, 24, 25 or 26 MHz */
  46. static const char *sys_clkin_ck_parents[] = {
  47. "virt_19200000_ck", "virt_24000000_ck", "virt_25000000_ck",
  48. "virt_26000000_ck",
  49. };
  50. /*
  51. * sys_clk in: input to the dpll and also used as funtional clock for,
  52. * adc_tsc, smartreflex0-1, timer1-7, mcasp0-1, dcan0-1, cefuse
  53. *
  54. */
  55. DEFINE_CLK_MUX(sys_clkin_ck, sys_clkin_ck_parents, NULL, 0x0,
  56. AM33XX_CTRL_REGADDR(AM33XX_CONTROL_STATUS),
  57. AM33XX_CONTROL_STATUS_SYSBOOT1_SHIFT,
  58. AM33XX_CONTROL_STATUS_SYSBOOT1_WIDTH,
  59. 0, NULL);
  60. /* External clock - 12 MHz */
  61. DEFINE_CLK_FIXED_RATE(tclkin_ck, CLK_IS_ROOT, 12000000, 0x0);
  62. /* Module clocks and DPLL outputs */
  63. /* DPLL_CORE */
  64. static struct dpll_data dpll_core_dd = {
  65. .mult_div1_reg = AM33XX_CM_CLKSEL_DPLL_CORE,
  66. .clk_bypass = &sys_clkin_ck,
  67. .clk_ref = &sys_clkin_ck,
  68. .control_reg = AM33XX_CM_CLKMODE_DPLL_CORE,
  69. .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
  70. .idlest_reg = AM33XX_CM_IDLEST_DPLL_CORE,
  71. .mult_mask = AM33XX_DPLL_MULT_MASK,
  72. .div1_mask = AM33XX_DPLL_DIV_MASK,
  73. .enable_mask = AM33XX_DPLL_EN_MASK,
  74. .idlest_mask = AM33XX_ST_DPLL_CLK_MASK,
  75. .max_multiplier = 2047,
  76. .max_divider = 128,
  77. .min_divider = 1,
  78. };
  79. /* CLKDCOLDO output */
  80. static const char *dpll_core_ck_parents[] = {
  81. "sys_clkin_ck",