diff options
Diffstat (limited to 'arch/arm/mach-imx')
34 files changed, 475 insertions, 185 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 11b2957f792b..e8627e04e1e6 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig | |||
@@ -633,12 +633,41 @@ config SOC_VF610 | |||
633 | bool "Vybrid Family VF610 support" | 633 | bool "Vybrid Family VF610 support" |
634 | select ARM_GIC | 634 | select ARM_GIC |
635 | select PINCTRL_VF610 | 635 | select PINCTRL_VF610 |
636 | select VF_PIT_TIMER | ||
637 | select PL310_ERRATA_769419 if CACHE_L2X0 | 636 | select PL310_ERRATA_769419 if CACHE_L2X0 |
638 | 637 | ||
639 | help | 638 | help |
640 | This enable support for Freescale Vybrid VF610 processor. | 639 | This enable support for Freescale Vybrid VF610 processor. |
641 | 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. | ||
670 | |||
642 | endif | 671 | endif |
643 | 672 | ||
644 | source "arch/arm/mach-imx/devices/Kconfig" | 673 | source "arch/arm/mach-imx/devices/Kconfig" |
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 6e4fcd8339cd..f5ac685a29fc 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile | |||
@@ -12,7 +12,7 @@ obj-$(CONFIG_SOC_IMX31) += mm-imx3.o cpu-imx31.o clk-imx31.o iomux-imx31.o ehci- | |||
12 | obj-$(CONFIG_SOC_IMX35) += mm-imx3.o cpu-imx35.o clk-imx35.o ehci-imx35.o pm-imx3.o | 12 | obj-$(CONFIG_SOC_IMX35) += mm-imx3.o cpu-imx35.o clk-imx35.o ehci-imx35.o pm-imx3.o |
13 | 13 | ||
14 | imx5-pm-$(CONFIG_PM) += pm-imx5.o | 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 | obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-gate2.o \ | 17 | obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-gate2.o \ |
18 | clk-pfd.o clk-busy.o clk.o \ | 18 | clk-pfd.o clk-busy.o clk.o \ |
@@ -89,7 +89,7 @@ obj-$(CONFIG_HAVE_IMX_ANATOP) += anatop.o | |||
89 | obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o | 89 | obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o |
90 | obj-$(CONFIG_HAVE_IMX_MMDC) += mmdc.o | 90 | obj-$(CONFIG_HAVE_IMX_MMDC) += mmdc.o |
91 | obj-$(CONFIG_HAVE_IMX_SRC) += src.o | 91 | obj-$(CONFIG_HAVE_IMX_SRC) += src.o |
92 | ifdef CONFIG_SOC_IMX6 | 92 | ifneq ($(CONFIG_SOC_IMX6)$(CONFIG_SOC_LS1021A),) |
93 | AFLAGS_headsmp.o :=-Wa,-march=armv7-a | 93 | AFLAGS_headsmp.o :=-Wa,-march=armv7-a |
94 | obj-$(CONFIG_SMP) += headsmp.o platsmp.o | 94 | obj-$(CONFIG_SMP) += headsmp.o platsmp.o |
95 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | 95 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o |
@@ -110,4 +110,6 @@ obj-$(CONFIG_SOC_IMX53) += mach-imx53.o | |||
110 | 110 | ||
111 | obj-$(CONFIG_SOC_VF610) += clk-vf610.o mach-vf610.o | 111 | obj-$(CONFIG_SOC_VF610) += clk-vf610.o mach-vf610.o |
112 | 112 | ||
113 | obj-$(CONFIG_SOC_LS1021A) += mach-ls1021a.o | ||
114 | |||
113 | obj-y += devices/ | 115 | obj-y += devices/ |
diff --git a/arch/arm/mach-imx/anatop.c b/arch/arm/mach-imx/anatop.c index 8259a625a920..7f262fe4ba77 100644 --- a/arch/arm/mach-imx/anatop.c +++ b/arch/arm/mach-imx/anatop.c | |||
@@ -30,8 +30,11 @@ | |||
30 | #define ANADIG_DIGPROG_IMX6SL 0x280 | 30 | #define ANADIG_DIGPROG_IMX6SL 0x280 |
31 | 31 | ||
32 | #define BM_ANADIG_REG_2P5_ENABLE_WEAK_LINREG 0x40000 | 32 | #define BM_ANADIG_REG_2P5_ENABLE_WEAK_LINREG 0x40000 |
33 | #define BM_ANADIG_REG_2P5_ENABLE_PULLDOWN 0x8 | ||
33 | #define BM_ANADIG_REG_CORE_FET_ODRIVE 0x20000000 | 34 | #define BM_ANADIG_REG_CORE_FET_ODRIVE 0x20000000 |
34 | #define BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG 0x1000 | 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 | #define BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B 0x80000 | 38 | #define BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B 0x80000 |
36 | #define BM_ANADIG_USB_CHRG_DETECT_EN_B 0x100000 | 39 | #define BM_ANADIG_USB_CHRG_DETECT_EN_B 0x100000 |
37 | 40 | ||
@@ -56,16 +59,43 @@ static void imx_anatop_enable_fet_odrive(bool enable) | |||
56 | BM_ANADIG_REG_CORE_FET_ODRIVE); | 59 | BM_ANADIG_REG_CORE_FET_ODRIVE); |
57 | } | 60 | } |
58 | 61 | ||
62 | static inline void imx_anatop_enable_2p5_pulldown(bool enable) | ||
63 | { | ||
64 | regmap_write(anatop, ANADIG_REG_2P5 + (enable ? REG_SET : REG_CLR), | ||
65 | BM_ANADIG_REG_2P5_ENABLE_PULLDOWN); | ||
66 | } | ||
67 | |||
68 | static inline void imx_anatop_disconnect_high_snvs(bool enable) | ||
69 | { | ||
70 | regmap_write(anatop, ANADIG_ANA_MISC0 + (enable ? REG_SET : REG_CLR), | ||
71 | BM_ANADIG_ANA_MISC0_DISCON_HIGH_SNVS); | ||
72 | } | ||
73 | |||
59 | void imx_anatop_pre_suspend(void) | 74 | void imx_anatop_pre_suspend(void) |
60 | { | 75 | { |
61 | imx_anatop_enable_weak2p5(true); | 76 | if (imx_mmdc_get_ddr_type() == IMX_DDR_TYPE_LPDDR2) |
77 | imx_anatop_enable_2p5_pulldown(true); | ||
78 | else | ||
79 | imx_anatop_enable_weak2p5(true); | ||
80 | |||
62 | imx_anatop_enable_fet_odrive(true); | 81 | imx_anatop_enable_fet_odrive(true); |
82 | |||
83 | if (cpu_is_imx6sl()) | ||
84 | imx_anatop_disconnect_high_snvs(true); | ||
63 | } | 85 | } |
64 | 86 | ||
65 | void imx_anatop_post_resume(void) | 87 | void imx_anatop_post_resume(void) |
66 | { | 88 | { |
89 | if (imx_mmdc_get_ddr_type() == IMX_DDR_TYPE_LPDDR2) | ||
90 | imx_anatop_enable_2p5_pulldown(false); | ||
91 | else | ||
92 | imx_anatop_enable_weak2p5(false); | ||
93 | |||
67 | imx_anatop_enable_fet_odrive(false); | 94 | imx_anatop_enable_fet_odrive(false); |
68 | imx_anatop_enable_weak2p5(false); | 95 | |
96 | if (cpu_is_imx6sl()) | ||
97 | imx_anatop_disconnect_high_snvs(false); | ||
98 | |||
69 | } | 99 | } |
70 | 100 | ||
71 | static void imx_anatop_usb_chrg_detect_disable(void) | 101 | static void imx_anatop_usb_chrg_detect_disable(void) |
diff --git a/arch/arm/mach-imx/clk-cpu.c b/arch/arm/mach-imx/clk-cpu.c new file mode 100644 index 000000000000..aa1c345e2a19 --- /dev/null +++ b/arch/arm/mach-imx/clk-cpu.c | |||
@@ -0,0 +1,107 @@ | |||
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 | } | ||
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c index 72d65214223e..0f7e536147cb 100644 --- a/arch/arm/mach-imx/clk-imx51-imx53.c +++ b/arch/arm/mach-imx/clk-imx51-imx53.c | |||
@@ -125,6 +125,8 @@ static const char *mx53_spdif_xtal_sel[] = { "osc", "ckih", "ckih2", "pll4_sw", | |||
125 | static const char *spdif_sel[] = { "pll1_sw", "pll2_sw", "pll3_sw", "spdif_xtal_sel", }; | 125 | static const char *spdif_sel[] = { "pll1_sw", "pll2_sw", "pll3_sw", "spdif_xtal_sel", }; |
126 | static const char *spdif0_com_sel[] = { "spdif0_podf", "ssi1_root_gate", }; | 126 | static const char *spdif0_com_sel[] = { "spdif0_podf", "ssi1_root_gate", }; |
127 | static const char *mx51_spdif1_com_sel[] = { "spdif1_podf", "ssi2_root_gate", }; | 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 | static struct clk *clk[IMX5_CLK_END]; | 131 | static struct clk *clk[IMX5_CLK_END]; |
130 | static struct clk_onecell_data clk_data; | 132 | static struct clk_onecell_data clk_data; |
@@ -193,7 +195,9 @@ static void __init mx5_clocks_common_init(void __iomem *ccm_base) | |||
193 | clk[IMX5_CLK_USB_PHY_PODF] = imx_clk_divider("usb_phy_podf", "usb_phy_pred", MXC_CCM_CDCDR, 0, 3); | 195 | clk[IMX5_CLK_USB_PHY_PODF] = imx_clk_divider("usb_phy_podf", "usb_phy_pred", MXC_CCM_CDCDR, 0, 3); |
194 | clk[IMX5_CLK_USB_PHY_SEL] = imx_clk_mux("usb_phy_sel", MXC_CCM_CSCMR1, 26, 1, | 196 | clk[IMX5_CLK_USB_PHY_SEL] = imx_clk_mux("usb_phy_sel", MXC_CCM_CSCMR1, 26, 1, |
195 | usb_phy_sel_str, ARRAY_SIZE(usb_phy_sel_str)); | 197 | usb_phy_sel_str, ARRAY_SIZE(usb_phy_sel_str)); |
196 | clk[IMX5_CLK_CPU_PODF] = imx_clk_divider("cpu_podf", "pll1_sw", MXC_CCM_CACRR, 0, 3); | 198 | clk[IMX5_CLK_STEP_SEL] = imx_clk_mux("step_sel", MXC_CCM_CCSR, 7, 2, step_sels, ARRAY_SIZE(step_sels)); |
199 | 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)); | ||
200 | clk[IMX5_CLK_CPU_PODF] = imx_clk_divider("cpu_podf", "cpu_podf_sel", MXC_CCM_CACRR, 0, 3); | ||
197 | clk[IMX5_CLK_DI_PRED] = imx_clk_divider("di_pred", "pll3_sw", MXC_CCM_CDCDR, 6, 3); | 201 | clk[IMX5_CLK_DI_PRED] = imx_clk_divider("di_pred", "pll3_sw", MXC_CCM_CDCDR, 6, 3); |
198 | clk[IMX5_CLK_IIM_GATE] = imx_clk_gate2("iim_gate", "ipg", MXC_CCM_CCGR0, 30); | 202 | clk[IMX5_CLK_IIM_GATE] = imx_clk_gate2("iim_gate", "ipg", MXC_CCM_CCGR0, 30); |
199 | clk[IMX5_CLK_UART1_IPG_GATE] = imx_clk_gate2("uart1_ipg_gate", "ipg", MXC_CCM_CCGR1, 6); | 203 | clk[IMX5_CLK_UART1_IPG_GATE] = imx_clk_gate2("uart1_ipg_gate", "ipg", MXC_CCM_CCGR1, 6); |
@@ -537,6 +541,11 @@ static void __init mx53_clocks_init(struct device_node *np) | |||
537 | clk[IMX5_CLK_CKO2] = imx_clk_gate2("cko2", "cko2_podf", MXC_CCM_CCOSR, 24); | 541 | clk[IMX5_CLK_CKO2] = imx_clk_gate2("cko2", "cko2_podf", MXC_CCM_CCOSR, 24); |
538 | clk[IMX5_CLK_SPDIF_XTAL_SEL] = imx_clk_mux("spdif_xtal_sel", MXC_CCM_CSCMR1, 2, 2, | 542 | clk[IMX5_CLK_SPDIF_XTAL_SEL] = imx_clk_mux("spdif_xtal_sel", MXC_CCM_CSCMR1, 2, 2, |
539 | mx53_spdif_xtal_sel, ARRAY_SIZE(mx53_spdif_xtal_sel)); | 543 | mx53_spdif_xtal_sel, ARRAY_SIZE(mx53_spdif_xtal_sel)); |
544 | clk[IMX5_CLK_ARM] = imx_clk_cpu("arm", "cpu_podf", | ||
545 | clk[IMX5_CLK_CPU_PODF], | ||
546 | clk[IMX5_CLK_CPU_PODF_SEL], | ||
547 | clk[IMX5_CLK_PLL1_SW], | ||
548 | clk[IMX5_CLK_STEP_SEL]); | ||
540 | 549 | ||
541 | imx_check_clocks(clk, ARRAY_SIZE(clk)); | 550 | imx_check_clocks(clk, ARRAY_SIZE(clk)); |
542 | 551 | ||
@@ -551,6 +560,9 @@ static void __init mx53_clocks_init(struct device_node *np) | |||
551 | /* move can bus clk to 24MHz */ | 560 | /* move can bus clk to 24MHz */ |
552 | clk_set_parent(clk[IMX5_CLK_CAN_SEL], clk[IMX5_CLK_LP_APM]); | 561 | clk_set_parent(clk[IMX5_CLK_CAN_SEL], clk[IMX5_CLK_LP_APM]); |
553 | 562 | ||
563 | /* make sure step clock is running from 24MHz */ | ||
564 | clk_set_parent(clk[IMX5_CLK_STEP_SEL], clk[IMX5_CLK_LP_APM]); | ||
565 | |||
554 | clk_prepare_enable(clk[IMX5_CLK_IIM_GATE]); | 566 | clk_prepare_enable(clk[IMX5_CLK_IIM_GATE]); |
555 | imx_print_silicon_rev("i.MX53", mx53_revision()); | 567 | imx_print_silicon_rev("i.MX53", mx53_revision()); |
556 | clk_disable_unprepare(clk[IMX5_CLK_IIM_GATE]); | 568 | clk_disable_unprepare(clk[IMX5_CLK_IIM_GATE]); |
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index 4e79da7c5e30..5951660d1bd2 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c | |||
@@ -145,7 +145,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) | |||
145 | post_div_table[2].div = 1; | 145 | post_div_table[2].div = 1; |
146 | video_div_table[1].div = 1; | 146 | video_div_table[1].div = 1; |
147 | video_div_table[2].div = 1; | 147 | video_div_table[2].div = 1; |
148 | }; | 148 | } |
149 | 149 | ||
150 | clk[IMX6QDL_PLL1_BYPASS_SRC] = imx_clk_mux("pll1_bypass_src", base + 0x00, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels)); | 150 | clk[IMX6QDL_PLL1_BYPASS_SRC] = imx_clk_mux("pll1_bypass_src", base + 0x00, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels)); |
151 | clk[IMX6QDL_PLL2_BYPASS_SRC] = imx_clk_mux("pll2_bypass_src", base + 0x30, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels)); | 151 | clk[IMX6QDL_PLL2_BYPASS_SRC] = imx_clk_mux("pll2_bypass_src", base + 0x30, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels)); |
diff --git a/arch/arm/mach-imx/clk-pllv3.c b/arch/arm/mach-imx/clk-pllv3.c index 57de74da0acf..0ad6e5442fd8 100644 --- a/arch/arm/mach-imx/clk-pllv3.c +++ b/arch/arm/mach-imx/clk-pllv3.c | |||
@@ -69,7 +69,6 @@ static int clk_pllv3_prepare(struct clk_hw *hw) | |||
69 | { | 69 | { |
70 | struct clk_pllv3 *pll = to_clk_pllv3(hw); | 70 | struct clk_pllv3 *pll = to_clk_pllv3(hw); |
71 | u32 val; | 71 | u32 val; |
72 | int ret; | ||
73 | 72 | ||
74 | val = readl_relaxed(pll->base); | 73 | val = readl_relaxed(pll->base); |
75 | if (pll->powerup_set) | 74 | if (pll->powerup_set) |
@@ -78,11 +77,7 @@ static int clk_pllv3_prepare(struct clk_hw *hw) | |||
78 | val &= ~BM_PLL_POWER; | 77 | val &= ~BM_PLL_POWER; |
79 | writel_relaxed(val, pll->base); | 78 | writel_relaxed(val, pll->base); |
80 | 79 | ||
81 | ret = clk_pllv3_wait_lock(pll); | 80 | return clk_pllv3_wait_lock(pll); |
82 | if (ret) | ||
83 | return ret; | ||
84 | |||
85 | return 0; | ||
86 | } | 81 | } |
87 | 82 | ||
88 | static void clk_pllv3_unprepare(struct clk_hw *hw) | 83 | static void clk_pllv3_unprepare(struct clk_hw *hw) |
diff --git a/arch/arm/mach-imx/clk-vf610.c b/arch/arm/mach-imx/clk-vf610.c index a17818475050..5937ddee1a99 100644 --- a/arch/arm/mach-imx/clk-vf610.c +++ b/arch/arm/mach-imx/clk-vf610.c | |||
@@ -58,8 +58,14 @@ | |||
58 | #define PFD_PLL1_BASE (anatop_base + 0x2b0) | 58 | #define PFD_PLL1_BASE (anatop_base + 0x2b0) |
59 | #define PFD_PLL2_BASE (anatop_base + 0x100) | 59 | #define PFD_PLL2_BASE (anatop_base + 0x100) |
60 | #define PFD_PLL3_BASE (anatop_base + 0xf0) | 60 | #define PFD_PLL3_BASE (anatop_base + 0xf0) |
61 | #define PLL1_CTRL (anatop_base + 0x270) | ||
62 | #define PLL2_CTRL (anatop_base + 0x30) | ||
61 | #define PLL3_CTRL (anatop_base + 0x10) | 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 | #define PLL7_CTRL (anatop_base + 0x20) | 67 | #define PLL7_CTRL (anatop_base + 0x20) |
68 | #define ANA_MISC1 (anatop_base + 0x160) | ||
63 | 69 | ||
64 | static void __iomem *anatop_base; | 70 | static void __iomem *anatop_base; |
65 | static void __iomem *ccm_base; | 71 | static void __iomem *ccm_base; |
@@ -67,25 +73,34 @@ static void __iomem *ccm_base; | |||
67 | /* sources for multiplexer clocks, this is used multiple times */ | 73 | /* sources for multiplexer clocks, this is used multiple times */ |
68 | static const char *fast_sels[] = { "firc", "fxosc", }; | 74 | static const char *fast_sels[] = { "firc", "fxosc", }; |
69 | static const char *slow_sels[] = { "sirc_32k", "sxosc", }; | 75 | static const char *slow_sels[] = { "sirc_32k", "sxosc", }; |
70 | static const char *pll1_sels[] = { "pll1_main", "pll1_pfd1", "pll1_pfd2", "pll1_pfd3", "pll1_pfd4", }; | 76 | static const char *pll1_sels[] = { "pll1_sys", "pll1_pfd1", "pll1_pfd2", "pll1_pfd3", "pll1_pfd4", }; |
71 | static const char *pll2_sels[] = { "pll2_main", "pll2_pfd1", "pll2_pfd2", "pll2_pfd3", "pll2_pfd4", }; | 77 | static const char *pll2_sels[] = { "pll2_bus", "pll2_pfd1", "pll2_pfd2", "pll2_pfd3", "pll2_pfd4", }; |
72 | static const char *sys_sels[] = { "fast_clk_sel", "slow_clk_sel", "pll2_pfd_sel", "pll2_main", "pll1_pfd_sel", "pll3_main", }; | 78 | static const char *pll_bypass_src_sels[] = { "fast_clk_sel", "lvds1_in", }; |
79 | static const char *pll1_bypass_sels[] = { "pll1", "pll1_bypass_src", }; | ||
80 | static const char *pll2_bypass_sels[] = { "pll2", "pll2_bypass_src", }; | ||
81 | static const char *pll3_bypass_sels[] = { "pll3", "pll3_bypass_src", }; | ||
82 | static const char *pll4_bypass_sels[] = { "pll4", "pll4_bypass_src", }; | ||
83 | static const char *pll5_bypass_sels[] = { "pll5", "pll5_bypass_src", }; | ||
84 | static const char *pll6_bypass_sels[] = { "pll6", "pll6_bypass_src", }; | ||
85 | static const char *pll7_bypass_sels[] = { "pll7", "pll7_bypass_src", }; | ||
86 | static const char *sys_sels[] = { "fast_clk_sel", "slow_clk_sel", "pll2_pfd_sel", "pll2_bus", "pll1_pfd_sel", "pll3_usb_otg", }; | ||
73 | static const char *ddr_sels[] = { "pll2_pfd2", "sys_sel", }; | 87 | static const char *ddr_sels[] = { "pll2_pfd2", "sys_sel", }; |
74 | static const char *rmii_sels[] = { "enet_ext", "audio_ext", "enet_50m", "enet_25m", }; | 88 | static const char *rmii_sels[] = { "enet_ext", "audio_ext", "enet_50m", "enet_25m", }; |
75 | static const char *enet_ts_sels[] = { "enet_ext", "fxosc", "audio_ext", "usb", "enet_ts", "enet_25m", "enet_50m", }; | 89 | static const char *enet_ts_sels[] = { "enet_ext", "fxosc", "audio_ext", "usb", "enet_ts", "enet_25m", "enet_50m", }; |
76 | static const char *esai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_main_div", }; | 90 | static const char *esai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_audio_div", }; |
77 | static const char *sai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_main_div", }; | 91 | static const char *sai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_audio_div", }; |
78 | static const char *nfc_sels[] = { "platform_bus", "pll1_pfd1", "pll3_pfd1", "pll3_pfd3", }; | 92 | static const char *nfc_sels[] = { "platform_bus", "pll1_pfd1", "pll3_pfd1", "pll3_pfd3", }; |
79 | static const char *qspi_sels[] = { "pll3_main", "pll3_pfd4", "pll2_pfd4", "pll1_pfd4", }; | 93 | static const char *qspi_sels[] = { "pll3_usb_otg", "pll3_pfd4", "pll2_pfd4", "pll1_pfd4", }; |
80 | static const char *esdhc_sels[] = { "pll3_main", "pll3_pfd3", "pll1_pfd3", "platform_bus", }; | 94 | static const char *esdhc_sels[] = { "pll3_usb_otg", "pll3_pfd3", "pll1_pfd3", "platform_bus", }; |
81 | static const char *dcu_sels[] = { "pll1_pfd2", "pll3_main", }; | 95 | static const char *dcu_sels[] = { "pll1_pfd2", "pll3_usb_otg", }; |
82 | static const char *gpu_sels[] = { "pll2_pfd2", "pll3_pfd2", }; | 96 | static const char *gpu_sels[] = { "pll2_pfd2", "pll3_pfd2", }; |
83 | static const char *vadc_sels[] = { "pll6_main_div", "pll3_main_div", "pll3_main", }; | 97 | static const char *vadc_sels[] = { "pll6_video_div", "pll3_usb_otg_div", "pll3_usb_otg", }; |
84 | /* FTM counter clock source, not module clock */ | 98 | /* FTM counter clock source, not module clock */ |
85 | static const char *ftm_ext_sels[] = {"sirc_128k", "sxosc", "fxosc_half", "audio_ext", }; | 99 | static const char *ftm_ext_sels[] = {"sirc_128k", "sxosc", "fxosc_half", "audio_ext", }; |
86 | static const char *ftm_fix_sels[] = { "sxosc", "ipg_bus", }; | 100 | static const char *ftm_fix_sels[] = { "sxosc", "ipg_bus", }; |
87 | 101 | ||
88 | static struct clk_div_table pll4_main_div_table[] = { | 102 | |
103 | static struct clk_div_table pll4_audio_div_table[] = { | ||
89 | { .val = 0, .div = 1 }, | 104 | { .val = 0, .div = 1 }, |
90 | { .val = 1, .div = 2 }, | 105 | { .val = 1, .div = 2 }, |
91 | { .val = 2, .div = 6 }, | 106 | { .val = 2, .div = 6 }, |
@@ -105,6 +120,17 @@ static unsigned int const clks_init_on[] __initconst = { | |||
105 | VF610_CLK_DDR_SEL, | 120 | VF610_CLK_DDR_SEL, |
106 | }; | 121 | }; |
107 | 122 | ||
123 | static struct clk * __init vf610_get_fixed_clock( | ||
124 | struct device_node *ccm_node, const char *name) | ||
125 | { | ||
126 | struct clk *clk = of_clk_get_by_name(ccm_node, name); | ||
127 | |||
128 | /* Backward compatibility if device tree is missing clks assignments */ | ||
129 | if (IS_ERR(clk)) | ||
130 | clk = imx_obtain_fixed_clock(name, 0); | ||
131 | return clk; | ||
132 | }; | ||
133 | |||
108 | static void __init vf610_clocks_init(struct device_node *ccm_node) | 134 | static void __init vf610_clocks_init(struct device_node *ccm_node) |
109 | { | 135 | { |
110 | struct device_node *np; | 136 | struct device_node *np; |
@@ -115,10 +141,13 @@ static void __init vf610_clocks_init(struct device_node *ccm_node) | |||
115 | clk[VF610_CLK_SIRC_32K] = imx_clk_fixed("sirc_32k", 32000); | 141 | clk[VF610_CLK_SIRC_32K] = imx_clk_fixed("sirc_32k", 32000); |
116 | clk[VF610_CLK_FIRC] = imx_clk_fixed("firc", 24000000); | 142 | clk[VF610_CLK_FIRC] = imx_clk_fixed("firc", 24000000); |
117 | 143 | ||
118 | clk[VF610_CLK_SXOSC] = imx_obtain_fixed_clock("sxosc", 0); | 144 | clk[VF610_CLK_SXOSC] = vf610_get_fixed_clock(ccm_node, "sxosc"); |
119 | clk[VF610_CLK_FXOSC] = imx_obtain_fixed_clock("fxosc", 0); | 145 | clk[VF610_CLK_FXOSC] = vf610_get_fixed_clock(ccm_node, "fxosc"); |
120 | clk[VF610_CLK_AUDIO_EXT] = imx_obtain_fixed_clock("audio_ext", 0); | 146 | clk[VF610_CLK_AUDIO_EXT] = vf610_get_fixed_clock(ccm_node, "audio_ext"); |
121 | clk[VF610_CLK_ENET_EXT] = imx_obtain_fixed_clock("enet_ext", 0); | 147 | clk[VF610_CLK_ENET_EXT] = vf610_get_fixed_clock(ccm_node, "enet_ext"); |
148 | |||
149 | /* Clock source from external clock via LVDs PAD */ | ||
150 | clk[VF610_CLK_ANACLK1] = vf610_get_fixed_clock(ccm_node, "anaclk1"); | ||
122 | 151 | ||
123 | clk[VF610_CLK_FXOSC_HALF] = imx_clk_fixed_factor("fxosc_half", "fxosc", 1, 2); | 152 | clk[VF610_CLK_FXOSC_HALF] = imx_clk_fixed_factor("fxosc_half", "fxosc", 1, 2); |
124 | 153 | ||
@@ -133,31 +162,63 @@ static void __init vf610_clocks_init(struct device_node *ccm_node) | |||
133 | clk[VF610_CLK_SLOW_CLK_SEL] = imx_clk_mux("slow_clk_sel", CCM_CCSR, 4, 1, slow_sels, ARRAY_SIZE(slow_sels)); | 162 | clk[VF610_CLK_SLOW_CLK_SEL] = imx_clk_mux("slow_clk_sel", CCM_CCSR, 4, 1, slow_sels, ARRAY_SIZE(slow_sels)); |
134 | clk[VF610_CLK_FASK_CLK_SEL] = imx_clk_mux("fast_clk_sel", CCM_CCSR, 5, 1, fast_sels, ARRAY_SIZE(fast_sels)); | 163 | clk[VF610_CLK_FASK_CLK_SEL] = imx_clk_mux("fast_clk_sel", CCM_CCSR, 5, 1, fast_sels, ARRAY_SIZE(fast_sels)); |
135 | 164 | ||
136 | clk[VF610_CLK_PLL1_MAIN] = imx_clk_fixed_factor("pll1_main", "fast_clk_sel", 22, 1); | 165 | 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_PLL1_PFD1] = imx_clk_pfd("pll1_pfd1", "pll1_main", PFD_PLL1_BASE, 0); | 166 | 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_PLL1_PFD2] = imx_clk_pfd("pll1_pfd2", "pll1_main", PFD_PLL1_BASE, 1); | 167 | 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_PLL1_PFD3] = imx_clk_pfd("pll1_pfd3", "pll1_main", PFD_PLL1_BASE, 2); | 168 | 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_PLL1_PFD4] = imx_clk_pfd("pll1_pfd4", "pll1_main", PFD_PLL1_BASE, 3); | 169 | 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 | 170 | 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_PLL2_MAIN] = imx_clk_fixed_factor("pll2_main", "fast_clk_sel", 22, 1); | 171 | 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)); |
143 | clk[VF610_CLK_PLL2_PFD1] = imx_clk_pfd("pll2_pfd1", "pll2_main", PFD_PLL2_BASE, 0); | 172 | |
144 | clk[VF610_CLK_PLL2_PFD2] = imx_clk_pfd("pll2_pfd2", "pll2_main", PFD_PLL2_BASE, 1); | 173 | clk[VF610_CLK_PLL1] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll1", "pll1_bypass_src", PLL1_CTRL, 0x1); |
145 | clk[VF610_CLK_PLL2_PFD3] = imx_clk_pfd("pll2_pfd3", "pll2_main", PFD_PLL2_BASE, 2); | 174 | clk[VF610_CLK_PLL2] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll2", "pll2_bypass_src", PLL2_CTRL, 0x1); |
146 | clk[VF610_CLK_PLL2_PFD4] = imx_clk_pfd("pll2_pfd4", "pll2_main", PFD_PLL2_BASE, 3); | 175 | clk[VF610_CLK_PLL3] = imx_clk_pllv3(IMX_PLLV3_USB, "pll3", "pll3_bypass_src", PLL3_CTRL, 0x1); |
147 | 176 | clk[VF610_CLK_PLL4] = imx_clk_pllv3(IMX_PLLV3_AV, "pll4", "pll4_bypass_src", PLL4_CTRL, 0x7f); | |
148 | clk[VF610_CLK_PLL3_MAIN] = imx_clk_fixed_factor("pll3_main", "fast_clk_sel", 20, 1); | 177 | clk[VF610_CLK_PLL5] = imx_clk_pllv3(IMX_PLLV3_ENET, "pll5", "pll5_bypass_src", PLL5_CTRL, 0x3); |
149 | clk[VF610_CLK_PLL3_PFD1] = imx_clk_pfd("pll3_pfd1", "pll3_main", PFD_PLL3_BASE, 0); | 178 | clk[VF610_CLK_PLL6] = imx_clk_pllv3(IMX_PLLV3_AV, "pll6", "pll6_bypass_src", PLL6_CTRL, 0x7f); |
150 | clk[VF610_CLK_PLL3_PFD2] = imx_clk_pfd("pll3_pfd2", "pll3_main", PFD_PLL3_BASE, 1); | 179 | clk[VF610_CLK_PLL7] = imx_clk_pllv3(IMX_PLLV3_USB, "pll7", "pll7_bypass_src", PLL7_CTRL, 0x1); |
151 | clk[VF610_CLK_PLL3_PFD3] = imx_clk_pfd("pll3_pfd3", "pll3_main", PFD_PLL3_BASE, 2); | 180 | |
152 | clk[VF610_CLK_PLL3_PFD4] = imx_clk_pfd("pll3_pfd4", "pll3_main", PFD_PLL3_BASE, 3); | 181 | 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 | 182 | 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_CLK_PLL4_MAIN] = imx_clk_fixed_factor("pll4_main", "fast_clk_sel", 25, 1); | 183 | 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 | /* Enet pll: fixed 50Mhz */ | 184 | 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_CLK_PLL5_MAIN] = imx_clk_fixed_factor("pll5_main", "fast_clk_sel", 125, 6); | 185 | 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 | /* pll6: default 960Mhz */ | 186 | 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_CLK_PLL6_MAIN] = imx_clk_fixed_factor("pll6_main", "fast_clk_sel", 40, 1); | 187 | 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); |
159 | /* pll7: USB1 PLL at 480MHz */ | 188 | |
160 | clk[VF610_CLK_PLL7_MAIN] = imx_clk_pllv3(IMX_PLLV3_USB, "pll7_main", "fast_clk_sel", PLL7_CTRL, 0x2); | 189 | /* Do not bypass PLLs initially */ |
190 | clk_set_parent(clk[VF610_PLL1_BYPASS], clk[VF610_CLK_PLL1]); | ||
191 | clk_set_parent(clk[VF610_PLL2_BYPASS], clk[VF610_CLK_PLL2]); | ||
192 | clk_set_parent(clk[VF610_PLL3_BYPASS], clk[VF610_CLK_PLL3]); | ||
193 | clk_set_parent(clk[VF610_PLL4_BYPASS], clk[VF610_CLK_PLL4]); | ||
194 | clk_set_parent(clk[VF610_PLL5_BYPASS], clk[VF610_CLK_PLL5]); | ||
195 | clk_set_parent(clk[VF610_PLL6_BYPASS], clk[VF610_CLK_PLL6]); | ||
196 | clk_set_parent(clk[VF610_PLL7_BYPASS], clk[VF610_CLK_PLL7]); | ||
197 | |||
198 | clk[VF610_CLK_PLL1_SYS] = imx_clk_gate("pll1_sys", "pll1_bypass", PLL1_CTRL, 13); | ||
199 | clk[VF610_CLK_PLL2_BUS] = imx_clk_gate("pll2_bus", "pll2_bypass", PLL2_CTRL, 13); | ||
200 | clk[VF610_CLK_PLL3_USB_OTG] = imx_clk_gate("pll3_usb_otg", "pll3_bypass", PLL3_CTRL, 13); | ||
201 | clk[VF610_CLK_PLL4_AUDIO] = imx_clk_gate("pll4_audio", "pll4_bypass", PLL4_CTRL, 13); | ||
202 | clk[VF610_CLK_PLL5_ENET] = imx_clk_gate("pll5_enet", "pll5_bypass", PLL5_CTRL, 13); | ||
203 | clk[VF610_CLK_PLL6_VIDEO] = imx_clk_gate("pll6_video", "pll6_bypass", PLL6_CTRL, 13); | ||
204 | clk[VF610_CLK_PLL7_USB_HOST] = imx_clk_gate("pll7_usb_host", "pll7_bypass", PLL7_CTRL, 13); | ||
205 | |||
206 | clk[VF610_CLK_LVDS1_IN] = imx_clk_gate_exclusive("lvds1_in", "anaclk1", ANA_MISC1, 12, BIT(10)); | ||
207 | |||
208 | clk[VF610_CLK_PLL1_PFD1] = imx_clk_pfd("pll1_pfd1", "pll1_sys", PFD_PLL1_BASE, 0); | ||
209 | clk[VF610_CLK_PLL1_PFD2] = imx_clk_pfd("pll1_pfd2", "pll1_sys", PFD_PLL1_BASE, 1); | ||
210 | clk[VF610_CLK_PLL1_PFD3] = imx_clk_pfd("pll1_pfd3", "pll1_sys", PFD_PLL1_BASE, 2); | ||
211 | clk[VF610_CLK_PLL1_PFD4] = imx_clk_pfd("pll1_pfd4", "pll1_sys", PFD_PLL1_BASE, 3); | ||
212 | |||
213 | clk[VF610_CLK_PLL2_PFD1] = imx_clk_pfd("pll2_pfd1", "pll2_bus", PFD_PLL2_BASE, 0); | ||
214 | clk[VF610_CLK_PLL2_PFD2] = imx_clk_pfd("pll2_pfd2", "pll2_bus", PFD_PLL2_BASE, 1); | ||
215 | clk[VF610_CLK_PLL2_PFD3] = imx_clk_pfd("pll2_pfd3", "pll2_bus", PFD_PLL2_BASE, 2); | ||
216 | clk[VF610_CLK_PLL2_PFD4] = imx_clk_pfd("pll2_pfd4", "pll2_bus", PFD_PLL2_BASE, 3); | ||
217 | |||
218 | clk[VF610_CLK_PLL3_PFD1] = imx_clk_pfd("pll3_pfd1", "pll3_usb_otg", PFD_PLL3_BASE, 0); | ||
219 | clk[VF610_CLK_PLL3_PFD2] = imx_clk_pfd("pll3_pfd2", "pll3_usb_otg", PFD_PLL3_BASE, 1); | ||
220 | clk[VF610_CLK_PLL3_PFD3] = imx_clk_pfd("pll3_pfd3", "pll3_usb_otg", PFD_PLL3_BASE, 2); | ||
221 | clk[VF610_CLK_PLL3_PFD4] = imx_clk_pfd("pll3_pfd4", "pll3_usb_otg", PFD_PLL3_BASE, 3); | ||
161 | 222 | ||
162 | clk[VF610_CLK_PLL1_PFD_SEL] = imx_clk_mux("pll1_pfd_sel", CCM_CCSR, 16, 3, pll1_sels, 5); | 223 | clk[VF610_CLK_PLL1_PFD_SEL] = imx_clk_mux("pll1_pfd_sel", CCM_CCSR, 16, 3, pll1_sels, 5); |
163 | clk[VF610_CLK_PLL2_PFD_SEL] = imx_clk_mux("pll2_pfd_sel", CCM_CCSR, 19, 3, pll2_sels, 5); | 224 | clk[VF610_CLK_PLL2_PFD_SEL] = imx_clk_mux("pll2_pfd_sel", CCM_CCSR, 19, 3, pll2_sels, 5); |
@@ -167,12 +228,12 @@ static void __init vf610_clocks_init(struct device_node *ccm_node) | |||
167 | clk[VF610_CLK_PLATFORM_BUS] = imx_clk_divider("platform_bus", "sys_bus", CCM_CACRR, 3, 3); | 228 | clk[VF610_CLK_PLATFORM_BUS] = imx_clk_divider("platform_bus", "sys_bus", CCM_CACRR, 3, 3); |
168 | clk[VF610_CLK_IPG_BUS] = imx_clk_divider("ipg_bus", "platform_bus", CCM_CACRR, 11, 2); | 229 | clk[VF610_CLK_IPG_BUS] = imx_clk_divider("ipg_bus", "platform_bus", CCM_CACRR, 11, 2); |
169 | 230 | ||
170 | clk[VF610_CLK_PLL3_MAIN_DIV] = imx_clk_divider("pll3_main_div", "pll3_main", CCM_CACRR, 20, 1); | 231 | 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_main_div", "pll4_main", 0, CCM_CACRR, 6, 3, 0, pll4_main_div_table, &imx_ccm_lock); | 232 | 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_main_div", "pll6_main", CCM_CACRR, 21, 1); | 233 | clk[VF610_CLK_PLL6_MAIN_DIV] = imx_clk_divider("pll6_video_div", "pll6_video", CCM_CACRR, 21, 1); |
173 | 234 | ||
174 | clk[VF610_CLK_USBPHY0] = imx_clk_gate("usbphy0", "pll3_main", PLL3_CTRL, 6); | 235 | clk[VF610_CLK_USBPHY0] = imx_clk_gate("usbphy0", "pll3_usb_otg", PLL3_CTRL, 6); |
175 | clk[VF610_CLK_USBPHY1] = imx_clk_gate("usbphy1", "pll7_main", PLL7_CTRL, 6); | 236 | clk[VF610_CLK_USBPHY1] = imx_clk_gate("usbphy1", "pll7_usb_host", PLL7_CTRL, 6); |
176 | 237 | ||
177 | clk[VF610_CLK_USBC0] = imx_clk_gate2("usbc0", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(4)); | 238 | clk[VF610_CLK_USBC0] = imx_clk_gate2("usbc0", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(4)); |
178 | clk[VF610_CLK_USBC1] = imx_clk_gate2("usbc1", "ipg_bus", CCM_CCGR7, CCM_CCGRx_CGn(4)); | 239 | clk[VF610_CLK_USBC1] = imx_clk_gate2("usbc1", "ipg_bus", CCM_CCGR7, CCM_CCGRx_CGn(4)); |
@@ -191,8 +252,8 @@ static void __init vf610_clocks_init(struct device_node *ccm_node) | |||
191 | clk[VF610_CLK_QSPI1_X1_DIV] = imx_clk_divider("qspi1_x1", "qspi1_x2", CCM_CSCDR3, 11, 1); | 252 | clk[VF610_CLK_QSPI1_X1_DIV] = imx_clk_divider("qspi1_x1", "qspi1_x2", CCM_CSCDR3, 11, 1); |
192 | clk[VF610_CLK_QSPI1] = imx_clk_gate2("qspi1", "qspi1_x1", CCM_CCGR8, CCM_CCGRx_CGn(4)); | 253 | clk[VF610_CLK_QSPI1] = imx_clk_gate2("qspi1", "qspi1_x1", CCM_CCGR8, CCM_CCGRx_CGn(4)); |
193 | 254 | ||
194 | clk[VF610_CLK_ENET_50M] = imx_clk_fixed_factor("enet_50m", "pll5_main", 1, 10); | 255 | 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_main", 1, 20); | 256 | clk[VF610_CLK_ENET_25M] = imx_clk_fixed_factor("enet_25m", "pll5_enet", 1, 20); |
196 | clk[VF610_CLK_ENET_SEL] = imx_clk_mux("enet_sel", CCM_CSCMR2, 4, 2, rmii_sels, 4); | 257 | clk[VF610_CLK_ENET_SEL] = imx_clk_mux("enet_sel", CCM_CSCMR2, 4, 2, rmii_sels, 4); |
197 | clk[VF610_CLK_ENET_TS_SEL] = imx_clk_mux("enet_ts_sel", CCM_CSCMR2, 0, 3, enet_ts_sels, 7); | 258 | clk[VF610_CLK_ENET_TS_SEL] = imx_clk_mux("enet_ts_sel", CCM_CSCMR2, 0, 3, enet_ts_sels, 7); |
198 | clk[VF610_CLK_ENET] = imx_clk_gate("enet", "enet_sel", CCM_CSCDR1, 24); | 259 | clk[VF610_CLK_ENET] = imx_clk_gate("enet", "enet_sel", CCM_CSCDR1, 24); |
diff --git a/arch/arm/mach-imx/clk.h b/arch/arm/mach-imx/clk.h index 4cdf8b6a74e8..5ef82e2f8fc5 100644 --- a/arch/arm/mach-imx/clk.h +++ b/arch/arm/mach-imx/clk.h | |||
@@ -131,4 +131,8 @@ static inline struct clk *imx_clk_fixed_factor(const char *name, | |||
131 | CLK_SET_RATE_PARENT, mult, div); | 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 | #endif | 138 | #endif |
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index 1dabf435c592..cfcdb623d78f 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h | |||
@@ -61,7 +61,6 @@ struct platform_device *mxc_register_gpio(char *name, int id, | |||
61 | void mxc_set_cpu_type(unsigned int type); | 61 | void mxc_set_cpu_type(unsigned int type); |
62 | void mxc_restart(enum reboot_mode, const char *); | 62 | void mxc_restart(enum reboot_mode, const char *); |
63 | void mxc_arch_reset_init(void __iomem *); | 63 | void mxc_arch_reset_init(void __iomem *); |
64 | void mxc_arch_reset_init_dt(void); | ||
65 | int mx51_revision(void); | 64 | int mx51_revision(void); |
66 | int mx53_revision(void); | 65 | int mx53_revision(void); |
67 | void imx_set_aips(void __iomem *); | 66 | void imx_set_aips(void __iomem *); |
@@ -108,14 +107,15 @@ void imx_gpc_pre_suspend(bool arm_power_off); | |||
108 | void imx_gpc_post_resume(void); | 107 | void imx_gpc_post_resume(void); |
109 | void imx_gpc_mask_all(void); | 108 | void imx_gpc_mask_all(void); |
110 | void imx_gpc_restore_all(void); | 109 | void imx_gpc_restore_all(void); |
111 | void imx_gpc_irq_mask(struct irq_data *d); | 110 | void imx_gpc_hwirq_mask(unsigned int hwirq); |
112 | void imx_gpc_irq_unmask(struct irq_data *d); | 111 | void imx_gpc_hwirq_unmask(unsigned int hwirq); |
113 | void imx_anatop_init(void); | 112 | void imx_anatop_init(void); |
114 | void imx_anatop_pre_suspend(void); | 113 | void imx_anatop_pre_suspend(void); |
115 | void imx_anatop_post_resume(void); | 114 | void imx_anatop_post_resume(void); |
116 | int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode); | 115 | int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode); |
117 | void imx6q_set_int_mem_clk_lpm(bool enable); | 116 | void imx6q_set_int_mem_clk_lpm(bool enable); |
118 | void imx6sl_set_wait_clk(bool enter); | 117 | void imx6sl_set_wait_clk(bool enter); |
118 | int imx_mmdc_get_ddr_type(void); | ||
119 | 119 | ||
120 | void imx_cpu_die(unsigned int cpu); | 120 | void imx_cpu_die(unsigned int cpu); |
121 | int imx_cpu_kill(unsigned int cpu); | 121 | int imx_cpu_kill(unsigned int cpu); |
@@ -157,5 +157,6 @@ static inline void imx_init_l2cache(void) {} | |||
157 | #endif | 157 | #endif |
158 | 158 | ||
159 | extern struct smp_operations imx_smp_ops; | 159 | extern struct smp_operations imx_smp_ops; |
160 | extern struct smp_operations ls1021a_smp_ops; | ||
160 | 161 | ||
161 | #endif | 162 | #endif |
diff --git a/arch/arm/mach-imx/cpuidle-imx5.c b/arch/arm/mach-imx/cpuidle-imx5.c index 5a47e3c6172f..3feca526d16b 100644 --- a/arch/arm/mach-imx/cpuidle-imx5.c +++ b/arch/arm/mach-imx/cpuidle-imx5.c | |||
@@ -24,7 +24,6 @@ static struct cpuidle_driver imx5_cpuidle_driver = { | |||
24 | .enter = imx5_cpuidle_enter, | 24 | .enter = imx5_cpuidle_enter, |
25 | .exit_latency = 2, | 25 | .exit_latency = 2, |
26 | .target_residency = 1, | 26 | .target_residency = 1, |
27 | .flags = CPUIDLE_FLAG_TIME_VALID, | ||
28 | .name = "IMX5 SRPG", | 27 | .name = "IMX5 SRPG", |
29 | .desc = "CPU state retained,powered off", | 28 | .desc = "CPU state retained,powered off", |
30 | }, | 29 | }, |
diff --git a/arch/arm/mach-imx/cpuidle-imx6q.c b/arch/arm/mach-imx/cpuidle-imx6q.c index aa935787b743..d76d08623f9f 100644 --- a/arch/arm/mach-imx/cpuidle-imx6q.c +++ b/arch/arm/mach-imx/cpuidle-imx6q.c | |||
@@ -53,8 +53,7 @@ static struct cpuidle_driver imx6q_cpuidle_driver = { | |||
53 | { | 53 | { |
54 | .exit_latency = 50, | 54 | .exit_latency = 50, |
55 | .target_residency = 75, | 55 | .target_residency = 75, |
56 | .flags = CPUIDLE_FLAG_TIME_VALID | | 56 | .flags = CPUIDLE_FLAG_TIMER_STOP, |
57 | CPUIDLE_FLAG_TIMER_STOP, | ||
58 | .enter = imx6q_enter_wait, | 57 | .enter = imx6q_enter_wait, |
59 | .name = "WAIT", | 58 | .name = "WAIT", |
60 | .desc = "Clock off", | 59 | .desc = "Clock off", |
diff --git a/arch/arm/mach-imx/cpuidle-imx6sl.c b/arch/arm/mach-imx/cpuidle-imx6sl.c index d4b6b8171fa9..7d92e6584551 100644 --- a/arch/arm/mach-imx/cpuidle-imx6sl.c +++ b/arch/arm/mach-imx/cpuidle-imx6sl.c | |||
@@ -40,8 +40,7 @@ static struct cpuidle_driver imx6sl_cpuidle_driver = { | |||
40 | { | 40 | { |
41 | .exit_latency = 50, | 41 | .exit_latency = 50, |
42 | .target_residency = 75, | 42 | .target_residency = 75, |
43 | .flags = CPUIDLE_FLAG_TIME_VALID | | 43 | .flags = CPUIDLE_FLAG_TIMER_STOP, |
44 | CPUIDLE_FLAG_TIMER_STOP, | ||
45 | .enter = imx6sl_enter_wait, | 44 | .enter = imx6sl_enter_wait, |
46 | .name = "WAIT", | 45 | .name = "WAIT", |
47 | .desc = "Clock off", | 46 | .desc = "Clock off", |
diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c index 82ea74e68482..5f3602ec74fa 100644 --- a/arch/arm/mach-imx/gpc.c +++ b/arch/arm/mach-imx/gpc.c | |||
@@ -56,14 +56,14 @@ void imx_gpc_post_resume(void) | |||
56 | 56 | ||
57 | static int imx_gpc_irq_set_wake(struct irq_data *d, unsigned int on) | 57 | static int imx_gpc_irq_set_wake(struct irq_data *d, unsigned int on) |
58 | { | 58 | { |
59 | unsigned int idx = d->irq / 32 - 1; | 59 | unsigned int idx = d->hwirq / 32 - 1; |
60 | u32 mask; | 60 | u32 mask; |
61 | 61 | ||
62 | /* Sanity check for SPI irq */ | 62 | /* Sanity check for SPI irq */ |
63 | if (d->irq < 32) | 63 | if (d->hwirq < 32) |
64 | return -EINVAL; | 64 | return -EINVAL; |
65 | 65 | ||
66 | mask = 1 << d->irq % 32; | 66 | mask = 1 << d->hwirq % 32; |
67 | gpc_wake_irqs[idx] = on ? gpc_wake_irqs[idx] | mask : | 67 | gpc_wake_irqs[idx] = on ? gpc_wake_irqs[idx] | mask : |
68 | gpc_wake_irqs[idx] & ~mask; | 68 | gpc_wake_irqs[idx] & ~mask; |
69 | 69 | ||
@@ -91,34 +91,44 @@ void imx_gpc_restore_all(void) | |||
91 | writel_relaxed(gpc_saved_imrs[i], reg_imr1 + i * 4); | 91 | writel_relaxed(gpc_saved_imrs[i], reg_imr1 + i * 4); |
92 | } | 92 | } |
93 | 93 | ||
94 | void imx_gpc_irq_unmask(struct irq_data *d) | 94 | void imx_gpc_hwirq_unmask(unsigned int hwirq) |
95 | { | 95 | { |
96 | void __iomem *reg; | 96 | void __iomem *reg; |
97 | u32 val; | 97 | u32 val; |
98 | 98 | ||
99 | /* Sanity check for SPI irq */ | 99 | reg = gpc_base + GPC_IMR1 + (hwirq / 32 - 1) * 4; |
100 | if (d->irq < 32) | ||
101 | return; | ||
102 | |||
103 | reg = gpc_base + GPC_IMR1 + (d->irq / 32 - 1) * 4; | ||
104 | val = readl_relaxed(reg); | 100 | val = readl_relaxed(reg); |
105 | val &= ~(1 << d->irq % 32); | 101 | val &= ~(1 << hwirq % 32); |
106 | writel_relaxed(val, reg); | 102 | writel_relaxed(val, reg); |
107 | } | 103 | } |
108 | 104 | ||
109 | void imx_gpc_irq_mask(struct irq_data *d) | 105 | void imx_gpc_hwirq_mask(unsigned int hwirq) |
110 | { | 106 | { |
111 | void __iomem *reg; | 107 | void __iomem *reg; |
112 | u32 val; | 108 | u32 val; |
113 | 109 | ||
110 | reg = gpc_base + GPC_IMR1 + (hwirq / 32 - 1) * 4; | ||
111 | val = readl_relaxed(reg); | ||
112 | val |= 1 << (hwirq % 32); | ||
113 | writel_relaxed(val, reg); | ||
114 | } | ||
115 | |||
116 | static void imx_gpc_irq_unmask(struct irq_data *d) | ||
117 | { | ||
118 | /* Sanity check for SPI irq */ | ||
119 | if (d->hwirq < 32) | ||
120 | return; | ||
121 | |||
122 | imx_gpc_hwirq_unmask(d->hwirq); | ||
123 | } | ||
124 | |||
125 | static void imx_gpc_irq_mask(struct irq_data *d) | ||
126 | { | ||
114 | /* Sanity check for SPI irq */ | 127 | /* Sanity check for SPI irq */ |
115 | if (d->irq < 32) | 128 | if (d->hwirq < 32) |
116 | return; | 129 | return; |
117 | 130 | ||
118 | reg = gpc_base + GPC_IMR1 + (d->irq / 32 - 1) * 4; | 131 | imx_gpc_hwirq_mask(d->hwirq); |
119 | val = readl_relaxed(reg); | ||
120 | val |= 1 << (d->irq % 32); | ||
121 | writel_relaxed(val, reg); | ||
122 | } | 132 | } |
123 | 133 | ||
124 | void __init imx_gpc_init(void) | 134 | void __init imx_gpc_init(void) |
diff --git a/arch/arm/mach-imx/imx25-dt.c b/arch/arm/mach-imx/imx25-dt.c index cf8032bae277..25defbdb06c4 100644 --- a/arch/arm/mach-imx/imx25-dt.c +++ b/arch/arm/mach-imx/imx25-dt.c | |||
@@ -17,13 +17,6 @@ | |||
17 | #include "common.h" | 17 | #include "common.h" |
18 | #include "mx25.h" | 18 | #include "mx25.h" |
19 | 19 | ||
20 | static void __init imx25_dt_init(void) | ||
21 | { | ||
22 | mxc_arch_reset_init_dt(); | ||
23 | |||
24 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
25 | } | ||
26 | |||
27 | static const char * const imx25_dt_board_compat[] __initconst = { | 20 | static const char * const imx25_dt_board_compat[] __initconst = { |
28 | "fsl,imx25", | 21 | "fsl,imx25", |
29 | NULL | 22 | NULL |
@@ -33,7 +26,5 @@ DT_MACHINE_START(IMX25_DT, "Freescale i.MX25 (Device Tree Support)") | |||
33 | .map_io = mx25_map_io, | 26 | .map_io = mx25_map_io, |
34 | .init_early = imx25_init_early, | 27 | .init_early = imx25_init_early, |
35 | .init_irq = mx25_init_irq, | 28 | .init_irq = mx25_init_irq, |
36 | .init_machine = imx25_dt_init, | ||
37 | .dt_compat = imx25_dt_board_compat, | 29 | .dt_compat = imx25_dt_board_compat, |
38 | .restart = mxc_restart, | ||
39 | MACHINE_END | 30 | MACHINE_END |
diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c index dc8f1a6f45f2..bd42d1bd10af 100644 --- a/arch/arm/mach-imx/imx27-dt.c +++ b/arch/arm/mach-imx/imx27-dt.c | |||
@@ -22,8 +22,6 @@ static void __init imx27_dt_init(void) | |||
22 | { | 22 | { |
23 | struct platform_device_info devinfo = { .name = "cpufreq-dt", }; | 23 | struct platform_device_info devinfo = { .name = "cpufreq-dt", }; |
24 | 24 | ||
25 | mxc_arch_reset_init_dt(); | ||
26 | |||
27 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 25 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
28 | 26 | ||
29 | platform_device_register_full(&devinfo); | 27 | platform_device_register_full(&devinfo); |
@@ -40,5 +38,4 @@ DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)") | |||
40 | .init_irq = mx27_init_irq, | 38 | .init_irq = mx27_init_irq, |
41 | .init_machine = imx27_dt_init, | 39 | .init_machine = imx27_dt_init, |
42 | .dt_compat = imx27_dt_board_compat, | 40 | .dt_compat = imx27_dt_board_compat, |
43 | .restart = mxc_restart, | ||
44 | MACHINE_END | 41 | MACHINE_END |
diff --git a/arch/arm/mach-imx/imx31-dt.c b/arch/arm/mach-imx/imx31-dt.c index 418dbc82adc4..32100222a017 100644 --- a/arch/arm/mach-imx/imx31-dt.c +++ b/arch/arm/mach-imx/imx31-dt.c | |||
@@ -18,13 +18,6 @@ | |||
18 | #include "common.h" | 18 | #include "common.h" |
19 | #include "mx31.h" | 19 | #include "mx31.h" |
20 | 20 | ||
21 | static void __init imx31_dt_init(void) | ||
22 | { | ||
23 | mxc_arch_reset_init_dt(); | ||
24 | |||
25 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
26 | } | ||
27 | |||
28 | static const char * const imx31_dt_board_compat[] __initconst = { | 21 | static const char * const imx31_dt_board_compat[] __initconst = { |
29 | "fsl,imx31", | 22 | "fsl,imx31", |
30 | NULL | 23 | NULL |
@@ -40,7 +33,5 @@ DT_MACHINE_START(IMX31_DT, "Freescale i.MX31 (Device Tree Support)") | |||
40 | .init_early = imx31_init_early, | 33 | .init_early = imx31_init_early, |
41 | .init_irq = mx31_init_irq, | 34 | .init_irq = mx31_init_irq, |
42 | .init_time = imx31_dt_timer_init, | 35 | .init_time = imx31_dt_timer_init, |
43 | .init_machine = imx31_dt_init, | ||
44 | .dt_compat = imx31_dt_board_compat, | 36 | .dt_compat = imx31_dt_board_compat, |
45 | .restart = mxc_restart, | ||
46 | MACHINE_END | 37 | MACHINE_END |
diff --git a/arch/arm/mach-imx/imx35-dt.c b/arch/arm/mach-imx/imx35-dt.c index 584fbe105579..e9396037235d 100644 --- a/arch/arm/mach-imx/imx35-dt.c +++ b/arch/arm/mach-imx/imx35-dt.c | |||
@@ -20,14 +20,6 @@ | |||
20 | #include "common.h" | 20 | #include "common.h" |
21 | #include "mx35.h" | 21 | #include "mx35.h" |
22 | 22 | ||
23 | static void __init imx35_dt_init(void) | ||
24 | { | ||
25 | mxc_arch_reset_init_dt(); | ||
26 | |||
27 | of_platform_populate(NULL, of_default_bus_match_table, | ||
28 | NULL, NULL); | ||
29 | } | ||
30 | |||
31 | static void __init imx35_irq_init(void) | 23 | static void __init imx35_irq_init(void) |
32 | { | 24 | { |
33 | imx_init_l2cache(); | 25 | imx_init_l2cache(); |
@@ -43,7 +35,5 @@ DT_MACHINE_START(IMX35_DT, "Freescale i.MX35 (Device Tree Support)") | |||
43 | .map_io = mx35_map_io, | 35 | .map_io = mx35_map_io, |
44 | .init_early = imx35_init_early, | 36 | .init_early = imx35_init_early, |
45 | .init_irq = imx35_irq_init, | 37 | .init_irq = imx35_irq_init, |
46 | .init_machine = imx35_dt_init, | ||
47 | .dt_compat = imx35_dt_board_compat, | 38 | .dt_compat = imx35_dt_board_compat, |
48 | .restart = mxc_restart, | ||
49 | MACHINE_END | 39 | MACHINE_END |
diff --git a/arch/arm/mach-imx/iomux-imx31.c b/arch/arm/mach-imx/iomux-imx31.c index 1657fe64cd0f..d6a30753ca7c 100644 --- a/arch/arm/mach-imx/iomux-imx31.c +++ b/arch/arm/mach-imx/iomux-imx31.c | |||
@@ -44,9 +44,11 @@ static unsigned long mxc_pin_alloc_map[NB_PORTS * 32 / BITS_PER_LONG]; | |||
44 | /* | 44 | /* |
45 | * set the mode for a IOMUX pin. | 45 | * set the mode for a IOMUX pin. |
46 | */ | 46 | */ |
47 | int mxc_iomux_mode(unsigned int pin_mode) | 47 | void mxc_iomux_mode(unsigned int pin_mode) |
48 | { | 48 | { |
49 | u32 field, l, mode, ret = 0; | 49 | u32 field; |
50 | u32 l; | ||
51 | u32 mode; | ||
50 | void __iomem *reg; | 52 | void __iomem *reg; |
51 | 53 | ||
52 | reg = IOMUXSW_MUX_CTL + (pin_mode & IOMUX_REG_MASK); | 54 | reg = IOMUXSW_MUX_CTL + (pin_mode & IOMUX_REG_MASK); |
@@ -61,8 +63,6 @@ int mxc_iomux_mode(unsigned int pin_mode) | |||
61 | __raw_writel(l, reg); | 63 | __raw_writel(l, reg); |
62 | 64 | ||
63 | spin_unlock(&gpio_mux_lock); | 65 | spin_unlock(&gpio_mux_lock); |
64 | |||
65 | return ret; | ||
66 | } | 66 | } |
67 | 67 | ||
68 | /* | 68 | /* |
diff --git a/arch/arm/mach-imx/iomux-mx3.h b/arch/arm/mach-imx/iomux-mx3.h index f79f78a1c0ed..0a5adba61e0b 100644 --- a/arch/arm/mach-imx/iomux-mx3.h +++ b/arch/arm/mach-imx/iomux-mx3.h | |||
@@ -144,7 +144,7 @@ void mxc_iomux_set_gpr(enum iomux_gp_func, bool en); | |||
144 | * It is called by the setup functions and should not be called directly anymore. | 144 | * It is called by the setup functions and should not be called directly anymore. |
145 | * It is here visible for backward compatibility | 145 | * It is here visible for backward compatibility |
146 | */ | 146 | */ |
147 | int mxc_iomux_mode(unsigned int pin_mode); | 147 | void mxc_iomux_mode(unsigned int pin_mode); |
148 | 148 | ||
149 | #define IOMUX_PADNUM_MASK 0x1ff | 149 | #define IOMUX_PADNUM_MASK 0x1ff |
150 | #define IOMUX_GPIONUM_SHIFT 9 | 150 | #define IOMUX_GPIONUM_SHIFT 9 |
diff --git a/arch/arm/mach-imx/mach-imx50.c b/arch/arm/mach-imx/mach-imx50.c index b1e56a94a382..ecf58b9e974b 100644 --- a/arch/arm/mach-imx/mach-imx50.c +++ b/arch/arm/mach-imx/mach-imx50.c | |||
@@ -16,13 +16,6 @@ | |||
16 | 16 | ||
17 | #include "common.h" | 17 | #include "common.h" |
18 | 18 | ||
19 | static void __init imx50_dt_init(void) | ||
20 | { | ||
21 | mxc_arch_reset_init_dt(); | ||
22 | |||
23 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
24 | } | ||
25 | |||
26 | static const char * const imx50_dt_board_compat[] __initconst = { | 19 | static const char * const imx50_dt_board_compat[] __initconst = { |
27 | "fsl,imx50", | 20 | "fsl,imx50", |
28 | NULL | 21 | NULL |
@@ -30,7 +23,5 @@ static const char * const imx50_dt_board_compat[] __initconst = { | |||
30 | 23 | ||
31 | DT_MACHINE_START(IMX50_DT, "Freescale i.MX50 (Device Tree Support)") | 24 | DT_MACHINE_START(IMX50_DT, "Freescale i.MX50 (Device Tree Support)") |
32 | .init_irq = tzic_init_irq, | 25 | .init_irq = tzic_init_irq, |
33 | .init_machine = imx50_dt_init, | ||
34 | .dt_compat = imx50_dt_board_compat, | 26 | .dt_compat = imx50_dt_board_compat, |
35 | .restart = mxc_restart, | ||
36 | MACHINE_END | 27 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-imx51.c b/arch/arm/mach-imx/mach-imx51.c index 2c5fcaf8675b..b015129e4045 100644 --- a/arch/arm/mach-imx/mach-imx51.c +++ b/arch/arm/mach-imx/mach-imx51.c | |||
@@ -53,7 +53,6 @@ static void __init imx51_dt_init(void) | |||
53 | { | 53 | { |
54 | struct platform_device_info devinfo = { .name = "cpufreq-dt", }; | 54 | struct platform_device_info devinfo = { .name = "cpufreq-dt", }; |
55 | 55 | ||
56 | mxc_arch_reset_init_dt(); | ||
57 | imx51_ipu_mipi_setup(); | 56 | imx51_ipu_mipi_setup(); |
58 | imx_src_init(); | 57 | imx_src_init(); |
59 | 58 | ||
@@ -78,5 +77,4 @@ DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)") | |||
78 | .init_machine = imx51_dt_init, | 77 | .init_machine = imx51_dt_init, |
79 | .init_late = imx51_init_late, | 78 | .init_late = imx51_init_late, |
80 | .dt_compat = imx51_dt_board_compat, | 79 | .dt_compat = imx51_dt_board_compat, |
81 | .restart = mxc_restart, | ||
82 | MACHINE_END | 80 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c index 03dd6ea13acc..86316a979297 100644 --- a/arch/arm/mach-imx/mach-imx53.c +++ b/arch/arm/mach-imx/mach-imx53.c | |||
@@ -30,7 +30,6 @@ static void __init imx53_init_early(void) | |||
30 | 30 | ||
31 | static void __init imx53_dt_init(void) | 31 | static void __init imx53_dt_init(void) |
32 | { | 32 | { |
33 | mxc_arch_reset_init_dt(); | ||
34 | imx_src_init(); | 33 | imx_src_init(); |
35 | 34 | ||
36 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 35 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
@@ -41,6 +40,8 @@ static void __init imx53_dt_init(void) | |||
41 | static void __init imx53_init_late(void) | 40 | static void __init imx53_init_late(void) |
42 | { | 41 | { |
43 | imx53_pm_init(); | 42 | imx53_pm_init(); |
43 | |||
44 | platform_device_register_simple("cpufreq-dt", -1, NULL, 0); | ||
44 | } | 45 | } |
45 | 46 | ||
46 | static const char * const imx53_dt_board_compat[] __initconst = { | 47 | static const char * const imx53_dt_board_compat[] __initconst = { |
@@ -54,5 +55,4 @@ DT_MACHINE_START(IMX53_DT, "Freescale i.MX53 (Device Tree Support)") | |||
54 | .init_machine = imx53_dt_init, | 55 | .init_machine = imx53_dt_init, |
55 | .init_late = imx53_init_late, | 56 | .init_late = imx53_init_late, |
56 | .dt_compat = imx53_dt_board_compat, | 57 | .dt_compat = imx53_dt_board_compat, |
57 | .restart = mxc_restart, | ||
58 | MACHINE_END | 58 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index d51c6e99a2e9..5057d61298b7 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c | |||
@@ -268,8 +268,6 @@ static void __init imx6q_init_machine(void) | |||
268 | imx_print_silicon_rev(cpu_is_imx6dl() ? "i.MX6DL" : "i.MX6Q", | 268 | imx_print_silicon_rev(cpu_is_imx6dl() ? "i.MX6DL" : "i.MX6Q", |
269 | imx_get_soc_revision()); | 269 | imx_get_soc_revision()); |
270 | 270 | ||
271 | mxc_arch_reset_init_dt(); | ||
272 | |||
273 | parent = imx_soc_device_init(); | 271 | parent = imx_soc_device_init(); |
274 | if (parent == NULL) | 272 | if (parent == NULL) |
275 | pr_warn("failed to initialize soc device\n"); | 273 | pr_warn("failed to initialize soc device\n"); |
@@ -409,5 +407,4 @@ DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad/DualLite (Device Tree)") | |||
409 | .init_machine = imx6q_init_machine, | 407 | .init_machine = imx6q_init_machine, |
410 | .init_late = imx6q_init_late, | 408 | .init_late = imx6q_init_late, |
411 | .dt_compat = imx6q_dt_compat, | 409 | .dt_compat = imx6q_dt_compat, |
412 | .restart = mxc_restart, | ||
413 | MACHINE_END | 410 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-imx6sl.c b/arch/arm/mach-imx/mach-imx6sl.c index ed263a21d928..24bfaaf944c8 100644 --- a/arch/arm/mach-imx/mach-imx6sl.c +++ b/arch/arm/mach-imx/mach-imx6sl.c | |||
@@ -48,8 +48,6 @@ static void __init imx6sl_init_machine(void) | |||
48 | { | 48 | { |
49 | struct device *parent; | 49 | struct device *parent; |
50 | 50 | ||
51 | mxc_arch_reset_init_dt(); | ||
52 | |||
53 | parent = imx_soc_device_init(); | 51 | parent = imx_soc_device_init(); |
54 | if (parent == NULL) | 52 | if (parent == NULL) |
55 | pr_warn("failed to initialize soc device\n"); | 53 | pr_warn("failed to initialize soc device\n"); |
@@ -76,10 +74,8 @@ static const char * const imx6sl_dt_compat[] __initconst = { | |||
76 | }; | 74 | }; |
77 | 75 | ||
78 | DT_MACHINE_START(IMX6SL, "Freescale i.MX6 SoloLite (Device Tree)") | 76 | DT_MACHINE_START(IMX6SL, "Freescale i.MX6 SoloLite (Device Tree)") |
79 | .map_io = debug_ll_io_init, | ||
80 | .init_irq = imx6sl_init_irq, | 77 | .init_irq = imx6sl_init_irq, |
81 | .init_machine = imx6sl_init_machine, | 78 | .init_machine = imx6sl_init_machine, |
82 | .init_late = imx6sl_init_late, | 79 | .init_late = imx6sl_init_late, |
83 | .dt_compat = imx6sl_dt_compat, | 80 | .dt_compat = imx6sl_dt_compat, |
84 | .restart = mxc_restart, | ||
85 | MACHINE_END | 81 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c index 3de3b7369aef..7a96c6577234 100644 --- a/arch/arm/mach-imx/mach-imx6sx.c +++ b/arch/arm/mach-imx/mach-imx6sx.c | |||
@@ -8,24 +8,73 @@ | |||
8 | 8 | ||
9 | #include <linux/irqchip.h> | 9 | #include <linux/irqchip.h> |
10 | #include <linux/of_platform.h> | 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 | #include <asm/mach/arch.h> | 15 | #include <asm/mach/arch.h> |
12 | #include <asm/mach/map.h> | 16 | #include <asm/mach/map.h> |
13 | 17 | ||
14 | #include "common.h" | 18 | #include "common.h" |
15 | #include "cpuidle.h" | 19 | #include "cpuidle.h" |
16 | 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 | } | ||
66 | |||
17 | static void __init imx6sx_init_machine(void) | 67 | static void __init imx6sx_init_machine(void) |
18 | { | 68 | { |
19 | struct device *parent; | 69 | struct device *parent; |
20 | 70 | ||
21 | mxc_arch_reset_init_dt(); | ||
22 | |||
23 | parent = imx_soc_device_init(); | 71 | parent = imx_soc_device_init(); |
24 | if (parent == NULL) | 72 | if (parent == NULL) |
25 | pr_warn("failed to initialize soc device\n"); | 73 | pr_warn("failed to initialize soc device\n"); |
26 | 74 | ||
27 | of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); | 75 | of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); |
28 | 76 | ||
77 | imx6sx_enet_init(); | ||
29 | imx_anatop_init(); | 78 | imx_anatop_init(); |
30 | imx6sx_pm_init(); | 79 | imx6sx_pm_init(); |
31 | } | 80 | } |
@@ -53,10 +102,8 @@ static const char * const imx6sx_dt_compat[] __initconst = { | |||
53 | }; | 102 | }; |
54 | 103 | ||
55 | DT_MACHINE_START(IMX6SX, "Freescale i.MX6 SoloX (Device Tree)") | 104 | DT_MACHINE_START(IMX6SX, "Freescale i.MX6 SoloX (Device Tree)") |
56 | .map_io = debug_ll_io_init, | ||
57 | .init_irq = imx6sx_init_irq, | 105 | .init_irq = imx6sx_init_irq, |
58 | .init_machine = imx6sx_init_machine, | 106 | .init_machine = imx6sx_init_machine, |
59 | .dt_compat = imx6sx_dt_compat, | 107 | .dt_compat = imx6sx_dt_compat, |
60 | .init_late = imx6sx_init_late, | 108 | .init_late = imx6sx_init_late, |
61 | .restart = mxc_restart, | ||
62 | MACHINE_END | 109 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-ls1021a.c b/arch/arm/mach-imx/mach-ls1021a.c new file mode 100644 index 000000000000..b89c858ebfd6 --- /dev/null +++ b/arch/arm/mach-imx/mach-ls1021a.c | |||
@@ -0,0 +1,22 @@ | |||
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 | ||
diff --git a/arch/arm/mach-imx/mach-vf610.c b/arch/arm/mach-imx/mach-vf610.c index ee7e57b752a7..c11ab6a1dc87 100644 --- a/arch/arm/mach-imx/mach-vf610.c +++ b/arch/arm/mach-imx/mach-vf610.c | |||
@@ -12,14 +12,6 @@ | |||
12 | #include <asm/mach/arch.h> | 12 | #include <asm/mach/arch.h> |
13 | #include <asm/hardware/cache-l2x0.h> | 13 | #include <asm/hardware/cache-l2x0.h> |
14 | 14 | ||
15 | #include "common.h" | ||
16 | |||
17 | static void __init vf610_init_machine(void) | ||
18 | { | ||
19 | mxc_arch_reset_init_dt(); | ||
20 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
21 | } | ||
22 | |||
23 | static const char * const vf610_dt_compat[] __initconst = { | 15 | static const char * const vf610_dt_compat[] __initconst = { |
24 | "fsl,vf610", | 16 | "fsl,vf610", |
25 | NULL, | 17 | NULL, |
@@ -28,7 +20,5 @@ static const char * const vf610_dt_compat[] __initconst = { | |||
28 | DT_MACHINE_START(VYBRID_VF610, "Freescale Vybrid VF610 (Device Tree)") | 20 | DT_MACHINE_START(VYBRID_VF610, "Freescale Vybrid VF610 (Device Tree)") |
29 | .l2c_aux_val = 0, | 21 | .l2c_aux_val = 0, |
30 | .l2c_aux_mask = ~0, | 22 | .l2c_aux_mask = ~0, |
31 | .init_machine = vf610_init_machine, | ||
32 | .dt_compat = vf610_dt_compat, | 23 | .dt_compat = vf610_dt_compat, |
33 | .restart = mxc_restart, | ||
34 | MACHINE_END | 24 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index a3dedc309bbc..a377f95033ae 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c | |||
@@ -21,6 +21,12 @@ | |||
21 | #define BP_MMDC_MAPSR_PSD 0 | 21 | #define BP_MMDC_MAPSR_PSD 0 |
22 | #define BP_MMDC_MAPSR_PSS 4 | 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 | static int imx_mmdc_probe(struct platform_device *pdev) | 30 | static int imx_mmdc_probe(struct platform_device *pdev) |
25 | { | 31 | { |
26 | struct device_node *np = pdev->dev.of_node; | 32 | struct device_node *np = pdev->dev.of_node; |
@@ -31,6 +37,12 @@ static int imx_mmdc_probe(struct platform_device *pdev) | |||
31 | mmdc_base = of_iomap(np, 0); | 37 | mmdc_base = of_iomap(np, 0); |
32 | WARN_ON(!mmdc_base); | 38 | WARN_ON(!mmdc_base); |
33 | 39 | ||
40 | reg = mmdc_base + MMDC_MDMISC; | ||
41 | /* Get ddr type */ | ||
42 | val = readl_relaxed(reg); | ||
43 | ddr_type = (val & BM_MMDC_MDMISC_DDR_TYPE) >> | ||
44 | BP_MMDC_MDMISC_DDR_TYPE; | ||
45 | |||
34 | reg = mmdc_base + MMDC_MAPSR; | 46 | reg = mmdc_base + MMDC_MAPSR; |
35 | 47 | ||
36 | /* Enable automatic power saving */ | 48 | /* Enable automatic power saving */ |
@@ -51,6 +63,11 @@ static int imx_mmdc_probe(struct platform_device *pdev) | |||
51 | return 0; | 63 | return 0; |
52 | } | 64 | } |
53 | 65 | ||
66 | int imx_mmdc_get_ddr_type(void) | ||
67 | { | ||
68 | return ddr_type; | ||
69 | } | ||
70 | |||
54 | static struct of_device_id imx_mmdc_dt_ids[] = { | 71 | static struct of_device_id imx_mmdc_dt_ids[] = { |
55 | { .compatible = "fsl,imx6q-mmdc", }, | 72 | { .compatible = "fsl,imx6q-mmdc", }, |
56 | { /* sentinel */ } | 73 | { /* sentinel */ } |
diff --git a/arch/arm/mach-imx/mxc.h b/arch/arm/mach-imx/mxc.h index 17a41ca65acf..4c1343df2ba4 100644 --- a/arch/arm/mach-imx/mxc.h +++ b/arch/arm/mach-imx/mxc.h | |||
@@ -55,6 +55,8 @@ | |||
55 | #define IMX_CHIP_REVISION_3_3 0x33 | 55 | #define IMX_CHIP_REVISION_3_3 0x33 |
56 | #define IMX_CHIP_REVISION_UNKNOWN 0xff | 56 | #define IMX_CHIP_REVISION_UNKNOWN 0xff |
57 | 57 | ||
58 | #define IMX_DDR_TYPE_LPDDR2 1 | ||
59 | |||
58 | #ifndef __ASSEMBLY__ | 60 | #ifndef __ASSEMBLY__ |
59 | extern unsigned int __mxc_cpu_type; | 61 | extern unsigned int __mxc_cpu_type; |
60 | #endif | 62 | #endif |
diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c index 771bd25c1025..7f270015fe58 100644 --- a/arch/arm/mach-imx/platsmp.c +++ b/arch/arm/mach-imx/platsmp.c | |||
@@ -11,7 +11,10 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/of_address.h> | ||
15 | #include <linux/of.h> | ||
14 | #include <linux/smp.h> | 16 | #include <linux/smp.h> |
17 | |||
15 | #include <asm/cacheflush.h> | 18 | #include <asm/cacheflush.h> |
16 | #include <asm/page.h> | 19 | #include <asm/page.h> |
17 | #include <asm/smp_scu.h> | 20 | #include <asm/smp_scu.h> |
@@ -94,3 +97,33 @@ struct smp_operations imx_smp_ops __initdata = { | |||
94 | .cpu_kill = imx_cpu_kill, | 97 | .cpu_kill = imx_cpu_kill, |
95 | #endif | 98 | #endif |
96 | }; | 99 | }; |
100 | |||
101 | #define DCFG_CCSR_SCRATCHRW1 0x200 | ||
102 | |||
103 | static int ls1021a_boot_secondary(unsigned int cpu, struct task_struct *idle) | ||
104 | { | ||
105 | arch_send_wakeup_ipi_mask(cpumask_of(cpu)); | ||
106 | |||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | static void __init ls1021a_smp_prepare_cpus(unsigned int max_cpus) | ||
111 | { | ||
112 | struct device_node *np; | ||
113 | void __iomem *dcfg_base; | ||
114 | unsigned long paddr; | ||
115 | |||
116 | np = of_find_compatible_node(NULL, NULL, "fsl,ls1021a-dcfg"); | ||
117 | dcfg_base = of_iomap(np, 0); | ||
118 | BUG_ON(!dcfg_base); | ||
119 | |||
120 | paddr = virt_to_phys(secondary_startup); | ||
121 | writel_relaxed(cpu_to_be32(paddr), dcfg_base + DCFG_CCSR_SCRATCHRW1); | ||
122 | |||
123 | iounmap(dcfg_base); | ||
124 | } | ||
125 | |||
126 | struct smp_operations ls1021a_smp_ops __initdata = { | ||
127 | .smp_prepare_cpus = ls1021a_smp_prepare_cpus, | ||
128 | .smp_boot_secondary = ls1021a_boot_secondary, | ||
129 | }; | ||
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c index 5c3af8f993d0..5d2c1bd5f5ef 100644 --- a/arch/arm/mach-imx/pm-imx6.c +++ b/arch/arm/mach-imx/pm-imx6.c | |||
@@ -88,7 +88,7 @@ struct imx6_pm_base { | |||
88 | }; | 88 | }; |
89 | 89 | ||
90 | struct imx6_pm_socdata { | 90 | struct imx6_pm_socdata { |
91 | u32 cpu_type; | 91 | u32 ddr_type; |
92 | const char *mmdc_compat; | 92 | const char *mmdc_compat; |
93 | const char *src_compat; | 93 | const char *src_compat; |
94 | const char *iomuxc_compat; | 94 | const char *iomuxc_compat; |
@@ -138,7 +138,6 @@ static const u32 imx6sx_mmdc_io_offset[] __initconst = { | |||
138 | }; | 138 | }; |
139 | 139 | ||
140 | static const struct imx6_pm_socdata imx6q_pm_data __initconst = { | 140 | static const struct imx6_pm_socdata imx6q_pm_data __initconst = { |
141 | .cpu_type = MXC_CPU_IMX6Q, | ||
142 | .mmdc_compat = "fsl,imx6q-mmdc", | 141 | .mmdc_compat = "fsl,imx6q-mmdc", |
143 | .src_compat = "fsl,imx6q-src", | 142 | .src_compat = "fsl,imx6q-src", |
144 | .iomuxc_compat = "fsl,imx6q-iomuxc", | 143 | .iomuxc_compat = "fsl,imx6q-iomuxc", |
@@ -148,7 +147,6 @@ static const struct imx6_pm_socdata imx6q_pm_data __initconst = { | |||
148 | }; | 147 | }; |
149 | 148 | ||
150 | static const struct imx6_pm_socdata imx6dl_pm_data __initconst = { | 149 | static const struct imx6_pm_socdata imx6dl_pm_data __initconst = { |
151 | .cpu_type = MXC_CPU_IMX6DL, | ||
152 | .mmdc_compat = "fsl,imx6q-mmdc", | 150 | .mmdc_compat = "fsl,imx6q-mmdc", |
153 | .src_compat = "fsl,imx6q-src", | 151 | .src_compat = "fsl,imx6q-src", |
154 | .iomuxc_compat = "fsl,imx6dl-iomuxc", | 152 | .iomuxc_compat = "fsl,imx6dl-iomuxc", |
@@ -158,7 +156,6 @@ static const struct imx6_pm_socdata imx6dl_pm_data __initconst = { | |||
158 | }; | 156 | }; |
159 | 157 | ||
160 | static const struct imx6_pm_socdata imx6sl_pm_data __initconst = { | 158 | static const struct imx6_pm_socdata imx6sl_pm_data __initconst = { |
161 | .cpu_type = MXC_CPU_IMX6SL, | ||
162 | .mmdc_compat = "fsl,imx6sl-mmdc", | 159 | .mmdc_compat = "fsl,imx6sl-mmdc", |
163 | .src_compat = "fsl,imx6sl-src", | 160 | .src_compat = "fsl,imx6sl-src", |
164 | .iomuxc_compat = "fsl,imx6sl-iomuxc", | 161 | .iomuxc_compat = "fsl,imx6sl-iomuxc", |
@@ -168,7 +165,6 @@ static const struct imx6_pm_socdata imx6sl_pm_data __initconst = { | |||
168 | }; | 165 | }; |
169 | 166 | ||
170 | static const struct imx6_pm_socdata imx6sx_pm_data __initconst = { | 167 | static const struct imx6_pm_socdata imx6sx_pm_data __initconst = { |
171 | .cpu_type = MXC_CPU_IMX6SX, | ||
172 | .mmdc_compat = "fsl,imx6sx-mmdc", | 168 | .mmdc_compat = "fsl,imx6sx-mmdc", |
173 | .src_compat = "fsl,imx6sx-src", | 169 | .src_compat = "fsl,imx6sx-src", |
174 | .iomuxc_compat = "fsl,imx6sx-iomuxc", | 170 | .iomuxc_compat = "fsl,imx6sx-iomuxc", |
@@ -187,7 +183,7 @@ static const struct imx6_pm_socdata imx6sx_pm_data __initconst = { | |||
187 | struct imx6_cpu_pm_info { | 183 | struct imx6_cpu_pm_info { |
188 | phys_addr_t pbase; /* The physical address of pm_info. */ | 184 | phys_addr_t pbase; /* The physical address of pm_info. */ |
189 | phys_addr_t resume_addr; /* The physical resume address for asm code */ | 185 | phys_addr_t resume_addr; /* The physical resume address for asm code */ |
190 | u32 cpu_type; | 186 | u32 ddr_type; |
191 | u32 pm_info_size; /* Size of pm_info. */ | 187 | u32 pm_info_size; /* Size of pm_info. */ |
192 | struct imx6_pm_base mmdc_base; | 188 | struct imx6_pm_base mmdc_base; |
193 | struct imx6_pm_base src_base; | 189 | struct imx6_pm_base src_base; |
@@ -261,7 +257,6 @@ static void imx6q_enable_wb(bool enable) | |||
261 | 257 | ||
262 | int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode) | 258 | int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode) |
263 | { | 259 | { |
264 | struct irq_data *iomuxc_irq_data = irq_get_irq_data(32); | ||
265 | u32 val = readl_relaxed(ccm_base + CLPCR); | 260 | u32 val = readl_relaxed(ccm_base + CLPCR); |
266 | 261 | ||
267 | val &= ~BM_CLPCR_LPM; | 262 | val &= ~BM_CLPCR_LPM; |
@@ -316,9 +311,9 @@ int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode) | |||
316 | * 3) Software should mask IRQ #32 right after CCM Low-Power mode | 311 | * 3) Software should mask IRQ #32 right after CCM Low-Power mode |
317 | * is set (set bits 0-1 of CCM_CLPCR). | 312 | * is set (set bits 0-1 of CCM_CLPCR). |
318 | */ | 313 | */ |
319 | imx_gpc_irq_unmask(iomuxc_irq_data); | 314 | imx_gpc_hwirq_unmask(32); |
320 | writel_relaxed(val, ccm_base + CLPCR); | 315 | writel_relaxed(val, ccm_base + CLPCR); |
321 | imx_gpc_irq_mask(iomuxc_irq_data); | 316 | imx_gpc_hwirq_mask(32); |
322 | 317 | ||
323 | return 0; | 318 | return 0; |
324 | } | 319 | } |
@@ -522,7 +517,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) | |||
522 | goto pl310_cache_map_failed; | 517 | goto pl310_cache_map_failed; |
523 | } | 518 | } |
524 | 519 | ||
525 | pm_info->cpu_type = socdata->cpu_type; | 520 | pm_info->ddr_type = imx_mmdc_get_ddr_type(); |
526 | pm_info->mmdc_io_num = socdata->mmdc_io_num; | 521 | pm_info->mmdc_io_num = socdata->mmdc_io_num; |
527 | mmdc_offset_array = socdata->mmdc_io_offset; | 522 | mmdc_offset_array = socdata->mmdc_io_offset; |
528 | 523 | ||
diff --git a/arch/arm/mach-imx/suspend-imx6.S b/arch/arm/mach-imx/suspend-imx6.S index ca4ea2daf25b..b99987b023fa 100644 --- a/arch/arm/mach-imx/suspend-imx6.S +++ b/arch/arm/mach-imx/suspend-imx6.S | |||
@@ -45,7 +45,7 @@ | |||
45 | */ | 45 | */ |
46 | #define PM_INFO_PBASE_OFFSET 0x0 | 46 | #define PM_INFO_PBASE_OFFSET 0x0 |
47 | #define PM_INFO_RESUME_ADDR_OFFSET 0x4 | 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 | #define PM_INFO_PM_INFO_SIZE_OFFSET 0xC | 49 | #define PM_INFO_PM_INFO_SIZE_OFFSET 0xC |
50 | #define PM_INFO_MX6Q_MMDC_P_OFFSET 0x10 | 50 | #define PM_INFO_MX6Q_MMDC_P_OFFSET 0x10 |
51 | #define PM_INFO_MX6Q_MMDC_V_OFFSET 0x14 | 51 | #define PM_INFO_MX6Q_MMDC_V_OFFSET 0x14 |
@@ -110,7 +110,7 @@ | |||
110 | ldreq r11, [r0, #PM_INFO_MX6Q_MMDC_V_OFFSET] | 110 | ldreq r11, [r0, #PM_INFO_MX6Q_MMDC_V_OFFSET] |
111 | ldrne r11, [r0, #PM_INFO_MX6Q_MMDC_P_OFFSET] | 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 | bne 4f | 114 | bne 4f |
115 | 115 | ||
116 | /* reset read FIFO, RST_RD_FIFO */ | 116 | /* reset read FIFO, RST_RD_FIFO */ |
@@ -151,7 +151,7 @@ | |||
151 | ENTRY(imx6_suspend) | 151 | ENTRY(imx6_suspend) |
152 | ldr r1, [r0, #PM_INFO_PBASE_OFFSET] | 152 | ldr r1, [r0, #PM_INFO_PBASE_OFFSET] |
153 | ldr r2, [r0, #PM_INFO_RESUME_ADDR_OFFSET] | 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 | ldr r4, [r0, #PM_INFO_PM_INFO_SIZE_OFFSET] | 155 | ldr r4, [r0, #PM_INFO_PM_INFO_SIZE_OFFSET] |
156 | 156 | ||
157 | /* | 157 | /* |
@@ -209,8 +209,8 @@ poll_dvfs_set: | |||
209 | ldr r7, [r0, #PM_INFO_MMDC_IO_NUM_OFFSET] | 209 | ldr r7, [r0, #PM_INFO_MMDC_IO_NUM_OFFSET] |
210 | ldr r8, =PM_INFO_MMDC_IO_VAL_OFFSET | 210 | ldr r8, =PM_INFO_MMDC_IO_VAL_OFFSET |
211 | add r8, r8, r0 | 211 | add r8, r8, r0 |
212 | /* i.MX6SL's last 3 IOs need special setting */ | 212 | /* LPDDR2's last 3 IOs need special setting */ |
213 | cmp r3, #MXC_CPU_IMX6SL | 213 | cmp r3, #IMX_DDR_TYPE_LPDDR2 |
214 | subeq r7, r7, #0x3 | 214 | subeq r7, r7, #0x3 |
215 | set_mmdc_io_lpm: | 215 | set_mmdc_io_lpm: |
216 | ldr r9, [r8], #0x8 | 216 | ldr r9, [r8], #0x8 |
@@ -218,7 +218,7 @@ set_mmdc_io_lpm: | |||
218 | subs r7, r7, #0x1 | 218 | subs r7, r7, #0x1 |
219 | bne set_mmdc_io_lpm | 219 | bne set_mmdc_io_lpm |
220 | 220 | ||
221 | cmp r3, #MXC_CPU_IMX6SL | 221 | cmp r3, #IMX_DDR_TYPE_LPDDR2 |
222 | bne set_mmdc_io_lpm_done | 222 | bne set_mmdc_io_lpm_done |
223 | ldr r6, =0x1000 | 223 | ldr r6, =0x1000 |
224 | ldr r9, [r8], #0x8 | 224 | ldr r9, [r8], #0x8 |
@@ -324,7 +324,7 @@ resume: | |||
324 | str r7, [r11, #MX6Q_SRC_GPR1] | 324 | str r7, [r11, #MX6Q_SRC_GPR1] |
325 | str r7, [r11, #MX6Q_SRC_GPR2] | 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 | mov r5, #0x1 | 328 | mov r5, #0x1 |
329 | resume_mmdc | 329 | resume_mmdc |
330 | 330 | ||
diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c index d14c33fd6b03..51c35013b673 100644 --- a/arch/arm/mach-imx/system.c +++ b/arch/arm/mach-imx/system.c | |||
@@ -89,21 +89,6 @@ void __init mxc_arch_reset_init(void __iomem *base) | |||
89 | clk_prepare(wdog_clk); | 89 | clk_prepare(wdog_clk); |
90 | } | 90 | } |
91 | 91 | ||
92 | void __init mxc_arch_reset_init_dt(void) | ||
93 | { | ||
94 | struct device_node *np; | ||
95 | |||
96 | np = of_find_compatible_node(NULL, NULL, "fsl,imx21-wdt"); | ||
97 | wdog_base = of_iomap(np, 0); | ||
98 | WARN_ON(!wdog_base); | ||
99 | |||
100 | wdog_clk = of_clk_get(np, 0); | ||
101 | if (IS_ERR(wdog_clk)) | ||
102 | pr_warn("%s: failed to get wdog clock\n", __func__); | ||
103 | else | ||
104 | clk_prepare(wdog_clk); | ||
105 | } | ||
106 | |||
107 | #ifdef CONFIG_CACHE_L2X0 | 92 | #ifdef CONFIG_CACHE_L2X0 |
108 | void __init imx_init_l2cache(void) | 93 | void __init imx_init_l2cache(void) |
109 | { | 94 | { |