diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3beagle.c')
| -rw-r--r-- | arch/arm/mach-omap2/board-omap3beagle.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 388c431c745a..d41ab98890ff 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/input.h> | 24 | #include <linux/input.h> |
| 25 | #include <linux/gpio_keys.h> | 25 | #include <linux/gpio_keys.h> |
| 26 | #include <linux/opp.h> | 26 | #include <linux/opp.h> |
| 27 | #include <linux/cpu.h> | ||
| 27 | 28 | ||
| 28 | #include <linux/mtd/mtd.h> | 29 | #include <linux/mtd/mtd.h> |
| 29 | #include <linux/mtd/partitions.h> | 30 | #include <linux/mtd/partitions.h> |
| @@ -444,27 +445,31 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
| 444 | }; | 445 | }; |
| 445 | #endif | 446 | #endif |
| 446 | 447 | ||
| 447 | static void __init beagle_opp_init(void) | 448 | static int __init beagle_opp_init(void) |
| 448 | { | 449 | { |
| 449 | int r = 0; | 450 | int r = 0; |
| 450 | 451 | ||
| 451 | /* Initialize the omap3 opp table */ | 452 | if (!machine_is_omap3_beagle()) |
| 452 | if (omap3_opp_init()) { | 453 | return 0; |
| 454 | |||
| 455 | /* Initialize the omap3 opp table if not already created. */ | ||
| 456 | r = omap3_opp_init(); | ||
| 457 | if (IS_ERR_VALUE(r) && (r != -EEXIST)) { | ||
| 453 | pr_err("%s: opp default init failed\n", __func__); | 458 | pr_err("%s: opp default init failed\n", __func__); |
| 454 | return; | 459 | return r; |
| 455 | } | 460 | } |
| 456 | 461 | ||
| 457 | /* Custom OPP enabled for all xM versions */ | 462 | /* Custom OPP enabled for all xM versions */ |
| 458 | if (cpu_is_omap3630()) { | 463 | if (cpu_is_omap3630()) { |
| 459 | struct device *mpu_dev, *iva_dev; | 464 | struct device *mpu_dev, *iva_dev; |
| 460 | 465 | ||
| 461 | mpu_dev = omap_device_get_by_hwmod_name("mpu"); | 466 | mpu_dev = get_cpu_device(0); |
| 462 | iva_dev = omap_device_get_by_hwmod_name("iva"); | 467 | iva_dev = omap_device_get_by_hwmod_name("iva"); |
| 463 | 468 | ||
| 464 | if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) { | 469 | if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) { |
| 465 | pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", | 470 | pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", |
| 466 | __func__, mpu_dev, iva_dev); | 471 | __func__, mpu_dev, iva_dev); |
| 467 | return; | 472 | return -ENODEV; |
| 468 | } | 473 | } |
| 469 | /* Enable MPU 1GHz and lower opps */ | 474 | /* Enable MPU 1GHz and lower opps */ |
| 470 | r = opp_enable(mpu_dev, 800000000); | 475 | r = opp_enable(mpu_dev, 800000000); |
| @@ -484,8 +489,9 @@ static void __init beagle_opp_init(void) | |||
| 484 | opp_disable(iva_dev, 660000000); | 489 | opp_disable(iva_dev, 660000000); |
| 485 | } | 490 | } |
| 486 | } | 491 | } |
| 487 | return; | 492 | return 0; |
| 488 | } | 493 | } |
| 494 | device_initcall(beagle_opp_init); | ||
| 489 | 495 | ||
| 490 | static void __init omap3_beagle_init(void) | 496 | static void __init omap3_beagle_init(void) |
| 491 | { | 497 | { |
| @@ -522,8 +528,6 @@ static void __init omap3_beagle_init(void) | |||
| 522 | /* Ensure SDRC pins are mux'd for self-refresh */ | 528 | /* Ensure SDRC pins are mux'd for self-refresh */ |
| 523 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | 529 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
| 524 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); | 530 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); |
| 525 | |||
| 526 | beagle_opp_init(); | ||
| 527 | } | 531 | } |
| 528 | 532 | ||
| 529 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") | 533 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") |
