diff options
author | Rob Herring <rob.herring@calxeda.com> | 2012-03-13 19:19:19 -0400 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2012-07-11 20:58:47 -0400 |
commit | 8d4d9f52081cd45bde42b9452eba95f38feb7dae (patch) | |
tree | 81b614f5f842150c910737a9e1f5414de3b49b4b /arch/arm/mach-highbank | |
parent | 260b6aa03edd87a3a85c137e7b95305d9eb40485 (diff) |
clk: add highbank clock support
This adds real clock support to Calxeda Highbank SOC using the common
clock infrastructure.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
[mturquette@linaro.org: fixed up invalid writes to const struct member]
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'arch/arm/mach-highbank')
-rw-r--r-- | arch/arm/mach-highbank/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-highbank/clock.c | 62 | ||||
-rw-r--r-- | arch/arm/mach-highbank/highbank.c | 7 |
3 files changed, 8 insertions, 63 deletions
diff --git a/arch/arm/mach-highbank/Makefile b/arch/arm/mach-highbank/Makefile index ded4652ada80..3ec8bdd25d09 100644 --- a/arch/arm/mach-highbank/Makefile +++ b/arch/arm/mach-highbank/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | obj-y := clock.o highbank.o system.o smc.o | 1 | obj-y := highbank.o system.o smc.o |
2 | 2 | ||
3 | plus_sec := $(call as-instr,.arch_extension sec,+sec) | 3 | plus_sec := $(call as-instr,.arch_extension sec,+sec) |
4 | AFLAGS_smc.o :=-Wa,-march=armv7-a$(plus_sec) | 4 | AFLAGS_smc.o :=-Wa,-march=armv7-a$(plus_sec) |
diff --git a/arch/arm/mach-highbank/clock.c b/arch/arm/mach-highbank/clock.c deleted file mode 100644 index c25a2ae4fde1..000000000000 --- a/arch/arm/mach-highbank/clock.c +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2011 Calxeda, Inc. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along with | ||
14 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | #include <linux/module.h> | ||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/errno.h> | ||
19 | #include <linux/clk.h> | ||
20 | #include <linux/clkdev.h> | ||
21 | |||
22 | struct clk { | ||
23 | unsigned long rate; | ||
24 | }; | ||
25 | |||
26 | int clk_enable(struct clk *clk) | ||
27 | { | ||
28 | return 0; | ||
29 | } | ||
30 | |||
31 | void clk_disable(struct clk *clk) | ||
32 | {} | ||
33 | |||
34 | unsigned long clk_get_rate(struct clk *clk) | ||
35 | { | ||
36 | return clk->rate; | ||
37 | } | ||
38 | |||
39 | long clk_round_rate(struct clk *clk, unsigned long rate) | ||
40 | { | ||
41 | return clk->rate; | ||
42 | } | ||
43 | |||
44 | int clk_set_rate(struct clk *clk, unsigned long rate) | ||
45 | { | ||
46 | return 0; | ||
47 | } | ||
48 | |||
49 | static struct clk eclk = { .rate = 200000000 }; | ||
50 | static struct clk pclk = { .rate = 150000000 }; | ||
51 | |||
52 | static struct clk_lookup lookups[] = { | ||
53 | { .clk = &pclk, .con_id = "apb_pclk", }, | ||
54 | { .clk = &pclk, .dev_id = "sp804", }, | ||
55 | { .clk = &eclk, .dev_id = "ffe0e000.sdhci", }, | ||
56 | { .clk = &pclk, .dev_id = "fff36000.serial", }, | ||
57 | }; | ||
58 | |||
59 | void __init highbank_clocks_init(void) | ||
60 | { | ||
61 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
62 | } | ||
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index 8777612b1a42..d75b0a78d88a 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c | |||
@@ -105,6 +105,11 @@ static void __init highbank_init_irq(void) | |||
105 | #endif | 105 | #endif |
106 | } | 106 | } |
107 | 107 | ||
108 | static struct clk_lookup lookup = { | ||
109 | .dev_id = "sp804", | ||
110 | .con_id = NULL, | ||
111 | }; | ||
112 | |||
108 | static void __init highbank_timer_init(void) | 113 | static void __init highbank_timer_init(void) |
109 | { | 114 | { |
110 | int irq; | 115 | int irq; |
@@ -122,6 +127,8 @@ static void __init highbank_timer_init(void) | |||
122 | irq = irq_of_parse_and_map(np, 0); | 127 | irq = irq_of_parse_and_map(np, 0); |
123 | 128 | ||
124 | highbank_clocks_init(); | 129 | highbank_clocks_init(); |
130 | lookup.clk = of_clk_get(np, 0); | ||
131 | clkdev_add(&lookup); | ||
125 | 132 | ||
126 | sp804_clocksource_and_sched_clock_init(timer_base + 0x20, "timer1"); | 133 | sp804_clocksource_and_sched_clock_init(timer_base + 0x20, "timer1"); |
127 | sp804_clockevents_init(timer_base, irq, "timer0"); | 134 | sp804_clockevents_init(timer_base, irq, "timer0"); |