Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Copyright 2013 Freescale Semiconductor, Inc.
0004  */
0005 
0006 #include <linux/irqchip.h>
0007 #include <linux/of_platform.h>
0008 #include <linux/mfd/syscon.h>
0009 #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
0010 #include <linux/regmap.h>
0011 #include <asm/mach/arch.h>
0012 #include <asm/mach/map.h>
0013 
0014 #include "common.h"
0015 #include "cpuidle.h"
0016 #include "hardware.h"
0017 
0018 static void __init imx6sl_fec_init(void)
0019 {
0020     struct regmap *gpr;
0021 
0022     /* set FEC clock from internal PLL clock source */
0023     gpr = syscon_regmap_lookup_by_compatible("fsl,imx6sl-iomuxc-gpr");
0024     if (!IS_ERR(gpr)) {
0025         regmap_update_bits(gpr, IOMUXC_GPR1,
0026             IMX6SL_GPR1_FEC_CLOCK_MUX2_SEL_MASK, 0);
0027         regmap_update_bits(gpr, IOMUXC_GPR1,
0028             IMX6SL_GPR1_FEC_CLOCK_MUX1_SEL_MASK, 0);
0029     } else {
0030         pr_err("failed to find fsl,imx6sl-iomux-gpr regmap\n");
0031     }
0032 }
0033 
0034 static void __init imx6sl_init_late(void)
0035 {
0036     /* imx6sl reuses imx6q cpufreq driver */
0037     if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
0038         platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
0039 
0040     if (IS_ENABLED(CONFIG_SOC_IMX6SL) && cpu_is_imx6sl())
0041         imx6sl_cpuidle_init();
0042     else if (IS_ENABLED(CONFIG_SOC_IMX6SLL))
0043         imx6sx_cpuidle_init();
0044 }
0045 
0046 static void __init imx6sl_init_machine(void)
0047 {
0048     of_platform_default_populate(NULL, NULL, NULL);
0049 
0050     if (cpu_is_imx6sl())
0051         imx6sl_fec_init();
0052     imx_anatop_init();
0053     imx6sl_pm_init();
0054 }
0055 
0056 static void __init imx6sl_init_irq(void)
0057 {
0058     imx_gpc_check_dt();
0059     imx_init_revision_from_anatop();
0060     imx_init_l2cache();
0061     imx_src_init();
0062     irqchip_init();
0063     if (cpu_is_imx6sl())
0064         imx6_pm_ccm_init("fsl,imx6sl-ccm");
0065     else
0066         imx6_pm_ccm_init("fsl,imx6sll-ccm");
0067 }
0068 
0069 static const char * const imx6sl_dt_compat[] __initconst = {
0070     "fsl,imx6sl",
0071     "fsl,imx6sll",
0072     NULL,
0073 };
0074 
0075 DT_MACHINE_START(IMX6SL, "Freescale i.MX6 SoloLite (Device Tree)")
0076     .l2c_aux_val    = 0,
0077     .l2c_aux_mask   = ~0,
0078     .init_irq   = imx6sl_init_irq,
0079     .init_machine   = imx6sl_init_machine,
0080     .init_late      = imx6sl_init_late,
0081     .dt_compat  = imx6sl_dt_compat,
0082 MACHINE_END