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

Commit 30c730f8 authored by Sascha Hauer's avatar Sascha Hauer
Browse files

[ARM] MXC: rework timer/clock initialisation



- rename mxc_clocks_init to architecture specific versions. This
  allows us to have more than one architecture compiled in.
- call mxc_timer_init from clock initialisation instead from board
  code

Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
parent a2865197
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@


#include <mach/clock.h>
#include <mach/clock.h>
#include <mach/hardware.h>
#include <mach/hardware.h>
#include <mach/common.h>
#include "crm_regs.h"
#include "crm_regs.h"


static int _clk_enable(struct clk *clk)
static int _clk_enable(struct clk *clk)
@@ -594,7 +595,7 @@ static struct clk *mxc_clks[] = {
	&rtc_clk,
	&rtc_clk,
};
};


int __init mxc_clocks_init(unsigned long fref)
int __init mx1_clocks_init(unsigned long fref)
{
{
	struct clk **clkp;
	struct clk **clkp;
	unsigned int reg;
	unsigned int reg;
@@ -625,5 +626,7 @@ int __init mxc_clocks_init(unsigned long fref)
	clk_enable(&hclk);
	clk_enable(&hclk);
	clk_enable(&fclk);
	clk_enable(&fclk);


	mxc_timer_init(&gpt_clk);

	return 0;
	return 0;
}
}
+1 −2
Original line number Original line Diff line number Diff line
@@ -118,8 +118,7 @@ static void __init mx1ads_init(void)


static void __init mx1ads_timer_init(void)
static void __init mx1ads_timer_init(void)
{
{
	mxc_clocks_init(32000);
	mx1_clocks_init(32000);
	mxc_timer_init("gpt_clk");
}
}


struct sys_timer mx1ads_timer = {
struct sys_timer mx1ads_timer = {
+4 −1
Original line number Original line Diff line number Diff line
@@ -1551,7 +1551,7 @@ static void __init probe_mxc_clocks(void)
 * must be called very early to get information about the
 * must be called very early to get information about the
 * available clock rate when the timer framework starts
 * available clock rate when the timer framework starts
 */
 */
int __init mxc_clocks_init(unsigned long fref)
int __init mx27_clocks_init(unsigned long fref)
{
{
	u32 cscr;
	u32 cscr;
	struct clk **clkp;
	struct clk **clkp;
@@ -1593,5 +1593,8 @@ int __init mxc_clocks_init(unsigned long fref)
#ifdef CONFIG_DEBUG_LL_CONSOLE
#ifdef CONFIG_DEBUG_LL_CONSOLE
	clk_enable(&uart1_clk[0]);
	clk_enable(&uart1_clk[0]);
#endif
#endif

	mxc_timer_init(&gpt1_clk[0]);

	return 0;
	return 0;
}
}
+1 −2
Original line number Original line Diff line number Diff line
@@ -263,8 +263,7 @@ static void __init mx27ads_timer_init(void)
	if ((__raw_readw(PBC_VERSION_REG) & CKIH_27MHZ_BIT_SET) == 0)
	if ((__raw_readw(PBC_VERSION_REG) & CKIH_27MHZ_BIT_SET) == 0)
		fref = 27000000;
		fref = 27000000;


	mxc_clocks_init(fref);
	mx27_clocks_init(fref);
	mxc_timer_init("gpt_clk.0");
}
}


struct sys_timer mx27ads_timer = {
struct sys_timer mx27ads_timer = {
+1 −2
Original line number Original line Diff line number Diff line
@@ -230,8 +230,7 @@ static void __init pcm038_init(void)


static void __init pcm038_timer_init(void)
static void __init pcm038_timer_init(void)
{
{
	mxc_clocks_init(26000000);
	mx27_clocks_init(26000000);
	mxc_timer_init("gpt_clk.0");
}
}


struct sys_timer pcm038_timer = {
struct sys_timer pcm038_timer = {
Loading