aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-04-16 15:38:29 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-05-12 15:49:56 -0400
commit6e2b07a172b6ed98c7cdc301333b2d9f86c11880 (patch)
treedcc6d0272e2f168364b0a5ec69f0ff8f4fabbd9e
parentc7785ea0d279322bf92107d9a4fee195f5148c08 (diff)
ARM: nomadik: convert all clocks except timer to dt
This moves all Nomadik clocks except the one used for the timer/clocksource over to the device tree. Acked-by: Mike Turquette <mturquette@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--Documentation/devicetree/bindings/arm/ste-nomadik.txt5
-rw-r--r--arch/arm/boot/dts/ste-nomadik-stn8815.dtsi54
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c20
-rw-r--r--drivers/clk/clk-nomadik.c26
4 files changed, 68 insertions, 37 deletions
diff --git a/Documentation/devicetree/bindings/arm/ste-nomadik.txt b/Documentation/devicetree/bindings/arm/ste-nomadik.txt
index 19bca04b81c9..6256ec31666d 100644
--- a/Documentation/devicetree/bindings/arm/ste-nomadik.txt
+++ b/Documentation/devicetree/bindings/arm/ste-nomadik.txt
@@ -3,6 +3,11 @@ ST-Ericsson Nomadik Device Tree Bindings
3For various board the "board" node may contain specific properties 3For various board the "board" node may contain specific properties
4that pertain to this particular board, such as board-specific GPIOs. 4that pertain to this particular board, such as board-specific GPIOs.
5 5
6Required root node property: src
7- Nomadik System and reset controller used for basic chip control, clock
8 and reset line control.
9- compatible: must be "stericsson,nomadik,src"
10
6Boards with the Nomadik SoC include: 11Boards with the Nomadik SoC include:
7 12
8S8815 "MiniKit" manufactured by Calao Systems: 13S8815 "MiniKit" manufactured by Calao Systems:
diff --git a/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi b/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
index 4a4aab395141..f0df9482cb6f 100644
--- a/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
+++ b/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
@@ -45,6 +45,7 @@
45 gpio-controller; 45 gpio-controller;
46 #gpio-cells = <2>; 46 #gpio-cells = <2>;
47 gpio-bank = <0>; 47 gpio-bank = <0>;
48 clocks = <&pclk>;
48 }; 49 };
49 50
50 gpio1: gpio@101e5000 { 51 gpio1: gpio@101e5000 {
@@ -57,6 +58,7 @@
57 gpio-controller; 58 gpio-controller;
58 #gpio-cells = <2>; 59 #gpio-cells = <2>;
59 gpio-bank = <1>; 60 gpio-bank = <1>;
61 clocks = <&pclk>;
60 }; 62 };
61 63
62 gpio2: gpio@101e6000 { 64 gpio2: gpio@101e6000 {
@@ -69,6 +71,7 @@
69 gpio-controller; 71 gpio-controller;
70 #gpio-cells = <2>; 72 #gpio-cells = <2>;
71 gpio-bank = <2>; 73 gpio-bank = <2>;
74 clocks = <&pclk>;
72 }; 75 };
73 76
74 gpio3: gpio@101e7000 { 77 gpio3: gpio@101e7000 {
@@ -81,12 +84,50 @@
81 gpio-controller; 84 gpio-controller;
82 #gpio-cells = <2>; 85 #gpio-cells = <2>;
83 gpio-bank = <3>; 86 gpio-bank = <3>;
87 clocks = <&pclk>;
84 }; 88 };
85 89
86 pinctrl { 90 pinctrl {
87 compatible = "stericsson,nmk-pinctrl-stn8815"; 91 compatible = "stericsson,nmk-pinctrl-stn8815";
88 }; 92 };
89 93
94 src: src@101e0000 {
95 compatible = "stericsson,nomadik-src";
96 reg = <0x101e0000 0x1000>;
97 clocks {
98 /*
99 * Dummy clock for primecells
100 */
101 pclk: pclk@0 {
102 #clock-cells = <0>;
103 compatible = "fixed-clock";
104 clock-frequency = <2400000>;
105 };
106 /*
107 * The 2.4 MHz TIMCLK reference clock is active at
108 * boot time, this is actually the MXTALCLK @19.2 MHz
109 * divided by 8. This clock is used by the timers and
110 * watchdog. See page 105 ff.
111 */
112 timclk: timclk@2.4M {
113 #clock-cells = <0>;
114 compatible = "fixed-clock";
115 clock-frequency = <2400000>;
116 };
117 /*
118 * At boot time, PLL2 is set to generate a set of
119 * fixed clocks, one of them is CLK48, the 48 MHz
120 * clock, routed to the UART, MMC/SD, I2C, IrDA,
121 * USB and SSP blocks.
122 */
123 clk48: clk48@48M {
124 #clock-cells = <0>;
125 compatible = "fixed-clock";
126 clock-frequency = <48000000>;
127 };
128 };
129 };
130
90 /* A NAND flash of 128 MiB */ 131 /* A NAND flash of 128 MiB */
91 fsmc: flash@40000000 { 132 fsmc: flash@40000000 {
92 compatible = "stericsson,fsmc-nand"; 133 compatible = "stericsson,fsmc-nand";
@@ -97,6 +138,7 @@
97 <0x41000000 0x2000>, /* NAND Base ADDR */ 138 <0x41000000 0x2000>, /* NAND Base ADDR */
98 <0x40800000 0x2000>; /* NAND Base CMD */ 139 <0x40800000 0x2000>; /* NAND Base CMD */
99 reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd"; 140 reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
141 clocks = <&pclk>;
100 status = "okay"; 142 status = "okay";
101 143
102 partition@0 { 144 partition@0 {
@@ -211,6 +253,8 @@
211 reg = <0x101fd000 0x1000>; 253 reg = <0x101fd000 0x1000>;
212 interrupt-parent = <&vica>; 254 interrupt-parent = <&vica>;
213 interrupts = <12>; 255 interrupts = <12>;
256 clocks = <&clk48>, <&pclk>;
257 clock-names = "uartclk", "apb_pclk";
214 }; 258 };
215 259
216 uart1: uart@101fb000 { 260 uart1: uart@101fb000 {
@@ -218,6 +262,8 @@
218 reg = <0x101fb000 0x1000>; 262 reg = <0x101fb000 0x1000>;
219 interrupt-parent = <&vica>; 263 interrupt-parent = <&vica>;
220 interrupts = <17>; 264 interrupts = <17>;
265 clocks = <&clk48>, <&pclk>;
266 clock-names = "uartclk", "apb_pclk";
221 }; 267 };
222 268
223 uart2: uart@101f2000 { 269 uart2: uart@101f2000 {
@@ -225,17 +271,23 @@
225 reg = <0x101f2000 0x1000>; 271 reg = <0x101f2000 0x1000>;
226 interrupt-parent = <&vica>; 272 interrupt-parent = <&vica>;
227 interrupts = <28>; 273 interrupts = <28>;
274 clocks = <&clk48>, <&pclk>;
275 clock-names = "uartclk", "apb_pclk";
228 status = "disabled"; 276 status = "disabled";
229 }; 277 };
230 278
231 rng: rng@101b0000 { 279 rng: rng@101b0000 {
232 compatible = "arm,primecell"; 280 compatible = "arm,primecell";
233 reg = <0x101b0000 0x1000>; 281 reg = <0x101b0000 0x1000>;
282 clocks = <&clk48>, <&pclk>;
283 clock-names = "rng", "apb_pclk";
234 }; 284 };
235 285
236 rtc: rtc@101e8000 { 286 rtc: rtc@101e8000 {
237 compatible = "arm,pl031", "arm,primecell"; 287 compatible = "arm,pl031", "arm,primecell";
238 reg = <0x101e8000 0x1000>; 288 reg = <0x101e8000 0x1000>;
289 clocks = <&pclk>;
290 clock-names = "apb_pclk";
239 interrupt-parent = <&vica>; 291 interrupt-parent = <&vica>;
240 interrupts = <10>; 292 interrupts = <10>;
241 }; 293 };
@@ -243,6 +295,8 @@
243 mmcsd: sdi@101f6000 { 295 mmcsd: sdi@101f6000 {
244 compatible = "arm,pl18x", "arm,primecell"; 296 compatible = "arm,pl18x", "arm,primecell";
245 reg = <0x101f6000 0x1000>; 297 reg = <0x101f6000 0x1000>;
298 clocks = <&clk48>, <&pclk>;
299 clock-names = "mclk", "apb_pclk";
246 interrupt-parent = <&vica>; 300 interrupt-parent = <&vica>;
247 interrupts = <22>; 301 interrupts = <22>;
248 max-frequency = <48000000>; 302 max-frequency = <48000000>;
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index 59f6ff5c9bae..0e2c5e0cd65e 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -280,28 +280,12 @@ device_initcall(cpu8815_mmcsd_init);
280 280
281/* These are mostly to get the right device names for the clock lookups */ 281/* These are mostly to get the right device names for the clock lookups */
282static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = { 282static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = {
283 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO0_BASE,
284 "gpio.0", NULL),
285 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO1_BASE,
286 "gpio.1", NULL),
287 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO2_BASE,
288 "gpio.2", NULL),
289 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO3_BASE,
290 "gpio.3", NULL),
291 OF_DEV_AUXDATA("stericsson,nmk-pinctrl-stn8815", 0, 283 OF_DEV_AUXDATA("stericsson,nmk-pinctrl-stn8815", 0,
292 "pinctrl-stn8815", NULL), 284 "pinctrl-stn8815", NULL),
293 OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART0_BASE,
294 "uart0", NULL),
295 OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART1_BASE,
296 "uart1", NULL),
297 OF_DEV_AUXDATA("arm,primecell", NOMADIK_RNG_BASE,
298 "rng", NULL),
299 OF_DEV_AUXDATA("arm,primecell", NOMADIK_RTC_BASE,
300 "rtc-pl031", NULL),
301 OF_DEV_AUXDATA("stericsson,fsmc-nand", NOMADIK_FSMC_BASE, 285 OF_DEV_AUXDATA("stericsson,fsmc-nand", NOMADIK_FSMC_BASE,
302 "fsmc-nand", &cpu8815_nand_data), 286 NULL, &cpu8815_nand_data),
303 OF_DEV_AUXDATA("arm,primecell", NOMADIK_SDI_BASE, 287 OF_DEV_AUXDATA("arm,primecell", NOMADIK_SDI_BASE,
304 "mmci", &mmcsd_plat_data), 288 NULL, &mmcsd_plat_data),
305 { /* sentinel */ }, 289 { /* sentinel */ },
306}; 290};
307 291
diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c
index 6b4c70f7d23d..19f197ccf28d 100644
--- a/drivers/clk/clk-nomadik.c
+++ b/drivers/clk/clk-nomadik.c
@@ -3,24 +3,24 @@
3#include <linux/err.h> 3#include <linux/err.h>
4#include <linux/io.h> 4#include <linux/io.h>
5#include <linux/clk-provider.h> 5#include <linux/clk-provider.h>
6#include <linux/of.h>
6 7
7/* 8/*
8 * The Nomadik clock tree is described in the STN8815A12 DB V4.2 9 * The Nomadik clock tree is described in the STN8815A12 DB V4.2
9 * reference manual for the chip, page 94 ff. 10 * reference manual for the chip, page 94 ff.
10 */ 11 */
11 12
13static const __initconst struct of_device_id cpu8815_clk_match[] = {
14 { .compatible = "fixed-clock", .data = of_fixed_clk_setup, },
15 { /* sentinel */ }
16};
17
12void __init nomadik_clk_init(void) 18void __init nomadik_clk_init(void)
13{ 19{
14 struct clk *clk; 20 struct clk *clk;
15 21
16 clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, CLK_IS_ROOT, 0); 22 clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, CLK_IS_ROOT, 0);
17 clk_register_clkdev(clk, "apb_pclk", NULL); 23 clk_register_clkdev(clk, "apb_pclk", NULL);
18 clk_register_clkdev(clk, NULL, "gpio.0");
19 clk_register_clkdev(clk, NULL, "gpio.1");
20 clk_register_clkdev(clk, NULL, "gpio.2");
21 clk_register_clkdev(clk, NULL, "gpio.3");
22 clk_register_clkdev(clk, NULL, "rng");
23 clk_register_clkdev(clk, NULL, "fsmc-nand");
24 24
25 /* 25 /*
26 * The 2.4 MHz TIMCLK reference clock is active at boot time, this is 26 * The 2.4 MHz TIMCLK reference clock is active at boot time, this is
@@ -32,17 +32,5 @@ void __init nomadik_clk_init(void)
32 clk_register_clkdev(clk, NULL, "mtu0"); 32 clk_register_clkdev(clk, NULL, "mtu0");
33 clk_register_clkdev(clk, NULL, "mtu1"); 33 clk_register_clkdev(clk, NULL, "mtu1");
34 34
35 /* 35 of_clk_init(cpu8815_clk_match);
36 * At boot time, PLL2 is set to generate a set of fixed clocks,
37 * one of them is CLK48, the 48 MHz clock, routed to the UART, MMC/SD
38 * I2C, IrDA, USB and SSP blocks.
39 */
40 clk = clk_register_fixed_rate(NULL, "CLK48", NULL, CLK_IS_ROOT,
41 48000000);
42 clk_register_clkdev(clk, NULL, "uart0");
43 clk_register_clkdev(clk, NULL, "uart1");
44 clk_register_clkdev(clk, NULL, "mmci");
45 clk_register_clkdev(clk, NULL, "ssp");
46 clk_register_clkdev(clk, NULL, "nmk-i2c.0");
47 clk_register_clkdev(clk, NULL, "nmk-i2c.1");
48} 36}