Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Copyright 2014 Freescale Semiconductor, Inc.
0004  */
0005 
0006 #include <linux/irqchip.h>
0007 #include <linux/of_platform.h>
0008 #include <linux/phy.h>
0009 #include <linux/regmap.h>
0010 #include <linux/mfd/syscon.h>
0011 #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
0012 #include <asm/mach/arch.h>
0013 #include <asm/mach/map.h>
0014 
0015 #include "common.h"
0016 #include "cpuidle.h"
0017 
0018 static void __init imx6sx_enet_clk_sel(void)
0019 {
0020     struct regmap *gpr;
0021 
0022     gpr = syscon_regmap_lookup_by_compatible("fsl,imx6sx-iomuxc-gpr");
0023     if (!IS_ERR(gpr)) {
0024         regmap_update_bits(gpr, IOMUXC_GPR1,
0025                    IMX6SX_GPR1_FEC_CLOCK_MUX_SEL_MASK, 0);
0026         regmap_update_bits(gpr, IOMUXC_GPR1,
0027                    IMX6SX_GPR1_FEC_CLOCK_PAD_DIR_MASK, 0);
0028     } else {
0029         pr_err("failed to find fsl,imx6sx-iomux-gpr regmap\n");
0030     }
0031 }
0032 
0033 static inline void imx6sx_enet_init(void)
0034 {
0035     imx6sx_enet_clk_sel();
0036 }
0037 
0038 static void __init imx6sx_init_machine(void)
0039 {
0040     of_platform_default_populate(NULL, NULL, NULL);
0041 
0042     imx6sx_enet_init();
0043     imx_anatop_init();
0044     imx6sx_pm_init();
0045 }
0046 
0047 static void __init imx6sx_init_irq(void)
0048 {
0049     imx_gpc_check_dt();
0050     imx_init_revision_from_anatop();
0051     imx_init_l2cache();
0052     imx_src_init();
0053     irqchip_init();
0054     imx6_pm_ccm_init("fsl,imx6sx-ccm");
0055 }
0056 
0057 static void __init imx6sx_init_late(void)
0058 {
0059     imx6sx_cpuidle_init();
0060 
0061     if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
0062         platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
0063 }
0064 
0065 static const char * const imx6sx_dt_compat[] __initconst = {
0066     "fsl,imx6sx",
0067     NULL,
0068 };
0069 
0070 DT_MACHINE_START(IMX6SX, "Freescale i.MX6 SoloX (Device Tree)")
0071     .l2c_aux_val    = 0,
0072     .l2c_aux_mask   = ~0,
0073     .init_irq   = imx6sx_init_irq,
0074     .init_machine   = imx6sx_init_machine,
0075     .dt_compat  = imx6sx_dt_compat,
0076     .init_late  = imx6sx_init_late,
0077 MACHINE_END