Commit 27f3c708 authored by Magnus Damm's avatar Magnus Damm Committed by Simon Horman

ARM: shmobile: Handle CA7 arch timer delay

Update the delay code to include arch timer checks
for CA7. From a arch timer availability perspective
CA7 should be treated same as CA15.
Signed-off-by: default avatarMagnus Damm <damm+renesas@opensource.se>
Signed-off-by: default avatarSimon Horman <horms+renesas@verge.net.au>
parent f114040e
...@@ -45,6 +45,7 @@ void __init shmobile_init_delay(void) ...@@ -45,6 +45,7 @@ void __init shmobile_init_delay(void)
struct device_node *np, *cpus; struct device_node *np, *cpus;
bool is_a7_a8_a9 = false; bool is_a7_a8_a9 = false;
bool is_a15 = false; bool is_a15 = false;
bool has_arch_timer = false;
u32 max_freq = 0; u32 max_freq = 0;
cpus = of_find_node_by_path("/cpus"); cpus = of_find_node_by_path("/cpus");
...@@ -57,12 +58,16 @@ void __init shmobile_init_delay(void) ...@@ -57,12 +58,16 @@ 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-a7") || if (of_device_is_compatible(np, "arm,cortex-a8") ||
of_device_is_compatible(np, "arm,cortex-a8") || of_device_is_compatible(np, "arm,cortex-a9")) {
of_device_is_compatible(np, "arm,cortex-a9"))
is_a7_a8_a9 = true; is_a7_a8_a9 = true;
else if (of_device_is_compatible(np, "arm,cortex-a15")) } 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; is_a15 = true;
has_arch_timer = true;
}
} }
of_node_put(cpus); of_node_put(cpus);
...@@ -70,10 +75,12 @@ void __init shmobile_init_delay(void) ...@@ -70,10 +75,12 @@ void __init shmobile_init_delay(void)
if (!max_freq) if (!max_freq)
return; return;
if (is_a7_a8_a9) if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) {
shmobile_setup_delay_hz(max_freq, 1, 3); if (is_a7_a8_a9)
else if (is_a15 && !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) shmobile_setup_delay_hz(max_freq, 1, 3);
shmobile_setup_delay_hz(max_freq, 2, 4); else if (is_a15)
shmobile_setup_delay_hz(max_freq, 2, 4);
}
} }
static void __init shmobile_late_time_init(void) static void __init shmobile_late_time_init(void)
......
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