2006-01-17 06:14:17 +00:00
|
|
|
/*
|
|
|
|
* arch/sh/kernel/cpu/clock.c - SuperH clock framework
|
|
|
|
*
|
2009-05-11 19:27:43 +00:00
|
|
|
* Copyright (C) 2005 - 2009 Paul Mundt
|
2006-01-17 06:14:17 +00:00
|
|
|
*
|
|
|
|
* This clock framework is derived from the OMAP version by:
|
|
|
|
*
|
2009-05-11 19:27:43 +00:00
|
|
|
* Copyright (C) 2004 - 2008 Nokia Corporation
|
2006-01-17 06:14:17 +00:00
|
|
|
* Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
|
|
|
|
*
|
2006-12-01 04:15:14 +00:00
|
|
|
* Modified for omap shared clock framework by Tony Lindgren <tony@atomide.com>
|
|
|
|
*
|
2006-01-17 06:14:17 +00: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 12:45:19 +00:00
|
|
|
#include <linux/clk.h>
|
2006-01-17 06:14:17 +00:00
|
|
|
#include <asm/clock.h>
|
2009-05-13 08:38:11 +00:00
|
|
|
#include <asm/machvec.h>
|
2006-01-17 06:14:17 +00:00
|
|
|
|
|
|
|
int __init clk_init(void)
|
|
|
|
{
|
2009-05-13 08:38:11 +00:00
|
|
|
int ret;
|
2006-01-17 06:14:17 +00:00
|
|
|
|
2016-07-31 03:11:30 +00:00
|
|
|
#ifndef CONFIG_COMMON_CLK
|
2009-05-13 08:38:11 +00:00
|
|
|
ret = arch_clk_init();
|
|
|
|
if (unlikely(ret)) {
|
|
|
|
pr_err("%s: CPU clock registration failed.\n", __func__);
|
|
|
|
return ret;
|
2006-01-17 06:14:17 +00:00
|
|
|
}
|
2016-07-31 03:11:30 +00:00
|
|
|
#endif
|
2006-01-17 06:14:17 +00:00
|
|
|
|
2009-05-13 08:38:11 +00: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-14 23:42:22 +00:00
|
|
|
|
2016-07-31 03:11:30 +00:00
|
|
|
#ifndef CONFIG_COMMON_CLK
|
2006-01-17 06:14:17 +00:00
|
|
|
/* Kick the child clocks.. */
|
2009-05-11 19:27:43 +00:00
|
|
|
recalculate_root_clocks();
|
2006-01-17 06:14:17 +00:00
|
|
|
|
2009-05-11 20:14:53 +00:00
|
|
|
/* Enable the necessary init clocks */
|
|
|
|
clk_enable_init_clocks();
|
2016-07-31 03:11:30 +00:00
|
|
|
#endif
|
2009-05-11 20:14:53 +00:00
|
|
|
|
2006-01-17 06:14:17 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2009-05-13 12:51:28 +00:00
|
|
|
|