From 11f1ca10b668995a031aade5c2728f0a251aaec7 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Thu, 5 Jun 2014 14:31:56 +0900 Subject: [PATCH 01/16] ARM: shmobile: Update EMEV2 DTS to include CPU frequency Add CPU Frequency information to the EMEV2 DTS file. This will allow us to use the shared C code to on EMEV2 which reads out the clock frequency from DT and calculates the delay settings from there. Signed-off-by: Magnus Damm Acked-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/boot/dts/emev2.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/emev2.dtsi b/arch/arm/boot/dts/emev2.dtsi index e37985fa10e2..00eeed3721b6 100644 --- a/arch/arm/boot/dts/emev2.dtsi +++ b/arch/arm/boot/dts/emev2.dtsi @@ -31,11 +31,13 @@ device_type = "cpu"; compatible = "arm,cortex-a9"; reg = <0>; + clock-frequency = <533000000>; }; cpu@1 { device_type = "cpu"; compatible = "arm,cortex-a9"; reg = <1>; + clock-frequency = <533000000>; }; }; From ef9026e6879da358376b58fc63fe7a82f07404ad Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Thu, 5 Jun 2014 14:32:04 +0900 Subject: [PATCH 02/16] ARM: shmobile: Use shmobile_init_delay() on EMEV2 Adjust EMEV2 to use shmobile_init_delay() together with CPU Frequency settings from the DTS. Signed-off-by: Magnus Damm Acked-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/setup-emev2.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c index 6e4ffa74dad4..e10d34e24817 100644 --- a/arch/arm/mach-shmobile/setup-emev2.c +++ b/arch/arm/mach-shmobile/setup-emev2.c @@ -42,11 +42,6 @@ static void __init emev2_map_io(void) iotable_init(emev2_io_desc, ARRAY_SIZE(emev2_io_desc)); } -static void __init emev2_init_delay(void) -{ - shmobile_setup_delay(533, 1, 3); /* Cortex-A9 @ 533MHz */ -} - static void __init emev2_add_standard_devices_dt(void) { of_clk_init(NULL); @@ -63,7 +58,7 @@ extern struct smp_operations emev2_smp_ops; DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)") .smp = smp_ops(emev2_smp_ops), .map_io = emev2_map_io, - .init_early = emev2_init_delay, + .init_early = shmobile_init_delay, .init_machine = emev2_add_standard_devices_dt, .init_late = shmobile_init_late, .dt_compat = emev2_boards_compat_dt, From af164ca33dcb3c1e6a2e723f24542d1278a8bef8 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Thu, 5 Jun 2014 14:32:12 +0900 Subject: [PATCH 03/16] ARM: shmobile: Get rid of redundant EMEV2 mach callbacks Update the EMEV2 specific SoC callbacks to get rid of the calls to of_clk_init() and of_platform_populate(). Those calls are by default executed by the functions in the shared ARM code in case the SoC specific mach callbacks are NULL. Signed-off-by: Magnus Damm Acked-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/setup-emev2.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c index e10d34e24817..b06a9e8f59a5 100644 --- a/arch/arm/mach-shmobile/setup-emev2.c +++ b/arch/arm/mach-shmobile/setup-emev2.c @@ -16,10 +16,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include #include -#include +#include #include #include #include @@ -42,12 +41,6 @@ static void __init emev2_map_io(void) iotable_init(emev2_io_desc, ARRAY_SIZE(emev2_io_desc)); } -static void __init emev2_add_standard_devices_dt(void) -{ - of_clk_init(NULL); - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); -} - static const char *emev2_boards_compat_dt[] __initconst = { "renesas,emev2", NULL, @@ -59,7 +52,6 @@ DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)") .smp = smp_ops(emev2_smp_ops), .map_io = emev2_map_io, .init_early = shmobile_init_delay, - .init_machine = emev2_add_standard_devices_dt, .init_late = shmobile_init_late, .dt_compat = emev2_boards_compat_dt, MACHINE_END From 005407fdf1c65a06fc0a9c588408f57e2eacef7c Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 6 Jun 2014 14:28:49 +0900 Subject: [PATCH 04/16] ARM: shmobile: Update r7s72100 DTS to include CPU frequency Add CPU Frequency information to the r7s72100 DTS file. This will allow us to use the shared C code on r7s72100 and Genmai which reads out the clock frequency from DT and calculates the delay settings from there. Signed-off-by: Magnus Damm Acked-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/boot/dts/r7s72100.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi index f50fbc8f3bd9..bdee22541189 100644 --- a/arch/arm/boot/dts/r7s72100.dtsi +++ b/arch/arm/boot/dts/r7s72100.dtsi @@ -144,6 +144,7 @@ device_type = "cpu"; compatible = "arm,cortex-a9"; reg = <0>; + clock-frequency = <400000000>; }; }; From 4387ac5282616ff14edc733aca79fe046ddb45f5 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 6 Jun 2014 14:28:56 +0900 Subject: [PATCH 05/16] ARM: shmobile: Use shmobile_init_delay() on Genmai boards Adjust Genmai board support to use shmobile_init_delay() together with r7s72100 CPU Frequency settings from the DTS. Signed-off-by: Magnus Damm Acked-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-genmai-reference.c | 2 +- arch/arm/mach-shmobile/board-genmai.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-shmobile/board-genmai-reference.c b/arch/arm/mach-shmobile/board-genmai-reference.c index d341ef09ec37..c06dc5c12d1e 100644 --- a/arch/arm/mach-shmobile/board-genmai-reference.c +++ b/arch/arm/mach-shmobile/board-genmai-reference.c @@ -47,7 +47,7 @@ static const char * const genmai_boards_compat_dt[] __initconst = { }; DT_MACHINE_START(GENMAI_DT, "genmai") - .init_early = r7s72100_init_early, + .init_early = shmobile_init_delay, .init_machine = genmai_add_standard_devices, .dt_compat = genmai_boards_compat_dt, MACHINE_END diff --git a/arch/arm/mach-shmobile/board-genmai.c b/arch/arm/mach-shmobile/board-genmai.c index f0a8eca7d10d..a0994f36b348 100644 --- a/arch/arm/mach-shmobile/board-genmai.c +++ b/arch/arm/mach-shmobile/board-genmai.c @@ -154,7 +154,7 @@ static const char * const genmai_boards_compat_dt[] __initconst = { }; DT_MACHINE_START(GENMAI_DT, "genmai") - .init_early = r7s72100_init_early, + .init_early = shmobile_init_delay, .init_machine = genmai_add_standard_devices, .dt_compat = genmai_boards_compat_dt, MACHINE_END From b42a6f7e8f22552aad0d8e595cd83f36316e312b Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 6 Jun 2014 14:29:04 +0900 Subject: [PATCH 06/16] ARM: shmobile: Use shmobile_init_delay() on r7s72100 Adjust the r7s72100 SoC support code to use shmobile_init_delay() together with CPU Frequency settings from the DTS. Get rid of the C code version. Signed-off-by: Magnus Damm Acked-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/include/mach/r7s72100.h | 1 - arch/arm/mach-shmobile/setup-r7s72100.c | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/arm/mach-shmobile/include/mach/r7s72100.h b/arch/arm/mach-shmobile/include/mach/r7s72100.h index 5f34b20ecd4a..efb723c88dd0 100644 --- a/arch/arm/mach-shmobile/include/mach/r7s72100.h +++ b/arch/arm/mach-shmobile/include/mach/r7s72100.h @@ -3,6 +3,5 @@ void r7s72100_add_dt_devices(void); void r7s72100_clock_init(void); -void r7s72100_init_early(void); #endif /* __ASM_R7S72100_H__ */ diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c index 17a74d355c5d..a55d68d89e6e 100644 --- a/arch/arm/mach-shmobile/setup-r7s72100.c +++ b/arch/arm/mach-shmobile/setup-r7s72100.c @@ -43,11 +43,6 @@ void __init r7s72100_add_dt_devices(void) r7s72100_register_mtu2(); } -void __init r7s72100_init_early(void) -{ - shmobile_setup_delay(400, 1, 3); /* Cortex-A9 @ 400MHz */ -} - #ifdef CONFIG_USE_OF static const char *r7s72100_boards_compat_dt[] __initdata = { "renesas,r7s72100", @@ -55,7 +50,7 @@ static const char *r7s72100_boards_compat_dt[] __initdata = { }; DT_MACHINE_START(R7S72100_DT, "Generic R7S72100 (Flattened Device Tree)") - .init_early = r7s72100_init_early, + .init_early = shmobile_init_delay, .dt_compat = r7s72100_boards_compat_dt, MACHINE_END #endif /* CONFIG_USE_OF */ From ed06ecbcc66f6224a908c8abfe940b00540f0aa8 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Tue, 20 May 2014 08:37:24 +0900 Subject: [PATCH 07/16] ARM: shmobile: Use r8a7790 DT CPU Frequency in common case Convert the common C-code-less r8a7790 DT board support to use shmobile_init_delay() to be able to migrate away from per-SoC delay setup functions. Signed-off-by: Magnus Damm Acked-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/setup-r8a7790.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c index 4212c8de987a..9c2bc16487e2 100644 --- a/arch/arm/mach-shmobile/setup-r8a7790.c +++ b/arch/arm/mach-shmobile/setup-r8a7790.c @@ -324,7 +324,7 @@ static const char * const r8a7790_boards_compat_dt[] __initconst = { DT_MACHINE_START(R8A7790_DT, "Generic R8A7790 (Flattened Device Tree)") .smp = smp_ops(r8a7790_smp_ops), - .init_early = r8a7790_init_early, + .init_early = shmobile_init_delay, .init_time = rcar_gen2_timer_init, .dt_compat = r8a7790_boards_compat_dt, MACHINE_END From a5d626813fc13f80b6ab80de1fe303ce5cdd8c54 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Tue, 20 May 2014 08:37:33 +0900 Subject: [PATCH 08/16] ARM: shmobile: Use r8a7790 DT CPU Frequency for Lager Convert the Lager board support to use shmobile_init_delay() to be able to migrate away from per-SoC delay setup functions. Signed-off-by: Magnus Damm Acked-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-lager-reference.c | 2 +- arch/arm/mach-shmobile/board-lager.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c index 4f0af91ebc81..e30017b910b9 100644 --- a/arch/arm/mach-shmobile/board-lager-reference.c +++ b/arch/arm/mach-shmobile/board-lager-reference.c @@ -129,7 +129,7 @@ static const char *lager_boards_compat_dt[] __initdata = { DT_MACHINE_START(LAGER_DT, "lager") .smp = smp_ops(r8a7790_smp_ops), - .init_early = r8a7790_init_early, + .init_early = shmobile_init_delay, .init_time = rcar_gen2_timer_init, .init_machine = lager_add_standard_devices, .init_late = shmobile_init_late, diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c index 83bbb5c48863..72785cc7405b 100644 --- a/arch/arm/mach-shmobile/board-lager.c +++ b/arch/arm/mach-shmobile/board-lager.c @@ -887,7 +887,7 @@ static const char * const lager_boards_compat_dt[] __initconst = { DT_MACHINE_START(LAGER_DT, "lager") .smp = smp_ops(r8a7790_smp_ops), - .init_early = r8a7790_init_early, + .init_early = shmobile_init_delay, .init_time = rcar_gen2_timer_init, .init_machine = lager_init, .init_late = shmobile_init_late, From d83fa4c9c27c4d8612e39e99506b5420fa05b58b Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Tue, 20 May 2014 08:37:42 +0900 Subject: [PATCH 09/16] ARM: shmobile: Remove unused r8a7790_init_early() Remove the now unused r8a7790_init_early() function. Signed-off-by: Magnus Damm Acked-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/include/mach/r8a7790.h | 1 - arch/arm/mach-shmobile/setup-r8a7790.c | 7 ------- 2 files changed, 8 deletions(-) diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h index d7555440fc7b..459827f1369b 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7790.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h @@ -31,7 +31,6 @@ void r8a7790_add_dt_devices(void); void r8a7790_clock_init(void); void r8a7790_pinmux_init(void); void r8a7790_pm_init(void); -void r8a7790_init_early(void); extern struct smp_operations r8a7790_smp_ops; #endif /* __ASM_R8A7790_H__ */ diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c index 9c2bc16487e2..ee5daccf35ee 100644 --- a/arch/arm/mach-shmobile/setup-r8a7790.c +++ b/arch/arm/mach-shmobile/setup-r8a7790.c @@ -308,13 +308,6 @@ void __init r8a7790_add_standard_devices(void) r8a7790_register_audio_dmac(1); } -void __init r8a7790_init_early(void) -{ -#ifndef CONFIG_ARM_ARCH_TIMER - shmobile_setup_delay(1300, 2, 4); /* Cortex-A15 @ 1300MHz */ -#endif -} - #ifdef CONFIG_USE_OF static const char * const r8a7790_boards_compat_dt[] __initconst = { From 96bd090066e2150f3970b32f35895de2ab631c95 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 20 Jun 2014 18:53:01 +0200 Subject: [PATCH 10/16] ARM: shmobile: Move r7s72100.h Change location of r7s72100.h so it can be included using "r7s72100.h" instead of the old style . Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-genmai-reference.c | 4 +++- arch/arm/mach-shmobile/board-genmai.c | 4 +++- arch/arm/mach-shmobile/clock-r7s72100.c | 3 ++- arch/arm/mach-shmobile/{include/mach => }/r7s72100.h | 0 arch/arm/mach-shmobile/setup-r7s72100.c | 4 +++- 5 files changed, 11 insertions(+), 4 deletions(-) rename arch/arm/mach-shmobile/{include/mach => }/r7s72100.h (100%) diff --git a/arch/arm/mach-shmobile/board-genmai-reference.c b/arch/arm/mach-shmobile/board-genmai-reference.c index c06dc5c12d1e..e5448f7b868a 100644 --- a/arch/arm/mach-shmobile/board-genmai-reference.c +++ b/arch/arm/mach-shmobile/board-genmai-reference.c @@ -20,11 +20,13 @@ #include #include -#include + #include #include + #include "clock.h" #include "common.h" +#include "r7s72100.h" /* * This is a really crude hack to provide clkdev support to platform diff --git a/arch/arm/mach-shmobile/board-genmai.c b/arch/arm/mach-shmobile/board-genmai.c index a0994f36b348..e2a3ba4871c3 100644 --- a/arch/arm/mach-shmobile/board-genmai.c +++ b/arch/arm/mach-shmobile/board-genmai.c @@ -25,11 +25,13 @@ #include #include #include -#include + #include #include + #include "common.h" #include "irqs.h" +#include "r7s72100.h" /* Ether */ static const struct sh_eth_plat_data ether_pdata __initconst = { diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c index 457dab0f8fc9..3eb2ec401e0c 100644 --- a/arch/arm/mach-shmobile/clock-r7s72100.c +++ b/arch/arm/mach-shmobile/clock-r7s72100.c @@ -19,8 +19,9 @@ #include #include #include -#include + #include "common.h" +#include "r7s72100.h" /* Frequency Control Registers */ #define FRQCR 0xfcfe0010 diff --git a/arch/arm/mach-shmobile/include/mach/r7s72100.h b/arch/arm/mach-shmobile/r7s72100.h similarity index 100% rename from arch/arm/mach-shmobile/include/mach/r7s72100.h rename to arch/arm/mach-shmobile/r7s72100.h diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c index a55d68d89e6e..4a98b232d316 100644 --- a/arch/arm/mach-shmobile/setup-r7s72100.c +++ b/arch/arm/mach-shmobile/setup-r7s72100.c @@ -22,10 +22,12 @@ #include #include #include -#include + #include + #include "common.h" #include "irqs.h" +#include "r7s72100.h" static struct resource mtu2_resources[] __initdata = { DEFINE_RES_MEM(0xfcff0000, 0x400), From fac49568b0d19e039e216ca6d13bc534ebf12c34 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 20 Jun 2014 18:53:02 +0200 Subject: [PATCH 11/16] ARM: shmobile: Move r8a73a4.h Change location of r8a73a4.h so it can be included as "r8a73a4.h" instead of the old style Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-ape6evm-reference.c | 4 +++- arch/arm/mach-shmobile/board-ape6evm.c | 4 +++- arch/arm/mach-shmobile/{include/mach => }/r8a73a4.h | 0 arch/arm/mach-shmobile/setup-r8a73a4.c | 4 +++- 4 files changed, 9 insertions(+), 3 deletions(-) rename arch/arm/mach-shmobile/{include/mach => }/r8a73a4.h (100%) diff --git a/arch/arm/mach-shmobile/board-ape6evm-reference.c b/arch/arm/mach-shmobile/board-ape6evm-reference.c index 76e4ff14be68..2f7723e5fe91 100644 --- a/arch/arm/mach-shmobile/board-ape6evm-reference.c +++ b/arch/arm/mach-shmobile/board-ape6evm-reference.c @@ -24,10 +24,12 @@ #include #include #include -#include + #include #include + #include "common.h" +#include "r8a73a4.h" static void __init ape6evm_add_standard_devices(void) { diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c index 8f8da25310e7..485567876d39 100644 --- a/arch/arm/mach-shmobile/board-ape6evm.c +++ b/arch/arm/mach-shmobile/board-ape6evm.c @@ -33,11 +33,13 @@ #include #include #include -#include + #include #include + #include "common.h" #include "irqs.h" +#include "r8a73a4.h" /* LEDS */ static struct gpio_led ape6evm_leds[] = { diff --git a/arch/arm/mach-shmobile/include/mach/r8a73a4.h b/arch/arm/mach-shmobile/r8a73a4.h similarity index 100% rename from arch/arm/mach-shmobile/include/mach/r8a73a4.h rename to arch/arm/mach-shmobile/r8a73a4.h diff --git a/arch/arm/mach-shmobile/setup-r8a73a4.c b/arch/arm/mach-shmobile/setup-r8a73a4.c index da94d9b9292e..f470b3cc0b7b 100644 --- a/arch/arm/mach-shmobile/setup-r8a73a4.c +++ b/arch/arm/mach-shmobile/setup-r8a73a4.c @@ -24,11 +24,13 @@ #include #include #include -#include + #include + #include "common.h" #include "dma-register.h" #include "irqs.h" +#include "r8a73a4.h" static const struct resource pfc_resources[] = { DEFINE_RES_MEM(0xe6050000, 0x9000), From 9e38b84b456ab7b2abd28257eec5caee4fb1f5ea Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 20 Jun 2014 18:53:03 +0200 Subject: [PATCH 12/16] ARM: shmobile: Move r8a7740.h Change location of r8a7740.h so it can be included as "r8a7740.h" instead of the old style Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-armadillo800eva-reference.c | 4 +++- arch/arm/mach-shmobile/board-armadillo800eva.c | 4 +++- arch/arm/mach-shmobile/clock-r8a7740.c | 3 ++- arch/arm/mach-shmobile/{include/mach => }/r8a7740.h | 0 arch/arm/mach-shmobile/setup-r8a7740.c | 4 +++- 5 files changed, 11 insertions(+), 4 deletions(-) rename arch/arm/mach-shmobile/{include/mach => }/r8a7740.h (100%) diff --git a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c index 368518b3b8ec..208576667b22 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c @@ -24,10 +24,12 @@ #include #include #include -#include + #include #include + #include "common.h" +#include "r8a7740.h" /* * CON1 Camera Module diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c index 53d03e85750a..32339cf6ee7b 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva.c @@ -45,7 +45,7 @@ #include #include #include -#include + #include #include #include @@ -59,9 +59,11 @@ #include