aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-04-25 18:10:37 -0400
committerArnd Bergmann <arnd@arndb.de>2016-04-25 18:10:37 -0400
commita3003158b14d0d7eccbb957a1a449d80bcf05f93 (patch)
treee9a18803206375536c50391aa3e0f408d466b845
parent7d912ba2948a60d5f334b74d6485a1e57fd0ecf2 (diff)
parenta4b8c18c40704c28be62af4606cc6758c9ff3dba (diff)
Merge tag 'renesas-soc-for-v4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/soc
Merge "Renesas ARM Based SoC Updates for v4.7" from Simon Horman: Drop support for Cortex A8 in timer code * tag 'renesas-soc-for-v4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: ARM: shmobile: timer: Drop support for Cortex A8 ARM: shmobile: timer: Fix preset_lpj leading to too short delays Revert "ARM: dts: porter: Enable SCIF_CLK frequency and pins" ARM: dts: r8a7791: Don't disable referenced optional clocks
-rw-r--r--arch/arm/boot/dts/r8a7791-koelsch.dts1
-rw-r--r--arch/arm/boot/dts/r8a7791-porter.dts14
-rw-r--r--arch/arm/boot/dts/r8a7791.dtsi5
-rw-r--r--arch/arm/mach-shmobile/timer.c56
4 files changed, 22 insertions, 54 deletions
diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
index 0ad71b81d3a2..cc6e28f81fe4 100644
--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
+++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
@@ -661,6 +661,7 @@
661}; 661};
662 662
663&pcie_bus_clk { 663&pcie_bus_clk {
664 clock-frequency = <100000000>;
664 status = "okay"; 665 status = "okay";
665}; 666};
666 667
diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts
index 6c08314427d6..a9285d9a57cd 100644
--- a/arch/arm/boot/dts/r8a7791-porter.dts
+++ b/arch/arm/boot/dts/r8a7791-porter.dts
@@ -143,19 +143,11 @@
143}; 143};
144 144
145&pfc { 145&pfc {
146 pinctrl-0 = <&scif_clk_pins>;
147 pinctrl-names = "default";
148
149 scif0_pins: serial0 { 146 scif0_pins: serial0 {
150 renesas,groups = "scif0_data_d"; 147 renesas,groups = "scif0_data_d";
151 renesas,function = "scif0"; 148 renesas,function = "scif0";
152 }; 149 };
153 150
154 scif_clk_pins: scif_clk {
155 renesas,groups = "scif_clk";
156 renesas,function = "scif_clk";
157 };
158
159 ether_pins: ether { 151 ether_pins: ether {
160 renesas,groups = "eth_link", "eth_mdio", "eth_rmii"; 152 renesas,groups = "eth_link", "eth_mdio", "eth_rmii";
161 renesas,function = "eth"; 153 renesas,function = "eth";
@@ -229,11 +221,6 @@
229 status = "okay"; 221 status = "okay";
230}; 222};
231 223
232&scif_clk {
233 clock-frequency = <14745600>;
234 status = "okay";
235};
236
237&ether { 224&ether {
238 pinctrl-0 = <&ether_pins &phy1_pins>; 225 pinctrl-0 = <&ether_pins &phy1_pins>;
239 pinctrl-names = "default"; 226 pinctrl-names = "default";
@@ -414,6 +401,7 @@
414}; 401};
415 402
416&pcie_bus_clk { 403&pcie_bus_clk {
404 clock-frequency = <100000000>;
417 status = "okay"; 405 status = "okay";
418}; 406};
419 407
diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 6439f0569fe2..1cd1b6a3a72a 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -1083,9 +1083,8 @@
1083 pcie_bus_clk: pcie_bus_clk { 1083 pcie_bus_clk: pcie_bus_clk {
1084 compatible = "fixed-clock"; 1084 compatible = "fixed-clock";
1085 #clock-cells = <0>; 1085 #clock-cells = <0>;
1086 clock-frequency = <100000000>; 1086 clock-frequency = <0>;
1087 clock-output-names = "pcie_bus"; 1087 clock-output-names = "pcie_bus";
1088 status = "disabled";
1089 }; 1088 };
1090 1089
1091 /* External SCIF clock */ 1090 /* External SCIF clock */
@@ -1094,7 +1093,6 @@
1094 #clock-cells = <0>; 1093 #clock-cells = <0>;
1095 /* This value must be overridden by the board. */ 1094 /* This value must be overridden by the board. */
1096 clock-frequency = <0>; 1095 clock-frequency = <0>;
1097 status = "disabled";
1098 }; 1096 };
1099 1097
1100 /* External USB clock - can be overridden by the board */ 1098 /* External USB clock - can be overridden by the board */
@@ -1112,7 +1110,6 @@
1112 /* This value must be overridden by the board. */ 1110 /* This value must be overridden by the board. */
1113 clock-frequency = <0>; 1111 clock-frequency = <0>;
1114 clock-output-names = "can_clk"; 1112 clock-output-names = "can_clk";
1115 status = "disabled";
1116 }; 1113 };
1117 1114
1118 /* Special CPG clocks */ 1115 /* Special CPG clocks */
diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c
index ad008e4b0c49..6196a6380385 100644
--- a/arch/arm/mach-shmobile/timer.c
+++ b/arch/arm/mach-shmobile/timer.c
@@ -20,29 +20,9 @@
20 20
21#include "common.h" 21#include "common.h"
22 22
23static void __init shmobile_setup_delay_hz(unsigned int max_cpu_core_hz,
24 unsigned int mult, unsigned int div)
25{
26 /* calculate a worst-case loops-per-jiffy value
27 * based on maximum cpu core hz setting and the
28 * __delay() implementation in arch/arm/lib/delay.S
29 *
30 * this will result in a longer delay than expected
31 * when the cpu core runs on lower frequencies.
32 */
33
34 unsigned int value = HZ * div / mult;
35
36 if (!preset_lpj)
37 preset_lpj = max_cpu_core_hz / value;
38}
39
40void __init shmobile_init_delay(void) 23void __init shmobile_init_delay(void)
41{ 24{
42 struct device_node *np, *cpus; 25 struct device_node *np, *cpus;
43 bool is_a7_a8_a9 = false;
44 bool is_a15 = false;
45 bool has_arch_timer = false;
46 u32 max_freq = 0; 26 u32 max_freq = 0;
47 27
48 cpus = of_find_node_by_path("/cpus"); 28 cpus = of_find_node_by_path("/cpus");
@@ -52,19 +32,16 @@ void __init shmobile_init_delay(void)
52 for_each_child_of_node(cpus, np) { 32 for_each_child_of_node(cpus, np) {
53 u32 freq; 33 u32 freq;
54 34
35 if (IS_ENABLED(CONFIG_ARM_ARCH_TIMER) &&
36 (of_device_is_compatible(np, "arm,cortex-a7") ||
37 of_device_is_compatible(np, "arm,cortex-a15"))) {
38 of_node_put(np);
39 of_node_put(cpus);
40 return;
41 }
42
55 if (!of_property_read_u32(np, "clock-frequency", &freq)) 43 if (!of_property_read_u32(np, "clock-frequency", &freq))
56 max_freq = max(max_freq, freq); 44 max_freq = max(max_freq, freq);
57
58 if (of_device_is_compatible(np, "arm,cortex-a8") ||
59 of_device_is_compatible(np, "arm,cortex-a9")) {
60 is_a7_a8_a9 = true;
61 } else if (of_device_is_compatible(np, "arm,cortex-a7")) {
62 is_a7_a8_a9 = true;
63 has_arch_timer = true;
64 } else if (of_device_is_compatible(np, "arm,cortex-a15")) {
65 is_a15 = true;
66 has_arch_timer = true;
67 }
68 } 45 }
69 46
70 of_node_put(cpus); 47 of_node_put(cpus);
@@ -72,10 +49,15 @@ void __init shmobile_init_delay(void)
72 if (!max_freq) 49 if (!max_freq)
73 return; 50 return;
74 51
75 if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) { 52 /*
76 if (is_a7_a8_a9) 53 * Calculate a worst-case loops-per-jiffy value
77 shmobile_setup_delay_hz(max_freq, 1, 3); 54 * based on maximum cpu core hz setting and the
78 else if (is_a15) 55 * __delay() implementation in arch/arm/lib/delay.S.
79 shmobile_setup_delay_hz(max_freq, 2, 4); 56 *
80 } 57 * This will result in a longer delay than expected
58 * when the cpu core runs on lower frequencies.
59 */
60
61 if (!preset_lpj)
62 preset_lpj = max_freq / HZ;
81} 63}