diff options
| author | Michal Simek <michal.simek@xilinx.com> | 2013-12-18 11:18:48 -0500 |
|---|---|---|
| committer | Michal Simek <michal.simek@xilinx.com> | 2014-01-27 05:24:55 -0500 |
| commit | c1120542b99a67a620cd8a298975d76dca5a13f0 (patch) | |
| tree | 942aaf1e8d3d0c08a3cdbee5316f14dd4a901083 /arch/microblaze/kernel/cpu | |
| parent | 21ecc1f1d2e01ddbd75c3db208236628474a43e1 (diff) | |
microblaze: Add support for CCF
Add support for CCF for Microblaze.
Old binding:
system_timer: system-timer@41c00000 {
clock-frequency = <75000000>;
...
}
New binding:
system_timer: system-timer@41c00000 {
clocks = <&clk_bus>;
...
}
Both should be supported for a while
Microblaze clock binding:
clocks {
#address-cells = <1>;
#size-cells = <0>;
clk_bus: bus {
#clock-cells = <0>;
clock-frequency = <75000000>;
clock-output-names = "bus";
compatible = "fixed-clock";
reg = <1>;
} ;
clk_cpu: cpu {
#clock-cells = <0>;
clock-frequency = <75000000>;
clock-output-names = "cpu";
compatible = "fixed-clock";
reg = <0>;
} ;
} ;
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'arch/microblaze/kernel/cpu')
| -rw-r--r-- | arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c | 3 | ||||
| -rw-r--r-- | arch/microblaze/kernel/cpu/cpuinfo-static.c | 2 | ||||
| -rw-r--r-- | arch/microblaze/kernel/cpu/cpuinfo.c | 23 |
3 files changed, 21 insertions, 7 deletions
diff --git a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c index ee4689415410..93c26cf50de5 100644 --- a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c +++ b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c | |||
| @@ -112,7 +112,4 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu) | |||
| 112 | CI(num_wr_brk, NUMBER_OF_WR_ADDR_BRK); | 112 | CI(num_wr_brk, NUMBER_OF_WR_ADDR_BRK); |
| 113 | 113 | ||
| 114 | CI(fpga_family_code, TARGET_FAMILY); | 114 | CI(fpga_family_code, TARGET_FAMILY); |
| 115 | |||
| 116 | /* take timebase-frequency from DTS */ | ||
| 117 | ci->cpu_clock_freq = fcpu(cpu, "timebase-frequency"); | ||
| 118 | } | 115 | } |
diff --git a/arch/microblaze/kernel/cpu/cpuinfo-static.c b/arch/microblaze/kernel/cpu/cpuinfo-static.c index 592bb2e838c4..4854285b26e7 100644 --- a/arch/microblaze/kernel/cpu/cpuinfo-static.c +++ b/arch/microblaze/kernel/cpu/cpuinfo-static.c | |||
| @@ -113,8 +113,6 @@ void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu) | |||
| 113 | ci->num_rd_brk = fcpu(cpu, "xlnx,number-of-rd-addr-brk"); | 113 | ci->num_rd_brk = fcpu(cpu, "xlnx,number-of-rd-addr-brk"); |
| 114 | ci->num_wr_brk = fcpu(cpu, "xlnx,number-of-wr-addr-brk"); | 114 | ci->num_wr_brk = fcpu(cpu, "xlnx,number-of-wr-addr-brk"); |
| 115 | 115 | ||
| 116 | ci->cpu_clock_freq = fcpu(cpu, "timebase-frequency"); | ||
| 117 | |||
| 118 | ci->pvr_user1 = fcpu(cpu, "xlnx,pvr-user1"); | 116 | ci->pvr_user1 = fcpu(cpu, "xlnx,pvr-user1"); |
| 119 | ci->pvr_user2 = fcpu(cpu, "xlnx,pvr-user2"); | 117 | ci->pvr_user2 = fcpu(cpu, "xlnx,pvr-user2"); |
| 120 | 118 | ||
diff --git a/arch/microblaze/kernel/cpu/cpuinfo.c b/arch/microblaze/kernel/cpu/cpuinfo.c index c9203b1007aa..ce1cfed731ea 100644 --- a/arch/microblaze/kernel/cpu/cpuinfo.c +++ b/arch/microblaze/kernel/cpu/cpuinfo.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | * for more details. | 8 | * for more details. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include <linux/clk.h> | ||
| 11 | #include <linux/init.h> | 12 | #include <linux/init.h> |
| 12 | #include <asm/cpuinfo.h> | 13 | #include <asm/cpuinfo.h> |
| 13 | #include <asm/pvr.h> | 14 | #include <asm/pvr.h> |
| @@ -68,11 +69,10 @@ const struct family_string_key family_string_lookup[] = { | |||
| 68 | }; | 69 | }; |
| 69 | 70 | ||
| 70 | struct cpuinfo cpuinfo; | 71 | struct cpuinfo cpuinfo; |
| 72 | static struct device_node *cpu; | ||
| 71 | 73 | ||
| 72 | void __init setup_cpuinfo(void) | 74 | void __init setup_cpuinfo(void) |
| 73 | { | 75 | { |
| 74 | struct device_node *cpu = NULL; | ||
| 75 | |||
| 76 | cpu = (struct device_node *) of_find_node_by_type(NULL, "cpu"); | 76 | cpu = (struct device_node *) of_find_node_by_type(NULL, "cpu"); |
| 77 | if (!cpu) | 77 | if (!cpu) |
| 78 | pr_err("You don't have cpu!!!\n"); | 78 | pr_err("You don't have cpu!!!\n"); |
| @@ -102,3 +102,22 @@ void __init setup_cpuinfo(void) | |||
| 102 | pr_warn("%s: Stream instructions enabled" | 102 | pr_warn("%s: Stream instructions enabled" |
| 103 | " - USERSPACE CAN LOCK THIS KERNEL!\n", __func__); | 103 | " - USERSPACE CAN LOCK THIS KERNEL!\n", __func__); |
| 104 | } | 104 | } |
| 105 | |||
| 106 | void __init setup_cpuinfo_clk(void) | ||
| 107 | { | ||
| 108 | struct clk *clk; | ||
| 109 | |||
| 110 | clk = of_clk_get(cpu, 0); | ||
| 111 | if (IS_ERR(clk)) { | ||
| 112 | pr_err("ERROR: CPU CCF input clock not found\n"); | ||
| 113 | /* take timebase-frequency from DTS */ | ||
| 114 | cpuinfo.cpu_clock_freq = fcpu(cpu, "timebase-frequency"); | ||
| 115 | } else { | ||
| 116 | cpuinfo.cpu_clock_freq = clk_get_rate(clk); | ||
| 117 | } | ||
| 118 | |||
| 119 | if (!cpuinfo.cpu_clock_freq) { | ||
| 120 | pr_err("ERROR: CPU clock frequency not setup\n"); | ||
| 121 | BUG(); | ||
| 122 | } | ||
| 123 | } | ||
