Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 313192
b: refs/heads/master
c: d1b8a77
h: refs/heads/master
v: v3
  • Loading branch information
Pawel Moll committed Jul 13, 2012
1 parent a7d51e6 commit a692b71
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 206 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 56a34b03ff427046494db87f05fc810aaedd23a5
refs/heads/master: d1b8a775fdb686c949d31e366a898b64147543e0
3 changes: 1 addition & 2 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,13 @@ config ARCH_VEXPRESS
select ARM_AMBA
select ARM_TIMER_SP804
select CLKDEV_LOOKUP
select HAVE_MACH_CLKDEV
select COMMON_CLK
select GENERIC_CLOCKEVENTS
select HAVE_CLK
select HAVE_PATA_PLATFORM
select ICST
select NO_IOPORT
select PLAT_VERSATILE
select PLAT_VERSATILE_CLOCK
select PLAT_VERSATILE_CLCD
help
This enables support for the ARM Ltd Versatile Express boards.
Expand Down
55 changes: 10 additions & 45 deletions trunk/arch/arm/mach-vexpress/ct-ca9x4.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,45 +112,11 @@ static struct amba_device *ct_ca9x4_amba_devs[] __initdata = {
};


static long ct_round(struct clk *clk, unsigned long rate)
{
return rate;
}

static int ct_set(struct clk *clk, unsigned long rate)
{
u32 site = v2m_get_master_site();

return v2m_cfg_write(SYS_CFG_OSC | SYS_CFG_SITE(site) | 1, rate);
}

static const struct clk_ops osc1_clk_ops = {
.round = ct_round,
.set = ct_set,
};

static struct clk osc1_clk = {
.ops = &osc1_clk_ops,
.rate = 24000000,
};

static struct clk ct_sp804_clk = {
.rate = 1000000,
};

static struct clk_lookup lookups[] = {
{ /* CLCD */
.dev_id = "ct:clcd",
.clk = &osc1_clk,
}, { /* SP804 timers */
.dev_id = "sp804",
.con_id = "ct-timer0",
.clk = &ct_sp804_clk,
}, { /* SP804 timers */
.dev_id = "sp804",
.con_id = "ct-timer1",
.clk = &ct_sp804_clk,
},
static struct v2m_osc ct_osc1 = {
.osc = 1,
.rate_min = 10000000,
.rate_max = 80000000,
.rate_default = 23750000,
};

static struct resource pmu_resources[] = {
Expand Down Expand Up @@ -183,14 +149,10 @@ static struct platform_device pmu_device = {
.resource = pmu_resources,
};

static void __init ct_ca9x4_init_early(void)
{
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
}

static void __init ct_ca9x4_init(void)
{
int i;
struct clk *clk;

#ifdef CONFIG_CACHE_L2X0
void __iomem *l2x0_base = ioremap(CT_CA9X4_L2CC, SZ_4K);
Expand All @@ -202,6 +164,10 @@ static void __init ct_ca9x4_init(void)
l2x0_init(l2x0_base, 0x00400000, 0xfe0fffff);
#endif

ct_osc1.site = v2m_get_master_site();
clk = v2m_osc_register("ct:osc1", &ct_osc1);
clk_register_clkdev(clk, NULL, "ct:clcd");

for (i = 0; i < ARRAY_SIZE(ct_ca9x4_amba_devs); i++)
amba_device_register(ct_ca9x4_amba_devs[i], &iomem_resource);

Expand Down Expand Up @@ -243,7 +209,6 @@ struct ct_desc ct_ca9x4_desc __initdata = {
.id = V2M_CT_ID_CA9,
.name = "CA9x4",
.map_io = ct_ca9x4_map_io,
.init_early = ct_ca9x4_init_early,
.init_irq = ct_ca9x4_init_irq,
.init_tile = ct_ca9x4_init,
#ifdef CONFIG_SMP
Expand Down
15 changes: 0 additions & 15 deletions trunk/arch/arm/mach-vexpress/include/mach/clkdev.h

This file was deleted.

19 changes: 19 additions & 0 deletions trunk/arch/arm/mach-vexpress/include/mach/motherboard.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef __MACH_MOTHERBOARD_H
#define __MACH_MOTHERBOARD_H

#include <linux/clk-provider.h>

/*
* Physical addresses, offset from V2M_PA_CS0-3
*/
Expand Down Expand Up @@ -147,4 +149,21 @@ struct ct_desc {

extern struct ct_desc *ct_desc;

/*
* OSC clock provider
*/
struct v2m_osc {
struct clk_hw hw;
u8 site; /* 0 = motherboard, 1 = site 1, 2 = site 2 */
u8 stack; /* board stack position */
u16 osc;
unsigned long rate_min;
unsigned long rate_max;
unsigned long rate_default;
};

#define to_v2m_osc(osc) container_of(osc, struct v2m_osc, hw)

struct clk *v2m_osc_register(const char *name, struct v2m_osc *osc);

#endif
Loading

0 comments on commit a692b71

Please sign in to comment.