-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 336502 b: refs/heads/master c: 70ee657 h: refs/heads/master v: v3
- Loading branch information
Linus Walleij
authored and
Mike Turquette
committed
Nov 21, 2012
1 parent
0461dd4
commit feecfcc
Showing
5 changed files
with
104 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 7a9ad671ac0a0ec2fc86887a9416f837c0cfb801 | ||
refs/heads/master: 70ee65771424829fd092a1df9afcc7e24c94004b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Makefile for Versatile-specific clocks | ||
obj-$(CONFIG_ICST) += clk-icst.o | ||
obj-$(CONFIG_ARCH_INTEGRATOR) += clk-integrator.o | ||
obj-$(CONFIG_INTEGRATOR_IMPD1) += clk-impd1.o | ||
obj-$(CONFIG_ARCH_REALVIEW) += clk-realview.o | ||
obj-$(CONFIG_ARCH_VEXPRESS) += clk-vexpress.o | ||
obj-$(CONFIG_VEXPRESS_CONFIG) += clk-vexpress-osc.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* Clock driver for the ARM Integrator/IM-PD1 board | ||
* Copyright (C) 2012 Linus Walleij | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
#include <linux/clk-provider.h> | ||
#include <linux/clk.h> | ||
#include <linux/clkdev.h> | ||
#include <linux/err.h> | ||
#include <linux/io.h> | ||
#include <linux/platform_data/clk-integrator.h> | ||
|
||
#include <mach/impd1.h> | ||
|
||
#include "clk-icst.h" | ||
|
||
struct impd1_clk { | ||
struct clk *vcoclk; | ||
struct clk *uartclk; | ||
struct clk_lookup *clks[3]; | ||
}; | ||
|
||
static struct impd1_clk impd1_clks[4]; | ||
|
||
/* | ||
* There are two VCO's on the IM-PD1 but only one is used by the | ||
* kernel, that is why we are only implementing the control of | ||
* IMPD1_OSC1 here. | ||
*/ | ||
|
||
static const struct icst_params impd1_vco_params = { | ||
.ref = 24000000, /* 24 MHz */ | ||
.vco_max = ICST525_VCO_MAX_3V, | ||
.vco_min = ICST525_VCO_MIN, | ||
.vd_min = 12, | ||
.vd_max = 519, | ||
.rd_min = 3, | ||
.rd_max = 120, | ||
.s2div = icst525_s2div, | ||
.idx2s = icst525_idx2s, | ||
}; | ||
|
||
static const struct clk_icst_desc impd1_icst1_desc = { | ||
.params = &impd1_vco_params, | ||
.vco_offset = IMPD1_OSC1, | ||
.lock_offset = IMPD1_LOCK, | ||
}; | ||
|
||
/** | ||
* integrator_impd1_clk_init() - set up the integrator clock tree | ||
* @base: base address of the logic module (LM) | ||
* @id: the ID of this LM | ||
*/ | ||
void integrator_impd1_clk_init(void __iomem *base, unsigned int id) | ||
{ | ||
struct impd1_clk *imc; | ||
struct clk *clk; | ||
int i; | ||
|
||
if (id > 3) { | ||
pr_crit("no more than 4 LMs can be attached\n"); | ||
return; | ||
} | ||
imc = &impd1_clks[id]; | ||
|
||
clk = icst_clk_register(NULL, &impd1_icst1_desc, base); | ||
imc->vcoclk = clk; | ||
imc->clks[0] = clkdev_alloc(clk, NULL, "lm%x:01000", id); | ||
|
||
/* UART reference clock */ | ||
clk = clk_register_fixed_rate(NULL, "uartclk", NULL, CLK_IS_ROOT, | ||
14745600); | ||
imc->uartclk = clk; | ||
imc->clks[1] = clkdev_alloc(clk, NULL, "lm%x:00100", id); | ||
imc->clks[2] = clkdev_alloc(clk, NULL, "lm%x:00200", id); | ||
|
||
for (i = 0; i < ARRAY_SIZE(imc->clks); i++) | ||
clkdev_add(imc->clks[i]); | ||
} | ||
|
||
void integrator_impd1_clk_exit(unsigned int id) | ||
{ | ||
int i; | ||
struct impd1_clk *imc; | ||
|
||
if (id > 3) | ||
return; | ||
imc = &impd1_clks[id]; | ||
|
||
for (i = 0; i < ARRAY_SIZE(imc->clks); i++) | ||
clkdev_drop(imc->clks[i]); | ||
clk_unregister(imc->uartclk); | ||
clk_unregister(imc->vcoclk); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
void integrator_clk_init(bool is_cp); | ||
void integrator_impd1_clk_init(void __iomem *base, unsigned int id); | ||
void integrator_impd1_clk_exit(unsigned int id); |