Skip to content

Commit

Permalink
ARM: socfgpa: prepare for arch-wide .init_time callback
Browse files Browse the repository at this point in the history
Current socfpga board init calls of_clk_init() from .machine_init. To
allow consolidation of DT driven .time_init, move of_clock_init() to
a temporary .time_init that will be removed when arch-wide callback is
available.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Dinh Nguyen <dinguyen@altera.com>
  • Loading branch information
Sebastian Hesselbarth committed Sep 29, 2013
1 parent 27966ff commit 8e7b25f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion arch/arm/mach-socfpga/socfpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <linux/clk-provider.h>
#include <linux/clocksource.h>
#include <linux/irqchip.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
Expand Down Expand Up @@ -90,6 +91,12 @@ static void __init socfpga_init_irq(void)
socfpga_sysmgr_init();
}

static void __init socfpga_init_time(void)
{
of_clk_init(NULL);
clocksource_of_init();
}

static void socfpga_cyclone5_restart(enum reboot_mode mode, const char *cmd)
{
u32 temp;
Expand All @@ -107,7 +114,6 @@ static void __init socfpga_cyclone5_init(void)
{
l2x0_of_init(0, ~0UL);
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
of_clk_init(NULL);
socfpga_init_clocks();
}

Expand All @@ -120,6 +126,7 @@ DT_MACHINE_START(SOCFPGA, "Altera SOCFPGA")
.smp = smp_ops(socfpga_smp_ops),
.map_io = socfpga_map_io,
.init_irq = socfpga_init_irq,
.init_time = socfpga_init_time,
.init_machine = socfpga_cyclone5_init,
.restart = socfpga_cyclone5_restart,
.dt_compat = altera_dt_match,
Expand Down

0 comments on commit 8e7b25f

Please sign in to comment.