mach-imx6sl.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright 2013 Freescale Semiconductor, Inc.
  4. */
  5. #include <linux/irqchip.h>
  6. #include <linux/of_platform.h>
  7. #include <linux/mfd/syscon.h>
  8. #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
  9. #include <linux/regmap.h>
  10. #include <asm/mach/arch.h>
  11. #include <asm/mach/map.h>
  12. #include "common.h"
  13. #include "cpuidle.h"
  14. #include "hardware.h"
  15. static void __init imx6sl_fec_init(void)
  16. {
  17. struct regmap *gpr;
  18. /* set FEC clock from internal PLL clock source */
  19. gpr = syscon_regmap_lookup_by_compatible("fsl,imx6sl-iomuxc-gpr");
  20. if (!IS_ERR(gpr)) {
  21. regmap_update_bits(gpr, IOMUXC_GPR1,
  22. IMX6SL_GPR1_FEC_CLOCK_MUX2_SEL_MASK, 0);
  23. regmap_update_bits(gpr, IOMUXC_GPR1,
  24. IMX6SL_GPR1_FEC_CLOCK_MUX1_SEL_MASK, 0);
  25. } else {
  26. pr_err("failed to find fsl,imx6sl-iomux-gpr regmap\n");
  27. }
  28. }
  29. static void __init imx6sl_init_late(void)
  30. {
  31. /* imx6sl reuses imx6q cpufreq driver */
  32. if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
  33. platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
  34. if (IS_ENABLED(CONFIG_SOC_IMX6SL) && cpu_is_imx6sl())
  35. imx6sl_cpuidle_init();
  36. else if (IS_ENABLED(CONFIG_SOC_IMX6SLL))
  37. imx6sx_cpuidle_init();
  38. }
  39. static void __init imx6sl_init_machine(void)
  40. {
  41. of_platform_default_populate(NULL, NULL, NULL);
  42. if (cpu_is_imx6sl())
  43. imx6sl_fec_init();
  44. imx_anatop_init();
  45. imx6sl_pm_init();
  46. }
  47. static void __init imx6sl_init_irq(void)
  48. {
  49. imx_gpc_check_dt();
  50. imx_init_revision_from_anatop();
  51. imx_init_l2cache();
  52. imx_src_init();
  53. irqchip_init();
  54. if (cpu_is_imx6sl())
  55. imx6_pm_ccm_init("fsl,imx6sl-ccm");
  56. else
  57. imx6_pm_ccm_init("fsl,imx6sll-ccm");
  58. }
  59. static const char * const imx6sl_dt_compat[] __initconst = {
  60. "fsl,imx6sl",
  61. "fsl,imx6sll",
  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