mach-imx6sx.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright 2014 Freescale Semiconductor, Inc.
  4. */
  5. #include <linux/irqchip.h>
  6. #include <linux/of_platform.h>
  7. #include <linux/phy.h>
  8. #include <linux/regmap.h>
  9. #include <linux/mfd/syscon.h>
  10. #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
  11. #include <asm/mach/arch.h>
  12. #include <asm/mach/map.h>
  13. #include "common.h"
  14. #include "cpuidle.h"
  15. static void __init imx6sx_enet_clk_sel(void)
  16. {
  17. struct regmap *gpr;
  18. gpr = syscon_regmap_lookup_by_compatible("fsl,imx6sx-iomuxc-gpr");
  19. if (!IS_ERR(gpr)) {
  20. regmap_update_bits(gpr, IOMUXC_GPR1,
  21. IMX6SX_GPR1_FEC_CLOCK_MUX_SEL_MASK, 0);
  22. regmap_update_bits(gpr, IOMUXC_GPR1,
  23. IMX6SX_GPR1_FEC_CLOCK_PAD_DIR_MASK, 0);
  24. } else {
  25. pr_err("failed to find fsl,imx6sx-iomux-gpr regmap\n");
  26. }
  27. }
  28. static inline void imx6sx_enet_init(void)
  29. {
  30. imx6sx_enet_clk_sel();
  31. }
  32. static void __init imx6sx_init_machine(void)
  33. {
  34. of_platform_default_populate(NULL, NULL, NULL);
  35. imx6sx_enet_init();
  36. imx_anatop_init();
  37. imx6sx_pm_init();
  38. }
  39. static void __init imx6sx_init_irq(void)
  40. {
  41. imx_gpc_check_dt();
  42. imx_init_revision_from_anatop();
  43. imx_init_l2cache();
  44. imx_src_init();
  45. irqchip_init();
  46. imx6_pm_ccm_init("fsl,imx6sx-ccm");
  47. }
  48. static void __init imx6sx_init_late(void)
  49. {
  50. imx6sx_cpuidle_init();
  51. if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
  52. platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
  53. }
  54. static const char * const imx6sx_dt_compat[] __initconst = {
  55. "fsl,imx6sx",
  56. NULL,
  57. };
  58. DT_MACHINE_START(IMX6SX, "Freescale i.MX6 SoloX (Device Tree)")
  59. .l2c_aux_val = 0,
  60. .l2c_aux_mask = ~0,
  61. .init_irq = imx6sx_init_irq,
  62. .init_machine = imx6sx_init_machine,
  63. .dt_compat = imx6sx_dt_compat,
  64. .init_late = imx6sx_init_late,
  65. MACHINE_END