Commit 20bef320 authored by Arnd Bergmann's avatar Arnd Bergmann

Merge tag 'renesas-fixes-for-v4.6' of...

Merge tag 'renesas-fixes-for-v4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/dt

Renesas ARM Based SoC Fixes for v4.6

* Correct preset_lpj calculation which may lead to too short delays
* Correct handling of optional clocks on r8a7791 to restore
  access to the serial port the porter board

This is a backmerge of v4.6 fixes, to avoid a merge conflict between 4.6
and our next/dt branch.

* tag 'renesas-fixes-for-v4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  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
parents d81e72c5 c531fb27
...@@ -660,6 +660,7 @@ &usbphy { ...@@ -660,6 +660,7 @@ &usbphy {
}; };
&pcie_bus_clk { &pcie_bus_clk {
clock-frequency = <100000000>;
status = "okay"; status = "okay";
}; };
......
...@@ -142,19 +142,11 @@ &extal_clk { ...@@ -142,19 +142,11 @@ &extal_clk {
}; };
&pfc { &pfc {
pinctrl-0 = <&scif_clk_pins>;
pinctrl-names = "default";
scif0_pins: serial0 { scif0_pins: serial0 {
groups = "scif0_data_d"; groups = "scif0_data_d";
function = "scif0"; function = "scif0";
}; };
scif_clk_pins: scif_clk {
groups = "scif_clk";
function = "scif_clk";
};
ether_pins: ether { ether_pins: ether {
groups = "eth_link", "eth_mdio", "eth_rmii"; groups = "eth_link", "eth_mdio", "eth_rmii";
function = "eth"; function = "eth";
...@@ -228,11 +220,6 @@ &scif0 { ...@@ -228,11 +220,6 @@ &scif0 {
status = "okay"; status = "okay";
}; };
&scif_clk {
clock-frequency = <14745600>;
status = "okay";
};
&ether { &ether {
pinctrl-0 = <&ether_pins &phy1_pins>; pinctrl-0 = <&ether_pins &phy1_pins>;
pinctrl-names = "default"; pinctrl-names = "default";
...@@ -413,6 +400,7 @@ &usbphy { ...@@ -413,6 +400,7 @@ &usbphy {
}; };
&pcie_bus_clk { &pcie_bus_clk {
clock-frequency = <100000000>;
status = "okay"; status = "okay";
}; };
......
...@@ -1079,8 +1079,7 @@ audio_clk_c: audio_clk_c { ...@@ -1079,8 +1079,7 @@ audio_clk_c: audio_clk_c {
pcie_bus_clk: pcie_bus { pcie_bus_clk: pcie_bus {
compatible = "fixed-clock"; compatible = "fixed-clock";
#clock-cells = <0>; #clock-cells = <0>;
clock-frequency = <100000000>; clock-frequency = <0>;
status = "disabled";
}; };
/* External SCIF clock */ /* External SCIF clock */
...@@ -1089,7 +1088,6 @@ scif_clk: scif { ...@@ -1089,7 +1088,6 @@ scif_clk: scif {
#clock-cells = <0>; #clock-cells = <0>;
/* This value must be overridden by the board. */ /* This value must be overridden by the board. */
clock-frequency = <0>; clock-frequency = <0>;
status = "disabled";
}; };
/* External USB clock - can be overridden by the board */ /* External USB clock - can be overridden by the board */
...@@ -1105,7 +1103,6 @@ can_clk: can_clk { ...@@ -1105,7 +1103,6 @@ can_clk: can_clk {
#clock-cells = <0>; #clock-cells = <0>;
/* This value must be overridden by the board. */ /* This value must be overridden by the board. */
clock-frequency = <0>; clock-frequency = <0>;
status = "disabled";
}; };
/* Special CPG clocks */ /* Special CPG clocks */
......
...@@ -40,8 +40,7 @@ static void __init shmobile_setup_delay_hz(unsigned int max_cpu_core_hz, ...@@ -40,8 +40,7 @@ static void __init shmobile_setup_delay_hz(unsigned int max_cpu_core_hz,
void __init shmobile_init_delay(void) void __init shmobile_init_delay(void)
{ {
struct device_node *np, *cpus; struct device_node *np, *cpus;
bool is_a7_a8_a9 = false; unsigned int div = 0;
bool is_a15 = false;
bool has_arch_timer = false; bool has_arch_timer = false;
u32 max_freq = 0; u32 max_freq = 0;
...@@ -55,27 +54,22 @@ void __init shmobile_init_delay(void) ...@@ -55,27 +54,22 @@ void __init shmobile_init_delay(void)
if (!of_property_read_u32(np, "clock-frequency", &freq)) if (!of_property_read_u32(np, "clock-frequency", &freq))
max_freq = max(max_freq, freq); max_freq = max(max_freq, freq);
if (of_device_is_compatible(np, "arm,cortex-a8") || if (of_device_is_compatible(np, "arm,cortex-a8")) {
of_device_is_compatible(np, "arm,cortex-a9")) { div = 2;
is_a7_a8_a9 = true; } else if (of_device_is_compatible(np, "arm,cortex-a9")) {
} else if (of_device_is_compatible(np, "arm,cortex-a7")) { div = 1;
is_a7_a8_a9 = true; } else if (of_device_is_compatible(np, "arm,cortex-a7") ||
has_arch_timer = true; of_device_is_compatible(np, "arm,cortex-a15")) {
} else if (of_device_is_compatible(np, "arm,cortex-a15")) { div = 1;
is_a15 = true;
has_arch_timer = true; has_arch_timer = true;
} }
} }
of_node_put(cpus); of_node_put(cpus);
if (!max_freq) if (!max_freq || !div)
return; return;
if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) { if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER))
if (is_a7_a8_a9) shmobile_setup_delay_hz(max_freq, 1, div);
shmobile_setup_delay_hz(max_freq, 1, 3);
else if (is_a15)
shmobile_setup_delay_hz(max_freq, 2, 4);
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment