aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2010-12-21 23:08:14 -0500
committerPaul Walmsley <paul@pwsan.com>2010-12-21 23:08:14 -0500
commit553d239aadc75bee70c7858ac4548d073cb3daff (patch)
treebf48a02f36751c00b17cbb4f1b40e2bb4cfd4ec9 /arch/arm/plat-omap
parentd4521f6731756c82a76d3e791c3ec2d28b38f97e (diff)
OMAP3: clock: clarify usage of struct clksel_rate.flags and struct omap_clk.cpu
Clarify the usage of the struct omap_clk.cpu flags (e.g., CK_*) to use bits only for individual SoC variants (e.g., CK_3430ES1, CK_3505, etc.). Superset flags, such as CK_3XXX or CK_AM35XX, are now defined as disjunctions of individual SoC variant flags. This simplifies the definition and use of these flags. struct omap_clk record definitions can now simply specify the bitmask of actual SoCs that the records are valid for. The clock init code can simply set a single CPU type mask bit for the SoC that is currently in use, and test against that, rather than needing to set some combination of flags. Similarly, clarify the use of struct clksel_rate.flags. The bit allocated for RATE_IN_3XXX has been reassigned, and RATE_IN_3XXX has been defined as a disjunction of the 34xx and 36xx rate flags. The advantages are the same as the above. Clarify the usage of struct omap_clk.cpu flags such as CK_34XX to only apply to the SoCs that they name, e.g., OMAP34xx chips. The previous practice caused significantly different SoCs, such as OMAP36xx, to be included in CK_34XX. In my opinion, this is much more intuitive. Similarly, clarify the use of struct clksel_rate.flags, such that RATE_IN_3430ES2PLUS now only applies to 34xx chips with ES level >= 2 - it does not apply to OMAP36xx. ... At some point, it probably makes sense to collapse the CK_* and RATE_IN_* flags together into a single bitfield, and possibly use the existing CHIP_IS_OMAP* flags for platform detection. ... This all seems to work fine on OMAP34xx and OMAP36xx Beagle. Not sure if it works on Sitara or the TI816X, unfortunately I don't have any here to test with. Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/include/plat/clkdev_omap.h20
-rw-r--r--arch/arm/plat-omap/include/plat/clock.h11
2 files changed, 18 insertions, 13 deletions
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index bb937f3fabed..b19774c9c112 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -31,18 +31,18 @@ struct omap_clk {
31#define CK_1510 (1 << 2) 31#define CK_1510 (1 << 2)
32#define CK_16XX (1 << 3) /* 16xx, 17xx, 5912 */ 32#define CK_16XX (1 << 3) /* 16xx, 17xx, 5912 */
33#define CK_242X (1 << 4) 33#define CK_242X (1 << 4)
34#define CK_243X (1 << 5) 34#define CK_243X (1 << 5) /* 243x, 253x */
35#define CK_3XXX (1 << 6) /* OMAP3 + AM3 common clocks*/ 35#define CK_3430ES1 (1 << 6) /* 34xxES1 only */
36#define CK_343X (1 << 7) /* OMAP34xx common clocks */ 36#define CK_3430ES2PLUS (1 << 7) /* 34xxES2, ES3, non-Sitara 35xx only */
37#define CK_3430ES1 (1 << 8) /* 34xxES1 only */ 37#define CK_3505 (1 << 8)
38#define CK_3430ES2 (1 << 9) /* 34xxES2, ES3, non-Sitara 35xx only */ 38#define CK_3517 (1 << 9)
39#define CK_3505 (1 << 10) 39#define CK_36XX (1 << 10) /* 36xx/37xx-specific clocks */
40#define CK_3517 (1 << 11) 40#define CK_443X (1 << 11)
41#define CK_36XX (1 << 12) /* OMAP36xx/37xx-specific clocks */
42#define CK_443X (1 << 13)
43 41
44#define CK_AM35XX (CK_3505 | CK_3517) /* all Sitara AM35xx */
45 42
43#define CK_34XX (CK_3430ES1 | CK_3430ES2PLUS)
44#define CK_AM35XX (CK_3505 | CK_3517) /* all Sitara AM35xx */
45#define CK_3XXX (CK_34XX | CK_AM35XX | CK_36XX)
46 46
47 47
48#endif 48#endif
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
index fef4696dcf67..6e223158268b 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -49,13 +49,18 @@ struct clkops {
49/* struct clksel_rate.flags possibilities */ 49/* struct clksel_rate.flags possibilities */
50#define RATE_IN_242X (1 << 0) 50#define RATE_IN_242X (1 << 0)
51#define RATE_IN_243X (1 << 1) 51#define RATE_IN_243X (1 << 1)
52#define RATE_IN_3XXX (1 << 2) /* rates common to all OMAP3 */ 52#define RATE_IN_3430ES1 (1 << 2) /* 3430ES1 rates only */
53#define RATE_IN_3430ES2 (1 << 3) /* 3430ES2 rates only */ 53#define RATE_IN_3430ES2PLUS (1 << 3) /* 3430 ES >= 2 rates only */
54#define RATE_IN_36XX (1 << 4) 54#define RATE_IN_36XX (1 << 4)
55#define RATE_IN_4430 (1 << 5) 55#define RATE_IN_4430 (1 << 5)
56 56
57#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X) 57#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
58#define RATE_IN_3430ES2PLUS (RATE_IN_3430ES2 | RATE_IN_36XX) 58#define RATE_IN_34XX (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
59#define RATE_IN_3XXX (RATE_IN_34XX | RATE_IN_36XX)
60
61/* RATE_IN_3430ES2PLUS_36XX includes 34xx/35xx with ES >=2, and all 36xx/37xx */
62#define RATE_IN_3430ES2PLUS_36XX (RATE_IN_3430ES2PLUS | RATE_IN_36XX)
63
59 64
60/** 65/**
61 * struct clksel_rate - register bitfield values corresponding to clk divisors 66 * struct clksel_rate - register bitfield values corresponding to clk divisors