aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2012-11-22 14:10:46 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2013-01-25 05:12:37 -0500
commitef0e4a606fb6d30ed8b8a72df6369068bc86ac3a (patch)
tree951b6ca1d40737c3828475681cd3c55f20c0bfda /arch/arm
parent8a1a9540384e06ca94296ec571f42ebcdc6c33ce (diff)
ARM: mx31: Replace clk_register_clkdev with clock DT lookup
Similarly as it was done for mx6q, use a DT lookup in order to make maintainance task for the clock devices easier. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/boot/dts/imx31.dtsi17
-rw-r--r--arch/arm/mach-imx/clk-imx31.c10
-rw-r--r--arch/arm/mach-imx/imx31-dt.c17
3 files changed, 28 insertions, 16 deletions
diff --git a/arch/arm/boot/dts/imx31.dtsi b/arch/arm/boot/dts/imx31.dtsi
index eef7099f3e3c..454c2d175402 100644
--- a/arch/arm/boot/dts/imx31.dtsi
+++ b/arch/arm/boot/dts/imx31.dtsi
@@ -45,6 +45,8 @@
45 compatible = "fsl,imx31-uart", "fsl,imx21-uart"; 45 compatible = "fsl,imx31-uart", "fsl,imx21-uart";
46 reg = <0x43f90000 0x4000>; 46 reg = <0x43f90000 0x4000>;
47 interrupts = <45>; 47 interrupts = <45>;
48 clocks = <&clks 10>, <&clks 30>;
49 clock-names = "ipg", "per";
48 status = "disabled"; 50 status = "disabled";
49 }; 51 };
50 52
@@ -52,12 +54,16 @@
52 compatible = "fsl,imx31-uart", "fsl,imx21-uart"; 54 compatible = "fsl,imx31-uart", "fsl,imx21-uart";
53 reg = <0x43f94000 0x4000>; 55 reg = <0x43f94000 0x4000>;
54 interrupts = <32>; 56 interrupts = <32>;
57 clocks = <&clks 10>, <&clks 31>;
58 clock-names = "ipg", "per";
55 status = "disabled"; 59 status = "disabled";
56 }; 60 };
57 61
58 uart4: serial@43fb0000 { 62 uart4: serial@43fb0000 {
59 compatible = "fsl,imx31-uart", "fsl,imx21-uart"; 63 compatible = "fsl,imx31-uart", "fsl,imx21-uart";
60 reg = <0x43fb0000 0x4000>; 64 reg = <0x43fb0000 0x4000>;
65 clocks = <&clks 10>, <&clks 49>;
66 clock-names = "ipg", "per";
61 interrupts = <46>; 67 interrupts = <46>;
62 status = "disabled"; 68 status = "disabled";
63 }; 69 };
@@ -66,6 +72,8 @@
66 compatible = "fsl,imx31-uart", "fsl,imx21-uart"; 72 compatible = "fsl,imx31-uart", "fsl,imx21-uart";
67 reg = <0x43fb4000 0x4000>; 73 reg = <0x43fb4000 0x4000>;
68 interrupts = <47>; 74 interrupts = <47>;
75 clocks = <&clks 10>, <&clks 50>;
76 clock-names = "ipg", "per";
69 status = "disabled"; 77 status = "disabled";
70 }; 78 };
71 }; 79 };
@@ -81,8 +89,17 @@
81 compatible = "fsl,imx31-uart", "fsl,imx21-uart"; 89 compatible = "fsl,imx31-uart", "fsl,imx21-uart";
82 reg = <0x5000c000 0x4000>; 90 reg = <0x5000c000 0x4000>;
83 interrupts = <18>; 91 interrupts = <18>;
92 clocks = <&clks 10>, <&clks 48>;
93 clock-names = "ipg", "per";
84 status = "disabled"; 94 status = "disabled";
85 }; 95 };
96
97 clks: ccm@53f80000{
98 compatible = "fsl,imx31-ccm";
99 reg = <0x53f80000 0x4000>;
100 interrupts = <0 31 0x04 0 53 0x04>;
101 #clock-cells = <1>;
102 };
86 }; 103 };
87 }; 104 };
88}; 105};
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
index 590dd876d66a..a42494d22c59 100644
--- a/arch/arm/mach-imx/clk-imx31.c
+++ b/arch/arm/mach-imx/clk-imx31.c
@@ -46,11 +46,13 @@ enum mx31_clks {
46}; 46};
47 47
48static struct clk *clk[clk_max]; 48static struct clk *clk[clk_max];
49static struct clk_onecell_data clk_data;
49 50
50int __init mx31_clocks_init(unsigned long fref) 51int __init mx31_clocks_init(unsigned long fref)
51{ 52{
52 void __iomem *base = MX31_IO_ADDRESS(MX31_CCM_BASE_ADDR); 53 void __iomem *base = MX31_IO_ADDRESS(MX31_CCM_BASE_ADDR);
53 int i; 54 int i;
55 struct device_node *np;
54 56
55 clk[dummy] = imx_clk_fixed("dummy", 0); 57 clk[dummy] = imx_clk_fixed("dummy", 0);
56 clk[ckih] = imx_clk_fixed("ckih", fref); 58 clk[ckih] = imx_clk_fixed("ckih", fref);
@@ -117,6 +119,14 @@ int __init mx31_clocks_init(unsigned long fref)
117 pr_err("imx31 clk %d: register failed with %ld\n", 119 pr_err("imx31 clk %d: register failed with %ld\n",
118 i, PTR_ERR(clk[i])); 120 i, PTR_ERR(clk[i]));
119 121
122 np = of_find_compatible_node(NULL, NULL, "fsl,imx31-ccm");
123
124 if (np) {
125 clk_data.clks = clk;
126 clk_data.clk_num = ARRAY_SIZE(clk);
127 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
128 }
129
120 clk_register_clkdev(clk[gpt_gate], "per", "imx-gpt.0"); 130 clk_register_clkdev(clk[gpt_gate], "per", "imx-gpt.0");
121 clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0"); 131 clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0");
122 clk_register_clkdev(clk[cspi1_gate], NULL, "imx31-cspi.0"); 132 clk_register_clkdev(clk[cspi1_gate], NULL, "imx31-cspi.0");
diff --git a/arch/arm/mach-imx/imx31-dt.c b/arch/arm/mach-imx/imx31-dt.c
index af476de2570e..dc083d33a758 100644
--- a/arch/arm/mach-imx/imx31-dt.c
+++ b/arch/arm/mach-imx/imx31-dt.c
@@ -18,24 +18,9 @@
18#include "common.h" 18#include "common.h"
19#include "mx31.h" 19#include "mx31.h"
20 20
21static const struct of_dev_auxdata imx31_auxdata_lookup[] __initconst = {
22 OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART1_BASE_ADDR,
23 "imx21-uart.0", NULL),
24 OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART2_BASE_ADDR,
25 "imx21-uart.1", NULL),
26 OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART3_BASE_ADDR,
27 "imx21-uart.2", NULL),
28 OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART4_BASE_ADDR,
29 "imx21-uart.3", NULL),
30 OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART5_BASE_ADDR,
31 "imx21-uart.4", NULL),
32 { /* sentinel */ }
33};
34
35static void __init imx31_dt_init(void) 21static void __init imx31_dt_init(void)
36{ 22{
37 of_platform_populate(NULL, of_default_bus_match_table, 23 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
38 imx31_auxdata_lookup, NULL);
39} 24}
40 25
41static void __init imx31_timer_init(void) 26static void __init imx31_timer_init(void)