Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6923ae4b authored by Thomas Abraham's avatar Thomas Abraham Committed by Kukjin Kim
Browse files

ARM: EXYNOS: Initialize the clocks prior to timer initialization



Since the clock initialization should be completed prior to the mct
timer initialization, create a new function 'exynos_init_time' that
first sets up the clock and then invokes the timer initialization
function. The 'init_time' callback in the board files are updated to
invoke this new wrapper function.

Signed-off-by: default avatarThomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent 6e6aac75
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@
#include <linux/irqdomain.h>
#include <linux/irqchip.h>
#include <linux/of_address.h>
#include <linux/clocksource.h>
#include <linux/clk-provider.h>
#include <linux/irqchip/arm-gic.h>

#include <asm/proc-fns.h>
@@ -395,6 +397,20 @@ static void __init exynos5440_map_io(void)
	iotable_init(exynos5440_iodesc0, ARRAY_SIZE(exynos5440_iodesc0));
}

void __init exynos_init_time(void)
{
	if (of_have_populated_dt()) {
#ifdef CONFIG_OF
		of_clk_init(NULL);
		clocksource_of_init();
#endif
	} else {
		/* todo: remove after migrating legacy E4 platforms to dt */
		exynos4_clk_init(NULL);
		mct_init();
	}
}

void __init exynos4_init_irq(void)
{
	unsigned int gic_bank_offset;
+1 −1
Original line number Diff line number Diff line
@@ -201,6 +201,6 @@ MACHINE_START(ARMLEX4210, "ARMLEX4210")
	.map_io		= armlex4210_map_io,
	.init_machine	= armlex4210_machine_init,
	.init_late	= exynos_init_late,
	.init_time	= mct_init,
	.init_time	= exynos_init_time,
	.restart	= exynos4_restart,
MACHINE_END
+1 −1
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
	.map_io		= exynos4_dt_map_io,
	.init_machine	= exynos4_dt_machine_init,
	.init_late	= exynos_init_late,
	.init_time	= clocksource_of_init,
	.init_time	= exynos_init_time,
	.dt_compat	= exynos4_dt_compat,
	.restart        = exynos4_restart,
	.reserve	= exynos4_reserve,
+1 −1
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
	.map_io		= exynos5_dt_map_io,
	.init_machine	= exynos5_dt_machine_init,
	.init_late	= exynos_init_late,
	.init_time	= clocksource_of_init,
	.init_time	= exynos_init_time,
	.dt_compat	= exynos5_dt_compat,
	.restart        = exynos5_restart,
	.reserve	= exynos5_reserve,
+1 −1
Original line number Diff line number Diff line
@@ -1379,7 +1379,7 @@ MACHINE_START(NURI, "NURI")
	.map_io		= nuri_map_io,
	.init_machine	= nuri_machine_init,
	.init_late	= exynos_init_late,
	.init_time	= mct_init,
	.init_time	= exynos_init_time,
	.reserve        = &nuri_reserve,
	.restart	= exynos4_restart,
MACHINE_END
Loading