diff options
author | Tony Lindgren <tony@atomide.com> | 2010-02-24 23:53:03 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-02-24 23:53:03 -0500 |
commit | b610ec502376d915b76a62e22576c5d0462cc9c9 (patch) | |
tree | 55206c47da1f010588964edafe09284fce704b63 /arch/arm/plat-omap/include | |
parent | 0fdc54b2019700a4b50179914e810367c14044a3 (diff) | |
parent | ad001f145dcf457251e78fe2ae2ed40df1bda4ed (diff) |
Merge branch 'for_2.6.34_b' of git://git.pwsan.com/linux-2.6 into omap-for-linus
Diffstat (limited to 'arch/arm/plat-omap/include')
-rw-r--r-- | arch/arm/plat-omap/include/plat/clock.h | 91 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/cpu.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap_device.h | 7 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap_hwmod.h | 136 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/powerdomain.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/prcm.h | 3 |
6 files changed, 179 insertions, 64 deletions
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h index 8a86df4ad99c..34f7fa9ad4c0 100644 --- a/arch/arm/plat-omap/include/plat/clock.h +++ b/arch/arm/plat-omap/include/plat/clock.h | |||
@@ -1,9 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/plat-omap/include/mach/clock.h | 2 | * OMAP clock: data structure definitions, function prototypes, shared macros |
3 | * | 3 | * |
4 | * Copyright (C) 2004 - 2005 Nokia corporation | 4 | * Copyright (C) 2004-2005, 2008-2010 Nokia Corporation |
5 | * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com> | 5 | * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com> |
6 | * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc | 6 | * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 2 as | 9 | * it under the terms of the GNU General Public License version 2 as |
@@ -22,8 +22,10 @@ struct clockdomain; | |||
22 | struct clkops { | 22 | struct clkops { |
23 | int (*enable)(struct clk *); | 23 | int (*enable)(struct clk *); |
24 | void (*disable)(struct clk *); | 24 | void (*disable)(struct clk *); |
25 | void (*find_idlest)(struct clk *, void __iomem **, u8 *); | 25 | void (*find_idlest)(struct clk *, void __iomem **, |
26 | void (*find_companion)(struct clk *, void __iomem **, u8 *); | 26 | u8 *, u8 *); |
27 | void (*find_companion)(struct clk *, void __iomem **, | ||
28 | u8 *); | ||
27 | }; | 29 | }; |
28 | 30 | ||
29 | #ifdef CONFIG_ARCH_OMAP2PLUS | 31 | #ifdef CONFIG_ARCH_OMAP2PLUS |
@@ -39,6 +41,50 @@ struct clksel { | |||
39 | const struct clksel_rate *rates; | 41 | const struct clksel_rate *rates; |
40 | }; | 42 | }; |
41 | 43 | ||
44 | /** | ||
45 | * struct dpll_data - DPLL registers and integration data | ||
46 | * @mult_div1_reg: register containing the DPLL M and N bitfields | ||
47 | * @mult_mask: mask of the DPLL M bitfield in @mult_div1_reg | ||
48 | * @div1_mask: mask of the DPLL N bitfield in @mult_div1_reg | ||
49 | * @clk_bypass: struct clk pointer to the clock's bypass clock input | ||
50 | * @clk_ref: struct clk pointer to the clock's reference clock input | ||
51 | * @control_reg: register containing the DPLL mode bitfield | ||
52 | * @enable_mask: mask of the DPLL mode bitfield in @control_reg | ||
53 | * @rate_tolerance: maximum variance allowed from target rate (in Hz) | ||
54 | * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate() | ||
55 | * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate() | ||
56 | * @max_multiplier: maximum valid non-bypass multiplier value (actual) | ||
57 | * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate() | ||
58 | * @min_divider: minimum valid non-bypass divider value (actual) | ||
59 | * @max_divider: maximum valid non-bypass divider value (actual) | ||
60 | * @modes: possible values of @enable_mask | ||
61 | * @autoidle_reg: register containing the DPLL autoidle mode bitfield | ||
62 | * @idlest_reg: register containing the DPLL idle status bitfield | ||
63 | * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg | ||
64 | * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg | ||
65 | * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg | ||
66 | * @auto_recal_bit: bitshift of the driftguard enable bit in @control_reg | ||
67 | * @recal_en_bit: bitshift of the PRM_IRQENABLE_* bit for recalibration IRQs | ||
68 | * @recal_st_bit: bitshift of the PRM_IRQSTATUS_* bit for recalibration IRQs | ||
69 | * @flags: DPLL type/features (see below) | ||
70 | * | ||
71 | * Possible values for @flags: | ||
72 | * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs) | ||
73 | * NO_DCO_SEL: don't program DCO (only for some J-type DPLLs) | ||
74 | |||
75 | * @freqsel_mask is only used on the OMAP34xx family and AM35xx. | ||
76 | * | ||
77 | * XXX Some DPLLs have multiple bypass inputs, so it's not technically | ||
78 | * correct to only have one @clk_bypass pointer. | ||
79 | * | ||
80 | * XXX @rate_tolerance should probably be deprecated - currently there | ||
81 | * don't seem to be any usecases for DPLL rounding that is not exact. | ||
82 | * | ||
83 | * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m, | ||
84 | * @last_rounded_n) should be separated from the runtime-fixed fields | ||
85 | * and placed into a differenct structure, so that the runtime-fixed data | ||
86 | * can be placed into read-only space. | ||
87 | */ | ||
42 | struct dpll_data { | 88 | struct dpll_data { |
43 | void __iomem *mult_div1_reg; | 89 | void __iomem *mult_div1_reg; |
44 | u32 mult_mask; | 90 | u32 mult_mask; |
@@ -50,13 +96,12 @@ struct dpll_data { | |||
50 | unsigned int rate_tolerance; | 96 | unsigned int rate_tolerance; |
51 | unsigned long last_rounded_rate; | 97 | unsigned long last_rounded_rate; |
52 | u16 last_rounded_m; | 98 | u16 last_rounded_m; |
99 | u16 max_multiplier; | ||
53 | u8 last_rounded_n; | 100 | u8 last_rounded_n; |
54 | u8 min_divider; | 101 | u8 min_divider; |
55 | u8 max_divider; | 102 | u8 max_divider; |
56 | u32 max_tolerance; | ||
57 | u16 max_multiplier; | ||
58 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) | ||
59 | u8 modes; | 103 | u8 modes; |
104 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) | ||
60 | void __iomem *autoidle_reg; | 105 | void __iomem *autoidle_reg; |
61 | void __iomem *idlest_reg; | 106 | void __iomem *idlest_reg; |
62 | u32 autoidle_mask; | 107 | u32 autoidle_mask; |
@@ -65,6 +110,7 @@ struct dpll_data { | |||
65 | u8 auto_recal_bit; | 110 | u8 auto_recal_bit; |
66 | u8 recal_en_bit; | 111 | u8 recal_en_bit; |
67 | u8 recal_st_bit; | 112 | u8 recal_st_bit; |
113 | u8 flags; | ||
68 | # endif | 114 | # endif |
69 | }; | 115 | }; |
70 | 116 | ||
@@ -74,12 +120,10 @@ struct clk { | |||
74 | struct list_head node; | 120 | struct list_head node; |
75 | const struct clkops *ops; | 121 | const struct clkops *ops; |
76 | const char *name; | 122 | const char *name; |
77 | int id; | ||
78 | struct clk *parent; | 123 | struct clk *parent; |
79 | struct list_head children; | 124 | struct list_head children; |
80 | struct list_head sibling; /* node for children */ | 125 | struct list_head sibling; /* node for children */ |
81 | unsigned long rate; | 126 | unsigned long rate; |
82 | __u32 flags; | ||
83 | void __iomem *enable_reg; | 127 | void __iomem *enable_reg; |
84 | unsigned long (*recalc)(struct clk *); | 128 | unsigned long (*recalc)(struct clk *); |
85 | int (*set_rate)(struct clk *, unsigned long); | 129 | int (*set_rate)(struct clk *, unsigned long); |
@@ -88,6 +132,7 @@ struct clk { | |||
88 | __u8 enable_bit; | 132 | __u8 enable_bit; |
89 | __s8 usecount; | 133 | __s8 usecount; |
90 | u8 fixed_div; | 134 | u8 fixed_div; |
135 | u8 flags; | ||
91 | #ifdef CONFIG_ARCH_OMAP2PLUS | 136 | #ifdef CONFIG_ARCH_OMAP2PLUS |
92 | void __iomem *clksel_reg; | 137 | void __iomem *clksel_reg; |
93 | u32 clksel_mask; | 138 | u32 clksel_mask; |
@@ -137,23 +182,18 @@ unsigned long omap_fixed_divisor_recalc(struct clk *clk); | |||
137 | extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); | 182 | extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); |
138 | extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table); | 183 | extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table); |
139 | #endif | 184 | #endif |
185 | extern struct clk *omap_clk_get_by_name(const char *name); | ||
140 | 186 | ||
141 | extern const struct clkops clkops_null; | 187 | extern const struct clkops clkops_null; |
142 | 188 | ||
189 | extern struct clk dummy_ck; | ||
190 | |||
143 | /* Clock flags */ | 191 | /* Clock flags */ |
144 | /* bit 0 is free */ | 192 | #define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */ |
145 | #define RATE_FIXED (1 << 1) /* Fixed clock rate */ | 193 | #define CLOCK_IDLE_CONTROL (1 << 1) |
146 | /* bits 2-4 are free */ | 194 | #define CLOCK_NO_IDLE_PARENT (1 << 2) |
147 | #define ENABLE_REG_32BIT (1 << 5) /* Use 32-bit access */ | 195 | #define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */ |
148 | #define CLOCK_IDLE_CONTROL (1 << 7) | 196 | #define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */ |
149 | #define CLOCK_NO_IDLE_PARENT (1 << 8) | ||
150 | #define DELAYED_APP (1 << 9) /* Delay application of clock */ | ||
151 | #define CONFIG_PARTICIPANT (1 << 10) /* Fundamental clock */ | ||
152 | #define ENABLE_ON_INIT (1 << 11) /* Enable upon framework init */ | ||
153 | #define INVERT_ENABLE (1 << 12) /* 0 enables, 1 disables */ | ||
154 | #define CLOCK_IN_OMAP4430 (1 << 13) | ||
155 | #define ALWAYS_ENABLED (1 << 14) | ||
156 | /* bits 13-31 are currently free */ | ||
157 | 197 | ||
158 | /* Clksel_rate flags */ | 198 | /* Clksel_rate flags */ |
159 | #define DEFAULT_RATE (1 << 0) | 199 | #define DEFAULT_RATE (1 << 0) |
@@ -161,7 +201,8 @@ extern const struct clkops clkops_null; | |||
161 | #define RATE_IN_243X (1 << 2) | 201 | #define RATE_IN_243X (1 << 2) |
162 | #define RATE_IN_343X (1 << 3) /* rates common to all 343X */ | 202 | #define RATE_IN_343X (1 << 3) /* rates common to all 343X */ |
163 | #define RATE_IN_3430ES2 (1 << 4) /* 3430ES2 rates only */ | 203 | #define RATE_IN_3430ES2 (1 << 4) /* 3430ES2 rates only */ |
164 | #define RATE_IN_4430 (1 << 5) | 204 | #define RATE_IN_36XX (1 << 5) |
205 | #define RATE_IN_4430 (1 << 6) | ||
165 | 206 | ||
166 | #define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X) | 207 | #define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X) |
167 | 208 | ||
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h index b80151c1ee61..ed8786c41df2 100644 --- a/arch/arm/plat-omap/include/plat/cpu.h +++ b/arch/arm/plat-omap/include/plat/cpu.h | |||
@@ -439,6 +439,7 @@ extern u32 omap3_features; | |||
439 | #define OMAP3_HAS_SGX BIT(2) | 439 | #define OMAP3_HAS_SGX BIT(2) |
440 | #define OMAP3_HAS_NEON BIT(3) | 440 | #define OMAP3_HAS_NEON BIT(3) |
441 | #define OMAP3_HAS_ISP BIT(4) | 441 | #define OMAP3_HAS_ISP BIT(4) |
442 | #define OMAP3_HAS_192MHZ_CLK BIT(5) | ||
442 | 443 | ||
443 | #define OMAP3_HAS_FEATURE(feat,flag) \ | 444 | #define OMAP3_HAS_FEATURE(feat,flag) \ |
444 | static inline unsigned int omap3_has_ ##feat(void) \ | 445 | static inline unsigned int omap3_has_ ##feat(void) \ |
@@ -451,5 +452,6 @@ OMAP3_HAS_FEATURE(sgx, SGX) | |||
451 | OMAP3_HAS_FEATURE(iva, IVA) | 452 | OMAP3_HAS_FEATURE(iva, IVA) |
452 | OMAP3_HAS_FEATURE(neon, NEON) | 453 | OMAP3_HAS_FEATURE(neon, NEON) |
453 | OMAP3_HAS_FEATURE(isp, ISP) | 454 | OMAP3_HAS_FEATURE(isp, ISP) |
455 | OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK) | ||
454 | 456 | ||
455 | #endif | 457 | #endif |
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h index 76d49171fed9..3694b622c4ac 100644 --- a/arch/arm/plat-omap/include/plat/omap_device.h +++ b/arch/arm/plat-omap/include/plat/omap_device.h | |||
@@ -62,6 +62,7 @@ | |||
62 | * | 62 | * |
63 | */ | 63 | */ |
64 | struct omap_device { | 64 | struct omap_device { |
65 | u32 magic; | ||
65 | struct platform_device pdev; | 66 | struct platform_device pdev; |
66 | struct omap_hwmod **hwmods; | 67 | struct omap_hwmod **hwmods; |
67 | struct omap_device_pm_latency *pm_lats; | 68 | struct omap_device_pm_latency *pm_lats; |
@@ -81,6 +82,7 @@ int omap_device_shutdown(struct platform_device *pdev); | |||
81 | 82 | ||
82 | /* Core code interface */ | 83 | /* Core code interface */ |
83 | 84 | ||
85 | bool omap_device_is_valid(struct omap_device *od); | ||
84 | int omap_device_count_resources(struct omap_device *od); | 86 | int omap_device_count_resources(struct omap_device *od); |
85 | int omap_device_fill_resources(struct omap_device *od, struct resource *res); | 87 | int omap_device_fill_resources(struct omap_device *od, struct resource *res); |
86 | 88 | ||
@@ -88,15 +90,16 @@ struct omap_device *omap_device_build(const char *pdev_name, int pdev_id, | |||
88 | struct omap_hwmod *oh, void *pdata, | 90 | struct omap_hwmod *oh, void *pdata, |
89 | int pdata_len, | 91 | int pdata_len, |
90 | struct omap_device_pm_latency *pm_lats, | 92 | struct omap_device_pm_latency *pm_lats, |
91 | int pm_lats_cnt); | 93 | int pm_lats_cnt, int is_early_device); |
92 | 94 | ||
93 | struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id, | 95 | struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id, |
94 | struct omap_hwmod **oh, int oh_cnt, | 96 | struct omap_hwmod **oh, int oh_cnt, |
95 | void *pdata, int pdata_len, | 97 | void *pdata, int pdata_len, |
96 | struct omap_device_pm_latency *pm_lats, | 98 | struct omap_device_pm_latency *pm_lats, |
97 | int pm_lats_cnt); | 99 | int pm_lats_cnt, int is_early_device); |
98 | 100 | ||
99 | int omap_device_register(struct omap_device *od); | 101 | int omap_device_register(struct omap_device *od); |
102 | int omap_early_device_register(struct omap_device *od); | ||
100 | 103 | ||
101 | /* OMAP PM interface */ | 104 | /* OMAP PM interface */ |
102 | int omap_device_align_pm_lat(struct platform_device *pdev, | 105 | int omap_device_align_pm_lat(struct platform_device *pdev, |
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h index 921990e2a29a..440b4164f2f6 100644 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * Copyright (C) 2009 Nokia Corporation | 4 | * Copyright (C) 2009 Nokia Corporation |
5 | * Paul Walmsley | 5 | * Paul Walmsley |
6 | * | 6 | * |
7 | * Created in collaboration with (alphabetical order): Benoit Cousson, | 7 | * Created in collaboration with (alphabetical order): Benoît Cousson, |
8 | * Kevin Hilman, Tony Lindgren, Rajendra Nayak, Vikram Pandita, Sakari | 8 | * Kevin Hilman, Tony Lindgren, Rajendra Nayak, Vikram Pandita, Sakari |
9 | * Poussa, Anand Sawant, Santosh Shilimkar, Richard Woodruff | 9 | * Poussa, Anand Sawant, Santosh Shilimkar, Richard Woodruff |
10 | * | 10 | * |
@@ -33,25 +33,42 @@ | |||
33 | #define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H | 33 | #define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H |
34 | 34 | ||
35 | #include <linux/kernel.h> | 35 | #include <linux/kernel.h> |
36 | #include <linux/list.h> | ||
36 | #include <linux/ioport.h> | 37 | #include <linux/ioport.h> |
37 | |||
38 | #include <plat/cpu.h> | 38 | #include <plat/cpu.h> |
39 | 39 | ||
40 | struct omap_device; | 40 | struct omap_device; |
41 | 41 | ||
42 | /* OCP SYSCONFIG bit shifts/masks */ | 42 | extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type1; |
43 | #define SYSC_MIDLEMODE_SHIFT 12 | 43 | extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2; |
44 | #define SYSC_MIDLEMODE_MASK (0x3 << SYSC_MIDLEMODE_SHIFT) | 44 | |
45 | #define SYSC_CLOCKACTIVITY_SHIFT 8 | 45 | /* |
46 | #define SYSC_CLOCKACTIVITY_MASK (0x3 << SYSC_CLOCKACTIVITY_SHIFT) | 46 | * OCP SYSCONFIG bit shifts/masks TYPE1. These are for IPs compliant |
47 | #define SYSC_SIDLEMODE_SHIFT 3 | 47 | * with the original PRCM protocol defined for OMAP2420 |
48 | #define SYSC_SIDLEMODE_MASK (0x3 << SYSC_SIDLEMODE_SHIFT) | 48 | */ |
49 | #define SYSC_ENAWAKEUP_SHIFT 2 | 49 | #define SYSC_TYPE1_MIDLEMODE_SHIFT 12 |
50 | #define SYSC_ENAWAKEUP_MASK (1 << SYSC_ENAWAKEUP_SHIFT) | 50 | #define SYSC_TYPE1_MIDLEMODE_MASK (0x3 << SYSC_MIDLEMODE_SHIFT) |
51 | #define SYSC_SOFTRESET_SHIFT 1 | 51 | #define SYSC_TYPE1_CLOCKACTIVITY_SHIFT 8 |
52 | #define SYSC_SOFTRESET_MASK (1 << SYSC_SOFTRESET_SHIFT) | 52 | #define SYSC_TYPE1_CLOCKACTIVITY_MASK (0x3 << SYSC_CLOCKACTIVITY_SHIFT) |
53 | #define SYSC_AUTOIDLE_SHIFT 0 | 53 | #define SYSC_TYPE1_SIDLEMODE_SHIFT 3 |
54 | #define SYSC_AUTOIDLE_MASK (1 << SYSC_AUTOIDLE_SHIFT) | 54 | #define SYSC_TYPE1_SIDLEMODE_MASK (0x3 << SYSC_SIDLEMODE_SHIFT) |
55 | #define SYSC_TYPE1_ENAWAKEUP_SHIFT 2 | ||
56 | #define SYSC_TYPE1_ENAWAKEUP_MASK (1 << SYSC_ENAWAKEUP_SHIFT) | ||
57 | #define SYSC_TYPE1_SOFTRESET_SHIFT 1 | ||
58 | #define SYSC_TYPE1_SOFTRESET_MASK (1 << SYSC_SOFTRESET_SHIFT) | ||
59 | #define SYSC_TYPE1_AUTOIDLE_SHIFT 0 | ||
60 | #define SYSC_TYPE1_AUTOIDLE_MASK (1 << SYSC_AUTOIDLE_SHIFT) | ||
61 | |||
62 | /* | ||
63 | * OCP SYSCONFIG bit shifts/masks TYPE2. These are for IPs compliant | ||
64 | * with the new PRCM protocol defined for new OMAP4 IPs. | ||
65 | */ | ||
66 | #define SYSC_TYPE2_SOFTRESET_SHIFT 0 | ||
67 | #define SYSC_TYPE2_SOFTRESET_MASK (1 << SYSC_TYPE2_SOFTRESET_SHIFT) | ||
68 | #define SYSC_TYPE2_SIDLEMODE_SHIFT 2 | ||
69 | #define SYSC_TYPE2_SIDLEMODE_MASK (0x3 << SYSC_TYPE2_SIDLEMODE_SHIFT) | ||
70 | #define SYSC_TYPE2_MIDLEMODE_SHIFT 4 | ||
71 | #define SYSC_TYPE2_MIDLEMODE_MASK (0x3 << SYSC_TYPE2_MIDLEMODE_SHIFT) | ||
55 | 72 | ||
56 | /* OCP SYSSTATUS bit shifts/masks */ | 73 | /* OCP SYSSTATUS bit shifts/masks */ |
57 | #define SYSS_RESETDONE_SHIFT 0 | 74 | #define SYSS_RESETDONE_SHIFT 0 |
@@ -62,7 +79,6 @@ struct omap_device; | |||
62 | #define HWMOD_IDLEMODE_NO (1 << 1) | 79 | #define HWMOD_IDLEMODE_NO (1 << 1) |
63 | #define HWMOD_IDLEMODE_SMART (1 << 2) | 80 | #define HWMOD_IDLEMODE_SMART (1 << 2) |
64 | 81 | ||
65 | |||
66 | /** | 82 | /** |
67 | * struct omap_hwmod_irq_info - MPU IRQs used by the hwmod | 83 | * struct omap_hwmod_irq_info - MPU IRQs used by the hwmod |
68 | * @name: name of the IRQ channel (module local name) | 84 | * @name: name of the IRQ channel (module local name) |
@@ -94,8 +110,7 @@ struct omap_hwmod_dma_info { | |||
94 | /** | 110 | /** |
95 | * struct omap_hwmod_opt_clk - optional clocks used by this hwmod | 111 | * struct omap_hwmod_opt_clk - optional clocks used by this hwmod |
96 | * @role: "sys", "32k", "tv", etc -- for use in clk_get() | 112 | * @role: "sys", "32k", "tv", etc -- for use in clk_get() |
97 | * @clkdev_dev_id: opt clock: clkdev dev_id string | 113 | * @clk: opt clock: OMAP clock name |
98 | * @clkdev_con_id: opt clock: clkdev con_id string | ||
99 | * @_clk: pointer to the struct clk (filled in at runtime) | 114 | * @_clk: pointer to the struct clk (filled in at runtime) |
100 | * | 115 | * |
101 | * The module's interface clock and main functional clock should not | 116 | * The module's interface clock and main functional clock should not |
@@ -103,8 +118,7 @@ struct omap_hwmod_dma_info { | |||
103 | */ | 118 | */ |
104 | struct omap_hwmod_opt_clk { | 119 | struct omap_hwmod_opt_clk { |
105 | const char *role; | 120 | const char *role; |
106 | const char *clkdev_dev_id; | 121 | const char *clk; |
107 | const char *clkdev_con_id; | ||
108 | struct clk *_clk; | 122 | struct clk *_clk; |
109 | }; | 123 | }; |
110 | 124 | ||
@@ -171,8 +185,7 @@ struct omap_hwmod_addr_space { | |||
171 | * @master: struct omap_hwmod that initiates OCP transactions on this link | 185 | * @master: struct omap_hwmod that initiates OCP transactions on this link |
172 | * @slave: struct omap_hwmod that responds to OCP transactions on this link | 186 | * @slave: struct omap_hwmod that responds to OCP transactions on this link |
173 | * @addr: address space associated with this link | 187 | * @addr: address space associated with this link |
174 | * @clkdev_dev_id: interface clock: clkdev dev_id string | 188 | * @clk: interface clock: OMAP clock name |
175 | * @clkdev_con_id: interface clock: clkdev con_id string | ||
176 | * @_clk: pointer to the interface struct clk (filled in at runtime) | 189 | * @_clk: pointer to the interface struct clk (filled in at runtime) |
177 | * @fw: interface firewall data | 190 | * @fw: interface firewall data |
178 | * @addr_cnt: ARRAY_SIZE(@addr) | 191 | * @addr_cnt: ARRAY_SIZE(@addr) |
@@ -191,8 +204,7 @@ struct omap_hwmod_ocp_if { | |||
191 | struct omap_hwmod *master; | 204 | struct omap_hwmod *master; |
192 | struct omap_hwmod *slave; | 205 | struct omap_hwmod *slave; |
193 | struct omap_hwmod_addr_space *addr; | 206 | struct omap_hwmod_addr_space *addr; |
194 | const char *clkdev_dev_id; | 207 | const char *clk; |
195 | const char *clkdev_con_id; | ||
196 | struct clk *_clk; | 208 | struct clk *_clk; |
197 | union { | 209 | union { |
198 | struct omap_hwmod_omap2_firewall omap2; | 210 | struct omap_hwmod_omap2_firewall omap2; |
@@ -236,7 +248,25 @@ struct omap_hwmod_ocp_if { | |||
236 | #define CLOCKACT_TEST_NONE 0x3 | 248 | #define CLOCKACT_TEST_NONE 0x3 |
237 | 249 | ||
238 | /** | 250 | /** |
239 | * struct omap_hwmod_sysconfig - hwmod OCP_SYSCONFIG/OCP_SYSSTATUS data | 251 | * struct omap_hwmod_sysc_fields - hwmod OCP_SYSCONFIG register field offsets. |
252 | * @midle_shift: Offset of the midle bit | ||
253 | * @clkact_shift: Offset of the clockactivity bit | ||
254 | * @sidle_shift: Offset of the sidle bit | ||
255 | * @enwkup_shift: Offset of the enawakeup bit | ||
256 | * @srst_shift: Offset of the softreset bit | ||
257 | * @autoidle_shift: Offset of the autoidle bit | ||
258 | */ | ||
259 | struct omap_hwmod_sysc_fields { | ||
260 | u8 midle_shift; | ||
261 | u8 clkact_shift; | ||
262 | u8 sidle_shift; | ||
263 | u8 enwkup_shift; | ||
264 | u8 srst_shift; | ||
265 | u8 autoidle_shift; | ||
266 | }; | ||
267 | |||
268 | /** | ||
269 | * struct omap_hwmod_class_sysconfig - hwmod class OCP_SYS* data | ||
240 | * @rev_offs: IP block revision register offset (from module base addr) | 270 | * @rev_offs: IP block revision register offset (from module base addr) |
241 | * @sysc_offs: OCP_SYSCONFIG register offset (from module base addr) | 271 | * @sysc_offs: OCP_SYSCONFIG register offset (from module base addr) |
242 | * @syss_offs: OCP_SYSSTATUS register offset (from module base addr) | 272 | * @syss_offs: OCP_SYSSTATUS register offset (from module base addr) |
@@ -252,14 +282,22 @@ struct omap_hwmod_ocp_if { | |||
252 | * been associated with the clocks marked in @clockact. This field is | 282 | * been associated with the clocks marked in @clockact. This field is |
253 | * only used if HWMOD_SET_DEFAULT_CLOCKACT is set (see below) | 283 | * only used if HWMOD_SET_DEFAULT_CLOCKACT is set (see below) |
254 | * | 284 | * |
285 | * @sysc_fields: structure containing the offset positions of various bits in | ||
286 | * SYSCONFIG register. This can be populated using omap_hwmod_sysc_type1 or | ||
287 | * omap_hwmod_sysc_type2 defined in omap_hwmod_common_data.c depending on | ||
288 | * whether the device ip is compliant with the original PRCM protocol | ||
289 | * defined for OMAP2420 or the new PRCM protocol for new OMAP4 IPs. | ||
290 | * If the device follows a different scheme for the sysconfig register , | ||
291 | * then this field has to be populated with the correct offset structure. | ||
255 | */ | 292 | */ |
256 | struct omap_hwmod_sysconfig { | 293 | struct omap_hwmod_class_sysconfig { |
257 | u16 rev_offs; | 294 | u16 rev_offs; |
258 | u16 sysc_offs; | 295 | u16 sysc_offs; |
259 | u16 syss_offs; | 296 | u16 syss_offs; |
260 | u8 idlemodes; | 297 | u8 idlemodes; |
261 | u8 sysc_flags; | 298 | u8 sysc_flags; |
262 | u8 clockact; | 299 | u8 clockact; |
300 | struct omap_hwmod_sysc_fields *sysc_fields; | ||
263 | }; | 301 | }; |
264 | 302 | ||
265 | /** | 303 | /** |
@@ -352,19 +390,33 @@ struct omap_hwmod_omap4_prcm { | |||
352 | #define _HWMOD_STATE_DISABLED 6 | 390 | #define _HWMOD_STATE_DISABLED 6 |
353 | 391 | ||
354 | /** | 392 | /** |
393 | * struct omap_hwmod_class - the type of an IP block | ||
394 | * @name: name of the hwmod_class | ||
395 | * @sysc: device SYSCONFIG/SYSSTATUS register data | ||
396 | * @rev: revision of the IP class | ||
397 | * | ||
398 | * Represent the class of a OMAP hardware "modules" (e.g. timer, | ||
399 | * smartreflex, gpio, uart...) | ||
400 | */ | ||
401 | struct omap_hwmod_class { | ||
402 | const char *name; | ||
403 | struct omap_hwmod_class_sysconfig *sysc; | ||
404 | u32 rev; | ||
405 | }; | ||
406 | |||
407 | /** | ||
355 | * struct omap_hwmod - integration data for OMAP hardware "modules" (IP blocks) | 408 | * struct omap_hwmod - integration data for OMAP hardware "modules" (IP blocks) |
356 | * @name: name of the hwmod | 409 | * @name: name of the hwmod |
410 | * @class: struct omap_hwmod_class * to the class of this hwmod | ||
357 | * @od: struct omap_device currently associated with this hwmod (internal use) | 411 | * @od: struct omap_device currently associated with this hwmod (internal use) |
358 | * @mpu_irqs: ptr to an array of MPU IRQs (see also mpu_irqs_cnt) | 412 | * @mpu_irqs: ptr to an array of MPU IRQs (see also mpu_irqs_cnt) |
359 | * @sdma_chs: ptr to an array of SDMA channel IDs (see also sdma_chs_cnt) | 413 | * @sdma_chs: ptr to an array of SDMA channel IDs (see also sdma_chs_cnt) |
360 | * @prcm: PRCM data pertaining to this hwmod | 414 | * @prcm: PRCM data pertaining to this hwmod |
361 | * @clkdev_dev_id: main clock: clkdev dev_id string | 415 | * @main_clk: main clock: OMAP clock name |
362 | * @clkdev_con_id: main clock: clkdev con_id string | ||
363 | * @_clk: pointer to the main struct clk (filled in at runtime) | 416 | * @_clk: pointer to the main struct clk (filled in at runtime) |
364 | * @opt_clks: other device clocks that drivers can request (0..*) | 417 | * @opt_clks: other device clocks that drivers can request (0..*) |
365 | * @masters: ptr to array of OCP ifs that this hwmod can initiate on | 418 | * @masters: ptr to array of OCP ifs that this hwmod can initiate on |
366 | * @slaves: ptr to array of OCP ifs that this hwmod can respond on | 419 | * @slaves: ptr to array of OCP ifs that this hwmod can respond on |
367 | * @sysconfig: device SYSCONFIG/SYSSTATUS register data | ||
368 | * @dev_attr: arbitrary device attributes that can be passed to the driver | 420 | * @dev_attr: arbitrary device attributes that can be passed to the driver |
369 | * @_sysc_cache: internal-use hwmod flags | 421 | * @_sysc_cache: internal-use hwmod flags |
370 | * @_rt_va: cached register target start address (internal use) | 422 | * @_rt_va: cached register target start address (internal use) |
@@ -383,16 +435,17 @@ struct omap_hwmod_omap4_prcm { | |||
383 | * @omap_chip: OMAP chips this hwmod is present on | 435 | * @omap_chip: OMAP chips this hwmod is present on |
384 | * @node: list node for hwmod list (internal use) | 436 | * @node: list node for hwmod list (internal use) |
385 | * | 437 | * |
386 | * @clkdev_dev_id, @clkdev_con_id, and @clk all refer to this module's "main | 438 | * @main_clk refers to this module's "main clock," which for our |
387 | * clock," which for our purposes is defined as "the functional clock needed | 439 | * purposes is defined as "the functional clock needed for register |
388 | * for register accesses to complete." Modules may not have a main clock if | 440 | * accesses to complete." Modules may not have a main clock if the |
389 | * the interface clock also serves as a main clock. | 441 | * interface clock also serves as a main clock. |
390 | * | 442 | * |
391 | * Parameter names beginning with an underscore are managed internally by | 443 | * Parameter names beginning with an underscore are managed internally by |
392 | * the omap_hwmod code and should not be set during initialization. | 444 | * the omap_hwmod code and should not be set during initialization. |
393 | */ | 445 | */ |
394 | struct omap_hwmod { | 446 | struct omap_hwmod { |
395 | const char *name; | 447 | const char *name; |
448 | struct omap_hwmod_class *class; | ||
396 | struct omap_device *od; | 449 | struct omap_device *od; |
397 | struct omap_hwmod_irq_info *mpu_irqs; | 450 | struct omap_hwmod_irq_info *mpu_irqs; |
398 | struct omap_hwmod_dma_info *sdma_chs; | 451 | struct omap_hwmod_dma_info *sdma_chs; |
@@ -400,13 +453,11 @@ struct omap_hwmod { | |||
400 | struct omap_hwmod_omap2_prcm omap2; | 453 | struct omap_hwmod_omap2_prcm omap2; |
401 | struct omap_hwmod_omap4_prcm omap4; | 454 | struct omap_hwmod_omap4_prcm omap4; |
402 | } prcm; | 455 | } prcm; |
403 | const char *clkdev_dev_id; | 456 | const char *main_clk; |
404 | const char *clkdev_con_id; | ||
405 | struct clk *_clk; | 457 | struct clk *_clk; |
406 | struct omap_hwmod_opt_clk *opt_clks; | 458 | struct omap_hwmod_opt_clk *opt_clks; |
407 | struct omap_hwmod_ocp_if **masters; /* connect to *_IA */ | 459 | struct omap_hwmod_ocp_if **masters; /* connect to *_IA */ |
408 | struct omap_hwmod_ocp_if **slaves; /* connect to *_TA */ | 460 | struct omap_hwmod_ocp_if **slaves; /* connect to *_TA */ |
409 | struct omap_hwmod_sysconfig *sysconfig; | ||
410 | void *dev_attr; | 461 | void *dev_attr; |
411 | u32 _sysc_cache; | 462 | u32 _sysc_cache; |
412 | void __iomem *_rt_va; | 463 | void __iomem *_rt_va; |
@@ -467,4 +518,17 @@ int omap_hwmod_set_clockact_none(struct omap_hwmod *oh); | |||
467 | int omap_hwmod_enable_wakeup(struct omap_hwmod *oh); | 518 | int omap_hwmod_enable_wakeup(struct omap_hwmod *oh); |
468 | int omap_hwmod_disable_wakeup(struct omap_hwmod *oh); | 519 | int omap_hwmod_disable_wakeup(struct omap_hwmod *oh); |
469 | 520 | ||
521 | int omap_hwmod_for_each_by_class(const char *classname, | ||
522 | int (*fn)(struct omap_hwmod *oh, | ||
523 | void *user), | ||
524 | void *user); | ||
525 | |||
526 | /* | ||
527 | * Chip variant-specific hwmod init routines - XXX should be converted | ||
528 | * to use initcalls once the initial boot ordering is straightened out | ||
529 | */ | ||
530 | extern int omap2420_hwmod_init(void); | ||
531 | extern int omap2430_hwmod_init(void); | ||
532 | extern int omap3xxx_hwmod_init(void); | ||
533 | |||
470 | #endif | 534 | #endif |
diff --git a/arch/arm/plat-omap/include/plat/powerdomain.h b/arch/arm/plat-omap/include/plat/powerdomain.h index e15c7e9da975..d82b2c00d4f1 100644 --- a/arch/arm/plat-omap/include/plat/powerdomain.h +++ b/arch/arm/plat-omap/include/plat/powerdomain.h | |||
@@ -100,6 +100,8 @@ struct powerdomain { | |||
100 | struct list_head node; | 100 | struct list_head node; |
101 | int state; | 101 | int state; |
102 | unsigned state_counter[PWRDM_MAX_PWRSTS]; | 102 | unsigned state_counter[PWRDM_MAX_PWRSTS]; |
103 | unsigned ret_logic_off_counter; | ||
104 | unsigned ret_mem_off_counter[PWRDM_MAX_MEM_BANKS]; | ||
103 | 105 | ||
104 | #ifdef CONFIG_PM_DEBUG | 106 | #ifdef CONFIG_PM_DEBUG |
105 | s64 timer; | 107 | s64 timer; |
@@ -137,8 +139,10 @@ int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst); | |||
137 | 139 | ||
138 | int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm); | 140 | int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm); |
139 | int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm); | 141 | int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm); |
142 | int pwrdm_read_logic_retst(struct powerdomain *pwrdm); | ||
140 | int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank); | 143 | int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank); |
141 | int pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank); | 144 | int pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank); |
145 | int pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank); | ||
142 | 146 | ||
143 | int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm); | 147 | int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm); |
144 | int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm); | 148 | int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm); |
diff --git a/arch/arm/plat-omap/include/plat/prcm.h b/arch/arm/plat-omap/include/plat/prcm.h index 66938a9f8dae..d6a0e27d5a7f 100644 --- a/arch/arm/plat-omap/include/plat/prcm.h +++ b/arch/arm/plat-omap/include/plat/prcm.h | |||
@@ -25,7 +25,8 @@ | |||
25 | 25 | ||
26 | u32 omap_prcm_get_reset_sources(void); | 26 | u32 omap_prcm_get_reset_sources(void); |
27 | void omap_prcm_arch_reset(char mode); | 27 | void omap_prcm_arch_reset(char mode); |
28 | int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, const char *name); | 28 | int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest, |
29 | const char *name); | ||
29 | 30 | ||
30 | #define START_PADCONF_SAVE 0x2 | 31 | #define START_PADCONF_SAVE 0x2 |
31 | #define PADCONF_SAVE_DONE 0x1 | 32 | #define PADCONF_SAVE_DONE 0x1 |