aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-28 22:59:34 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-28 22:59:34 -0500
commitf8f466c81795a3ed2b8a74c8feebc280aec3db81 (patch)
tree5d5d7e2cc0fd46f2a865974adc8a86bbd8c2f3be /arch/arm/mach-imx
parent2af78448fff61e13392daf4f770cfbcf9253316a (diff)
parent4a9226a3d192c38493106dcaf5f47f291ede9ed5 (diff)
Merge tag 'late-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC i.MX DT changes from Olof Johansson: "This branch contains of devicetree changes for the Freescale i.MX platform. The base patch of the branch changes the format of the dts files to a slightly different format that makes it easier to do derivative board definitions, but it also introduces a lot of churn in the process since every line of the file is touched. On top of that are a handful of the regular changes; enabling more boards as DT-based instead of legacy board files (mx25pdk), enabling another driver for devicetree and thus adding bindings (onewire), etc. I'm not happy about the churn, and will likely not take it for other platforms in the future." * tag 'late-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (21 commits) ARM: dts: add dtsi for imx6q and imx6dl ARM: dts: rename imx6q.dtsi to imx6qdl.dtsi ARM: dts: i.MX6: Add regulator delay support ARM: dts: Add device tree entry for onewire master on i.MX53 ARM: i.MX53: Add clocks for i.mx53 onewire master. W1: Add device tree support to MXC onewire master. ARM: imx: enable imx6q-cpufreq support ARM: dts: Add apf51 basic support ARM i.MX6: change mxs usbphy clock usage ARM: dts: imx6q: Remove silicon version from SDMA firmware ARM i.MX53: dts: add oftree for MBa53 baseboard ARM i.MX53: add dts for the TQ tqma53 module ARM: dts: imx53: pinctrl update ARM i.MX51 babbage: Add keypad support ARM: dts: imx: Add imx51 KPP entry ARM: dts: imx25-karo-tx25: Put status entry in the end ARM: mx25pdk: Add device tree support ARM: dts: imx: use nodes label in board dts ARM: dts: add missing imx dtb targets ARM: boot: dts: Add an entry for imx27-pdk.dtb ...
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/clk-imx51-imx53.c4
-rw-r--r--arch/arm/mach-imx/clk-imx6q.c26
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c65
3 files changed, 90 insertions, 5 deletions
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
index fb7cb841b64c..0f39f8c93b94 100644
--- a/arch/arm/mach-imx/clk-imx51-imx53.c
+++ b/arch/arm/mach-imx/clk-imx51-imx53.c
@@ -83,6 +83,7 @@ enum imx5_clks {
83 ssi2_root_gate, ssi3_root_gate, ssi_ext1_gate, ssi_ext2_gate, 83 ssi2_root_gate, ssi3_root_gate, ssi_ext1_gate, ssi_ext2_gate,
84 epit1_ipg_gate, epit1_hf_gate, epit2_ipg_gate, epit2_hf_gate, 84 epit1_ipg_gate, epit1_hf_gate, epit2_ipg_gate, epit2_hf_gate,
85 can_sel, can1_serial_gate, can1_ipg_gate, 85 can_sel, can1_serial_gate, can1_ipg_gate,
86 owire_gate,
86 clk_max 87 clk_max
87}; 88};
88 89
@@ -233,12 +234,13 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil,
233 clk[epit1_hf_gate] = imx_clk_gate2("epit1_hf_gate", "per_root", MXC_CCM_CCGR2, 4); 234 clk[epit1_hf_gate] = imx_clk_gate2("epit1_hf_gate", "per_root", MXC_CCM_CCGR2, 4);
234 clk[epit2_ipg_gate] = imx_clk_gate2("epit2_ipg_gate", "ipg", MXC_CCM_CCGR2, 6); 235 clk[epit2_ipg_gate] = imx_clk_gate2("epit2_ipg_gate", "ipg", MXC_CCM_CCGR2, 6);
235 clk[epit2_hf_gate] = imx_clk_gate2("epit2_hf_gate", "per_root", MXC_CCM_CCGR2, 8); 236 clk[epit2_hf_gate] = imx_clk_gate2("epit2_hf_gate", "per_root", MXC_CCM_CCGR2, 8);
237 clk[owire_gate] = imx_clk_gate2("owire_gate", "per_root", MXC_CCM_CCGR2, 22);
236 238
237 for (i = 0; i < ARRAY_SIZE(clk); i++) 239 for (i = 0; i < ARRAY_SIZE(clk); i++)
238 if (IS_ERR(clk[i])) 240 if (IS_ERR(clk[i]))
239 pr_err("i.MX5 clk %d: register failed with %ld\n", 241 pr_err("i.MX5 clk %d: register failed with %ld\n",
240 i, PTR_ERR(clk[i])); 242 i, PTR_ERR(clk[i]));
241 243
242 clk_register_clkdev(clk[gpt_hf_gate], "per", "imx-gpt.0"); 244 clk_register_clkdev(clk[gpt_hf_gate], "per", "imx-gpt.0");
243 clk_register_clkdev(clk[gpt_ipg_gate], "ipg", "imx-gpt.0"); 245 clk_register_clkdev(clk[gpt_ipg_gate], "ipg", "imx-gpt.0");
244 clk_register_clkdev(clk[uart1_per_gate], "per", "imx21-uart.0"); 246 clk_register_clkdev(clk[uart1_per_gate], "per", "imx21-uart.0");
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index 540138c4606c..7b025ee528a5 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -164,8 +164,8 @@ enum mx6q_clks {
164 usdhc4, vdo_axi, vpu_axi, cko1, pll1_sys, pll2_bus, pll3_usb_otg, 164 usdhc4, vdo_axi, vpu_axi, cko1, pll1_sys, pll2_bus, pll3_usb_otg,
165 pll4_audio, pll5_video, pll8_mlb, pll7_usb_host, pll6_enet, ssi1_ipg, 165 pll4_audio, pll5_video, pll8_mlb, pll7_usb_host, pll6_enet, ssi1_ipg,
166 ssi2_ipg, ssi3_ipg, rom, usbphy1, usbphy2, ldb_di0_div_3_5, ldb_di1_div_3_5, 166 ssi2_ipg, ssi3_ipg, rom, usbphy1, usbphy2, ldb_di0_div_3_5, ldb_di1_div_3_5,
167 sata_ref, sata_ref_100m, pcie_ref, pcie_ref_125m, enet_ref, 167 sata_ref, sata_ref_100m, pcie_ref, pcie_ref_125m, enet_ref, usbphy1_gate,
168 clk_max 168 usbphy2_gate, clk_max
169}; 169};
170 170
171static struct clk *clk[clk_max]; 171static struct clk *clk[clk_max];
@@ -218,8 +218,21 @@ int __init mx6q_clocks_init(void)
218 clk[pll7_usb_host] = imx_clk_pllv3(IMX_PLLV3_USB, "pll7_usb_host","osc", base + 0x20, 0x3); 218 clk[pll7_usb_host] = imx_clk_pllv3(IMX_PLLV3_USB, "pll7_usb_host","osc", base + 0x20, 0x3);
219 clk[pll8_mlb] = imx_clk_pllv3(IMX_PLLV3_MLB, "pll8_mlb", "osc", base + 0xd0, 0x0); 219 clk[pll8_mlb] = imx_clk_pllv3(IMX_PLLV3_MLB, "pll8_mlb", "osc", base + 0xd0, 0x0);
220 220
221 clk[usbphy1] = imx_clk_gate("usbphy1", "pll3_usb_otg", base + 0x10, 6); 221 /*
222 clk[usbphy2] = imx_clk_gate("usbphy2", "pll7_usb_host", base + 0x20, 6); 222 * Bit 20 is the reserved and read-only bit, we do this only for:
223 * - Do nothing for usbphy clk_enable/disable
224 * - Keep refcount when do usbphy clk_enable/disable, in that case,
225 * the clk framework may need to enable/disable usbphy's parent
226 */
227 clk[usbphy1] = imx_clk_gate("usbphy1", "pll3_usb_otg", base + 0x10, 20);
228 clk[usbphy2] = imx_clk_gate("usbphy2", "pll7_usb_host", base + 0x20, 20);
229
230 /*
231 * usbphy*_gate needs to be on after system boots up, and software
232 * never needs to control it anymore.
233 */
234 clk[usbphy1_gate] = imx_clk_gate("usbphy1_gate", "dummy", base + 0x10, 6);
235 clk[usbphy2_gate] = imx_clk_gate("usbphy2_gate", "dummy", base + 0x20, 6);
223 236
224 clk[sata_ref] = imx_clk_fixed_factor("sata_ref", "pll6_enet", 1, 5); 237 clk[sata_ref] = imx_clk_fixed_factor("sata_ref", "pll6_enet", 1, 5);
225 clk[pcie_ref] = imx_clk_fixed_factor("pcie_ref", "pll6_enet", 1, 4); 238 clk[pcie_ref] = imx_clk_fixed_factor("pcie_ref", "pll6_enet", 1, 4);
@@ -446,6 +459,11 @@ int __init mx6q_clocks_init(void)
446 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) 459 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
447 clk_prepare_enable(clk[clks_init_on[i]]); 460 clk_prepare_enable(clk[clks_init_on[i]]);
448 461
462 if (IS_ENABLED(CONFIG_USB_MXS_PHY)) {
463 clk_prepare_enable(clk[usbphy1_gate]);
464 clk_prepare_enable(clk[usbphy2_gate]);
465 }
466
449 /* Set initial power mode */ 467 /* Set initial power mode */
450 imx6q_set_lpm(WAIT_CLOCKED); 468 imx6q_set_lpm(WAIT_CLOCKED);
451 469
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 1786b2d1257e..9ffd103b27e4 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -12,6 +12,7 @@
12 12
13#include <linux/clk.h> 13#include <linux/clk.h>
14#include <linux/clkdev.h> 14#include <linux/clkdev.h>
15#include <linux/cpu.h>
15#include <linux/delay.h> 16#include <linux/delay.h>
16#include <linux/export.h> 17#include <linux/export.h>
17#include <linux/init.h> 18#include <linux/init.h>
@@ -22,6 +23,7 @@
22#include <linux/of_address.h> 23#include <linux/of_address.h>
23#include <linux/of_irq.h> 24#include <linux/of_irq.h>
24#include <linux/of_platform.h> 25#include <linux/of_platform.h>
26#include <linux/opp.h>
25#include <linux/phy.h> 27#include <linux/phy.h>
26#include <linux/regmap.h> 28#include <linux/regmap.h>
27#include <linux/micrel_phy.h> 29#include <linux/micrel_phy.h>
@@ -200,6 +202,64 @@ static void __init imx6q_init_machine(void)
200 imx6q_1588_init(); 202 imx6q_1588_init();
201} 203}
202 204
205#define OCOTP_CFG3 0x440
206#define OCOTP_CFG3_SPEED_SHIFT 16
207#define OCOTP_CFG3_SPEED_1P2GHZ 0x3
208
209static void __init imx6q_opp_check_1p2ghz(struct device *cpu_dev)
210{
211 struct device_node *np;
212 void __iomem *base;
213 u32 val;
214
215 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-ocotp");
216 if (!np) {
217 pr_warn("failed to find ocotp node\n");
218 return;
219 }
220
221 base = of_iomap(np, 0);
222 if (!base) {
223 pr_warn("failed to map ocotp\n");
224 goto put_node;
225 }
226
227 val = readl_relaxed(base + OCOTP_CFG3);
228 val >>= OCOTP_CFG3_SPEED_SHIFT;
229 if ((val & 0x3) != OCOTP_CFG3_SPEED_1P2GHZ)
230 if (opp_disable(cpu_dev, 1200000000))
231 pr_warn("failed to disable 1.2 GHz OPP\n");
232
233put_node:
234 of_node_put(np);
235}
236
237static void __init imx6q_opp_init(struct device *cpu_dev)
238{
239 struct device_node *np;
240
241 np = of_find_node_by_path("/cpus/cpu@0");
242 if (!np) {
243 pr_warn("failed to find cpu0 node\n");
244 return;
245 }
246
247 cpu_dev->of_node = np;
248 if (of_init_opp_table(cpu_dev)) {
249 pr_warn("failed to init OPP table\n");
250 goto put_node;
251 }
252
253 imx6q_opp_check_1p2ghz(cpu_dev);
254
255put_node:
256 of_node_put(np);
257}
258
259struct platform_device imx6q_cpufreq_pdev = {
260 .name = "imx6q-cpufreq",
261};
262
203static void __init imx6q_init_late(void) 263static void __init imx6q_init_late(void)
204{ 264{
205 /* 265 /*
@@ -208,6 +268,11 @@ static void __init imx6q_init_late(void)
208 */ 268 */
209 if (imx6q_revision() > IMX_CHIP_REVISION_1_1) 269 if (imx6q_revision() > IMX_CHIP_REVISION_1_1)
210 imx6q_cpuidle_init(); 270 imx6q_cpuidle_init();
271
272 if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) {
273 imx6q_opp_init(&imx6q_cpufreq_pdev.dev);
274 platform_device_register(&imx6q_cpufreq_pdev);
275 }
211} 276}
212 277
213static void __init imx6q_map_io(void) 278static void __init imx6q_map_io(void)