diff options
-rw-r--r-- | arch/arm/boot/dts/r8a7740.dtsi | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-armadillo800eva-reference.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-koelsch-reference.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-koelsch.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/r8a7740.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/r8a7791.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-r8a7740.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-r8a7791.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/timer.c | 23 |
9 files changed, 27 insertions, 22 deletions
diff --git a/arch/arm/boot/dts/r8a7740.dtsi b/arch/arm/boot/dts/r8a7740.dtsi index 2551e9438d35..97a9545f5232 100644 --- a/arch/arm/boot/dts/r8a7740.dtsi +++ b/arch/arm/boot/dts/r8a7740.dtsi | |||
@@ -22,6 +22,7 @@ | |||
22 | compatible = "arm,cortex-a9"; | 22 | compatible = "arm,cortex-a9"; |
23 | device_type = "cpu"; | 23 | device_type = "cpu"; |
24 | reg = <0x0>; | 24 | reg = <0x0>; |
25 | clock-frequency = <800000000>; | ||
25 | }; | 26 | }; |
26 | }; | 27 | }; |
27 | 28 | ||
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c index 57d1a78367b6..57d246eb8813 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c | |||
@@ -187,7 +187,7 @@ static const char *eva_boards_compat_dt[] __initdata = { | |||
187 | 187 | ||
188 | DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva-reference") | 188 | DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva-reference") |
189 | .map_io = r8a7740_map_io, | 189 | .map_io = r8a7740_map_io, |
190 | .init_early = r8a7740_init_delay, | 190 | .init_early = shmobile_init_delay, |
191 | .init_irq = r8a7740_init_irq_of, | 191 | .init_irq = r8a7740_init_irq_of, |
192 | .init_machine = eva_init, | 192 | .init_machine = eva_init, |
193 | .init_late = shmobile_init_late, | 193 | .init_late = shmobile_init_late, |
diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c index a3fd30242bd8..ff33d9c4b658 100644 --- a/arch/arm/mach-shmobile/board-koelsch-reference.c +++ b/arch/arm/mach-shmobile/board-koelsch-reference.c | |||
@@ -139,7 +139,7 @@ static const char * const koelsch_boards_compat_dt[] __initconst = { | |||
139 | 139 | ||
140 | DT_MACHINE_START(KOELSCH_DT, "koelsch") | 140 | DT_MACHINE_START(KOELSCH_DT, "koelsch") |
141 | .smp = smp_ops(r8a7791_smp_ops), | 141 | .smp = smp_ops(r8a7791_smp_ops), |
142 | .init_early = r8a7791_init_early, | 142 | .init_early = shmobile_init_delay, |
143 | .init_time = rcar_gen2_timer_init, | 143 | .init_time = rcar_gen2_timer_init, |
144 | .init_machine = koelsch_add_standard_devices, | 144 | .init_machine = koelsch_add_standard_devices, |
145 | .init_late = shmobile_init_late, | 145 | .init_late = shmobile_init_late, |
diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c index 5a034ff405d0..3cd8008d09dd 100644 --- a/arch/arm/mach-shmobile/board-koelsch.c +++ b/arch/arm/mach-shmobile/board-koelsch.c | |||
@@ -522,7 +522,7 @@ static const char * const koelsch_boards_compat_dt[] __initconst = { | |||
522 | 522 | ||
523 | DT_MACHINE_START(KOELSCH_DT, "koelsch") | 523 | DT_MACHINE_START(KOELSCH_DT, "koelsch") |
524 | .smp = smp_ops(r8a7791_smp_ops), | 524 | .smp = smp_ops(r8a7791_smp_ops), |
525 | .init_early = r8a7791_init_early, | 525 | .init_early = shmobile_init_delay, |
526 | .init_time = rcar_gen2_timer_init, | 526 | .init_time = rcar_gen2_timer_init, |
527 | .init_machine = koelsch_init, | 527 | .init_machine = koelsch_init, |
528 | .init_late = shmobile_init_late, | 528 | .init_late = shmobile_init_late, |
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7740.h b/arch/arm/mach-shmobile/include/mach/r8a7740.h index d07932f872b6..5e3c9ec06303 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7740.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7740.h | |||
@@ -47,7 +47,6 @@ enum { | |||
47 | }; | 47 | }; |
48 | 48 | ||
49 | extern void r8a7740_meram_workaround(void); | 49 | extern void r8a7740_meram_workaround(void); |
50 | extern void r8a7740_init_delay(void); | ||
51 | extern void r8a7740_init_irq_of(void); | 50 | extern void r8a7740_init_irq_of(void); |
52 | extern void r8a7740_map_io(void); | 51 | extern void r8a7740_map_io(void); |
53 | extern void r8a7740_add_early_devices(void); | 52 | extern void r8a7740_add_early_devices(void); |
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7791.h b/arch/arm/mach-shmobile/include/mach/r8a7791.h index 200fa699f730..664274cc4b64 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7791.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7791.h | |||
@@ -5,7 +5,6 @@ void r8a7791_add_standard_devices(void); | |||
5 | void r8a7791_add_dt_devices(void); | 5 | void r8a7791_add_dt_devices(void); |
6 | void r8a7791_clock_init(void); | 6 | void r8a7791_clock_init(void); |
7 | void r8a7791_pinmux_init(void); | 7 | void r8a7791_pinmux_init(void); |
8 | void r8a7791_init_early(void); | ||
9 | extern struct smp_operations r8a7791_smp_ops; | 8 | extern struct smp_operations r8a7791_smp_ops; |
10 | 9 | ||
11 | #endif /* __ASM_R8A7791_H__ */ | 10 | #endif /* __ASM_R8A7791_H__ */ |
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c index 8f3c68101d59..7bdc51c195c7 100644 --- a/arch/arm/mach-shmobile/setup-r8a7740.c +++ b/arch/arm/mach-shmobile/setup-r8a7740.c | |||
@@ -887,11 +887,6 @@ void __init r8a7740_add_standard_devices_dt(void) | |||
887 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 887 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
888 | } | 888 | } |
889 | 889 | ||
890 | void __init r8a7740_init_delay(void) | ||
891 | { | ||
892 | shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */ | ||
893 | }; | ||
894 | |||
895 | void __init r8a7740_init_irq_of(void) | 890 | void __init r8a7740_init_irq_of(void) |
896 | { | 891 | { |
897 | void __iomem *intc_prio_base = ioremap_nocache(0xe6900010, 0x10); | 892 | void __iomem *intc_prio_base = ioremap_nocache(0xe6900010, 0x10); |
@@ -935,9 +930,10 @@ static const char *r8a7740_boards_compat_dt[] __initdata = { | |||
935 | 930 | ||
936 | DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)") | 931 | DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)") |
937 | .map_io = r8a7740_map_io, | 932 | .map_io = r8a7740_map_io, |
938 | .init_early = r8a7740_init_delay, | 933 | .init_early = shmobile_init_delay, |
939 | .init_irq = r8a7740_init_irq_of, | 934 | .init_irq = r8a7740_init_irq_of, |
940 | .init_machine = r8a7740_generic_init, | 935 | .init_machine = r8a7740_generic_init, |
936 | .init_late = shmobile_init_late, | ||
941 | .dt_compat = r8a7740_boards_compat_dt, | 937 | .dt_compat = r8a7740_boards_compat_dt, |
942 | MACHINE_END | 938 | MACHINE_END |
943 | 939 | ||
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c index a7e4966f5e18..949580ae150a 100644 --- a/arch/arm/mach-shmobile/setup-r8a7791.c +++ b/arch/arm/mach-shmobile/setup-r8a7791.c | |||
@@ -210,13 +210,6 @@ void __init r8a7791_add_standard_devices(void) | |||
210 | r8a7791_register_thermal(); | 210 | r8a7791_register_thermal(); |
211 | } | 211 | } |
212 | 212 | ||
213 | void __init r8a7791_init_early(void) | ||
214 | { | ||
215 | #ifndef CONFIG_ARM_ARCH_TIMER | ||
216 | shmobile_setup_delay(1500, 2, 4); /* Cortex-A15 @ 1500MHz */ | ||
217 | #endif | ||
218 | } | ||
219 | |||
220 | #ifdef CONFIG_USE_OF | 213 | #ifdef CONFIG_USE_OF |
221 | static const char *r8a7791_boards_compat_dt[] __initdata = { | 214 | static const char *r8a7791_boards_compat_dt[] __initdata = { |
222 | "renesas,r8a7791", | 215 | "renesas,r8a7791", |
@@ -225,7 +218,7 @@ static const char *r8a7791_boards_compat_dt[] __initdata = { | |||
225 | 218 | ||
226 | DT_MACHINE_START(R8A7791_DT, "Generic R8A7791 (Flattened Device Tree)") | 219 | DT_MACHINE_START(R8A7791_DT, "Generic R8A7791 (Flattened Device Tree)") |
227 | .smp = smp_ops(r8a7791_smp_ops), | 220 | .smp = smp_ops(r8a7791_smp_ops), |
228 | .init_early = r8a7791_init_early, | 221 | .init_early = shmobile_init_delay, |
229 | .init_time = rcar_gen2_timer_init, | 222 | .init_time = rcar_gen2_timer_init, |
230 | .dt_compat = r8a7791_boards_compat_dt, | 223 | .dt_compat = r8a7791_boards_compat_dt, |
231 | MACHINE_END | 224 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c index ccecde9a3362..68bc0b82226d 100644 --- a/arch/arm/mach-shmobile/timer.c +++ b/arch/arm/mach-shmobile/timer.c | |||
@@ -23,6 +23,23 @@ | |||
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/of_address.h> | 24 | #include <linux/of_address.h> |
25 | 25 | ||
26 | void __init shmobile_setup_delay_hz(unsigned int max_cpu_core_hz, | ||
27 | unsigned int mult, unsigned int div) | ||
28 | { | ||
29 | /* calculate a worst-case loops-per-jiffy value | ||
30 | * based on maximum cpu core hz setting and the | ||
31 | * __delay() implementation in arch/arm/lib/delay.S | ||
32 | * | ||
33 | * this will result in a longer delay than expected | ||
34 | * when the cpu core runs on lower frequencies. | ||
35 | */ | ||
36 | |||
37 | unsigned int value = HZ * div / mult; | ||
38 | |||
39 | if (!preset_lpj) | ||
40 | preset_lpj = max_cpu_core_hz / value; | ||
41 | } | ||
42 | |||
26 | void __init shmobile_setup_delay(unsigned int max_cpu_core_mhz, | 43 | void __init shmobile_setup_delay(unsigned int max_cpu_core_mhz, |
27 | unsigned int mult, unsigned int div) | 44 | unsigned int mult, unsigned int div) |
28 | { | 45 | { |
@@ -58,12 +75,12 @@ void __init shmobile_init_delay(void) | |||
58 | 75 | ||
59 | if (max_freq) { | 76 | if (max_freq) { |
60 | if (of_find_compatible_node(NULL, NULL, "arm,cortex-a8")) | 77 | if (of_find_compatible_node(NULL, NULL, "arm,cortex-a8")) |
61 | shmobile_setup_delay(max_freq, 1, 3); | 78 | shmobile_setup_delay_hz(max_freq, 1, 3); |
62 | else if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9")) | 79 | else if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9")) |
63 | shmobile_setup_delay(max_freq, 1, 3); | 80 | shmobile_setup_delay_hz(max_freq, 1, 3); |
64 | else if (of_find_compatible_node(NULL, NULL, "arm,cortex-a15")) | 81 | else if (of_find_compatible_node(NULL, NULL, "arm,cortex-a15")) |
65 | if (!IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) | 82 | if (!IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) |
66 | shmobile_setup_delay(max_freq, 2, 4); | 83 | shmobile_setup_delay_hz(max_freq, 2, 4); |
67 | } | 84 | } |
68 | } | 85 | } |
69 | 86 | ||