2006-01-17 14:14:17 +08:00
|
|
|
/*
|
|
|
|
* arch/sh/kernel/cpu/clock.c - SuperH clock framework
|
|
|
|
*
|
2009-05-12 03:27:43 +08:00
|
|
|
* Copyright (C) 2005 - 2009 Paul Mundt
|
2006-01-17 14:14:17 +08:00
|
|
|
*
|
|
|
|
* This clock framework is derived from the OMAP version by:
|
|
|
|
*
|
2009-05-12 03:27:43 +08:00
|
|
|
* Copyright (C) 2004 - 2008 Nokia Corporation
|
2006-01-17 14:14:17 +08:00
|
|
|
* Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
|
|
|
|
*
|
2006-12-01 12:15:14 +08:00
|
|
|
* Modified for omap shared clock framework by Tony Lindgren <tony@atomide.com>
|
|
|
|
*
|
2006-01-17 14:14:17 +08:00
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/init.h>
|
2010-03-08 20:45:19 +08:00
|
|
|
#include <linux/clk.h>
|
2006-01-17 14:14:17 +08:00
|
|
|
#include <asm/clock.h>
|
2009-05-13 16:38:11 +08:00
|
|
|
#include <asm/machvec.h>
|
2006-01-17 14:14:17 +08:00
|
|
|
|
|
|
|
int __init clk_init(void)
|
|
|
|
{
|
2009-05-13 16:38:11 +08:00
|
|
|
int ret;
|
2006-01-17 14:14:17 +08:00
|
|
|
|
2009-05-13 16:38:11 +08:00
|
|
|
ret = arch_clk_init();
|
|
|
|
if (unlikely(ret)) {
|
|
|
|
pr_err("%s: CPU clock registration failed.\n", __func__);
|
|
|
|
return ret;
|
2006-01-17 14:14:17 +08:00
|
|
|
}
|
|
|
|
|
2009-05-13 16:38:11 +08:00
|
|
|
if (sh_mv.mv_clk_init) {
|
|
|
|
ret = sh_mv.mv_clk_init();
|
|
|
|
if (unlikely(ret)) {
|
|
|
|
pr_err("%s: machvec clock initialization failed.\n",
|
|
|
|
__func__);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
2007-05-15 07:42:22 +08:00
|
|
|
|
2006-01-17 14:14:17 +08:00
|
|
|
/* Kick the child clocks.. */
|
2009-05-12 03:27:43 +08:00
|
|
|
recalculate_root_clocks();
|
2006-01-17 14:14:17 +08:00
|
|
|
|
2009-05-12 04:14:53 +08:00
|
|
|
/* Enable the necessary init clocks */
|
|
|
|
clk_enable_init_clocks();
|
|
|
|
|
2006-01-17 14:14:17 +08:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2009-05-13 20:51:28 +08:00
|
|
|
|