main.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (C) 2012 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. */
  9. #include <linux/mm.h>
  10. #include <linux/delay.h>
  11. #include <linux/clk.h>
  12. #include <linux/io.h>
  13. #include <linux/clkdev.h>
  14. #include <linux/of.h>
  15. #include <linux/err.h>
  16. #include "crmregs-imx3.h"
  17. #include "clk.h"
  18. #include "common.h"
  19. #include "hardware.h"
  20. struct arm_ahb_div {
  21. unsigned char arm, ahb, sel;
  22. };
  23. static struct arm_ahb_div clk_consumer[] = {
  24. { .arm = 1, .ahb = 4, .sel = 0},
  25. { .arm = 1, .ahb = 3, .sel = 1},
  26. { .arm = 2, .ahb = 2, .sel = 0},
  27. { .arm = 0, .ahb = 0, .sel = 0},
  28. { .arm = 0, .ahb = 0, .sel = 0},
  29. { .arm = 0, .ahb = 0, .sel = 0},
  30. { .arm = 4, .ahb = 1, .sel = 0},
  31. { .arm = 1, .ahb = 5, .sel = 0},
  32. { .arm = 1, .ahb = 8, .sel = 0},
  33. { .arm = 1, .ahb = 6, .sel = 1},
  34. { .arm = 2, .ahb = 4, .sel = 0},
  35. { .arm = 0, .ahb = 0, .sel = 0},
  36. { .arm = 0, .ahb = 0, .sel = 0},
  37. { .arm = 0, .ahb = 0, .sel = 0},
  38. { .arm = 4, .ahb = 2, .sel = 0},
  39. { .arm = 0, .ahb = 0, .sel = 0},
  40. };
  41. static char hsp_div_532[] = { 4, 8, 3, 0 };
  42. static char hsp_div_400[] = { 3, 6, 3, 0 };
  43. static const char *std_sel[] = {"ppll", "arm"};
  44. static const char *ipg_per_sel[] = {"ahb_per_div", "arm_per_div"};
  45. enum mx35_clks {