Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 1 | /* |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 2 | * Copyright 2011-2014 Freescale Semiconductor, Inc. |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 3 | * Copyright 2011 Linaro Ltd. |
| 4 | * |
| 5 | * The code contained herein is licensed under the GNU General Public |
| 6 | * License. You may obtain a copy of the GNU General Public License |
| 7 | * Version 2 or later at the following locations: |
| 8 | * |
| 9 | * http://www.opensource.org/licenses/gpl-license.html |
| 10 | * http://www.gnu.org/copyleft/gpl.html |
| 11 | */ |
| 12 | |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 13 | #include <linux/delay.h> |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 14 | #include <linux/init.h> |
| 15 | #include <linux/io.h> |
Shawn Guo | d48866f | 2013-10-16 19:52:00 +0800 | [diff] [blame] | 16 | #include <linux/irq.h> |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 17 | #include <linux/genalloc.h> |
Shawn Guo | d48866f | 2013-10-16 19:52:00 +0800 | [diff] [blame] | 18 | #include <linux/mfd/syscon.h> |
| 19 | #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 20 | #include <linux/of.h> |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 21 | #include <linux/of_address.h> |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 22 | #include <linux/of_platform.h> |
Shawn Guo | d48866f | 2013-10-16 19:52:00 +0800 | [diff] [blame] | 23 | #include <linux/regmap.h> |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 24 | #include <linux/suspend.h> |
| 25 | #include <asm/cacheflush.h> |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 26 | #include <asm/fncpy.h> |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 27 | #include <asm/proc-fns.h> |
| 28 | #include <asm/suspend.h> |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 29 | #include <asm/tlb.h> |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 30 | |
Shawn Guo | e337247 | 2012-09-13 21:01:00 +0800 | [diff] [blame] | 31 | #include "common.h" |
Shawn Guo | 50f2de6 | 2012-09-14 14:14:45 +0800 | [diff] [blame] | 32 | #include "hardware.h" |
Shawn Guo | e337247 | 2012-09-13 21:01:00 +0800 | [diff] [blame] | 33 | |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 34 | #define CCR 0x0 |
| 35 | #define BM_CCR_WB_COUNT (0x7 << 16) |
| 36 | #define BM_CCR_RBC_BYPASS_COUNT (0x3f << 21) |
| 37 | #define BM_CCR_RBC_EN (0x1 << 27) |
| 38 | |
| 39 | #define CLPCR 0x54 |
| 40 | #define BP_CLPCR_LPM 0 |
| 41 | #define BM_CLPCR_LPM (0x3 << 0) |
| 42 | #define BM_CLPCR_BYPASS_PMIC_READY (0x1 << 2) |
| 43 | #define BM_CLPCR_ARM_CLK_DIS_ON_LPM (0x1 << 5) |
| 44 | #define BM_CLPCR_SBYOS (0x1 << 6) |
| 45 | #define BM_CLPCR_DIS_REF_OSC (0x1 << 7) |
| 46 | #define BM_CLPCR_VSTBY (0x1 << 8) |
| 47 | #define BP_CLPCR_STBY_COUNT 9 |
| 48 | #define BM_CLPCR_STBY_COUNT (0x3 << 9) |
| 49 | #define BM_CLPCR_COSC_PWRDOWN (0x1 << 11) |
| 50 | #define BM_CLPCR_WB_PER_AT_LPM (0x1 << 16) |
| 51 | #define BM_CLPCR_WB_CORE_AT_LPM (0x1 << 17) |
| 52 | #define BM_CLPCR_BYP_MMDC_CH0_LPM_HS (0x1 << 19) |
| 53 | #define BM_CLPCR_BYP_MMDC_CH1_LPM_HS (0x1 << 21) |
| 54 | #define BM_CLPCR_MASK_CORE0_WFI (0x1 << 22) |
| 55 | #define BM_CLPCR_MASK_CORE1_WFI (0x1 << 23) |
| 56 | #define BM_CLPCR_MASK_CORE2_WFI (0x1 << 24) |
| 57 | #define BM_CLPCR_MASK_CORE3_WFI (0x1 << 25) |
| 58 | #define BM_CLPCR_MASK_SCU_IDLE (0x1 << 26) |
| 59 | #define BM_CLPCR_MASK_L2CC_IDLE (0x1 << 27) |
| 60 | |
| 61 | #define CGPR 0x64 |
Fabio Estevam | fa6be65 | 2014-01-07 08:00:40 -0200 | [diff] [blame] | 62 | #define BM_CGPR_INT_MEM_CLK_LPM (0x1 << 17) |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 63 | |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 64 | #define MX6Q_SUSPEND_OCRAM_SIZE 0x1000 |
| 65 | #define MX6_MAX_MMDC_IO_NUM 33 |
| 66 | |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 67 | static void __iomem *ccm_base; |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 68 | static void __iomem *suspend_ocram_base; |
| 69 | static void (*imx6_suspend_in_ocram_fn)(void __iomem *ocram_vbase); |
| 70 | |
| 71 | /* |
| 72 | * suspend ocram space layout: |
| 73 | * ======================== high address ====================== |
| 74 | * . |
| 75 | * . |
| 76 | * . |
| 77 | * ^ |
| 78 | * ^ |
| 79 | * ^ |
| 80 | * imx6_suspend code |
| 81 | * PM_INFO structure(imx6_cpu_pm_info) |
| 82 | * ======================== low address ======================= |
| 83 | */ |
| 84 | |
| 85 | struct imx6_pm_base { |
| 86 | phys_addr_t pbase; |
| 87 | void __iomem *vbase; |
| 88 | }; |
| 89 | |
| 90 | struct imx6_pm_socdata { |
Anson Huang | ec336b2 | 2014-09-17 11:11:45 +0800 | [diff] [blame] | 91 | u32 ddr_type; |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 92 | const char *mmdc_compat; |
| 93 | const char *src_compat; |
| 94 | const char *iomuxc_compat; |
| 95 | const char *gpc_compat; |
Anson Huang | ee4a5f8 | 2015-08-05 01:48:37 +0800 | [diff] [blame] | 96 | const char *pl310_compat; |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 97 | const u32 mmdc_io_num; |
| 98 | const u32 *mmdc_io_offset; |
| 99 | }; |
| 100 | |
| 101 | static const u32 imx6q_mmdc_io_offset[] __initconst = { |
| 102 | 0x5ac, 0x5b4, 0x528, 0x520, /* DQM0 ~ DQM3 */ |
| 103 | 0x514, 0x510, 0x5bc, 0x5c4, /* DQM4 ~ DQM7 */ |
| 104 | 0x56c, 0x578, 0x588, 0x594, /* CAS, RAS, SDCLK_0, SDCLK_1 */ |
| 105 | 0x5a8, 0x5b0, 0x524, 0x51c, /* SDQS0 ~ SDQS3 */ |
| 106 | 0x518, 0x50c, 0x5b8, 0x5c0, /* SDQS4 ~ SDQS7 */ |
| 107 | 0x784, 0x788, 0x794, 0x79c, /* GPR_B0DS ~ GPR_B3DS */ |
| 108 | 0x7a0, 0x7a4, 0x7a8, 0x748, /* GPR_B4DS ~ GPR_B7DS */ |
| 109 | 0x59c, 0x5a0, 0x750, 0x774, /* SODT0, SODT1, MODE_CTL, MODE */ |
| 110 | 0x74c, /* GPR_ADDS */ |
| 111 | }; |
| 112 | |
Anson Huang | da9e926 | 2014-01-17 11:39:06 +0800 | [diff] [blame] | 113 | static const u32 imx6dl_mmdc_io_offset[] __initconst = { |
| 114 | 0x470, 0x474, 0x478, 0x47c, /* DQM0 ~ DQM3 */ |
| 115 | 0x480, 0x484, 0x488, 0x48c, /* DQM4 ~ DQM7 */ |
| 116 | 0x464, 0x490, 0x4ac, 0x4b0, /* CAS, RAS, SDCLK_0, SDCLK_1 */ |
| 117 | 0x4bc, 0x4c0, 0x4c4, 0x4c8, /* DRAM_SDQS0 ~ DRAM_SDQS3 */ |
| 118 | 0x4cc, 0x4d0, 0x4d4, 0x4d8, /* DRAM_SDQS4 ~ DRAM_SDQS7 */ |
| 119 | 0x764, 0x770, 0x778, 0x77c, /* GPR_B0DS ~ GPR_B3DS */ |
| 120 | 0x780, 0x784, 0x78c, 0x748, /* GPR_B4DS ~ GPR_B7DS */ |
| 121 | 0x4b4, 0x4b8, 0x750, 0x760, /* SODT0, SODT1, MODE_CTL, MODE */ |
| 122 | 0x74c, /* GPR_ADDS */ |
| 123 | }; |
| 124 | |
Anson Huang | 64b0868 | 2014-01-17 11:39:07 +0800 | [diff] [blame] | 125 | static const u32 imx6sl_mmdc_io_offset[] __initconst = { |
| 126 | 0x30c, 0x310, 0x314, 0x318, /* DQM0 ~ DQM3 */ |
| 127 | 0x5c4, 0x5cc, 0x5d4, 0x5d8, /* GPR_B0DS ~ GPR_B3DS */ |
| 128 | 0x300, 0x31c, 0x338, 0x5ac, /* CAS, RAS, SDCLK_0, GPR_ADDS */ |
| 129 | 0x33c, 0x340, 0x5b0, 0x5c0, /* SODT0, SODT1, MODE_CTL, MODE */ |
| 130 | 0x330, 0x334, 0x320, /* SDCKE0, SDCKE1, RESET */ |
| 131 | }; |
| 132 | |
Anson Huang | ff843d6 | 2014-06-20 13:20:54 +0800 | [diff] [blame] | 133 | static const u32 imx6sx_mmdc_io_offset[] __initconst = { |
| 134 | 0x2ec, 0x2f0, 0x2f4, 0x2f8, /* DQM0 ~ DQM3 */ |
| 135 | 0x60c, 0x610, 0x61c, 0x620, /* GPR_B0DS ~ GPR_B3DS */ |
| 136 | 0x300, 0x2fc, 0x32c, 0x5f4, /* CAS, RAS, SDCLK_0, GPR_ADDS */ |
| 137 | 0x310, 0x314, 0x5f8, 0x608, /* SODT0, SODT1, MODE_CTL, MODE */ |
| 138 | 0x330, 0x334, 0x338, 0x33c, /* SDQS0 ~ SDQS3 */ |
| 139 | }; |
| 140 | |
Anson Huang | ee4a5f8 | 2015-08-05 01:48:37 +0800 | [diff] [blame] | 141 | static const u32 imx6ul_mmdc_io_offset[] __initconst = { |
| 142 | 0x244, 0x248, 0x24c, 0x250, /* DQM0, DQM1, RAS, CAS */ |
| 143 | 0x27c, 0x498, 0x4a4, 0x490, /* SDCLK0, GPR_B0DS-B1DS, GPR_ADDS */ |
| 144 | 0x280, 0x284, 0x260, 0x264, /* SDQS0~1, SODT0, SODT1 */ |
| 145 | 0x494, 0x4b0, /* MODE_CTL, MODE, */ |
| 146 | }; |
| 147 | |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 148 | static const struct imx6_pm_socdata imx6q_pm_data __initconst = { |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 149 | .mmdc_compat = "fsl,imx6q-mmdc", |
| 150 | .src_compat = "fsl,imx6q-src", |
| 151 | .iomuxc_compat = "fsl,imx6q-iomuxc", |
| 152 | .gpc_compat = "fsl,imx6q-gpc", |
Anson Huang | ee4a5f8 | 2015-08-05 01:48:37 +0800 | [diff] [blame] | 153 | .pl310_compat = "arm,pl310-cache", |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 154 | .mmdc_io_num = ARRAY_SIZE(imx6q_mmdc_io_offset), |
| 155 | .mmdc_io_offset = imx6q_mmdc_io_offset, |
| 156 | }; |
| 157 | |
Anson Huang | da9e926 | 2014-01-17 11:39:06 +0800 | [diff] [blame] | 158 | static const struct imx6_pm_socdata imx6dl_pm_data __initconst = { |
Anson Huang | da9e926 | 2014-01-17 11:39:06 +0800 | [diff] [blame] | 159 | .mmdc_compat = "fsl,imx6q-mmdc", |
| 160 | .src_compat = "fsl,imx6q-src", |
| 161 | .iomuxc_compat = "fsl,imx6dl-iomuxc", |
| 162 | .gpc_compat = "fsl,imx6q-gpc", |
Anson Huang | ee4a5f8 | 2015-08-05 01:48:37 +0800 | [diff] [blame] | 163 | .pl310_compat = "arm,pl310-cache", |
Anson Huang | da9e926 | 2014-01-17 11:39:06 +0800 | [diff] [blame] | 164 | .mmdc_io_num = ARRAY_SIZE(imx6dl_mmdc_io_offset), |
| 165 | .mmdc_io_offset = imx6dl_mmdc_io_offset, |
| 166 | }; |
| 167 | |
Anson Huang | 64b0868 | 2014-01-17 11:39:07 +0800 | [diff] [blame] | 168 | static const struct imx6_pm_socdata imx6sl_pm_data __initconst = { |
Anson Huang | 64b0868 | 2014-01-17 11:39:07 +0800 | [diff] [blame] | 169 | .mmdc_compat = "fsl,imx6sl-mmdc", |
| 170 | .src_compat = "fsl,imx6sl-src", |
| 171 | .iomuxc_compat = "fsl,imx6sl-iomuxc", |
| 172 | .gpc_compat = "fsl,imx6sl-gpc", |
Anson Huang | ee4a5f8 | 2015-08-05 01:48:37 +0800 | [diff] [blame] | 173 | .pl310_compat = "arm,pl310-cache", |
Anson Huang | 64b0868 | 2014-01-17 11:39:07 +0800 | [diff] [blame] | 174 | .mmdc_io_num = ARRAY_SIZE(imx6sl_mmdc_io_offset), |
| 175 | .mmdc_io_offset = imx6sl_mmdc_io_offset, |
| 176 | }; |
| 177 | |
Anson Huang | ff843d6 | 2014-06-20 13:20:54 +0800 | [diff] [blame] | 178 | static const struct imx6_pm_socdata imx6sx_pm_data __initconst = { |
Anson Huang | ff843d6 | 2014-06-20 13:20:54 +0800 | [diff] [blame] | 179 | .mmdc_compat = "fsl,imx6sx-mmdc", |
| 180 | .src_compat = "fsl,imx6sx-src", |
| 181 | .iomuxc_compat = "fsl,imx6sx-iomuxc", |
| 182 | .gpc_compat = "fsl,imx6sx-gpc", |
Anson Huang | ee4a5f8 | 2015-08-05 01:48:37 +0800 | [diff] [blame] | 183 | .pl310_compat = "arm,pl310-cache", |
Anson Huang | ff843d6 | 2014-06-20 13:20:54 +0800 | [diff] [blame] | 184 | .mmdc_io_num = ARRAY_SIZE(imx6sx_mmdc_io_offset), |
| 185 | .mmdc_io_offset = imx6sx_mmdc_io_offset, |
| 186 | }; |
| 187 | |
Anson Huang | ee4a5f8 | 2015-08-05 01:48:37 +0800 | [diff] [blame] | 188 | static const struct imx6_pm_socdata imx6ul_pm_data __initconst = { |
| 189 | .mmdc_compat = "fsl,imx6ul-mmdc", |
| 190 | .src_compat = "fsl,imx6ul-src", |
| 191 | .iomuxc_compat = "fsl,imx6ul-iomuxc", |
| 192 | .gpc_compat = "fsl,imx6ul-gpc", |
| 193 | .pl310_compat = NULL, |
| 194 | .mmdc_io_num = ARRAY_SIZE(imx6ul_mmdc_io_offset), |
| 195 | .mmdc_io_offset = imx6ul_mmdc_io_offset, |
| 196 | }; |
| 197 | |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 198 | /* |
| 199 | * This structure is for passing necessary data for low level ocram |
| 200 | * suspend code(arch/arm/mach-imx/suspend-imx6.S), if this struct |
| 201 | * definition is changed, the offset definition in |
| 202 | * arch/arm/mach-imx/suspend-imx6.S must be also changed accordingly, |
| 203 | * otherwise, the suspend to ocram function will be broken! |
| 204 | */ |
| 205 | struct imx6_cpu_pm_info { |
| 206 | phys_addr_t pbase; /* The physical address of pm_info. */ |
| 207 | phys_addr_t resume_addr; /* The physical resume address for asm code */ |
Anson Huang | ec336b2 | 2014-09-17 11:11:45 +0800 | [diff] [blame] | 208 | u32 ddr_type; |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 209 | u32 pm_info_size; /* Size of pm_info. */ |
| 210 | struct imx6_pm_base mmdc_base; |
| 211 | struct imx6_pm_base src_base; |
| 212 | struct imx6_pm_base iomuxc_base; |
| 213 | struct imx6_pm_base ccm_base; |
| 214 | struct imx6_pm_base gpc_base; |
| 215 | struct imx6_pm_base l2_base; |
| 216 | u32 mmdc_io_num; /* Number of MMDC IOs which need saved/restored. */ |
| 217 | u32 mmdc_io_val[MX6_MAX_MMDC_IO_NUM][2]; /* To save offset and value */ |
| 218 | } __aligned(8); |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 219 | |
Anson Huang | 8765caa | 2016-08-29 21:49:56 +0800 | [diff] [blame] | 220 | void imx6_set_int_mem_clk_lpm(bool enable) |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 221 | { |
| 222 | u32 val = readl_relaxed(ccm_base + CGPR); |
| 223 | |
Anson Huang | dfea953 | 2014-06-23 16:42:43 +0800 | [diff] [blame] | 224 | val &= ~BM_CGPR_INT_MEM_CLK_LPM; |
| 225 | if (enable) |
| 226 | val |= BM_CGPR_INT_MEM_CLK_LPM; |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 227 | writel_relaxed(val, ccm_base + CGPR); |
| 228 | } |
| 229 | |
Anson Huang | 05136f0 | 2014-12-17 12:24:12 +0800 | [diff] [blame] | 230 | void imx6_enable_rbc(bool enable) |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 231 | { |
| 232 | u32 val; |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 233 | |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 234 | /* |
| 235 | * need to mask all interrupts in GPC before |
| 236 | * operating RBC configurations |
| 237 | */ |
| 238 | imx_gpc_mask_all(); |
| 239 | |
| 240 | /* configure RBC enable bit */ |
| 241 | val = readl_relaxed(ccm_base + CCR); |
| 242 | val &= ~BM_CCR_RBC_EN; |
| 243 | val |= enable ? BM_CCR_RBC_EN : 0; |
| 244 | writel_relaxed(val, ccm_base + CCR); |
| 245 | |
| 246 | /* configure RBC count */ |
| 247 | val = readl_relaxed(ccm_base + CCR); |
| 248 | val &= ~BM_CCR_RBC_BYPASS_COUNT; |
| 249 | val |= enable ? BM_CCR_RBC_BYPASS_COUNT : 0; |
| 250 | writel(val, ccm_base + CCR); |
| 251 | |
| 252 | /* |
| 253 | * need to delay at least 2 cycles of CKIL(32K) |
| 254 | * due to hardware design requirement, which is |
| 255 | * ~61us, here we use 65us for safe |
| 256 | */ |
| 257 | udelay(65); |
| 258 | |
| 259 | /* restore GPC interrupt mask settings */ |
| 260 | imx_gpc_restore_all(); |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 261 | } |
| 262 | |
| 263 | static void imx6q_enable_wb(bool enable) |
| 264 | { |
| 265 | u32 val; |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 266 | |
| 267 | /* configure well bias enable bit */ |
| 268 | val = readl_relaxed(ccm_base + CLPCR); |
| 269 | val &= ~BM_CLPCR_WB_PER_AT_LPM; |
| 270 | val |= enable ? BM_CLPCR_WB_PER_AT_LPM : 0; |
| 271 | writel_relaxed(val, ccm_base + CLPCR); |
| 272 | |
| 273 | /* configure well bias count */ |
| 274 | val = readl_relaxed(ccm_base + CCR); |
| 275 | val &= ~BM_CCR_WB_COUNT; |
| 276 | val |= enable ? BM_CCR_WB_COUNT : 0; |
| 277 | writel_relaxed(val, ccm_base + CCR); |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 278 | } |
| 279 | |
Shawn Guo | 8fb76a0 | 2015-04-25 22:59:19 +0800 | [diff] [blame] | 280 | int imx6_set_lpm(enum mxc_cpu_pwr_mode mode) |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 281 | { |
| 282 | u32 val = readl_relaxed(ccm_base + CLPCR); |
| 283 | |
| 284 | val &= ~BM_CLPCR_LPM; |
| 285 | switch (mode) { |
| 286 | case WAIT_CLOCKED: |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 287 | break; |
| 288 | case WAIT_UNCLOCKED: |
| 289 | val |= 0x1 << BP_CLPCR_LPM; |
| 290 | val |= BM_CLPCR_ARM_CLK_DIS_ON_LPM; |
| 291 | break; |
| 292 | case STOP_POWER_ON: |
| 293 | val |= 0x2 << BP_CLPCR_LPM; |
Anson Huang | 80c0ecd | 2014-06-23 16:42:44 +0800 | [diff] [blame] | 294 | val &= ~BM_CLPCR_VSTBY; |
| 295 | val &= ~BM_CLPCR_SBYOS; |
| 296 | if (cpu_is_imx6sl()) |
| 297 | val |= BM_CLPCR_BYPASS_PMIC_READY; |
Leonard Crestez | bf5a01d | 2017-06-06 20:50:43 +0300 | [diff] [blame^] | 298 | if (cpu_is_imx6sl() || cpu_is_imx6sx() || cpu_is_imx6ul() || |
| 299 | cpu_is_imx6ull()) |
Anson Huang | 80c0ecd | 2014-06-23 16:42:44 +0800 | [diff] [blame] | 300 | val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS; |
| 301 | else |
| 302 | val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS; |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 303 | break; |
| 304 | case WAIT_UNCLOCKED_POWER_OFF: |
| 305 | val |= 0x1 << BP_CLPCR_LPM; |
| 306 | val &= ~BM_CLPCR_VSTBY; |
| 307 | val &= ~BM_CLPCR_SBYOS; |
| 308 | break; |
| 309 | case STOP_POWER_OFF: |
| 310 | val |= 0x2 << BP_CLPCR_LPM; |
| 311 | val |= 0x3 << BP_CLPCR_STBY_COUNT; |
| 312 | val |= BM_CLPCR_VSTBY; |
| 313 | val |= BM_CLPCR_SBYOS; |
Anson Huang | 8aade77 | 2016-08-22 23:53:25 +0800 | [diff] [blame] | 314 | if (cpu_is_imx6sl() || cpu_is_imx6sx()) |
Shawn Guo | 9ba64fe | 2013-10-17 10:07:09 +0800 | [diff] [blame] | 315 | val |= BM_CLPCR_BYPASS_PMIC_READY; |
Leonard Crestez | bf5a01d | 2017-06-06 20:50:43 +0300 | [diff] [blame^] | 316 | if (cpu_is_imx6sl() || cpu_is_imx6sx() || cpu_is_imx6ul() || |
| 317 | cpu_is_imx6ull()) |
Shawn Guo | 9ba64fe | 2013-10-17 10:07:09 +0800 | [diff] [blame] | 318 | val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS; |
Anson Huang | ff843d6 | 2014-06-20 13:20:54 +0800 | [diff] [blame] | 319 | else |
Shawn Guo | 9ba64fe | 2013-10-17 10:07:09 +0800 | [diff] [blame] | 320 | val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS; |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 321 | break; |
| 322 | default: |
| 323 | return -EINVAL; |
| 324 | } |
| 325 | |
Shawn Guo | d48866f | 2013-10-16 19:52:00 +0800 | [diff] [blame] | 326 | /* |
Anson Huang | 48c9584 | 2013-12-24 17:19:21 -0500 | [diff] [blame] | 327 | * ERR007265: CCM: When improper low-power sequence is used, |
| 328 | * the SoC enters low power mode before the ARM core executes WFI. |
| 329 | * |
| 330 | * Software workaround: |
| 331 | * 1) Software should trigger IRQ #32 (IOMUX) to be always pending |
| 332 | * by setting IOMUX_GPR1_GINT. |
| 333 | * 2) Software should then unmask IRQ #32 in GPC before setting CCM |
| 334 | * Low-Power mode. |
| 335 | * 3) Software should mask IRQ #32 right after CCM Low-Power mode |
| 336 | * is set (set bits 0-1 of CCM_CLPCR). |
Marc Zyngier | b923ff6 | 2015-02-23 17:45:18 +0000 | [diff] [blame] | 337 | * |
| 338 | * Note that IRQ #32 is GIC SPI #0. |
Shawn Guo | d48866f | 2013-10-16 19:52:00 +0800 | [diff] [blame] | 339 | */ |
Marc Zyngier | b923ff6 | 2015-02-23 17:45:18 +0000 | [diff] [blame] | 340 | imx_gpc_hwirq_unmask(0); |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 341 | writel_relaxed(val, ccm_base + CLPCR); |
Marc Zyngier | b923ff6 | 2015-02-23 17:45:18 +0000 | [diff] [blame] | 342 | imx_gpc_hwirq_mask(0); |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 343 | |
| 344 | return 0; |
| 345 | } |
| 346 | |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 347 | static int imx6q_suspend_finish(unsigned long val) |
| 348 | { |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 349 | if (!imx6_suspend_in_ocram_fn) { |
| 350 | cpu_do_idle(); |
| 351 | } else { |
| 352 | /* |
| 353 | * call low level suspend function in ocram, |
| 354 | * as we need to float DDR IO. |
| 355 | */ |
| 356 | local_flush_tlb_all(); |
Anson Huang | ee4a5f8 | 2015-08-05 01:48:37 +0800 | [diff] [blame] | 357 | /* check if need to flush internal L2 cache */ |
| 358 | if (!((struct imx6_cpu_pm_info *) |
| 359 | suspend_ocram_base)->l2_base.vbase) |
| 360 | flush_cache_all(); |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 361 | imx6_suspend_in_ocram_fn(suspend_ocram_base); |
| 362 | } |
| 363 | |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 364 | return 0; |
| 365 | } |
| 366 | |
| 367 | static int imx6q_pm_enter(suspend_state_t state) |
| 368 | { |
| 369 | switch (state) { |
Anson Huang | 80c0ecd | 2014-06-23 16:42:44 +0800 | [diff] [blame] | 370 | case PM_SUSPEND_STANDBY: |
Shawn Guo | 8fb76a0 | 2015-04-25 22:59:19 +0800 | [diff] [blame] | 371 | imx6_set_lpm(STOP_POWER_ON); |
Anson Huang | 8765caa | 2016-08-29 21:49:56 +0800 | [diff] [blame] | 372 | imx6_set_int_mem_clk_lpm(true); |
Anson Huang | 80c0ecd | 2014-06-23 16:42:44 +0800 | [diff] [blame] | 373 | imx_gpc_pre_suspend(false); |
| 374 | if (cpu_is_imx6sl()) |
| 375 | imx6sl_set_wait_clk(true); |
| 376 | /* Zzz ... */ |
| 377 | cpu_do_idle(); |
| 378 | if (cpu_is_imx6sl()) |
| 379 | imx6sl_set_wait_clk(false); |
| 380 | imx_gpc_post_resume(); |
Shawn Guo | 8fb76a0 | 2015-04-25 22:59:19 +0800 | [diff] [blame] | 381 | imx6_set_lpm(WAIT_CLOCKED); |
Anson Huang | 80c0ecd | 2014-06-23 16:42:44 +0800 | [diff] [blame] | 382 | break; |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 383 | case PM_SUSPEND_MEM: |
Shawn Guo | 8fb76a0 | 2015-04-25 22:59:19 +0800 | [diff] [blame] | 384 | imx6_set_lpm(STOP_POWER_OFF); |
Anson Huang | 8765caa | 2016-08-29 21:49:56 +0800 | [diff] [blame] | 385 | imx6_set_int_mem_clk_lpm(false); |
Shawn Guo | 1d674a7 | 2013-10-09 20:31:28 +0800 | [diff] [blame] | 386 | imx6q_enable_wb(true); |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 387 | /* |
| 388 | * For suspend into ocram, asm code already take care of |
| 389 | * RBC setting, so we do NOT need to do that here. |
| 390 | */ |
| 391 | if (!imx6_suspend_in_ocram_fn) |
Anson Huang | 05136f0 | 2014-12-17 12:24:12 +0800 | [diff] [blame] | 392 | imx6_enable_rbc(true); |
Anson Huang | 80c0ecd | 2014-06-23 16:42:44 +0800 | [diff] [blame] | 393 | imx_gpc_pre_suspend(true); |
Anson Huang | e95dddb | 2013-03-20 19:39:42 -0400 | [diff] [blame] | 394 | imx_anatop_pre_suspend(); |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 395 | /* Zzz ... */ |
| 396 | cpu_suspend(0, imx6q_suspend_finish); |
Shawn Guo | 9ba64fe | 2013-10-17 10:07:09 +0800 | [diff] [blame] | 397 | if (cpu_is_imx6q() || cpu_is_imx6dl()) |
| 398 | imx_smp_prepare(); |
Anson Huang | e95dddb | 2013-03-20 19:39:42 -0400 | [diff] [blame] | 399 | imx_anatop_post_resume(); |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 400 | imx_gpc_post_resume(); |
Anson Huang | 05136f0 | 2014-12-17 12:24:12 +0800 | [diff] [blame] | 401 | imx6_enable_rbc(false); |
Shawn Guo | 1d674a7 | 2013-10-09 20:31:28 +0800 | [diff] [blame] | 402 | imx6q_enable_wb(false); |
Anson Huang | 8765caa | 2016-08-29 21:49:56 +0800 | [diff] [blame] | 403 | imx6_set_int_mem_clk_lpm(true); |
Shawn Guo | 8fb76a0 | 2015-04-25 22:59:19 +0800 | [diff] [blame] | 404 | imx6_set_lpm(WAIT_CLOCKED); |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 405 | break; |
| 406 | default: |
| 407 | return -EINVAL; |
| 408 | } |
| 409 | |
| 410 | return 0; |
| 411 | } |
| 412 | |
Anson Huang | 80c0ecd | 2014-06-23 16:42:44 +0800 | [diff] [blame] | 413 | static int imx6q_pm_valid(suspend_state_t state) |
| 414 | { |
| 415 | return (state == PM_SUSPEND_STANDBY || state == PM_SUSPEND_MEM); |
| 416 | } |
| 417 | |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 418 | static const struct platform_suspend_ops imx6q_pm_ops = { |
| 419 | .enter = imx6q_pm_enter, |
Anson Huang | 80c0ecd | 2014-06-23 16:42:44 +0800 | [diff] [blame] | 420 | .valid = imx6q_pm_valid, |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 421 | }; |
| 422 | |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 423 | static int __init imx6_pm_get_base(struct imx6_pm_base *base, |
| 424 | const char *compat) |
| 425 | { |
| 426 | struct device_node *node; |
| 427 | struct resource res; |
| 428 | int ret = 0; |
| 429 | |
| 430 | node = of_find_compatible_node(NULL, NULL, compat); |
| 431 | if (!node) { |
| 432 | ret = -ENODEV; |
| 433 | goto out; |
| 434 | } |
| 435 | |
| 436 | ret = of_address_to_resource(node, 0, &res); |
| 437 | if (ret) |
| 438 | goto put_node; |
| 439 | |
| 440 | base->pbase = res.start; |
| 441 | base->vbase = ioremap(res.start, resource_size(&res)); |
| 442 | if (!base->vbase) |
| 443 | ret = -ENOMEM; |
| 444 | |
| 445 | put_node: |
| 446 | of_node_put(node); |
| 447 | out: |
| 448 | return ret; |
| 449 | } |
| 450 | |
Shawn Guo | afc51f4 | 2014-02-26 21:28:18 +0800 | [diff] [blame] | 451 | static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 452 | { |
| 453 | phys_addr_t ocram_pbase; |
| 454 | struct device_node *node; |
| 455 | struct platform_device *pdev; |
| 456 | struct imx6_cpu_pm_info *pm_info; |
| 457 | struct gen_pool *ocram_pool; |
| 458 | unsigned long ocram_base; |
| 459 | int i, ret = 0; |
| 460 | const u32 *mmdc_offset_array; |
| 461 | |
Shawn Guo | afc51f4 | 2014-02-26 21:28:18 +0800 | [diff] [blame] | 462 | suspend_set_ops(&imx6q_pm_ops); |
| 463 | |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 464 | if (!socdata) { |
| 465 | pr_warn("%s: invalid argument!\n", __func__); |
| 466 | return -EINVAL; |
| 467 | } |
| 468 | |
| 469 | node = of_find_compatible_node(NULL, NULL, "mmio-sram"); |
| 470 | if (!node) { |
| 471 | pr_warn("%s: failed to find ocram node!\n", __func__); |
| 472 | return -ENODEV; |
| 473 | } |
| 474 | |
| 475 | pdev = of_find_device_by_node(node); |
| 476 | if (!pdev) { |
| 477 | pr_warn("%s: failed to find ocram device!\n", __func__); |
| 478 | ret = -ENODEV; |
| 479 | goto put_node; |
| 480 | } |
| 481 | |
Vladimir Zapolskiy | 7385817 | 2015-09-04 15:47:43 -0700 | [diff] [blame] | 482 | ocram_pool = gen_pool_get(&pdev->dev, NULL); |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 483 | if (!ocram_pool) { |
| 484 | pr_warn("%s: ocram pool unavailable!\n", __func__); |
| 485 | ret = -ENODEV; |
| 486 | goto put_node; |
| 487 | } |
| 488 | |
| 489 | ocram_base = gen_pool_alloc(ocram_pool, MX6Q_SUSPEND_OCRAM_SIZE); |
| 490 | if (!ocram_base) { |
| 491 | pr_warn("%s: unable to alloc ocram!\n", __func__); |
| 492 | ret = -ENOMEM; |
| 493 | goto put_node; |
| 494 | } |
| 495 | |
| 496 | ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base); |
| 497 | |
| 498 | suspend_ocram_base = __arm_ioremap_exec(ocram_pbase, |
| 499 | MX6Q_SUSPEND_OCRAM_SIZE, false); |
| 500 | |
Anson Huang | ee4a5f8 | 2015-08-05 01:48:37 +0800 | [diff] [blame] | 501 | memset(suspend_ocram_base, 0, sizeof(*pm_info)); |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 502 | pm_info = suspend_ocram_base; |
| 503 | pm_info->pbase = ocram_pbase; |
Florian Fainelli | 64fc2a9 | 2017-01-15 03:59:29 +0100 | [diff] [blame] | 504 | pm_info->resume_addr = __pa_symbol(v7_cpu_resume); |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 505 | pm_info->pm_info_size = sizeof(*pm_info); |
| 506 | |
| 507 | /* |
| 508 | * ccm physical address is not used by asm code currently, |
Shawn Guo | f0b478b | 2015-04-25 23:37:12 +0800 | [diff] [blame] | 509 | * so get ccm virtual address directly. |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 510 | */ |
| 511 | pm_info->ccm_base.vbase = ccm_base; |
| 512 | |
| 513 | ret = imx6_pm_get_base(&pm_info->mmdc_base, socdata->mmdc_compat); |
| 514 | if (ret) { |
| 515 | pr_warn("%s: failed to get mmdc base %d!\n", __func__, ret); |
| 516 | goto put_node; |
| 517 | } |
| 518 | |
| 519 | ret = imx6_pm_get_base(&pm_info->src_base, socdata->src_compat); |
| 520 | if (ret) { |
| 521 | pr_warn("%s: failed to get src base %d!\n", __func__, ret); |
| 522 | goto src_map_failed; |
| 523 | } |
| 524 | |
| 525 | ret = imx6_pm_get_base(&pm_info->iomuxc_base, socdata->iomuxc_compat); |
| 526 | if (ret) { |
| 527 | pr_warn("%s: failed to get iomuxc base %d!\n", __func__, ret); |
| 528 | goto iomuxc_map_failed; |
| 529 | } |
| 530 | |
| 531 | ret = imx6_pm_get_base(&pm_info->gpc_base, socdata->gpc_compat); |
| 532 | if (ret) { |
| 533 | pr_warn("%s: failed to get gpc base %d!\n", __func__, ret); |
| 534 | goto gpc_map_failed; |
| 535 | } |
| 536 | |
Anson Huang | ee4a5f8 | 2015-08-05 01:48:37 +0800 | [diff] [blame] | 537 | if (socdata->pl310_compat) { |
| 538 | ret = imx6_pm_get_base(&pm_info->l2_base, socdata->pl310_compat); |
| 539 | if (ret) { |
| 540 | pr_warn("%s: failed to get pl310-cache base %d!\n", |
| 541 | __func__, ret); |
| 542 | goto pl310_cache_map_failed; |
| 543 | } |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 544 | } |
| 545 | |
Anson Huang | ec336b2 | 2014-09-17 11:11:45 +0800 | [diff] [blame] | 546 | pm_info->ddr_type = imx_mmdc_get_ddr_type(); |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 547 | pm_info->mmdc_io_num = socdata->mmdc_io_num; |
| 548 | mmdc_offset_array = socdata->mmdc_io_offset; |
| 549 | |
| 550 | for (i = 0; i < pm_info->mmdc_io_num; i++) { |
| 551 | pm_info->mmdc_io_val[i][0] = |
| 552 | mmdc_offset_array[i]; |
| 553 | pm_info->mmdc_io_val[i][1] = |
| 554 | readl_relaxed(pm_info->iomuxc_base.vbase + |
| 555 | mmdc_offset_array[i]); |
| 556 | } |
| 557 | |
| 558 | imx6_suspend_in_ocram_fn = fncpy( |
| 559 | suspend_ocram_base + sizeof(*pm_info), |
| 560 | &imx6_suspend, |
| 561 | MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info)); |
| 562 | |
| 563 | goto put_node; |
| 564 | |
| 565 | pl310_cache_map_failed: |
Jean-Christophe Dubois | cfefb76 | 2015-12-26 23:16:08 +0100 | [diff] [blame] | 566 | iounmap(pm_info->gpc_base.vbase); |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 567 | gpc_map_failed: |
Jean-Christophe Dubois | cfefb76 | 2015-12-26 23:16:08 +0100 | [diff] [blame] | 568 | iounmap(pm_info->iomuxc_base.vbase); |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 569 | iomuxc_map_failed: |
Jean-Christophe Dubois | cfefb76 | 2015-12-26 23:16:08 +0100 | [diff] [blame] | 570 | iounmap(pm_info->src_base.vbase); |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 571 | src_map_failed: |
Jean-Christophe Dubois | cfefb76 | 2015-12-26 23:16:08 +0100 | [diff] [blame] | 572 | iounmap(pm_info->mmdc_base.vbase); |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 573 | put_node: |
| 574 | of_node_put(node); |
| 575 | |
| 576 | return ret; |
| 577 | } |
| 578 | |
| 579 | static void __init imx6_pm_common_init(const struct imx6_pm_socdata |
| 580 | *socdata) |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 581 | { |
Shawn Guo | d48866f | 2013-10-16 19:52:00 +0800 | [diff] [blame] | 582 | struct regmap *gpr; |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 583 | int ret; |
Shawn Guo | d48866f | 2013-10-16 19:52:00 +0800 | [diff] [blame] | 584 | |
Shawn Guo | 9e8147b | 2013-09-25 23:09:36 +0800 | [diff] [blame] | 585 | WARN_ON(!ccm_base); |
| 586 | |
Shawn Guo | 110666d | 2014-02-26 21:40:32 +0800 | [diff] [blame] | 587 | if (IS_ENABLED(CONFIG_SUSPEND)) { |
| 588 | ret = imx6q_suspend_init(socdata); |
| 589 | if (ret) |
| 590 | pr_warn("%s: No DDR LPM support with suspend %d!\n", |
| 591 | __func__, ret); |
| 592 | } |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 593 | |
Shawn Guo | d48866f | 2013-10-16 19:52:00 +0800 | [diff] [blame] | 594 | /* |
Anson Huang | 48c9584 | 2013-12-24 17:19:21 -0500 | [diff] [blame] | 595 | * This is for SW workaround step #1 of ERR007265, see comments |
Shawn Guo | 8fb76a0 | 2015-04-25 22:59:19 +0800 | [diff] [blame] | 596 | * in imx6_set_lpm for details of this errata. |
Shawn Guo | d48866f | 2013-10-16 19:52:00 +0800 | [diff] [blame] | 597 | * Force IOMUXC irq pending, so that the interrupt to GPC can be |
| 598 | * used to deassert dsm_request signal when the signal gets |
| 599 | * asserted unexpectedly. |
| 600 | */ |
| 601 | gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr"); |
| 602 | if (!IS_ERR(gpr)) |
| 603 | regmap_update_bits(gpr, IOMUXC_GPR1, IMX6Q_GPR1_GINT, |
| 604 | IMX6Q_GPR1_GINT); |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 605 | } |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 606 | |
Shawn Guo | 35e2916 | 2015-04-29 13:07:03 +0800 | [diff] [blame] | 607 | void __init imx6_pm_ccm_init(const char *ccm_compat) |
| 608 | { |
| 609 | struct device_node *np; |
| 610 | u32 val; |
| 611 | |
| 612 | np = of_find_compatible_node(NULL, NULL, ccm_compat); |
| 613 | ccm_base = of_iomap(np, 0); |
| 614 | BUG_ON(!ccm_base); |
| 615 | |
| 616 | /* |
| 617 | * Initialize CCM_CLPCR_LPM into RUN mode to avoid ARM core |
| 618 | * clock being shut down unexpectedly by WAIT mode. |
| 619 | */ |
| 620 | val = readl_relaxed(ccm_base + CLPCR); |
| 621 | val &= ~BM_CLPCR_LPM; |
| 622 | writel_relaxed(val, ccm_base + CLPCR); |
| 623 | } |
| 624 | |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 625 | void __init imx6q_pm_init(void) |
| 626 | { |
| 627 | imx6_pm_common_init(&imx6q_pm_data); |
| 628 | } |
| 629 | |
| 630 | void __init imx6dl_pm_init(void) |
| 631 | { |
Anson Huang | da9e926 | 2014-01-17 11:39:06 +0800 | [diff] [blame] | 632 | imx6_pm_common_init(&imx6dl_pm_data); |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 633 | } |
| 634 | |
| 635 | void __init imx6sl_pm_init(void) |
| 636 | { |
Anson Huang | 64b0868 | 2014-01-17 11:39:07 +0800 | [diff] [blame] | 637 | imx6_pm_common_init(&imx6sl_pm_data); |
Anson Huang | df59574 | 2014-01-17 11:39:05 +0800 | [diff] [blame] | 638 | } |
Anson Huang | ff843d6 | 2014-06-20 13:20:54 +0800 | [diff] [blame] | 639 | |
| 640 | void __init imx6sx_pm_init(void) |
| 641 | { |
| 642 | imx6_pm_common_init(&imx6sx_pm_data); |
| 643 | } |
Anson Huang | ee4a5f8 | 2015-08-05 01:48:37 +0800 | [diff] [blame] | 644 | |
| 645 | void __init imx6ul_pm_init(void) |
| 646 | { |
| 647 | imx6_pm_common_init(&imx6ul_pm_data); |
| 648 | } |