diff options
author | Aneesh V <aneesh@ti.com> | 2011-09-23 13:20:14 -0400 |
---|---|---|
committer | Paolo Pisati <paolo.pisati@canonical.com> | 2012-08-17 04:19:20 -0400 |
commit | e3b4aebdd4deacf5f1cd4f44b0888d77a7e751a3 (patch) | |
tree | 8b39c3efd1cf55d24dec7976d2643c29aa68ca74 /arch/arm | |
parent | 8086a8ece6d83cd3808c786aa64a6c230147b7c5 (diff) |
OMAP4: ID: add omap_has_feature for max freq supported
Macros for identifying the max frequency supported by various
OMAP4 variants - Expanding along the lines of OMAP3's feature
handling.
[nm@ti.com: minor fixes for checks that should only for 443x|446x]
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Reviewed-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/id.c | 40 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/cpu.h | 23 |
2 files changed, 54 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index a2458b67dde..947dba4289d 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -31,7 +31,7 @@ | |||
31 | static struct omap_chip_id omap_chip; | 31 | static struct omap_chip_id omap_chip; |
32 | static unsigned int omap_revision; | 32 | static unsigned int omap_revision; |
33 | 33 | ||
34 | u32 omap3_features; | 34 | u32 omap_features; |
35 | 35 | ||
36 | unsigned int omap_rev(void) | 36 | unsigned int omap_rev(void) |
37 | { | 37 | { |
@@ -183,14 +183,14 @@ static void __init omap24xx_check_revision(void) | |||
183 | #define OMAP3_CHECK_FEATURE(status,feat) \ | 183 | #define OMAP3_CHECK_FEATURE(status,feat) \ |
184 | if (((status & OMAP3_ ##feat## _MASK) \ | 184 | if (((status & OMAP3_ ##feat## _MASK) \ |
185 | >> OMAP3_ ##feat## _SHIFT) != FEAT_ ##feat## _NONE) { \ | 185 | >> OMAP3_ ##feat## _SHIFT) != FEAT_ ##feat## _NONE) { \ |
186 | omap3_features |= OMAP3_HAS_ ##feat; \ | 186 | omap_features |= OMAP3_HAS_ ##feat; \ |
187 | } | 187 | } |
188 | 188 | ||
189 | static void __init omap3_check_features(void) | 189 | static void __init omap3_check_features(void) |
190 | { | 190 | { |
191 | u32 status; | 191 | u32 status; |
192 | 192 | ||
193 | omap3_features = 0; | 193 | omap_features = 0; |
194 | 194 | ||
195 | status = omap_ctrl_readl(OMAP3_CONTROL_OMAP_STATUS); | 195 | status = omap_ctrl_readl(OMAP3_CONTROL_OMAP_STATUS); |
196 | 196 | ||
@@ -200,11 +200,11 @@ static void __init omap3_check_features(void) | |||
200 | OMAP3_CHECK_FEATURE(status, NEON); | 200 | OMAP3_CHECK_FEATURE(status, NEON); |
201 | OMAP3_CHECK_FEATURE(status, ISP); | 201 | OMAP3_CHECK_FEATURE(status, ISP); |
202 | if (cpu_is_omap3630()) | 202 | if (cpu_is_omap3630()) |
203 | omap3_features |= OMAP3_HAS_192MHZ_CLK; | 203 | omap_features |= OMAP3_HAS_192MHZ_CLK; |
204 | if (!cpu_is_omap3505() && !cpu_is_omap3517()) | 204 | if (!cpu_is_omap3505() && !cpu_is_omap3517()) |
205 | omap3_features |= OMAP3_HAS_IO_WAKEUP; | 205 | omap_features |= OMAP3_HAS_IO_WAKEUP; |
206 | 206 | ||
207 | omap3_features |= OMAP3_HAS_SDRC; | 207 | omap_features |= OMAP3_HAS_SDRC; |
208 | 208 | ||
209 | /* | 209 | /* |
210 | * TODO: Get additional info (where applicable) | 210 | * TODO: Get additional info (where applicable) |
@@ -212,9 +212,34 @@ static void __init omap3_check_features(void) | |||
212 | */ | 212 | */ |
213 | } | 213 | } |
214 | 214 | ||
215 | static void __init omap4_check_features(void) | ||
216 | { | ||
217 | u32 si_type; | ||
218 | |||
219 | if (cpu_is_omap443x()) | ||
220 | omap_features |= OMAP4_HAS_MPU_1GHZ; | ||
221 | |||
222 | |||
223 | if (cpu_is_omap446x()) { | ||
224 | si_type = | ||
225 | read_tap_reg(OMAP4_CTRL_MODULE_CORE_STD_FUSE_PROD_ID_1); | ||
226 | switch ((si_type & (3 << 16)) >> 16) { | ||
227 | case 2: | ||
228 | /* High performance device */ | ||
229 | omap_features |= OMAP4_HAS_MPU_1_5GHZ; | ||
230 | break; | ||
231 | case 1: | ||
232 | default: | ||
233 | /* Standard device */ | ||
234 | omap_features |= OMAP4_HAS_MPU_1_2GHZ; | ||
235 | break; | ||
236 | } | ||
237 | } | ||
238 | } | ||
239 | |||
215 | static void __init ti816x_check_features(void) | 240 | static void __init ti816x_check_features(void) |
216 | { | 241 | { |
217 | omap3_features = OMAP3_HAS_NEON; | 242 | omap_features = OMAP3_HAS_NEON; |
218 | } | 243 | } |
219 | 244 | ||
220 | static void __init omap3_check_revision(void) | 245 | static void __init omap3_check_revision(void) |
@@ -532,6 +557,7 @@ void __init omap2_check_revision(void) | |||
532 | return; | 557 | return; |
533 | } else if (cpu_is_omap44xx()) { | 558 | } else if (cpu_is_omap44xx()) { |
534 | omap4_check_revision(); | 559 | omap4_check_revision(); |
560 | omap4_check_features(); | ||
535 | return; | 561 | return; |
536 | } else { | 562 | } else { |
537 | pr_err("OMAP revision unknown, please fix!\n"); | 563 | pr_err("OMAP revision unknown, please fix!\n"); |
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h index 3faa25120c5..24391fb2320 100644 --- a/arch/arm/plat-omap/include/plat/cpu.h +++ b/arch/arm/plat-omap/include/plat/cpu.h | |||
@@ -481,7 +481,7 @@ void omap2_check_revision(void); | |||
481 | /* | 481 | /* |
482 | * Runtime detection of OMAP3 features | 482 | * Runtime detection of OMAP3 features |
483 | */ | 483 | */ |
484 | extern u32 omap3_features; | 484 | extern u32 omap_features; |
485 | 485 | ||
486 | #define OMAP3_HAS_L2CACHE BIT(0) | 486 | #define OMAP3_HAS_L2CACHE BIT(0) |
487 | #define OMAP3_HAS_IVA BIT(1) | 487 | #define OMAP3_HAS_IVA BIT(1) |
@@ -491,11 +491,15 @@ extern u32 omap3_features; | |||
491 | #define OMAP3_HAS_192MHZ_CLK BIT(5) | 491 | #define OMAP3_HAS_192MHZ_CLK BIT(5) |
492 | #define OMAP3_HAS_IO_WAKEUP BIT(6) | 492 | #define OMAP3_HAS_IO_WAKEUP BIT(6) |
493 | #define OMAP3_HAS_SDRC BIT(7) | 493 | #define OMAP3_HAS_SDRC BIT(7) |
494 | #define OMAP4_HAS_MPU_1GHZ BIT(8) | ||
495 | #define OMAP4_HAS_MPU_1_2GHZ BIT(9) | ||
496 | #define OMAP4_HAS_MPU_1_5GHZ BIT(10) | ||
497 | |||
494 | 498 | ||
495 | #define OMAP3_HAS_FEATURE(feat,flag) \ | 499 | #define OMAP3_HAS_FEATURE(feat,flag) \ |
496 | static inline unsigned int omap3_has_ ##feat(void) \ | 500 | static inline unsigned int omap3_has_ ##feat(void) \ |
497 | { \ | 501 | { \ |
498 | return (omap3_features & OMAP3_HAS_ ##flag); \ | 502 | return omap_features & OMAP3_HAS_ ##flag; \ |
499 | } \ | 503 | } \ |
500 | 504 | ||
501 | OMAP3_HAS_FEATURE(l2cache, L2CACHE) | 505 | OMAP3_HAS_FEATURE(l2cache, L2CACHE) |
@@ -507,4 +511,19 @@ OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK) | |||
507 | OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP) | 511 | OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP) |
508 | OMAP3_HAS_FEATURE(sdrc, SDRC) | 512 | OMAP3_HAS_FEATURE(sdrc, SDRC) |
509 | 513 | ||
514 | /* | ||
515 | * Runtime detection of OMAP4 features | ||
516 | */ | ||
517 | extern u32 omap_features; | ||
518 | |||
519 | #define OMAP4_HAS_FEATURE(feat, flag) \ | ||
520 | static inline unsigned int omap4_has_ ##feat(void) \ | ||
521 | { \ | ||
522 | return omap_features & OMAP4_HAS_ ##flag; \ | ||
523 | } \ | ||
524 | |||
525 | OMAP4_HAS_FEATURE(mpu_1ghz, MPU_1GHZ) | ||
526 | OMAP4_HAS_FEATURE(mpu_1_2ghz, MPU_1_2GHZ) | ||
527 | OMAP4_HAS_FEATURE(mpu_1_5ghz, MPU_1_5GHZ) | ||
528 | |||
510 | #endif | 529 | #endif |