clk-ase.c 958 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * This program is free software; you can redistribute it and/or modify it
  3. * under the terms of the GNU General Public License version 2 as published
  4. * by the Free Software Foundation.
  5. *
  6. * Copyright (C) 2011 John Crispin <blogic@openwrt.org>
  7. */
  8. #include <linux/io.h>
  9. #include <linux/export.h>
  10. #include <linux/init.h>
  11. #include <linux/clk.h>
  12. #include <asm/time.h>
  13. #include <asm/irq.h>
  14. #include <asm/div64.h>
  15. #include <lantiq_soc.h>
  16. /* cgu registers */
  17. #define LTQ_CGU_SYS 0x0010
  18. unsigned int ltq_get_io_region_clock(void)
  19. {
  20. return CLOCK_133M;
  21. }
  22. EXPORT_SYMBOL(ltq_get_io_region_clock);
  23. unsigned int ltq_get_fpi_bus_clock(int fpi)
  24. {
  25. return CLOCK_133M;
  26. }
  27. EXPORT_SYMBOL(ltq_get_fpi_bus_clock);
  28. unsigned int ltq_get_cpu_hz(void)
  29. {
  30. if (ltq_cgu_r32(LTQ_CGU_SYS) & (1 << 5))
  31. return CLOCK_266M;
  32. else
  33. return CLOCK_133M;
  34. }
  35. EXPORT_SYMBOL(ltq_get_cpu_hz);
  36. unsigned int ltq_get_fpi_hz(void)
  37. {
  38. return CLOCK_133M;
  39. }
  40. EXPORT_SYMBOL(ltq_get_fpi_hz);