diff options
author | Arnd Bergmann <arnd@arndb.de> | 2014-11-28 08:59:53 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2014-11-28 08:59:53 -0500 |
commit | 32e049ad7997ef09af3fc1969325ce2326a5dd11 (patch) | |
tree | 88d20e9a928b165e311298e1d764674da707a219 /arch/arm | |
parent | df717a58a38c49cf7c6e761d35aa822344dbd1bd (diff) | |
parent | 3db47dc0ae4d370ec3c86fc357608132ca695c27 (diff) |
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>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/configs/imx_v4_v5_defconfig | 1 | ||||
-rw-r--r-- | arch/arm/configs/imx_v6_v7_defconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/Kconfig | 31 | ||||
-rw-r--r-- | arch/arm/mach-imx/Makefile | 6 | ||||
-rw-r--r-- | arch/arm/mach-imx/anatop.c | 34 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-cpu.c | 107 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-imx51-imx53.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-vf610.c | 153 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-imx/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-imx53.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-imx6sx.c | 51 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-ls1021a.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-imx/mmdc.c | 17 | ||||
-rw-r--r-- | arch/arm/mach-imx/mxc.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/platsmp.c | 33 | ||||
-rw-r--r-- | arch/arm/mach-imx/pm-imx6.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-imx/suspend-imx6.S | 14 |
18 files changed, 438 insertions, 66 deletions
diff --git a/arch/arm/configs/imx_v4_v5_defconfig b/arch/arm/configs/imx_v4_v5_defconfig index e688741c89aa..e6b0007355f8 100644 --- a/arch/arm/configs/imx_v4_v5_defconfig +++ b/arch/arm/configs/imx_v4_v5_defconfig | |||
@@ -97,6 +97,7 @@ CONFIG_SERIAL_IMX_CONSOLE=y | |||
97 | # CONFIG_HW_RANDOM is not set | 97 | # CONFIG_HW_RANDOM is not set |
98 | CONFIG_I2C_CHARDEV=y | 98 | CONFIG_I2C_CHARDEV=y |
99 | CONFIG_I2C_IMX=y | 99 | CONFIG_I2C_IMX=y |
100 | CONFIG_SPI=y | ||
100 | CONFIG_SPI_IMX=y | 101 | CONFIG_SPI_IMX=y |
101 | CONFIG_SPI_SPIDEV=y | 102 | CONFIG_SPI_SPIDEV=y |
102 | CONFIG_GPIO_SYSFS=y | 103 | CONFIG_GPIO_SYSFS=y |
diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig index 8fca6e276b69..6790f1b3f3a1 100644 --- a/arch/arm/configs/imx_v6_v7_defconfig +++ b/arch/arm/configs/imx_v6_v7_defconfig | |||
@@ -158,6 +158,7 @@ CONFIG_I2C_CHARDEV=y | |||
158 | CONFIG_I2C_ALGOPCF=m | 158 | CONFIG_I2C_ALGOPCF=m |
159 | CONFIG_I2C_ALGOPCA=m | 159 | CONFIG_I2C_ALGOPCA=m |
160 | CONFIG_I2C_IMX=y | 160 | CONFIG_I2C_IMX=y |
161 | CONFIG_SPI=y | ||
161 | CONFIG_SPI_IMX=y | 162 | CONFIG_SPI_IMX=y |
162 | CONFIG_GPIO_SYSFS=y | 163 | CONFIG_GPIO_SYSFS=y |
163 | CONFIG_GPIO_MC9S08DZ60=y | 164 | CONFIG_GPIO_MC9S08DZ60=y |
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-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..fe9a908da3ed 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h | |||
@@ -116,6 +116,7 @@ void imx_anatop_post_resume(void); | |||
116 | int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode); | 116 | int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode); |
117 | void imx6q_set_int_mem_clk_lpm(bool enable); | 117 | void imx6q_set_int_mem_clk_lpm(bool enable); |
118 | void imx6sl_set_wait_clk(bool enter); | 118 | void imx6sl_set_wait_clk(bool enter); |
119 | int imx_mmdc_get_ddr_type(void); | ||
119 | 120 | ||
120 | void imx_cpu_die(unsigned int cpu); | 121 | void imx_cpu_die(unsigned int cpu); |
121 | int imx_cpu_kill(unsigned int cpu); | 122 | int imx_cpu_kill(unsigned int cpu); |
@@ -157,5 +158,6 @@ static inline void imx_init_l2cache(void) {} | |||
157 | #endif | 158 | #endif |
158 | 159 | ||
159 | extern struct smp_operations imx_smp_ops; | 160 | extern struct smp_operations imx_smp_ops; |
161 | extern struct smp_operations ls1021a_smp_ops; | ||
160 | 162 | ||
161 | #endif | 163 | #endif |
diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c index 03dd6ea13acc..7587cf0cba3e 100644 --- a/arch/arm/mach-imx/mach-imx53.c +++ b/arch/arm/mach-imx/mach-imx53.c | |||
@@ -41,6 +41,8 @@ static void __init imx53_dt_init(void) | |||
41 | static void __init imx53_init_late(void) | 41 | static void __init imx53_init_late(void) |
42 | { | 42 | { |
43 | imx53_pm_init(); | 43 | imx53_pm_init(); |
44 | |||
45 | platform_device_register_simple("cpufreq-dt", -1, NULL, 0); | ||
44 | } | 46 | } |
45 | 47 | ||
46 | static const char * const imx53_dt_board_compat[] __initconst = { | 48 | static const char * const imx53_dt_board_compat[] __initconst = { |
diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c index 3de3b7369aef..982224922fb1 100644 --- a/arch/arm/mach-imx/mach-imx6sx.c +++ b/arch/arm/mach-imx/mach-imx6sx.c | |||
@@ -8,12 +8,62 @@ | |||
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; |
@@ -26,6 +76,7 @@ static void __init imx6sx_init_machine(void) | |||
26 | 76 | ||
27 | of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); | 77 | of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); |
28 | 78 | ||
79 | imx6sx_enet_init(); | ||
29 | imx_anatop_init(); | 80 | imx_anatop_init(); |
30 | imx6sx_pm_init(); | 81 | imx6sx_pm_init(); |
31 | } | 82 | } |
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/mmdc.c b/arch/arm/mach-imx/mmdc.c index 7a9686ad994c..3729d90cfa46 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..c653dd4c9103 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; |
@@ -522,7 +518,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) | |||
522 | goto pl310_cache_map_failed; | 518 | goto pl310_cache_map_failed; |
523 | } | 519 | } |
524 | 520 | ||
525 | pm_info->cpu_type = socdata->cpu_type; | 521 | pm_info->ddr_type = imx_mmdc_get_ddr_type(); |
526 | pm_info->mmdc_io_num = socdata->mmdc_io_num; | 522 | pm_info->mmdc_io_num = socdata->mmdc_io_num; |
527 | mmdc_offset_array = socdata->mmdc_io_offset; | 523 | mmdc_offset_array = socdata->mmdc_io_offset; |
528 | 524 | ||
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 | ||