main.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (C) 2012 Sascha Hauer <kernel@pengutronix.de>
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program; if not, write to the Free Software
  15. * Foundation.
  16. */
  17. #include <linux/module.h>
  18. #include <linux/clk.h>
  19. #include <linux/clkdev.h>
  20. #include <linux/io.h>
  21. #include <linux/err.h>
  22. #include <linux/of.h>
  23. #include "clk.h"
  24. #include "common.h"
  25. #include "crmregs-imx3.h"
  26. #include "hardware.h"
  27. #include "mx31.h"
  28. static const char *mcu_main_sel[] = { "spll", "mpll", };
  29. static const char *per_sel[] = { "per_div", "ipg", };
  30. static const char *csi_sel[] = { "upll", "spll", };
  31. static const char *fir_sel[] = { "mcu_main", "upll", "spll" };
  32. enum mx31_clks {
  33. ckih, ckil, mpll, spll, upll, mcu_main, hsp, ahb, nfc, ipg, per_div,
  34. per, csi, fir, csi_div, usb_div_pre, usb_div_post, fir_div_pre,
  35. fir_div_post, sdhc1_gate, sdhc2_gate, gpt_gate, epit1_gate, epit2_gate,
  36. iim_gate, ata_gate, sdma_gate, cspi3_gate, rng_gate, uart1_gate,
  37. uart2_gate, ssi1_gate, i2c1_gate, i2c2_gate, i2c3_gate, hantro_gate,
  38. mstick1_gate, mstick2_gate, csi_gate, rtc_gate, wdog_gate, pwm_gate,
  39. sim_gate, ect_gate, usb_gate, kpp_gate, ipu_gate, uart3_gate,
  40. uart4_gate, uart5_gate, owire_gate, ssi2_gate, cspi1_gate, cspi2_gate,
  41. gacc_gate, emi_gate, rtic_gate, firi_gate, clk_max
  42. };