aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorBoris BREZILLON <b.brezillon@overkiz.com>2013-10-11 08:43:31 -0400
committerNicolas Ferre <nicolas.ferre@atmel.com>2013-12-02 09:31:27 -0500
commitd4d24c1b4f74e055905db6e677a2ba05f55de30a (patch)
treef7607ceeb45ab33079117acced7866114a4fbd27 /arch/arm
parentc59b631517e91300f6a4838f593ebca5ebde8742 (diff)
ARM: at91: prepare sama5 dt boards transition to common clk
This patch prepare the transition to common clk for sama5 dt boards by replacing the timer init callback. Clocks registration cannot be done in early init callback (as formerly done by the old clk implementation) because it requires dynamic allocation which is not ready yet during early init. In the other hand, at91 clocks must be registered before at91sam926x_pit_init is called because PIT (Periodic Interval Timer) driver request the master clk (mck). A new function (at91sama5_dt_timer_init) is created to fullfil these needs. This function registers all at91 clks using the dt definition before calling the PIT init function. The device tree clock registration is enabled only if common clk is selected. Else the old clk registration is been done during at91_dt_initialize call. Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-at91/board-dt-sama5.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c
index bf00d15d954d..075ec0576ada 100644
--- a/arch/arm/mach-at91/board-dt-sama5.c
+++ b/arch/arm/mach-at91/board-dt-sama5.c
@@ -16,6 +16,7 @@
16#include <linux/of_irq.h> 16#include <linux/of_irq.h>
17#include <linux/of_platform.h> 17#include <linux/of_platform.h>
18#include <linux/phy.h> 18#include <linux/phy.h>
19#include <linux/clk-provider.h>
19 20
20#include <asm/setup.h> 21#include <asm/setup.h>
21#include <asm/irq.h> 22#include <asm/irq.h>
@@ -26,6 +27,13 @@
26#include "at91_aic.h" 27#include "at91_aic.h"
27#include "generic.h" 28#include "generic.h"
28 29
30static void __init sama5_dt_timer_init(void)
31{
32#if defined(CONFIG_COMMON_CLK)
33 of_clk_init(NULL);
34#endif
35 at91sam926x_pit_init();
36}
29 37
30static const struct of_device_id irq_of_match[] __initconst = { 38static const struct of_device_id irq_of_match[] __initconst = {
31 39
@@ -72,7 +80,7 @@ static const char *sama5_dt_board_compat[] __initdata = {
72 80
73DT_MACHINE_START(sama5_dt, "Atmel SAMA5 (Device Tree)") 81DT_MACHINE_START(sama5_dt, "Atmel SAMA5 (Device Tree)")
74 /* Maintainer: Atmel */ 82 /* Maintainer: Atmel */
75 .init_time = at91sam926x_pit_init, 83 .init_time = sama5_dt_timer_init,
76 .map_io = at91_map_io, 84 .map_io = at91_map_io,
77 .handle_irq = at91_aic5_handle_irq, 85 .handle_irq = at91_aic5_handle_irq,
78 .init_early = at91_dt_initialize, 86 .init_early = at91_dt_initialize,