aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mmp/clock.h
diff options
context:
space:
mode:
authorEric Miao <eric.miao@marvell.com>2009-01-20 01:15:18 -0500
committerEric Miao <eric.miao@marvell.com>2009-03-22 22:11:34 -0400
commit49cbe78637eb0503f45fc9b556ec08918a616534 (patch)
tree96de29959c5ef512d8f1e0bea7eae2245b7cc3f9 /arch/arm/mach-mmp/clock.h
parentf8dec04d33b94a4cfa9358fd9666c01480bb164d (diff)
[ARM] pxa: add base support for Marvell's PXA168 processor line
"""The MarvellĀ® PXA168 processor is the first in a family of application processors targeted at mass market opportunities in computing and consumer devices. It balances high computing and multimedia performance with low power consumption to support extended battery life, and includes a wealth of integrated peripherals to reduce overall BOM cost .... """ See http://www.marvell.com/featured/pxa168.jsp for more information. 1. Marvell Mohawk core is a hybrid of xscale3 and its own ARM core, there are many enhancements like instructions for flushing the whole D-cache, and so on 2. Clock reuses Russell's common clkdev, and added the basic support for UART1/2. 3. Devices are a bit different from the 'mach-pxa' way, the platform devices are now dynamically allocated only when necessary (i.e. when pxa_register_device() is called). Description for each device are stored in an array of 'struct pxa_device_desc'. Now that: a. this array of device description is marked with __initdata and can be freed up system is fully up b. which means board code has to add all needed devices early in his initializing function c. platform specific data can now be marked as __initdata since they are allocated and copied by platform_device_add_data() 4. only the basic UART1/2/3 are added, more devices will come later. Signed-off-by: Jason Chagas <chagas@marvell.com> Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'arch/arm/mach-mmp/clock.h')
-rw-r--r--arch/arm/mach-mmp/clock.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/arch/arm/mach-mmp/clock.h b/arch/arm/mach-mmp/clock.h
new file mode 100644
index 000000000000..ed967e78e6a8
--- /dev/null
+++ b/arch/arm/mach-mmp/clock.h
@@ -0,0 +1,71 @@
1/*
2 * linux/arch/arm/mach-mmp/clock.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <asm/clkdev.h>
10
11struct clkops {
12 void (*enable)(struct clk *);
13 void (*disable)(struct clk *);
14 unsigned long (*getrate)(struct clk *);
15};
16
17struct clk {
18 const struct clkops *ops;
19
20 void __iomem *clk_rst; /* clock reset control register */
21 int fnclksel; /* functional clock select (APBC) */
22 uint32_t enable_val; /* value for clock enable (APMU) */
23 unsigned long rate;
24 int enabled;
25};
26
27extern struct clkops apbc_clk_ops;
28
29#define APBC_CLK(_name, _reg, _fnclksel, _rate) \
30struct clk clk_##_name = { \
31 .clk_rst = (void __iomem *)APBC_##_reg, \
32 .fnclksel = _fnclksel, \
33 .rate = _rate, \
34 .ops = &apbc_clk_ops, \
35}
36
37#define APBC_CLK_OPS(_name, _reg, _fnclksel, _rate, _ops) \
38struct clk clk_##_name = { \
39 .clk_rst = (void __iomem *)APBC_##_reg, \
40 .fnclksel = _fnclksel, \
41 .rate = _rate, \
42 .ops = _ops, \
43}
44
45#define APMU_CLK(_name, _reg, _eval, _rate) \
46struct clk clk_##_name = { \
47 .clk_rst = (void __iomem *)APMU_##_reg, \
48 .enable_val = _eval, \
49 .rate = _rate, \
50 .ops = &apmu_clk_ops, \
51}
52
53#define APMU_CLK_OPS(_name, _reg, _eval, _rate, _ops) \
54struct clk clk_##_name = { \
55 .clk_rst = (void __iomem *)APMU_##_reg, \
56 .enable_val = _eval, \
57 .rate = _rate, \
58 .ops = _ops, \
59}
60
61#define INIT_CLKREG(_clk, _devname, _conname) \
62 { \
63 .clk = _clk, \
64 .dev_id = _devname, \
65 .con_id = _conname, \
66 }
67
68extern struct clk clk_pxa168_gpio;
69extern struct clk clk_pxa168_timers;
70
71extern void clks_register(struct clk_lookup *, size_t);