diff options
author | Vaibhav Hiremath <hvaibhav@ti.com> | 2011-12-19 05:20:15 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-12-19 18:47:14 -0500 |
commit | 4de34f3572882fd0a0e655cda494577c22663215 (patch) | |
tree | bacfc1653577ac6470d7e99e7d1c21931157dc80 /arch/arm/mach-omap2/id.c | |
parent | 50a01e6440020877c2f71bc5ac4d818d9b8f31c1 (diff) |
ARM: OMAP2+: split omap2/3/4_check_revision function
We need to detect the SoC revision early, but the SoC
feature detection can be done later on. In order to allow
further clean-up later on, this patch separates the SoC
revision check from the SoC feature check.
This patch doesn't change functionality or behavior of the code
execution; it barely cleans up the code and splits into SoC
specific implementation for Rev ID and feature detection.
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
[tony@atomide.com: updated comments]
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/id.c')
-rw-r--r-- | arch/arm/mach-omap2/id.c | 46 |
1 files changed, 9 insertions, 37 deletions
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 752dcae8f78a..92e4d5558b1e 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -112,7 +112,7 @@ void omap_get_die_id(struct omap_die_id *odi) | |||
112 | odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_3); | 112 | odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_3); |
113 | } | 113 | } |
114 | 114 | ||
115 | static void __init omap24xx_check_revision(void) | 115 | void __init omap2xxx_check_revision(void) |
116 | { | 116 | { |
117 | int i, j; | 117 | int i, j; |
118 | u32 idcode, prod_id; | 118 | u32 idcode, prod_id; |
@@ -222,7 +222,7 @@ static void __init omap3_cpuinfo(void) | |||
222 | omap_features |= OMAP3_HAS_ ##feat; \ | 222 | omap_features |= OMAP3_HAS_ ##feat; \ |
223 | } | 223 | } |
224 | 224 | ||
225 | static void __init omap3_check_features(void) | 225 | void __init omap3xxx_check_features(void) |
226 | { | 226 | { |
227 | u32 status; | 227 | u32 status; |
228 | 228 | ||
@@ -249,9 +249,11 @@ static void __init omap3_check_features(void) | |||
249 | * TODO: Get additional info (where applicable) | 249 | * TODO: Get additional info (where applicable) |
250 | * e.g. Size of L2 cache. | 250 | * e.g. Size of L2 cache. |
251 | */ | 251 | */ |
252 | |||
253 | omap3_cpuinfo(); | ||
252 | } | 254 | } |
253 | 255 | ||
254 | static void __init omap4_check_features(void) | 256 | void __init omap4xxx_check_features(void) |
255 | { | 257 | { |
256 | u32 si_type; | 258 | u32 si_type; |
257 | 259 | ||
@@ -276,12 +278,13 @@ static void __init omap4_check_features(void) | |||
276 | } | 278 | } |
277 | } | 279 | } |
278 | 280 | ||
279 | static void __init ti81xx_check_features(void) | 281 | void __init ti81xx_check_features(void) |
280 | { | 282 | { |
281 | omap_features = OMAP3_HAS_NEON; | 283 | omap_features = OMAP3_HAS_NEON; |
284 | omap3_cpuinfo(); | ||
282 | } | 285 | } |
283 | 286 | ||
284 | static void __init omap3_check_revision(void) | 287 | void __init omap3xxx_check_revision(void) |
285 | { | 288 | { |
286 | u32 cpuid, idcode; | 289 | u32 cpuid, idcode; |
287 | u16 hawkeye; | 290 | u16 hawkeye; |
@@ -421,7 +424,7 @@ static void __init omap3_check_revision(void) | |||
421 | } | 424 | } |
422 | } | 425 | } |
423 | 426 | ||
424 | static void __init omap4_check_revision(void) | 427 | void __init omap4xxx_check_revision(void) |
425 | { | 428 | { |
426 | u32 idcode; | 429 | u32 idcode; |
427 | u16 hawkeye; | 430 | u16 hawkeye; |
@@ -495,37 +498,6 @@ static void __init omap4_check_revision(void) | |||
495 | } | 498 | } |
496 | 499 | ||
497 | /* | 500 | /* |
498 | * Try to detect the exact revision of the omap we're running on | ||
499 | */ | ||
500 | void __init omap2_check_revision(void) | ||
501 | { | ||
502 | /* | ||
503 | * At this point we have an idea about the processor revision set | ||
504 | * earlier with omap2_set_globals_tap(). | ||
505 | */ | ||
506 | if (cpu_is_omap24xx()) { | ||
507 | omap24xx_check_revision(); | ||
508 | } else if (cpu_is_omap34xx()) { | ||
509 | omap3_check_revision(); | ||
510 | |||
511 | /* TI81XX doesn't have feature register */ | ||
512 | if (!cpu_is_ti81xx()) | ||
513 | omap3_check_features(); | ||
514 | else | ||
515 | ti81xx_check_features(); | ||
516 | |||
517 | omap3_cpuinfo(); | ||
518 | return; | ||
519 | } else if (cpu_is_omap44xx()) { | ||
520 | omap4_check_revision(); | ||
521 | omap4_check_features(); | ||
522 | return; | ||
523 | } else { | ||
524 | pr_err("OMAP revision unknown, please fix!\n"); | ||
525 | } | ||
526 | } | ||
527 | |||
528 | /* | ||
529 | * Set up things for map_io and processor detection later on. Gets called | 501 | * Set up things for map_io and processor detection later on. Gets called |
530 | * pretty much first thing from board init. For multi-omap, this gets | 502 | * pretty much first thing from board init. For multi-omap, this gets |
531 | * cpu_is_omapxxxx() working accurately enough for map_io. Then we'll try to | 503 | * cpu_is_omapxxxx() working accurately enough for map_io. Then we'll try to |