Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'imx-soc-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/soc

Pull "The i.MX SoC update for 3.19" from Shawn Guo

- Update i.MX6 suspend code to check DDR instead of CPU type, as the
difference we need to handle is between LPDDR2 and DDR3, not SoCs.
- Set anatop properly for LPDDR2 in DSM mode
- Add support for new SoC LS1021A which integrates dual Cortex-A7
- Add ENET initialization for i.MX6SX platform
- Add cpufreq support for i.MX53 platform
- Add a SNVS based poweroff driver for i.MX6 platforms
- Use ARM Global Timer as clocksource on VF610

Note: the change set is built on top of tag imx-fixes-3.18-2 to resolve
a conflict on file arch/arm/mach-imx/clk-vf610.c.

* tag 'imx-soc-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
power: reset: imx-snvs-poweroff: add power off driver for i.mx6
ARM: imx: temporarily remove CONFIG_SOC_FSL from LS1021A
ARM: imx: clk-vf610: get input clocks from assigned clocks
ARM: imx: Add Freescale LS1021A SMP support
ARM: imx: Add initial support for Freescale LS1021A
ARM: imx53: add cpufreq support
ARM: imx53: clk: add ARM clock
ARM: imx: add CPU clock type
ARM: imx5: add step clock, used when reprogramming PLL1
ARM: imx: add enet init for i.mx6sx
ARM: imx6sx: add imx6sx iomux-gpr field define
ARM: vf610: Add ARM Global Timer clocksource option
ARM: imx: add anatop settings for LPDDR2 when enter DSM mode
ARM: imx: replace cpu type check with ddr type check
ARM: imx: Fix the removal of CONFIG_SPI option
ARM: imx: clk-vf610: define PLL's clock tree

Signed-off-by; Arnd Bergmann <arnd@arndb.de>

+608 -72
+23
Documentation/devicetree/bindings/power_supply/imx-snvs-poweroff.txt
··· 1 + i.mx6 Poweroff Driver 2 + 3 + SNVS_LPCR in SNVS module can power off the whole system by pull 4 + PMIC_ON_REQ low if PMIC_ON_REQ is connected with external PMIC. 5 + If you don't want to use PMIC_ON_REQ as power on/off control, 6 + please set status='disabled' to disable this driver. 7 + 8 + Required Properties: 9 + -compatible: "fsl,sec-v4.0-poweroff" 10 + -reg: Specifies the physical address of the SNVS_LPCR register 11 + 12 + Example: 13 + snvs@020cc000 { 14 + compatible = "fsl,sec-v4.0-mon", "simple-bus"; 15 + #address-cells = <1>; 16 + #size-cells = <1>; 17 + ranges = <0 0x020cc000 0x4000>; 18 + ..... 19 + snvs_poweroff: snvs-poweroff@38 { 20 + compatible = "fsl,sec-v4.0-poweroff"; 21 + reg = <0x38 0x4>; 22 + }; 23 + }
+1
arch/arm/configs/imx_v4_v5_defconfig
··· 97 97 # CONFIG_HW_RANDOM is not set 98 98 CONFIG_I2C_CHARDEV=y 99 99 CONFIG_I2C_IMX=y 100 + CONFIG_SPI=y 100 101 CONFIG_SPI_IMX=y 101 102 CONFIG_SPI_SPIDEV=y 102 103 CONFIG_GPIO_SYSFS=y
+1
arch/arm/configs/imx_v6_v7_defconfig
··· 158 158 CONFIG_I2C_ALGOPCF=m 159 159 CONFIG_I2C_ALGOPCA=m 160 160 CONFIG_I2C_IMX=y 161 + CONFIG_SPI=y 161 162 CONFIG_SPI_IMX=y 162 163 CONFIG_GPIO_SYSFS=y 163 164 CONFIG_GPIO_MC9S08DZ60=y
+30 -1
arch/arm/mach-imx/Kconfig
··· 633 633 bool "Vybrid Family VF610 support" 634 634 select ARM_GIC 635 635 select PINCTRL_VF610 636 - select VF_PIT_TIMER 637 636 select PL310_ERRATA_769419 if CACHE_L2X0 638 637 639 638 help 640 639 This enable support for Freescale Vybrid VF610 processor. 640 + 641 + choice 642 + prompt "Clocksource for scheduler clock" 643 + depends on SOC_VF610 644 + default VF_USE_ARM_GLOBAL_TIMER 645 + 646 + config VF_USE_ARM_GLOBAL_TIMER 647 + bool "Use ARM Global Timer" 648 + select ARM_GLOBAL_TIMER 649 + select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK 650 + help 651 + Use the ARM Global Timer as clocksource 652 + 653 + config VF_USE_PIT_TIMER 654 + bool "Use PIT timer" 655 + select VF_PIT_TIMER 656 + help 657 + Use SoC Periodic Interrupt Timer (PIT) as clocksource 658 + 659 + endchoice 660 + 661 + config SOC_LS1021A 662 + bool "Freescale LS1021A support" 663 + select ARM_GIC 664 + select HAVE_ARM_ARCH_TIMER 665 + select PCI_DOMAINS if PCI 666 + select ZONE_DMA if ARM_LPAE 667 + 668 + help 669 + This enable support for Freescale LS1021A processor. 641 670 642 671 endif 643 672
+4 -2
arch/arm/mach-imx/Makefile
··· 12 12 obj-$(CONFIG_SOC_IMX35) += mm-imx3.o cpu-imx35.o clk-imx35.o ehci-imx35.o pm-imx3.o 13 13 14 14 imx5-pm-$(CONFIG_PM) += pm-imx5.o 15 - obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o clk-imx51-imx53.o $(imx5-pm-y) 15 + obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o clk-imx51-imx53.o clk-cpu.o $(imx5-pm-y) 16 16 17 17 obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-gate2.o \ 18 18 clk-pfd.o clk-busy.o clk.o \ ··· 89 89 obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o 90 90 obj-$(CONFIG_HAVE_IMX_MMDC) += mmdc.o 91 91 obj-$(CONFIG_HAVE_IMX_SRC) += src.o 92 - ifdef CONFIG_SOC_IMX6 92 + ifneq ($(CONFIG_SOC_IMX6)$(CONFIG_SOC_LS1021A),) 93 93 AFLAGS_headsmp.o :=-Wa,-march=armv7-a 94 94 obj-$(CONFIG_SMP) += headsmp.o platsmp.o 95 95 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o ··· 109 109 obj-$(CONFIG_SOC_IMX53) += mach-imx53.o 110 110 111 111 obj-$(CONFIG_SOC_VF610) += clk-vf610.o mach-vf610.o 112 + 113 + obj-$(CONFIG_SOC_LS1021A) += mach-ls1021a.o 112 114 113 115 obj-y += devices/
+32 -2
arch/arm/mach-imx/anatop.c
··· 30 30 #define ANADIG_DIGPROG_IMX6SL 0x280 31 31 32 32 #define BM_ANADIG_REG_2P5_ENABLE_WEAK_LINREG 0x40000 33 + #define BM_ANADIG_REG_2P5_ENABLE_PULLDOWN 0x8 33 34 #define BM_ANADIG_REG_CORE_FET_ODRIVE 0x20000000 34 35 #define BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG 0x1000 36 + /* Below MISC0_DISCON_HIGH_SNVS is only for i.MX6SL */ 37 + #define BM_ANADIG_ANA_MISC0_DISCON_HIGH_SNVS 0x2000 35 38 #define BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B 0x80000 36 39 #define BM_ANADIG_USB_CHRG_DETECT_EN_B 0x100000 37 40 ··· 59 56 BM_ANADIG_REG_CORE_FET_ODRIVE); 60 57 } 61 58 59 + static inline void imx_anatop_enable_2p5_pulldown(bool enable) 60 + { 61 + regmap_write(anatop, ANADIG_REG_2P5 + (enable ? REG_SET : REG_CLR), 62 + BM_ANADIG_REG_2P5_ENABLE_PULLDOWN); 63 + } 64 + 65 + static inline void imx_anatop_disconnect_high_snvs(bool enable) 66 + { 67 + regmap_write(anatop, ANADIG_ANA_MISC0 + (enable ? REG_SET : REG_CLR), 68 + BM_ANADIG_ANA_MISC0_DISCON_HIGH_SNVS); 69 + } 70 + 62 71 void imx_anatop_pre_suspend(void) 63 72 { 64 - imx_anatop_enable_weak2p5(true); 73 + if (imx_mmdc_get_ddr_type() == IMX_DDR_TYPE_LPDDR2) 74 + imx_anatop_enable_2p5_pulldown(true); 75 + else 76 + imx_anatop_enable_weak2p5(true); 77 + 65 78 imx_anatop_enable_fet_odrive(true); 79 + 80 + if (cpu_is_imx6sl()) 81 + imx_anatop_disconnect_high_snvs(true); 66 82 } 67 83 68 84 void imx_anatop_post_resume(void) 69 85 { 86 + if (imx_mmdc_get_ddr_type() == IMX_DDR_TYPE_LPDDR2) 87 + imx_anatop_enable_2p5_pulldown(false); 88 + else 89 + imx_anatop_enable_weak2p5(false); 90 + 70 91 imx_anatop_enable_fet_odrive(false); 71 - imx_anatop_enable_weak2p5(false); 92 + 93 + if (cpu_is_imx6sl()) 94 + imx_anatop_disconnect_high_snvs(false); 95 + 72 96 } 73 97 74 98 static void imx_anatop_usb_chrg_detect_disable(void)
+107
arch/arm/mach-imx/clk-cpu.c
··· 1 + /* 2 + * Copyright (c) 2014 Lucas Stach <l.stach@pengutronix.de>, Pengutronix 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 + * http://www.opensource.org/licenses/gpl-license.html 9 + * http://www.gnu.org/copyleft/gpl.html 10 + */ 11 + 12 + #include <linux/clk.h> 13 + #include <linux/clk-provider.h> 14 + #include <linux/slab.h> 15 + 16 + struct clk_cpu { 17 + struct clk_hw hw; 18 + struct clk *div; 19 + struct clk *mux; 20 + struct clk *pll; 21 + struct clk *step; 22 + }; 23 + 24 + static inline struct clk_cpu *to_clk_cpu(struct clk_hw *hw) 25 + { 26 + return container_of(hw, struct clk_cpu, hw); 27 + } 28 + 29 + static unsigned long clk_cpu_recalc_rate(struct clk_hw *hw, 30 + unsigned long parent_rate) 31 + { 32 + struct clk_cpu *cpu = to_clk_cpu(hw); 33 + 34 + return clk_get_rate(cpu->div); 35 + } 36 + 37 + static long clk_cpu_round_rate(struct clk_hw *hw, unsigned long rate, 38 + unsigned long *prate) 39 + { 40 + struct clk_cpu *cpu = to_clk_cpu(hw); 41 + 42 + return clk_round_rate(cpu->pll, rate); 43 + } 44 + 45 + static int clk_cpu_set_rate(struct clk_hw *hw, unsigned long rate, 46 + unsigned long parent_rate) 47 + { 48 + struct clk_cpu *cpu = to_clk_cpu(hw); 49 + int ret; 50 + 51 + /* switch to PLL bypass clock */ 52 + ret = clk_set_parent(cpu->mux, cpu->step); 53 + if (ret) 54 + return ret; 55 + 56 + /* reprogram PLL */ 57 + ret = clk_set_rate(cpu->pll, rate); 58 + if (ret) { 59 + clk_set_parent(cpu->mux, cpu->pll); 60 + return ret; 61 + } 62 + /* switch back to PLL clock */ 63 + clk_set_parent(cpu->mux, cpu->pll); 64 + 65 + /* Ensure the divider is what we expect */ 66 + clk_set_rate(cpu->div, rate); 67 + 68 + return 0; 69 + } 70 + 71 + static const struct clk_ops clk_cpu_ops = { 72 + .recalc_rate = clk_cpu_recalc_rate, 73 + .round_rate = clk_cpu_round_rate, 74 + .set_rate = clk_cpu_set_rate, 75 + }; 76 + 77 + struct clk *imx_clk_cpu(const char *name, const char *parent_name, 78 + struct clk *div, struct clk *mux, struct clk *pll, 79 + struct clk *step) 80 + { 81 + struct clk_cpu *cpu; 82 + struct clk *clk; 83 + struct clk_init_data init; 84 + 85 + cpu = kzalloc(sizeof(*cpu), GFP_KERNEL); 86 + if (!cpu) 87 + return ERR_PTR(-ENOMEM); 88 + 89 + cpu->div = div; 90 + cpu->mux = mux; 91 + cpu->pll = pll; 92 + cpu->step = step; 93 + 94 + init.name = name; 95 + init.ops = &clk_cpu_ops; 96 + init.flags = 0; 97 + init.parent_names = &parent_name; 98 + init.num_parents = 1; 99 + 100 + cpu->hw.init = &init; 101 + 102 + clk = clk_register(NULL, &cpu->hw); 103 + if (IS_ERR(clk)) 104 + kfree(cpu); 105 + 106 + return clk; 107 + }
+13 -1
arch/arm/mach-imx/clk-imx51-imx53.c
··· 125 125 static const char *spdif_sel[] = { "pll1_sw", "pll2_sw", "pll3_sw", "spdif_xtal_sel", }; 126 126 static const char *spdif0_com_sel[] = { "spdif0_podf", "ssi1_root_gate", }; 127 127 static const char *mx51_spdif1_com_sel[] = { "spdif1_podf", "ssi2_root_gate", }; 128 + static const char *step_sels[] = { "lp_apm", }; 129 + static const char *cpu_podf_sels[] = { "pll1_sw", "step_sel" }; 128 130 129 131 static struct clk *clk[IMX5_CLK_END]; 130 132 static struct clk_onecell_data clk_data; ··· 195 193 clk[IMX5_CLK_USB_PHY_PODF] = imx_clk_divider("usb_phy_podf", "usb_phy_pred", MXC_CCM_CDCDR, 0, 3); 196 194 clk[IMX5_CLK_USB_PHY_SEL] = imx_clk_mux("usb_phy_sel", MXC_CCM_CSCMR1, 26, 1, 197 195 usb_phy_sel_str, ARRAY_SIZE(usb_phy_sel_str)); 198 - clk[IMX5_CLK_CPU_PODF] = imx_clk_divider("cpu_podf", "pll1_sw", MXC_CCM_CACRR, 0, 3); 196 + clk[IMX5_CLK_STEP_SEL] = imx_clk_mux("step_sel", MXC_CCM_CCSR, 7, 2, step_sels, ARRAY_SIZE(step_sels)); 197 + clk[IMX5_CLK_CPU_PODF_SEL] = imx_clk_mux("cpu_podf_sel", MXC_CCM_CCSR, 2, 1, cpu_podf_sels, ARRAY_SIZE(cpu_podf_sels)); 198 + clk[IMX5_CLK_CPU_PODF] = imx_clk_divider("cpu_podf", "cpu_podf_sel", MXC_CCM_CACRR, 0, 3); 199 199 clk[IMX5_CLK_DI_PRED] = imx_clk_divider("di_pred", "pll3_sw", MXC_CCM_CDCDR, 6, 3); 200 200 clk[IMX5_CLK_IIM_GATE] = imx_clk_gate2("iim_gate", "ipg", MXC_CCM_CCGR0, 30); 201 201 clk[IMX5_CLK_UART1_IPG_GATE] = imx_clk_gate2("uart1_ipg_gate", "ipg", MXC_CCM_CCGR1, 6); ··· 541 537 clk[IMX5_CLK_CKO2] = imx_clk_gate2("cko2", "cko2_podf", MXC_CCM_CCOSR, 24); 542 538 clk[IMX5_CLK_SPDIF_XTAL_SEL] = imx_clk_mux("spdif_xtal_sel", MXC_CCM_CSCMR1, 2, 2, 543 539 mx53_spdif_xtal_sel, ARRAY_SIZE(mx53_spdif_xtal_sel)); 540 + clk[IMX5_CLK_ARM] = imx_clk_cpu("arm", "cpu_podf", 541 + clk[IMX5_CLK_CPU_PODF], 542 + clk[IMX5_CLK_CPU_PODF_SEL], 543 + clk[IMX5_CLK_PLL1_SW], 544 + clk[IMX5_CLK_STEP_SEL]); 544 545 545 546 imx_check_clocks(clk, ARRAY_SIZE(clk)); 546 547 ··· 559 550 560 551 /* move can bus clk to 24MHz */ 561 552 clk_set_parent(clk[IMX5_CLK_CAN_SEL], clk[IMX5_CLK_LP_APM]); 553 + 554 + /* make sure step clock is running from 24MHz */ 555 + clk_set_parent(clk[IMX5_CLK_STEP_SEL], clk[IMX5_CLK_LP_APM]); 562 556 563 557 clk_prepare_enable(clk[IMX5_CLK_IIM_GATE]); 564 558 imx_print_silicon_rev("i.MX53", mx53_revision());
+104 -43
arch/arm/mach-imx/clk-vf610.c
··· 58 58 #define PFD_PLL1_BASE (anatop_base + 0x2b0) 59 59 #define PFD_PLL2_BASE (anatop_base + 0x100) 60 60 #define PFD_PLL3_BASE (anatop_base + 0xf0) 61 + #define PLL1_CTRL (anatop_base + 0x270) 62 + #define PLL2_CTRL (anatop_base + 0x30) 61 63 #define PLL3_CTRL (anatop_base + 0x10) 64 + #define PLL4_CTRL (anatop_base + 0x70) 65 + #define PLL5_CTRL (anatop_base + 0xe0) 66 + #define PLL6_CTRL (anatop_base + 0xa0) 62 67 #define PLL7_CTRL (anatop_base + 0x20) 68 + #define ANA_MISC1 (anatop_base + 0x160) 63 69 64 70 static void __iomem *anatop_base; 65 71 static void __iomem *ccm_base; ··· 73 67 /* sources for multiplexer clocks, this is used multiple times */ 74 68 static const char *fast_sels[] = { "firc", "fxosc", }; 75 69 static const char *slow_sels[] = { "sirc_32k", "sxosc", }; 76 - static const char *pll1_sels[] = { "pll1_main", "pll1_pfd1", "pll1_pfd2", "pll1_pfd3", "pll1_pfd4", }; 77 - static const char *pll2_sels[] = { "pll2_main", "pll2_pfd1", "pll2_pfd2", "pll2_pfd3", "pll2_pfd4", }; 78 - static const char *sys_sels[] = { "fast_clk_sel", "slow_clk_sel", "pll2_pfd_sel", "pll2_main", "pll1_pfd_sel", "pll3_main", }; 70 + static const char *pll1_sels[] = { "pll1_sys", "pll1_pfd1", "pll1_pfd2", "pll1_pfd3", "pll1_pfd4", }; 71 + static const char *pll2_sels[] = { "pll2_bus", "pll2_pfd1", "pll2_pfd2", "pll2_pfd3", "pll2_pfd4", }; 72 + static const char *pll_bypass_src_sels[] = { "fast_clk_sel", "lvds1_in", }; 73 + static const char *pll1_bypass_sels[] = { "pll1", "pll1_bypass_src", }; 74 + static const char *pll2_bypass_sels[] = { "pll2", "pll2_bypass_src", }; 75 + static const char *pll3_bypass_sels[] = { "pll3", "pll3_bypass_src", }; 76 + static const char *pll4_bypass_sels[] = { "pll4", "pll4_bypass_src", }; 77 + static const char *pll5_bypass_sels[] = { "pll5", "pll5_bypass_src", }; 78 + static const char *pll6_bypass_sels[] = { "pll6", "pll6_bypass_src", }; 79 + static const char *pll7_bypass_sels[] = { "pll7", "pll7_bypass_src", }; 80 + static const char *sys_sels[] = { "fast_clk_sel", "slow_clk_sel", "pll2_pfd_sel", "pll2_bus", "pll1_pfd_sel", "pll3_usb_otg", }; 79 81 static const char *ddr_sels[] = { "pll2_pfd2", "sys_sel", }; 80 82 static const char *rmii_sels[] = { "enet_ext", "audio_ext", "enet_50m", "enet_25m", }; 81 83 static const char *enet_ts_sels[] = { "enet_ext", "fxosc", "audio_ext", "usb", "enet_ts", "enet_25m", "enet_50m", }; 82 - static const char *esai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_main_div", }; 83 - static const char *sai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_main_div", }; 84 + static const char *esai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_audio_div", }; 85 + static const char *sai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_audio_div", }; 84 86 static const char *nfc_sels[] = { "platform_bus", "pll1_pfd1", "pll3_pfd1", "pll3_pfd3", }; 85 - static const char *qspi_sels[] = { "pll3_main", "pll3_pfd4", "pll2_pfd4", "pll1_pfd4", }; 86 - static const char *esdhc_sels[] = { "pll3_main", "pll3_pfd3", "pll1_pfd3", "platform_bus", }; 87 - static const char *dcu_sels[] = { "pll1_pfd2", "pll3_main", }; 87 + static const char *qspi_sels[] = { "pll3_usb_otg", "pll3_pfd4", "pll2_pfd4", "pll1_pfd4", }; 88 + static const char *esdhc_sels[] = { "pll3_usb_otg", "pll3_pfd3", "pll1_pfd3", "platform_bus", }; 89 + static const char *dcu_sels[] = { "pll1_pfd2", "pll3_usb_otg", }; 88 90 static const char *gpu_sels[] = { "pll2_pfd2", "pll3_pfd2", }; 89 - static const char *vadc_sels[] = { "pll6_main_div", "pll3_main_div", "pll3_main", }; 91 + static const char *vadc_sels[] = { "pll6_video_div", "pll3_usb_otg_div", "pll3_usb_otg", }; 90 92 /* FTM counter clock source, not module clock */ 91 93 static const char *ftm_ext_sels[] = {"sirc_128k", "sxosc", "fxosc_half", "audio_ext", }; 92 94 static const char *ftm_fix_sels[] = { "sxosc", "ipg_bus", }; 93 95 94 - static struct clk_div_table pll4_main_div_table[] = { 96 + 97 + static struct clk_div_table pll4_audio_div_table[] = { 95 98 { .val = 0, .div = 1 }, 96 99 { .val = 1, .div = 2 }, 97 100 { .val = 2, .div = 6 }, ··· 120 105 VF610_CLK_DDR_SEL, 121 106 }; 122 107 108 + static struct clk * __init vf610_get_fixed_clock( 109 + struct device_node *ccm_node, const char *name) 110 + { 111 + struct clk *clk = of_clk_get_by_name(ccm_node, name); 112 + 113 + /* Backward compatibility if device tree is missing clks assignments */ 114 + if (IS_ERR(clk)) 115 + clk = imx_obtain_fixed_clock(name, 0); 116 + return clk; 117 + }; 118 + 123 119 static void __init vf610_clocks_init(struct device_node *ccm_node) 124 120 { 125 121 struct device_node *np; ··· 141 115 clk[VF610_CLK_SIRC_32K] = imx_clk_fixed("sirc_32k", 32000); 142 116 clk[VF610_CLK_FIRC] = imx_clk_fixed("firc", 24000000); 143 117 144 - clk[VF610_CLK_SXOSC] = imx_obtain_fixed_clock("sxosc", 0); 145 - clk[VF610_CLK_FXOSC] = imx_obtain_fixed_clock("fxosc", 0); 146 - clk[VF610_CLK_AUDIO_EXT] = imx_obtain_fixed_clock("audio_ext", 0); 147 - clk[VF610_CLK_ENET_EXT] = imx_obtain_fixed_clock("enet_ext", 0); 118 + clk[VF610_CLK_SXOSC] = vf610_get_fixed_clock(ccm_node, "sxosc"); 119 + clk[VF610_CLK_FXOSC] = vf610_get_fixed_clock(ccm_node, "fxosc"); 120 + clk[VF610_CLK_AUDIO_EXT] = vf610_get_fixed_clock(ccm_node, "audio_ext"); 121 + clk[VF610_CLK_ENET_EXT] = vf610_get_fixed_clock(ccm_node, "enet_ext"); 122 + 123 + /* Clock source from external clock via LVDs PAD */ 124 + clk[VF610_CLK_ANACLK1] = vf610_get_fixed_clock(ccm_node, "anaclk1"); 148 125 149 126 clk[VF610_CLK_FXOSC_HALF] = imx_clk_fixed_factor("fxosc_half", "fxosc", 1, 2); 150 127 ··· 162 133 clk[VF610_CLK_SLOW_CLK_SEL] = imx_clk_mux("slow_clk_sel", CCM_CCSR, 4, 1, slow_sels, ARRAY_SIZE(slow_sels)); 163 134 clk[VF610_CLK_FASK_CLK_SEL] = imx_clk_mux("fast_clk_sel", CCM_CCSR, 5, 1, fast_sels, ARRAY_SIZE(fast_sels)); 164 135 165 - clk[VF610_CLK_PLL1_MAIN] = imx_clk_fixed_factor("pll1_main", "fast_clk_sel", 22, 1); 166 - clk[VF610_CLK_PLL1_PFD1] = imx_clk_pfd("pll1_pfd1", "pll1_main", PFD_PLL1_BASE, 0); 167 - clk[VF610_CLK_PLL1_PFD2] = imx_clk_pfd("pll1_pfd2", "pll1_main", PFD_PLL1_BASE, 1); 168 - clk[VF610_CLK_PLL1_PFD3] = imx_clk_pfd("pll1_pfd3", "pll1_main", PFD_PLL1_BASE, 2); 169 - clk[VF610_CLK_PLL1_PFD4] = imx_clk_pfd("pll1_pfd4", "pll1_main", PFD_PLL1_BASE, 3); 136 + clk[VF610_CLK_PLL1_BYPASS_SRC] = imx_clk_mux("pll1_bypass_src", PLL1_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels)); 137 + clk[VF610_CLK_PLL2_BYPASS_SRC] = imx_clk_mux("pll2_bypass_src", PLL2_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels)); 138 + clk[VF610_CLK_PLL3_BYPASS_SRC] = imx_clk_mux("pll3_bypass_src", PLL3_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels)); 139 + clk[VF610_CLK_PLL4_BYPASS_SRC] = imx_clk_mux("pll4_bypass_src", PLL4_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels)); 140 + clk[VF610_CLK_PLL5_BYPASS_SRC] = imx_clk_mux("pll5_bypass_src", PLL5_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels)); 141 + clk[VF610_CLK_PLL6_BYPASS_SRC] = imx_clk_mux("pll6_bypass_src", PLL6_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels)); 142 + clk[VF610_CLK_PLL7_BYPASS_SRC] = imx_clk_mux("pll7_bypass_src", PLL7_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels)); 170 143 171 - clk[VF610_CLK_PLL2_MAIN] = imx_clk_fixed_factor("pll2_main", "fast_clk_sel", 22, 1); 172 - clk[VF610_CLK_PLL2_PFD1] = imx_clk_pfd("pll2_pfd1", "pll2_main", PFD_PLL2_BASE, 0); 173 - clk[VF610_CLK_PLL2_PFD2] = imx_clk_pfd("pll2_pfd2", "pll2_main", PFD_PLL2_BASE, 1); 174 - clk[VF610_CLK_PLL2_PFD3] = imx_clk_pfd("pll2_pfd3", "pll2_main", PFD_PLL2_BASE, 2); 175 - clk[VF610_CLK_PLL2_PFD4] = imx_clk_pfd("pll2_pfd4", "pll2_main", PFD_PLL2_BASE, 3); 144 + clk[VF610_CLK_PLL1] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll1", "pll1_bypass_src", PLL1_CTRL, 0x1); 145 + clk[VF610_CLK_PLL2] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll2", "pll2_bypass_src", PLL2_CTRL, 0x1); 146 + clk[VF610_CLK_PLL3] = imx_clk_pllv3(IMX_PLLV3_USB, "pll3", "pll3_bypass_src", PLL3_CTRL, 0x1); 147 + clk[VF610_CLK_PLL4] = imx_clk_pllv3(IMX_PLLV3_AV, "pll4", "pll4_bypass_src", PLL4_CTRL, 0x7f); 148 + clk[VF610_CLK_PLL5] = imx_clk_pllv3(IMX_PLLV3_ENET, "pll5", "pll5_bypass_src", PLL5_CTRL, 0x3); 149 + clk[VF610_CLK_PLL6] = imx_clk_pllv3(IMX_PLLV3_AV, "pll6", "pll6_bypass_src", PLL6_CTRL, 0x7f); 150 + clk[VF610_CLK_PLL7] = imx_clk_pllv3(IMX_PLLV3_USB, "pll7", "pll7_bypass_src", PLL7_CTRL, 0x1); 176 151 177 - clk[VF610_CLK_PLL3_MAIN] = imx_clk_fixed_factor("pll3_main", "fast_clk_sel", 20, 1); 178 - clk[VF610_CLK_PLL3_PFD1] = imx_clk_pfd("pll3_pfd1", "pll3_main", PFD_PLL3_BASE, 0); 179 - clk[VF610_CLK_PLL3_PFD2] = imx_clk_pfd("pll3_pfd2", "pll3_main", PFD_PLL3_BASE, 1); 180 - clk[VF610_CLK_PLL3_PFD3] = imx_clk_pfd("pll3_pfd3", "pll3_main", PFD_PLL3_BASE, 2); 181 - clk[VF610_CLK_PLL3_PFD4] = imx_clk_pfd("pll3_pfd4", "pll3_main", PFD_PLL3_BASE, 3); 152 + clk[VF610_PLL1_BYPASS] = imx_clk_mux_flags("pll1_bypass", PLL1_CTRL, 16, 1, pll1_bypass_sels, ARRAY_SIZE(pll1_bypass_sels), CLK_SET_RATE_PARENT); 153 + clk[VF610_PLL2_BYPASS] = imx_clk_mux_flags("pll2_bypass", PLL2_CTRL, 16, 1, pll2_bypass_sels, ARRAY_SIZE(pll2_bypass_sels), CLK_SET_RATE_PARENT); 154 + clk[VF610_PLL3_BYPASS] = imx_clk_mux_flags("pll3_bypass", PLL3_CTRL, 16, 1, pll3_bypass_sels, ARRAY_SIZE(pll3_bypass_sels), CLK_SET_RATE_PARENT); 155 + clk[VF610_PLL4_BYPASS] = imx_clk_mux_flags("pll4_bypass", PLL4_CTRL, 16, 1, pll4_bypass_sels, ARRAY_SIZE(pll4_bypass_sels), CLK_SET_RATE_PARENT); 156 + clk[VF610_PLL5_BYPASS] = imx_clk_mux_flags("pll5_bypass", PLL5_CTRL, 16, 1, pll5_bypass_sels, ARRAY_SIZE(pll5_bypass_sels), CLK_SET_RATE_PARENT); 157 + clk[VF610_PLL6_BYPASS] = imx_clk_mux_flags("pll6_bypass", PLL6_CTRL, 16, 1, pll6_bypass_sels, ARRAY_SIZE(pll6_bypass_sels), CLK_SET_RATE_PARENT); 158 + clk[VF610_PLL7_BYPASS] = imx_clk_mux_flags("pll7_bypass", PLL7_CTRL, 16, 1, pll7_bypass_sels, ARRAY_SIZE(pll7_bypass_sels), CLK_SET_RATE_PARENT); 182 159 183 - clk[VF610_CLK_PLL4_MAIN] = imx_clk_fixed_factor("pll4_main", "fast_clk_sel", 25, 1); 184 - /* Enet pll: fixed 50Mhz */ 185 - clk[VF610_CLK_PLL5_MAIN] = imx_clk_fixed_factor("pll5_main", "fast_clk_sel", 125, 6); 186 - /* pll6: default 960Mhz */ 187 - clk[VF610_CLK_PLL6_MAIN] = imx_clk_fixed_factor("pll6_main", "fast_clk_sel", 40, 1); 188 - /* pll7: USB1 PLL at 480MHz */ 189 - clk[VF610_CLK_PLL7_MAIN] = imx_clk_pllv3(IMX_PLLV3_USB, "pll7_main", "fast_clk_sel", PLL7_CTRL, 0x2); 160 + /* Do not bypass PLLs initially */ 161 + clk_set_parent(clk[VF610_PLL1_BYPASS], clk[VF610_CLK_PLL1]); 162 + clk_set_parent(clk[VF610_PLL2_BYPASS], clk[VF610_CLK_PLL2]); 163 + clk_set_parent(clk[VF610_PLL3_BYPASS], clk[VF610_CLK_PLL3]); 164 + clk_set_parent(clk[VF610_PLL4_BYPASS], clk[VF610_CLK_PLL4]); 165 + clk_set_parent(clk[VF610_PLL5_BYPASS], clk[VF610_CLK_PLL5]); 166 + clk_set_parent(clk[VF610_PLL6_BYPASS], clk[VF610_CLK_PLL6]); 167 + clk_set_parent(clk[VF610_PLL7_BYPASS], clk[VF610_CLK_PLL7]); 168 + 169 + clk[VF610_CLK_PLL1_SYS] = imx_clk_gate("pll1_sys", "pll1_bypass", PLL1_CTRL, 13); 170 + clk[VF610_CLK_PLL2_BUS] = imx_clk_gate("pll2_bus", "pll2_bypass", PLL2_CTRL, 13); 171 + clk[VF610_CLK_PLL3_USB_OTG] = imx_clk_gate("pll3_usb_otg", "pll3_bypass", PLL3_CTRL, 13); 172 + clk[VF610_CLK_PLL4_AUDIO] = imx_clk_gate("pll4_audio", "pll4_bypass", PLL4_CTRL, 13); 173 + clk[VF610_CLK_PLL5_ENET] = imx_clk_gate("pll5_enet", "pll5_bypass", PLL5_CTRL, 13); 174 + clk[VF610_CLK_PLL6_VIDEO] = imx_clk_gate("pll6_video", "pll6_bypass", PLL6_CTRL, 13); 175 + clk[VF610_CLK_PLL7_USB_HOST] = imx_clk_gate("pll7_usb_host", "pll7_bypass", PLL7_CTRL, 13); 176 + 177 + clk[VF610_CLK_LVDS1_IN] = imx_clk_gate_exclusive("lvds1_in", "anaclk1", ANA_MISC1, 12, BIT(10)); 178 + 179 + clk[VF610_CLK_PLL1_PFD1] = imx_clk_pfd("pll1_pfd1", "pll1_sys", PFD_PLL1_BASE, 0); 180 + clk[VF610_CLK_PLL1_PFD2] = imx_clk_pfd("pll1_pfd2", "pll1_sys", PFD_PLL1_BASE, 1); 181 + clk[VF610_CLK_PLL1_PFD3] = imx_clk_pfd("pll1_pfd3", "pll1_sys", PFD_PLL1_BASE, 2); 182 + clk[VF610_CLK_PLL1_PFD4] = imx_clk_pfd("pll1_pfd4", "pll1_sys", PFD_PLL1_BASE, 3); 183 + 184 + clk[VF610_CLK_PLL2_PFD1] = imx_clk_pfd("pll2_pfd1", "pll2_bus", PFD_PLL2_BASE, 0); 185 + clk[VF610_CLK_PLL2_PFD2] = imx_clk_pfd("pll2_pfd2", "pll2_bus", PFD_PLL2_BASE, 1); 186 + clk[VF610_CLK_PLL2_PFD3] = imx_clk_pfd("pll2_pfd3", "pll2_bus", PFD_PLL2_BASE, 2); 187 + clk[VF610_CLK_PLL2_PFD4] = imx_clk_pfd("pll2_pfd4", "pll2_bus", PFD_PLL2_BASE, 3); 188 + 189 + clk[VF610_CLK_PLL3_PFD1] = imx_clk_pfd("pll3_pfd1", "pll3_usb_otg", PFD_PLL3_BASE, 0); 190 + clk[VF610_CLK_PLL3_PFD2] = imx_clk_pfd("pll3_pfd2", "pll3_usb_otg", PFD_PLL3_BASE, 1); 191 + clk[VF610_CLK_PLL3_PFD3] = imx_clk_pfd("pll3_pfd3", "pll3_usb_otg", PFD_PLL3_BASE, 2); 192 + clk[VF610_CLK_PLL3_PFD4] = imx_clk_pfd("pll3_pfd4", "pll3_usb_otg", PFD_PLL3_BASE, 3); 190 193 191 194 clk[VF610_CLK_PLL1_PFD_SEL] = imx_clk_mux("pll1_pfd_sel", CCM_CCSR, 16, 3, pll1_sels, 5); 192 195 clk[VF610_CLK_PLL2_PFD_SEL] = imx_clk_mux("pll2_pfd_sel", CCM_CCSR, 19, 3, pll2_sels, 5); ··· 228 167 clk[VF610_CLK_PLATFORM_BUS] = imx_clk_divider("platform_bus", "sys_bus", CCM_CACRR, 3, 3); 229 168 clk[VF610_CLK_IPG_BUS] = imx_clk_divider("ipg_bus", "platform_bus", CCM_CACRR, 11, 2); 230 169 231 - clk[VF610_CLK_PLL3_MAIN_DIV] = imx_clk_divider("pll3_main_div", "pll3_main", CCM_CACRR, 20, 1); 232 - clk[VF610_CLK_PLL4_MAIN_DIV] = clk_register_divider_table(NULL, "pll4_main_div", "pll4_main", 0, CCM_CACRR, 6, 3, 0, pll4_main_div_table, &imx_ccm_lock); 233 - clk[VF610_CLK_PLL6_MAIN_DIV] = imx_clk_divider("pll6_main_div", "pll6_main", CCM_CACRR, 21, 1); 170 + clk[VF610_CLK_PLL3_MAIN_DIV] = imx_clk_divider("pll3_usb_otg_div", "pll3_usb_otg", CCM_CACRR, 20, 1); 171 + clk[VF610_CLK_PLL4_MAIN_DIV] = clk_register_divider_table(NULL, "pll4_audio_div", "pll4_audio", 0, CCM_CACRR, 6, 3, 0, pll4_audio_div_table, &imx_ccm_lock); 172 + clk[VF610_CLK_PLL6_MAIN_DIV] = imx_clk_divider("pll6_video_div", "pll6_video", CCM_CACRR, 21, 1); 234 173 235 - clk[VF610_CLK_USBPHY0] = imx_clk_gate("usbphy0", "pll3_main", PLL3_CTRL, 6); 236 - clk[VF610_CLK_USBPHY1] = imx_clk_gate("usbphy1", "pll7_main", PLL7_CTRL, 6); 174 + clk[VF610_CLK_USBPHY0] = imx_clk_gate("usbphy0", "pll3_usb_otg", PLL3_CTRL, 6); 175 + clk[VF610_CLK_USBPHY1] = imx_clk_gate("usbphy1", "pll7_usb_host", PLL7_CTRL, 6); 237 176 238 177 clk[VF610_CLK_USBC0] = imx_clk_gate2("usbc0", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(4)); 239 178 clk[VF610_CLK_USBC1] = imx_clk_gate2("usbc1", "ipg_bus", CCM_CCGR7, CCM_CCGRx_CGn(4)); ··· 252 191 clk[VF610_CLK_QSPI1_X1_DIV] = imx_clk_divider("qspi1_x1", "qspi1_x2", CCM_CSCDR3, 11, 1); 253 192 clk[VF610_CLK_QSPI1] = imx_clk_gate2("qspi1", "qspi1_x1", CCM_CCGR8, CCM_CCGRx_CGn(4)); 254 193 255 - clk[VF610_CLK_ENET_50M] = imx_clk_fixed_factor("enet_50m", "pll5_main", 1, 10); 256 - clk[VF610_CLK_ENET_25M] = imx_clk_fixed_factor("enet_25m", "pll5_main", 1, 20); 194 + clk[VF610_CLK_ENET_50M] = imx_clk_fixed_factor("enet_50m", "pll5_enet", 1, 10); 195 + clk[VF610_CLK_ENET_25M] = imx_clk_fixed_factor("enet_25m", "pll5_enet", 1, 20); 257 196 clk[VF610_CLK_ENET_SEL] = imx_clk_mux("enet_sel", CCM_CSCMR2, 4, 2, rmii_sels, 4); 258 197 clk[VF610_CLK_ENET_TS_SEL] = imx_clk_mux("enet_ts_sel", CCM_CSCMR2, 0, 3, enet_ts_sels, 7); 259 198 clk[VF610_CLK_ENET] = imx_clk_gate("enet", "enet_sel", CCM_CSCDR1, 24);
+4
arch/arm/mach-imx/clk.h
··· 131 131 CLK_SET_RATE_PARENT, mult, div); 132 132 } 133 133 134 + struct clk *imx_clk_cpu(const char *name, const char *parent_name, 135 + struct clk *div, struct clk *mux, struct clk *pll, 136 + struct clk *step); 137 + 134 138 #endif
+2
arch/arm/mach-imx/common.h
··· 116 116 int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode); 117 117 void imx6q_set_int_mem_clk_lpm(bool enable); 118 118 void imx6sl_set_wait_clk(bool enter); 119 + int imx_mmdc_get_ddr_type(void); 119 120 120 121 void imx_cpu_die(unsigned int cpu); 121 122 int imx_cpu_kill(unsigned int cpu); ··· 158 157 #endif 159 158 160 159 extern struct smp_operations imx_smp_ops; 160 + extern struct smp_operations ls1021a_smp_ops; 161 161 162 162 #endif
+2
arch/arm/mach-imx/mach-imx53.c
··· 41 41 static void __init imx53_init_late(void) 42 42 { 43 43 imx53_pm_init(); 44 + 45 + platform_device_register_simple("cpufreq-dt", -1, NULL, 0); 44 46 } 45 47 46 48 static const char * const imx53_dt_board_compat[] __initconst = {
+51
arch/arm/mach-imx/mach-imx6sx.c
··· 8 8 9 9 #include <linux/irqchip.h> 10 10 #include <linux/of_platform.h> 11 + #include <linux/phy.h> 12 + #include <linux/regmap.h> 13 + #include <linux/mfd/syscon.h> 14 + #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> 11 15 #include <asm/mach/arch.h> 12 16 #include <asm/mach/map.h> 13 17 14 18 #include "common.h" 15 19 #include "cpuidle.h" 20 + 21 + static int ar8031_phy_fixup(struct phy_device *dev) 22 + { 23 + u16 val; 24 + 25 + /* Set RGMII IO voltage to 1.8V */ 26 + phy_write(dev, 0x1d, 0x1f); 27 + phy_write(dev, 0x1e, 0x8); 28 + 29 + /* introduce tx clock delay */ 30 + phy_write(dev, 0x1d, 0x5); 31 + val = phy_read(dev, 0x1e); 32 + val |= 0x0100; 33 + phy_write(dev, 0x1e, val); 34 + 35 + return 0; 36 + } 37 + 38 + #define PHY_ID_AR8031 0x004dd074 39 + static void __init imx6sx_enet_phy_init(void) 40 + { 41 + if (IS_BUILTIN(CONFIG_PHYLIB)) 42 + phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff, 43 + ar8031_phy_fixup); 44 + } 45 + 46 + static void __init imx6sx_enet_clk_sel(void) 47 + { 48 + struct regmap *gpr; 49 + 50 + gpr = syscon_regmap_lookup_by_compatible("fsl,imx6sx-iomuxc-gpr"); 51 + if (!IS_ERR(gpr)) { 52 + regmap_update_bits(gpr, IOMUXC_GPR1, 53 + IMX6SX_GPR1_FEC_CLOCK_MUX_SEL_MASK, 0); 54 + regmap_update_bits(gpr, IOMUXC_GPR1, 55 + IMX6SX_GPR1_FEC_CLOCK_PAD_DIR_MASK, 0); 56 + } else { 57 + pr_err("failed to find fsl,imx6sx-iomux-gpr regmap\n"); 58 + } 59 + } 60 + 61 + static inline void imx6sx_enet_init(void) 62 + { 63 + imx6sx_enet_phy_init(); 64 + imx6sx_enet_clk_sel(); 65 + } 16 66 17 67 static void __init imx6sx_init_machine(void) 18 68 { ··· 76 26 77 27 of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); 78 28 29 + imx6sx_enet_init(); 79 30 imx_anatop_init(); 80 31 imx6sx_pm_init(); 81 32 }
+22
arch/arm/mach-imx/mach-ls1021a.c
··· 1 + /* 2 + * Copyright 2013-2014 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 as published by 6 + * the Free Software Foundation; either version 2 of the License, or 7 + * (at your option) any later version. 8 + */ 9 + 10 + #include <asm/mach/arch.h> 11 + 12 + #include "common.h" 13 + 14 + static const char * const ls1021a_dt_compat[] __initconst = { 15 + "fsl,ls1021a", 16 + NULL, 17 + }; 18 + 19 + DT_MACHINE_START(LS1021A, "Freescale LS1021A") 20 + .smp = smp_ops(ls1021a_smp_ops), 21 + .dt_compat = ls1021a_dt_compat, 22 + MACHINE_END
+17
arch/arm/mach-imx/mmdc.c
··· 21 21 #define BP_MMDC_MAPSR_PSD 0 22 22 #define BP_MMDC_MAPSR_PSS 4 23 23 24 + #define MMDC_MDMISC 0x18 25 + #define BM_MMDC_MDMISC_DDR_TYPE 0x18 26 + #define BP_MMDC_MDMISC_DDR_TYPE 0x3 27 + 28 + static int ddr_type; 29 + 24 30 static int imx_mmdc_probe(struct platform_device *pdev) 25 31 { 26 32 struct device_node *np = pdev->dev.of_node; ··· 36 30 37 31 mmdc_base = of_iomap(np, 0); 38 32 WARN_ON(!mmdc_base); 33 + 34 + reg = mmdc_base + MMDC_MDMISC; 35 + /* Get ddr type */ 36 + val = readl_relaxed(reg); 37 + ddr_type = (val & BM_MMDC_MDMISC_DDR_TYPE) >> 38 + BP_MMDC_MDMISC_DDR_TYPE; 39 39 40 40 reg = mmdc_base + MMDC_MAPSR; 41 41 ··· 61 49 } 62 50 63 51 return 0; 52 + } 53 + 54 + int imx_mmdc_get_ddr_type(void) 55 + { 56 + return ddr_type; 64 57 } 65 58 66 59 static struct of_device_id imx_mmdc_dt_ids[] = {
+2
arch/arm/mach-imx/mxc.h
··· 55 55 #define IMX_CHIP_REVISION_3_3 0x33 56 56 #define IMX_CHIP_REVISION_UNKNOWN 0xff 57 57 58 + #define IMX_DDR_TYPE_LPDDR2 1 59 + 58 60 #ifndef __ASSEMBLY__ 59 61 extern unsigned int __mxc_cpu_type; 60 62 #endif
+33
arch/arm/mach-imx/platsmp.c
··· 11 11 */ 12 12 13 13 #include <linux/init.h> 14 + #include <linux/of_address.h> 15 + #include <linux/of.h> 14 16 #include <linux/smp.h> 17 + 15 18 #include <asm/cacheflush.h> 16 19 #include <asm/page.h> 17 20 #include <asm/smp_scu.h> ··· 96 93 .cpu_die = imx_cpu_die, 97 94 .cpu_kill = imx_cpu_kill, 98 95 #endif 96 + }; 97 + 98 + #define DCFG_CCSR_SCRATCHRW1 0x200 99 + 100 + static int ls1021a_boot_secondary(unsigned int cpu, struct task_struct *idle) 101 + { 102 + arch_send_wakeup_ipi_mask(cpumask_of(cpu)); 103 + 104 + return 0; 105 + } 106 + 107 + static void __init ls1021a_smp_prepare_cpus(unsigned int max_cpus) 108 + { 109 + struct device_node *np; 110 + void __iomem *dcfg_base; 111 + unsigned long paddr; 112 + 113 + np = of_find_compatible_node(NULL, NULL, "fsl,ls1021a-dcfg"); 114 + dcfg_base = of_iomap(np, 0); 115 + BUG_ON(!dcfg_base); 116 + 117 + paddr = virt_to_phys(secondary_startup); 118 + writel_relaxed(cpu_to_be32(paddr), dcfg_base + DCFG_CCSR_SCRATCHRW1); 119 + 120 + iounmap(dcfg_base); 121 + } 122 + 123 + struct smp_operations ls1021a_smp_ops __initdata = { 124 + .smp_prepare_cpus = ls1021a_smp_prepare_cpus, 125 + .smp_boot_secondary = ls1021a_boot_secondary, 99 126 };
+3 -7
arch/arm/mach-imx/pm-imx6.c
··· 88 88 }; 89 89 90 90 struct imx6_pm_socdata { 91 - u32 cpu_type; 91 + u32 ddr_type; 92 92 const char *mmdc_compat; 93 93 const char *src_compat; 94 94 const char *iomuxc_compat; ··· 138 138 }; 139 139 140 140 static const struct imx6_pm_socdata imx6q_pm_data __initconst = { 141 - .cpu_type = MXC_CPU_IMX6Q, 142 141 .mmdc_compat = "fsl,imx6q-mmdc", 143 142 .src_compat = "fsl,imx6q-src", 144 143 .iomuxc_compat = "fsl,imx6q-iomuxc", ··· 147 148 }; 148 149 149 150 static const struct imx6_pm_socdata imx6dl_pm_data __initconst = { 150 - .cpu_type = MXC_CPU_IMX6DL, 151 151 .mmdc_compat = "fsl,imx6q-mmdc", 152 152 .src_compat = "fsl,imx6q-src", 153 153 .iomuxc_compat = "fsl,imx6dl-iomuxc", ··· 156 158 }; 157 159 158 160 static const struct imx6_pm_socdata imx6sl_pm_data __initconst = { 159 - .cpu_type = MXC_CPU_IMX6SL, 160 161 .mmdc_compat = "fsl,imx6sl-mmdc", 161 162 .src_compat = "fsl,imx6sl-src", 162 163 .iomuxc_compat = "fsl,imx6sl-iomuxc", ··· 165 168 }; 166 169 167 170 static const struct imx6_pm_socdata imx6sx_pm_data __initconst = { 168 - .cpu_type = MXC_CPU_IMX6SX, 169 171 .mmdc_compat = "fsl,imx6sx-mmdc", 170 172 .src_compat = "fsl,imx6sx-src", 171 173 .iomuxc_compat = "fsl,imx6sx-iomuxc", ··· 183 187 struct imx6_cpu_pm_info { 184 188 phys_addr_t pbase; /* The physical address of pm_info. */ 185 189 phys_addr_t resume_addr; /* The physical resume address for asm code */ 186 - u32 cpu_type; 190 + u32 ddr_type; 187 191 u32 pm_info_size; /* Size of pm_info. */ 188 192 struct imx6_pm_base mmdc_base; 189 193 struct imx6_pm_base src_base; ··· 518 522 goto pl310_cache_map_failed; 519 523 } 520 524 521 - pm_info->cpu_type = socdata->cpu_type; 525 + pm_info->ddr_type = imx_mmdc_get_ddr_type(); 522 526 pm_info->mmdc_io_num = socdata->mmdc_io_num; 523 527 mmdc_offset_array = socdata->mmdc_io_offset; 524 528
+7 -7
arch/arm/mach-imx/suspend-imx6.S
··· 45 45 */ 46 46 #define PM_INFO_PBASE_OFFSET 0x0 47 47 #define PM_INFO_RESUME_ADDR_OFFSET 0x4 48 - #define PM_INFO_CPU_TYPE_OFFSET 0x8 48 + #define PM_INFO_DDR_TYPE_OFFSET 0x8 49 49 #define PM_INFO_PM_INFO_SIZE_OFFSET 0xC 50 50 #define PM_INFO_MX6Q_MMDC_P_OFFSET 0x10 51 51 #define PM_INFO_MX6Q_MMDC_V_OFFSET 0x14 ··· 110 110 ldreq r11, [r0, #PM_INFO_MX6Q_MMDC_V_OFFSET] 111 111 ldrne r11, [r0, #PM_INFO_MX6Q_MMDC_P_OFFSET] 112 112 113 - cmp r3, #MXC_CPU_IMX6SL 113 + cmp r3, #IMX_DDR_TYPE_LPDDR2 114 114 bne 4f 115 115 116 116 /* reset read FIFO, RST_RD_FIFO */ ··· 151 151 ENTRY(imx6_suspend) 152 152 ldr r1, [r0, #PM_INFO_PBASE_OFFSET] 153 153 ldr r2, [r0, #PM_INFO_RESUME_ADDR_OFFSET] 154 - ldr r3, [r0, #PM_INFO_CPU_TYPE_OFFSET] 154 + ldr r3, [r0, #PM_INFO_DDR_TYPE_OFFSET] 155 155 ldr r4, [r0, #PM_INFO_PM_INFO_SIZE_OFFSET] 156 156 157 157 /* ··· 209 209 ldr r7, [r0, #PM_INFO_MMDC_IO_NUM_OFFSET] 210 210 ldr r8, =PM_INFO_MMDC_IO_VAL_OFFSET 211 211 add r8, r8, r0 212 - /* i.MX6SL's last 3 IOs need special setting */ 213 - cmp r3, #MXC_CPU_IMX6SL 212 + /* LPDDR2's last 3 IOs need special setting */ 213 + cmp r3, #IMX_DDR_TYPE_LPDDR2 214 214 subeq r7, r7, #0x3 215 215 set_mmdc_io_lpm: 216 216 ldr r9, [r8], #0x8 ··· 218 218 subs r7, r7, #0x1 219 219 bne set_mmdc_io_lpm 220 220 221 - cmp r3, #MXC_CPU_IMX6SL 221 + cmp r3, #IMX_DDR_TYPE_LPDDR2 222 222 bne set_mmdc_io_lpm_done 223 223 ldr r6, =0x1000 224 224 ldr r9, [r8], #0x8 ··· 324 324 str r7, [r11, #MX6Q_SRC_GPR1] 325 325 str r7, [r11, #MX6Q_SRC_GPR2] 326 326 327 - ldr r3, [r0, #PM_INFO_CPU_TYPE_OFFSET] 327 + ldr r3, [r0, #PM_INFO_DDR_TYPE_OFFSET] 328 328 mov r5, #0x1 329 329 resume_mmdc 330 330
+9
drivers/power/reset/Kconfig
··· 71 71 help 72 72 Reboot support for Hisilicon boards. 73 73 74 + config POWER_RESET_IMX 75 + bool "IMX6 power-off driver" 76 + depends on POWER_RESET && SOC_IMX6 77 + help 78 + This driver support power off external PMIC by PMIC_ON_REQ on i.mx6 79 + boards.If you want to use other pin to control external power,please 80 + say N here or disable in dts to make sure pm_power_off never be 81 + overwrote wrongly by this driver. 82 + 74 83 config POWER_RESET_MSM 75 84 bool "Qualcomm MSM power-off driver" 76 85 depends on ARCH_QCOM
+1
drivers/power/reset/Makefile
··· 6 6 obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o 7 7 obj-$(CONFIG_POWER_RESET_GPIO_RESTART) += gpio-restart.o 8 8 obj-$(CONFIG_POWER_RESET_HISI) += hisi-reboot.o 9 + obj-$(CONFIG_POWER_RESET_IMX) += imx-snvs-poweroff.o 9 10 obj-$(CONFIG_POWER_RESET_MSM) += msm-poweroff.o 10 11 obj-$(CONFIG_POWER_RESET_LTC2952) += ltc2952-poweroff.o 11 12 obj-$(CONFIG_POWER_RESET_QNAP) += qnap-poweroff.o
+66
drivers/power/reset/imx-snvs-poweroff.c
··· 1 + /* Power off driver for i.mx6 2 + * Copyright (c) 2014, FREESCALE CORPORATION. All rights reserved. 3 + * 4 + * based on msm-poweroff.c 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 and 8 + * only version 2 as published by the Free Software Foundation. 9 + * 10 + * This program is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 + * GNU General Public License for more details. 14 + * 15 + */ 16 + 17 + #include <linux/err.h> 18 + #include <linux/init.h> 19 + #include <linux/io.h> 20 + #include <linux/kernel.h> 21 + #include <linux/module.h> 22 + #include <linux/of.h> 23 + #include <linux/of_address.h> 24 + #include <linux/platform_device.h> 25 + 26 + static void __iomem *snvs_base; 27 + 28 + static void do_imx_poweroff(void) 29 + { 30 + u32 value = readl(snvs_base); 31 + 32 + /* set TOP and DP_EN bit */ 33 + writel(value | 0x60, snvs_base); 34 + } 35 + 36 + static int imx_poweroff_probe(struct platform_device *pdev) 37 + { 38 + snvs_base = of_iomap(pdev->dev.of_node, 0); 39 + if (!snvs_base) { 40 + dev_err(&pdev->dev, "failed to get memory\n"); 41 + return -ENODEV; 42 + } 43 + 44 + pm_power_off = do_imx_poweroff; 45 + return 0; 46 + } 47 + 48 + static const struct of_device_id of_imx_poweroff_match[] = { 49 + { .compatible = "fsl,sec-v4.0-poweroff", }, 50 + {}, 51 + }; 52 + MODULE_DEVICE_TABLE(of, of_imx_poweroff_match); 53 + 54 + static struct platform_driver imx_poweroff_driver = { 55 + .probe = imx_poweroff_probe, 56 + .driver = { 57 + .name = "imx-snvs-poweroff", 58 + .of_match_table = of_match_ptr(of_imx_poweroff_match), 59 + }, 60 + }; 61 + 62 + static int __init imx_poweroff_init(void) 63 + { 64 + return platform_driver_register(&imx_poweroff_driver); 65 + } 66 + device_initcall(imx_poweroff_init);
+4 -1
include/dt-bindings/clock/imx5-clock.h
··· 198 198 #define IMX5_CLK_OCRAM 186 199 199 #define IMX5_CLK_SAHARA_IPG_GATE 187 200 200 #define IMX5_CLK_SATA_REF 188 201 - #define IMX5_CLK_END 189 201 + #define IMX5_CLK_STEP_SEL 189 202 + #define IMX5_CLK_CPU_PODF_SEL 190 203 + #define IMX5_CLK_ARM 191 204 + #define IMX5_CLK_END 192 202 205 203 206 #endif /* __DT_BINDINGS_CLOCK_IMX5_H */
+31 -8
include/dt-bindings/clock/vf610-clock.h
··· 21 21 #define VF610_CLK_FASK_CLK_SEL 8 22 22 #define VF610_CLK_AUDIO_EXT 9 23 23 #define VF610_CLK_ENET_EXT 10 24 - #define VF610_CLK_PLL1_MAIN 11 24 + #define VF610_CLK_PLL1_SYS 11 25 25 #define VF610_CLK_PLL1_PFD1 12 26 26 #define VF610_CLK_PLL1_PFD2 13 27 27 #define VF610_CLK_PLL1_PFD3 14 28 28 #define VF610_CLK_PLL1_PFD4 15 29 - #define VF610_CLK_PLL2_MAIN 16 29 + #define VF610_CLK_PLL2_BUS 16 30 30 #define VF610_CLK_PLL2_PFD1 17 31 31 #define VF610_CLK_PLL2_PFD2 18 32 32 #define VF610_CLK_PLL2_PFD3 19 33 33 #define VF610_CLK_PLL2_PFD4 20 34 - #define VF610_CLK_PLL3_MAIN 21 34 + #define VF610_CLK_PLL3_USB_OTG 21 35 35 #define VF610_CLK_PLL3_PFD1 22 36 36 #define VF610_CLK_PLL3_PFD2 23 37 37 #define VF610_CLK_PLL3_PFD3 24 38 38 #define VF610_CLK_PLL3_PFD4 25 39 - #define VF610_CLK_PLL4_MAIN 26 40 - #define VF610_CLK_PLL5_MAIN 27 41 - #define VF610_CLK_PLL6_MAIN 28 39 + #define VF610_CLK_PLL4_AUDIO 26 40 + #define VF610_CLK_PLL5_ENET 27 41 + #define VF610_CLK_PLL6_VIDEO 28 42 42 #define VF610_CLK_PLL3_MAIN_DIV 29 43 43 #define VF610_CLK_PLL4_MAIN_DIV 30 44 44 #define VF610_CLK_PLL6_MAIN_DIV 31 ··· 166 166 #define VF610_CLK_DMAMUX3 153 167 167 #define VF610_CLK_FLEXCAN0_EN 154 168 168 #define VF610_CLK_FLEXCAN1_EN 155 169 - #define VF610_CLK_PLL7_MAIN 156 169 + #define VF610_CLK_PLL7_USB_HOST 156 170 170 #define VF610_CLK_USBPHY0 157 171 171 #define VF610_CLK_USBPHY1 158 172 - #define VF610_CLK_END 159 172 + #define VF610_CLK_LVDS1_IN 159 173 + #define VF610_CLK_ANACLK1 160 174 + #define VF610_CLK_PLL1_BYPASS_SRC 161 175 + #define VF610_CLK_PLL2_BYPASS_SRC 162 176 + #define VF610_CLK_PLL3_BYPASS_SRC 163 177 + #define VF610_CLK_PLL4_BYPASS_SRC 164 178 + #define VF610_CLK_PLL5_BYPASS_SRC 165 179 + #define VF610_CLK_PLL6_BYPASS_SRC 166 180 + #define VF610_CLK_PLL7_BYPASS_SRC 167 181 + #define VF610_CLK_PLL1 168 182 + #define VF610_CLK_PLL2 169 183 + #define VF610_CLK_PLL3 170 184 + #define VF610_CLK_PLL4 171 185 + #define VF610_CLK_PLL5 172 186 + #define VF610_CLK_PLL6 173 187 + #define VF610_CLK_PLL7 174 188 + #define VF610_PLL1_BYPASS 175 189 + #define VF610_PLL2_BYPASS 176 190 + #define VF610_PLL3_BYPASS 177 191 + #define VF610_PLL4_BYPASS 178 192 + #define VF610_PLL5_BYPASS 179 193 + #define VF610_PLL6_BYPASS 180 194 + #define VF610_PLL7_BYPASS 181 195 + #define VF610_CLK_END 182 173 196 174 197 #endif /* __DT_BINDINGS_CLOCK_VF610_H */
+39
include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
··· 395 395 #define IMX6SL_GPR1_FEC_CLOCK_MUX1_SEL_MASK (0x3 << 17) 396 396 #define IMX6SL_GPR1_FEC_CLOCK_MUX2_SEL_MASK (0x1 << 14) 397 397 398 + /* For imx6sx iomux gpr register field define */ 399 + #define IMX6SX_GPR1_VDEC_SW_RST_MASK (0x1 << 20) 400 + #define IMX6SX_GPR1_VDEC_SW_RST_RESET (0x1 << 20) 401 + #define IMX6SX_GPR1_VDEC_SW_RST_RELEASE (0x0 << 20) 402 + #define IMX6SX_GPR1_VADC_SW_RST_MASK (0x1 << 19) 403 + #define IMX6SX_GPR1_VADC_SW_RST_RESET (0x1 << 19) 404 + #define IMX6SX_GPR1_VADC_SW_RST_RELEASE (0x0 << 19) 405 + #define IMX6SX_GPR1_FEC_CLOCK_MUX_SEL_MASK (0x3 << 13) 406 + #define IMX6SX_GPR1_FEC_CLOCK_PAD_DIR_MASK (0x3 << 17) 407 + #define IMX6SX_GPR1_FEC_CLOCK_MUX_SEL_EXT (0x3 << 13) 408 + 409 + #define IMX6SX_GPR4_FEC_ENET1_STOP_REQ (0x1 << 3) 410 + #define IMX6SX_GPR4_FEC_ENET2_STOP_REQ (0x1 << 4) 411 + 412 + #define IMX6SX_GPR5_DISP_MUX_LDB_CTRL_MASK (0x1 << 3) 413 + #define IMX6SX_GPR5_DISP_MUX_LDB_CTRL_LCDIF1 (0x0 << 3) 414 + #define IMX6SX_GPR5_DISP_MUX_LDB_CTRL_LCDIF2 (0x1 << 3) 415 + 416 + #define IMX6SX_GPR5_CSI2_MUX_CTRL_MASK (0x3 << 27) 417 + #define IMX6SX_GPR5_CSI2_MUX_CTRL_EXT_PIN (0x0 << 27) 418 + #define IMX6SX_GPR5_CSI2_MUX_CTRL_CVD (0x1 << 27) 419 + #define IMX6SX_GPR5_CSI2_MUX_CTRL_VDAC_TO_CSI (0x2 << 27) 420 + #define IMX6SX_GPR5_CSI2_MUX_CTRL_GND (0x3 << 27) 421 + #define IMX6SX_GPR5_VADC_TO_CSI_CAPTURE_EN_MASK (0x1 << 26) 422 + #define IMX6SX_GPR5_VADC_TO_CSI_CAPTURE_EN_ENABLE (0x1 << 26) 423 + #define IMX6SX_GPR5_VADC_TO_CSI_CAPTURE_EN_DISABLE (0x0 << 26) 424 + #define IMX6SX_GPR5_CSI1_MUX_CTRL_MASK (0x3 << 4) 425 + #define IMX6SX_GPR5_CSI1_MUX_CTRL_EXT_PIN (0x0 << 4) 426 + #define IMX6SX_GPR5_CSI1_MUX_CTRL_CVD (0x1 << 4) 427 + #define IMX6SX_GPR5_CSI1_MUX_CTRL_VDAC_TO_CSI (0x2 << 4) 428 + #define IMX6SX_GPR5_CSI1_MUX_CTRL_GND (0x3 << 4) 429 + 430 + #define IMX6SX_GPR5_DISP_MUX_DCIC2_LCDIF2 (0x0 << 2) 431 + #define IMX6SX_GPR5_DISP_MUX_DCIC2_LVDS (0x1 << 2) 432 + #define IMX6SX_GPR5_DISP_MUX_DCIC2_MASK (0x1 << 2) 433 + #define IMX6SX_GPR5_DISP_MUX_DCIC1_LCDIF1 (0x0 << 1) 434 + #define IMX6SX_GPR5_DISP_MUX_DCIC1_LVDS (0x1 << 1) 435 + #define IMX6SX_GPR5_DISP_MUX_DCIC1_MASK (0x1 << 1) 436 + 398 437 #endif /* __LINUX_IMX6Q_IOMUXC_GPR_H */