aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Trumtrar <s.trumtrar@pengutronix.de>2013-12-18 09:10:25 -0500
committerShawn Guo <shawn.guo@linaro.org>2013-12-30 20:36:40 -0500
commita55a3d726680d1d236e54bcf58c444feeedd7d37 (patch)
tree768cc28ecfc048fa9c53a6aac2ce2684fd58182d
parent920c9648c10547aef67f7a1d6f227ab479dca658 (diff)
ARM i.MX35: Add devicetree support.
Cc: linux-arm-kernel@lists.infradead.org Cc: Eric Bénard <eric@eukrea.com> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Denis Carikli <denis@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
-rw-r--r--Documentation/devicetree/bindings/clock/imx35-clock.txt113
-rw-r--r--arch/arm/mach-imx/Kconfig8
-rw-r--r--arch/arm/mach-imx/Makefile1
-rw-r--r--arch/arm/mach-imx/clk-imx35.c14
-rw-r--r--arch/arm/mach-imx/imx35-dt.c50
5 files changed, 186 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/clock/imx35-clock.txt b/Documentation/devicetree/bindings/clock/imx35-clock.txt
new file mode 100644
index 000000000000..a70356452a82
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/imx35-clock.txt
@@ -0,0 +1,113 @@
1* Clock bindings for Freescale i.MX35
2
3Required properties:
4- compatible: Should be "fsl,imx35-ccm"
5- reg: Address and length of the register set
6- interrupts: Should contain CCM interrupt
7- #clock-cells: Should be <1>
8
9The clock consumer should specify the desired clock by having the clock
10ID in its "clocks" phandle cell. The following is a full list of i.MX35
11clocks and IDs.
12
13 Clock ID
14 ---------------------------
15 ckih 0
16 mpll 1
17 ppll 2
18 mpll_075 3
19 arm 4
20 hsp 5
21 hsp_div 6
22 hsp_sel 7
23 ahb 8
24 ipg 9
25 arm_per_div 10
26 ahb_per_div 11
27 ipg_per 12
28 uart_sel 13
29 uart_div 14
30 esdhc_sel 15
31 esdhc1_div 16
32 esdhc2_div 17
33 esdhc3_div 18
34 spdif_sel 19
35 spdif_div_pre 20
36 spdif_div_post 21
37 ssi_sel 22
38 ssi1_div_pre 23
39 ssi1_div_post 24
40 ssi2_div_pre 25
41 ssi2_div_post 26
42 usb_sel 27
43 usb_div 28
44 nfc_div 29
45 asrc_gate 30
46 pata_gate 31
47 audmux_gate 32
48 can1_gate 33
49 can2_gate 34
50 cspi1_gate 35
51 cspi2_gate 36
52 ect_gate 37
53 edio_gate 38
54 emi_gate 39
55 epit1_gate 40
56 epit2_gate 41
57 esai_gate 42
58 esdhc1_gate 43
59 esdhc2_gate 44
60 esdhc3_gate 45
61 fec_gate 46
62 gpio1_gate 47
63 gpio2_gate 48
64 gpio3_gate 49
65 gpt_gate 50
66 i2c1_gate 51
67 i2c2_gate 52
68 i2c3_gate 53
69 iomuxc_gate 54
70 ipu_gate 55
71 kpp_gate 56
72 mlb_gate 57
73 mshc_gate 58
74 owire_gate 59
75 pwm_gate 60
76 rngc_gate 61
77 rtc_gate 62
78 rtic_gate 63
79 scc_gate 64
80 sdma_gate 65
81 spba_gate 66
82 spdif_gate 67
83 ssi1_gate 68
84 ssi2_gate 69
85 uart1_gate 70
86 uart2_gate 71
87 uart3_gate 72
88 usbotg_gate 73
89 wdog_gate 74
90 max_gate 75
91 admux_gate 76
92 csi_gate 77
93 csi_div 78
94 csi_sel 79
95 iim_gate 80
96 gpu2d_gate 81
97
98Examples:
99
100clks: ccm@53f80000 {
101 compatible = "fsl,imx35-ccm";
102 reg = <0x53f80000 0x4000>;
103 interrupts = <31>;
104 #clock-cells = <1>;
105};
106
107esdhc1: esdhc@53fb4000 {
108 compatible = "fsl,imx35-esdhc";
109 reg = <0x53fb4000 0x4000>;
110 interrupts = <7>;
111 clocks = <&clks 9>, <&clks 8>, <&clks 43>;
112 clock-names = "ipg", "ahb", "per";
113};
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index d511e0546546..b0c6eb35a322 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -126,6 +126,7 @@ config SOC_IMX35
126 select HAVE_EPIT 126 select HAVE_EPIT
127 select MXC_AVIC 127 select MXC_AVIC
128 select SMP_ON_UP if SMP 128 select SMP_ON_UP if SMP
129 select PINCTRL
129 130
130config SOC_IMX5 131config SOC_IMX5
131 bool 132 bool
@@ -611,6 +612,13 @@ config MACH_IMX31_DT
611 612
612comment "MX35 platforms:" 613comment "MX35 platforms:"
613 614
615config MACH_IMX35_DT
616 bool "Support i.MX35 platforms from device tree"
617 select SOC_IMX35
618 help
619 Include support for Freescale i.MX35 based platforms
620 using the device tree for discovery.
621
614config MACH_PCM043 622config MACH_PCM043
615 bool "Support Phytec pcm043 (i.MX35) platforms" 623 bool "Support Phytec pcm043 (i.MX35) platforms"
616 select IMX_HAVE_PLATFORM_FLEXCAN 624 select IMX_HAVE_PLATFORM_FLEXCAN
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 0db169728396..befcaf5d0574 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -89,6 +89,7 @@ obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35_3ds.o
89obj-$(CONFIG_MACH_EUKREA_CPUIMX35SD) += mach-cpuimx35.o 89obj-$(CONFIG_MACH_EUKREA_CPUIMX35SD) += mach-cpuimx35.o
90obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd35-baseboard.o 90obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd35-baseboard.o
91obj-$(CONFIG_MACH_VPR200) += mach-vpr200.o 91obj-$(CONFIG_MACH_VPR200) += mach-vpr200.o
92obj-$(CONFIG_MACH_IMX35_DT) += imx35-dt.o
92 93
93obj-$(CONFIG_HAVE_IMX_ANATOP) += anatop.o 94obj-$(CONFIG_HAVE_IMX_ANATOP) += anatop.o
94obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o 95obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o
diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c
index 2193c834f55c..a4d5e425cd82 100644
--- a/arch/arm/mach-imx/clk-imx35.c
+++ b/arch/arm/mach-imx/clk-imx35.c
@@ -45,6 +45,8 @@ static struct arm_ahb_div clk_consumer[] = {
45static char hsp_div_532[] = { 4, 8, 3, 0 }; 45static char hsp_div_532[] = { 4, 8, 3, 0 };
46static char hsp_div_400[] = { 3, 6, 3, 0 }; 46static char hsp_div_400[] = { 3, 6, 3, 0 };
47 47
48static struct clk_onecell_data clk_data;
49
48static const char *std_sel[] = {"ppll", "arm"}; 50static const char *std_sel[] = {"ppll", "arm"};
49static const char *ipg_per_sel[] = {"ahb_per_div", "arm_per_div"}; 51static const char *ipg_per_sel[] = {"ahb_per_div", "arm_per_div"};
50 52
@@ -286,3 +288,15 @@ int __init mx35_clocks_init(void)
286 288
287 return 0; 289 return 0;
288} 290}
291
292static int __init mx35_clocks_init_dt(struct device_node *ccm_node)
293{
294 clk_data.clks = clk;
295 clk_data.clk_num = ARRAY_SIZE(clk);
296 of_clk_add_provider(ccm_node, of_clk_src_onecell_get, &clk_data);
297
298 mx35_clocks_init();
299
300 return 0;
301}
302CLK_OF_DECLARE(imx35, "fsl,imx35-ccm", mx35_clocks_init_dt);
diff --git a/arch/arm/mach-imx/imx35-dt.c b/arch/arm/mach-imx/imx35-dt.c
new file mode 100644
index 000000000000..9d48e0065a63
--- /dev/null
+++ b/arch/arm/mach-imx/imx35-dt.c
@@ -0,0 +1,50 @@
1/*
2 * Copyright 2012 Steffen Trumtrar, Pengutronix
3 *
4 * based on imx27-dt.c
5 *
6 * This program is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License version 2 as published by the
8 * Free Software Foundation.
9 */
10
11#include <linux/irq.h>
12#include <linux/irqdomain.h>
13#include <linux/of_irq.h>
14#include <linux/of_platform.h>
15#include <linux/clk-provider.h>
16#include <linux/clocksource.h>
17#include <asm/mach/arch.h>
18#include <asm/mach/time.h>
19#include <asm/hardware/cache-l2x0.h>
20#include "common.h"
21#include "mx35.h"
22
23static void __init imx35_dt_init(void)
24{
25 mxc_arch_reset_init_dt();
26
27 of_platform_populate(NULL, of_default_bus_match_table,
28 NULL, NULL);
29}
30
31static void __init imx35_irq_init(void)
32{
33 imx_init_l2cache();
34 mx35_init_irq();
35}
36
37static const char *imx35_dt_board_compat[] __initconst = {
38 "fsl,imx35",
39 NULL
40};
41
42DT_MACHINE_START(IMX35_DT, "Freescale i.MX35 (Device Tree Support)")
43 .map_io = mx35_map_io,
44 .init_early = imx35_init_early,
45 .init_irq = imx35_irq_init,
46 .handle_irq = imx35_handle_irq,
47 .init_machine = imx35_dt_init,
48 .dt_compat = imx35_dt_board_compat,
49 .restart = mxc_restart,
50MACHINE_END