mach-imx6sl.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright 2013 Freescale Semiconductor, Inc.
  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/irqchip.h>
  10. #include <linux/of.h>
  11. #include <linux/of_platform.h>
  12. #include <linux/mfd/syscon.h>
  13. #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
  14. #include <linux/regmap.h>
  15. #include <asm/mach/arch.h>
  16. #include <asm/mach/map.h>
  17. #include "common.h"
  18. #include "cpuidle.h"
  19. static void __init imx6sl_fec_init(void)
  20. {
  21. struct regmap *gpr;
  22. /* set FEC clock from internal PLL clock source */
  23. gpr = syscon_regmap_lookup_by_compatible("fsl,imx6sl-iomuxc-gpr");
  24. if (!IS_ERR(gpr)) {
  25. regmap_update_bits(gpr, IOMUXC_GPR1,
  26. IMX6SL_GPR1_FEC_CLOCK_MUX2_SEL_MASK, 0);
  27. regmap_update_bits(gpr, IOMUXC_GPR1,
  28. IMX6SL_GPR1_FEC_CLOCK_MUX1_SEL_MASK, 0);
  29. } else {
  30. pr_err("failed to find fsl,imx6sl-iomux-gpr regmap\n");
  31. }
  32. }
  33. static void __init imx6sl_init_late(void)
  34. {
  35. /* imx6sl reuses imx6q cpufreq driver */
  36. if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
  37. platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
  38. imx6sl_cpuidle_init();
  39. }
  40. static void __init imx6sl_init_machine(void)
  41. {
  42. struct device *parent;
  43. parent = imx_soc_device_init();
  44. if (parent == NULL)
  45. pr_warn("failed to initialize soc device\n");
  46. of_platform_default_populate(NULL, NULL, parent);
  47. imx6sl_fec_init();
  48. imx_anatop_init();
  49. imx6sl_pm_init();
  50. }
  51. static void __init imx6sl_init_irq(void)
  52. {
  53. imx_gpc_check_dt();
  54. imx_init_revision_from_anatop();
  55. imx_init_l2cache();
  56. imx_src_init();
  57. irqchip_init();
  58. imx6_pm_ccm_init("fsl,imx6sl-ccm");
  59. }
  60. static const char * const imx6sl_dt_compat[] __initconst = {
  61. "fsl,imx6sl",
  62. NULL,
  63. };
  64. DT_MACHINE_START(IMX6SL, "Freescale i.MX6 SoloLite (Device Tree)")
  65. .l2c_aux_val = 0,
  66. .l2c_aux_mask = ~0,
  67. .init_irq = imx6sl_init_irq,
  68. .init_machine = imx6sl_init_machine,
  69. .init_late = imx6sl_init_late,
  70. .dt_compat = imx6sl_dt_compat,
  71. MACHINE_END