clk-nomadik.c 1000 B

123456789101112131415161718192021222324252627282930313233343536
  1. #include <linux/clk.h>
  2. #include <linux/clkdev.h>
  3. #include <linux/err.h>
  4. #include <linux/io.h>
  5. #include <linux/clk-provider.h>
  6. #include <linux/of.h>
  7. /*
  8. * The Nomadik clock tree is described in the STN8815A12 DB V4.2
  9. * reference manual for the chip, page 94 ff.
  10. */
  11. static const __initconst struct of_device_id cpu8815_clk_match[] = {
  12. { .compatible = "fixed-clock", .data = of_fixed_clk_setup, },
  13. { /* sentinel */ }
  14. };
  15. void __init nomadik_clk_init(void)
  16. {
  17. struct clk *clk;
  18. clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, CLK_IS_ROOT, 0);
  19. clk_register_clkdev(clk, "apb_pclk", NULL);
  20. /*
  21. * The 2.4 MHz TIMCLK reference clock is active at boot time, this is
  22. * actually the MXTALCLK @19.2 MHz divided by 8. This clock is used
  23. * by the timers and watchdog. See page 105 ff.
  24. */
  25. clk = clk_register_fixed_rate(NULL, "TIMCLK", NULL, CLK_IS_ROOT,
  26. 2400000);
  27. clk_register_clkdev(clk, NULL, "mtu0");
  28. clk_register_clkdev(clk, NULL, "mtu1");
  29. of_clk_init(cpu8815_clk_match);
  30. }