diff options
Diffstat (limited to 'arch/arm/mach-davinci/clock.h')
-rw-r--r-- | arch/arm/mach-davinci/clock.h | 45 |
1 files changed, 29 insertions, 16 deletions
diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h index c92d77a3008..aa0a6115032 100644 --- a/arch/arm/mach-davinci/clock.h +++ b/arch/arm/mach-davinci/clock.h | |||
@@ -12,9 +12,6 @@ | |||
12 | #ifndef __ARCH_ARM_DAVINCI_CLOCK_H | 12 | #ifndef __ARCH_ARM_DAVINCI_CLOCK_H |
13 | #define __ARCH_ARM_DAVINCI_CLOCK_H | 13 | #define __ARCH_ARM_DAVINCI_CLOCK_H |
14 | 14 | ||
15 | #include <linux/list.h> | ||
16 | #include <asm/clkdev.h> | ||
17 | |||
18 | #define DAVINCI_PLL1_BASE 0x01c40800 | 15 | #define DAVINCI_PLL1_BASE 0x01c40800 |
19 | #define DAVINCI_PLL2_BASE 0x01c40c00 | 16 | #define DAVINCI_PLL2_BASE 0x01c40c00 |
20 | #define MAX_PLL 2 | 17 | #define MAX_PLL 2 |
@@ -53,6 +50,26 @@ | |||
53 | #define PLLDIV_EN BIT(15) | 50 | #define PLLDIV_EN BIT(15) |
54 | #define PLLDIV_RATIO_MASK 0x1f | 51 | #define PLLDIV_RATIO_MASK 0x1f |
55 | 52 | ||
53 | /* | ||
54 | * OMAP-L138 system reference guide recommends a wait for 4 OSCIN/CLKIN | ||
55 | * cycles to ensure that the PLLC has switched to bypass mode. Delay of 1us | ||
56 | * ensures we are good for all > 4MHz OSCIN/CLKIN inputs. Typically the input | ||
57 | * is ~25MHz. Units are micro seconds. | ||
58 | */ | ||
59 | #define PLL_BYPASS_TIME 1 | ||
60 | /* From OMAP-L138 datasheet table 6-4. Units are micro seconds */ | ||
61 | #define PLL_RESET_TIME 1 | ||
62 | /* | ||
63 | * From OMAP-L138 datasheet table 6-4; assuming prediv = 1, sqrt(pllm) = 4 | ||
64 | * Units are micro seconds. | ||
65 | */ | ||
66 | #define PLL_LOCK_TIME 20 | ||
67 | |||
68 | #ifndef __ASSEMBLER__ | ||
69 | |||
70 | #include <linux/list.h> | ||
71 | #include <asm/clkdev.h> | ||
72 | |||
56 | struct pll_data { | 73 | struct pll_data { |
57 | u32 phys_base; | 74 | u32 phys_base; |
58 | void __iomem *base; | 75 | void __iomem *base; |
@@ -89,23 +106,19 @@ struct clk { | |||
89 | #define CLK_PLL BIT(4) /* PLL-derived clock */ | 106 | #define CLK_PLL BIT(4) /* PLL-derived clock */ |
90 | #define PRE_PLL BIT(5) /* source is before PLL mult/div */ | 107 | #define PRE_PLL BIT(5) /* source is before PLL mult/div */ |
91 | 108 | ||
92 | struct davinci_clk { | 109 | #define CLK(dev, con, ck) \ |
93 | struct clk_lookup lk; | 110 | { \ |
94 | }; | 111 | .dev_id = dev, \ |
95 | 112 | .con_id = con, \ | |
96 | #define CLK(dev, con, ck) \ | 113 | .clk = ck, \ |
97 | { \ | 114 | } \ |
98 | .lk = { \ | ||
99 | .dev_id = dev, \ | ||
100 | .con_id = con, \ | ||
101 | .clk = ck, \ | ||
102 | }, \ | ||
103 | } | ||
104 | 115 | ||
105 | int davinci_clk_init(struct davinci_clk *clocks); | 116 | int davinci_clk_init(struct clk_lookup *clocks); |
106 | int davinci_set_pllrate(struct pll_data *pll, unsigned int prediv, | 117 | int davinci_set_pllrate(struct pll_data *pll, unsigned int prediv, |
107 | unsigned int mult, unsigned int postdiv); | 118 | unsigned int mult, unsigned int postdiv); |
108 | 119 | ||
109 | extern struct platform_device davinci_wdt_device; | 120 | extern struct platform_device davinci_wdt_device; |
110 | 121 | ||
111 | #endif | 122 | #endif |
123 | |||
124 | #endif | ||