Skip to content

Commit

Permalink
Merge branch 'renesas/fixes-2' into next/dt64
Browse files Browse the repository at this point in the history
This merges fixes from linux-4.6 into the next/dt64 tree to avoid
a later merge conflict.

* renesas/fixes-2:
  arm64: dts: r8a7795: Don't disable referenced optional scif clock
  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
  • Loading branch information
Arnd Bergmann committed May 10, 2016
2 parents d6a58a5 + f5515f9 commit 41caed5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 34 deletions.
1 change: 1 addition & 0 deletions arch/arm/boot/dts/r8a7791-koelsch.dts
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@
};

&pcie_bus_clk {
clock-frequency = <100000000>;
status = "okay";
};

Expand Down
14 changes: 1 addition & 13 deletions arch/arm/boot/dts/r8a7791-porter.dts
Original file line number Diff line number Diff line change
Expand Up @@ -143,19 +143,11 @@
};

&pfc {
pinctrl-0 = <&scif_clk_pins>;
pinctrl-names = "default";

scif0_pins: serial0 {
renesas,groups = "scif0_data_d";
renesas,function = "scif0";
};

scif_clk_pins: scif_clk {
renesas,groups = "scif_clk";
renesas,function = "scif_clk";
};

ether_pins: ether {
renesas,groups = "eth_link", "eth_mdio", "eth_rmii";
renesas,function = "eth";
Expand Down Expand Up @@ -229,11 +221,6 @@
status = "okay";
};

&scif_clk {
clock-frequency = <14745600>;
status = "okay";
};

&ether {
pinctrl-0 = <&ether_pins &phy1_pins>;
pinctrl-names = "default";
Expand Down Expand Up @@ -414,6 +401,7 @@
};

&pcie_bus_clk {
clock-frequency = <100000000>;
status = "okay";
};

Expand Down
5 changes: 1 addition & 4 deletions arch/arm/boot/dts/r8a7791.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -1083,9 +1083,8 @@
pcie_bus_clk: pcie_bus_clk {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <100000000>;
clock-frequency = <0>;
clock-output-names = "pcie_bus";
status = "disabled";
};

/* External SCIF clock */
Expand All @@ -1094,7 +1093,6 @@
#clock-cells = <0>;
/* This value must be overridden by the board. */
clock-frequency = <0>;
status = "disabled";
};

/* External USB clock - can be overridden by the board */
Expand All @@ -1112,7 +1110,6 @@
/* This value must be overridden by the board. */
clock-frequency = <0>;
clock-output-names = "can_clk";
status = "disabled";
};

/* Special CPG clocks */
Expand Down
28 changes: 11 additions & 17 deletions arch/arm/mach-shmobile/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ static void __init shmobile_setup_delay_hz(unsigned int max_cpu_core_hz,
void __init shmobile_init_delay(void)
{
struct device_node *np, *cpus;
bool is_a7_a8_a9 = false;
bool is_a15 = false;
unsigned int div = 0;
bool has_arch_timer = false;
u32 max_freq = 0;

Expand All @@ -55,27 +54,22 @@ void __init shmobile_init_delay(void)
if (!of_property_read_u32(np, "clock-frequency", &freq))
max_freq = max(max_freq, freq);

if (of_device_is_compatible(np, "arm,cortex-a8") ||
of_device_is_compatible(np, "arm,cortex-a9")) {
is_a7_a8_a9 = true;
} else if (of_device_is_compatible(np, "arm,cortex-a7")) {
is_a7_a8_a9 = true;
has_arch_timer = true;
} else if (of_device_is_compatible(np, "arm,cortex-a15")) {
is_a15 = true;
if (of_device_is_compatible(np, "arm,cortex-a8")) {
div = 2;
} else if (of_device_is_compatible(np, "arm,cortex-a9")) {
div = 1;
} else if (of_device_is_compatible(np, "arm,cortex-a7") ||
of_device_is_compatible(np, "arm,cortex-a15")) {
div = 1;
has_arch_timer = true;
}
}

of_node_put(cpus);

if (!max_freq)
if (!max_freq || !div)
return;

if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) {
if (is_a7_a8_a9)
shmobile_setup_delay_hz(max_freq, 1, 3);
else if (is_a15)
shmobile_setup_delay_hz(max_freq, 2, 4);
}
if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER))
shmobile_setup_delay_hz(max_freq, 1, div);
}

0 comments on commit 41caed5

Please sign in to comment.