diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3beagle.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3beagle.c | 73 |
1 files changed, 59 insertions, 14 deletions
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index f0963b6e4627..7640c054f43b 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/gpio.h> | 23 | #include <linux/gpio.h> |
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 | 27 | ||
27 | #include <linux/mtd/mtd.h> | 28 | #include <linux/mtd/mtd.h> |
28 | #include <linux/mtd/partitions.h> | 29 | #include <linux/mtd/partitions.h> |
@@ -45,10 +46,12 @@ | |||
45 | #include <plat/gpmc.h> | 46 | #include <plat/gpmc.h> |
46 | #include <plat/nand.h> | 47 | #include <plat/nand.h> |
47 | #include <plat/usb.h> | 48 | #include <plat/usb.h> |
49 | #include <plat/omap_device.h> | ||
48 | 50 | ||
49 | #include "mux.h" | 51 | #include "mux.h" |
50 | #include "hsmmc.h" | 52 | #include "hsmmc.h" |
51 | #include "timer-gp.h" | 53 | #include "timer-gp.h" |
54 | #include "pm.h" | ||
52 | 55 | ||
53 | #define NAND_BLOCK_SIZE SZ_128K | 56 | #define NAND_BLOCK_SIZE SZ_128K |
54 | 57 | ||
@@ -228,14 +231,6 @@ static struct omap_dss_board_info beagle_dss_data = { | |||
228 | .default_device = &beagle_dvi_device, | 231 | .default_device = &beagle_dvi_device, |
229 | }; | 232 | }; |
230 | 233 | ||
231 | static struct platform_device beagle_dss_device = { | ||
232 | .name = "omapdss", | ||
233 | .id = -1, | ||
234 | .dev = { | ||
235 | .platform_data = &beagle_dss_data, | ||
236 | }, | ||
237 | }; | ||
238 | |||
239 | static struct regulator_consumer_supply beagle_vdac_supply = | 234 | static struct regulator_consumer_supply beagle_vdac_supply = |
240 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); | 235 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
241 | 236 | ||
@@ -435,9 +430,7 @@ static struct twl4030_usb_data beagle_usb_data = { | |||
435 | .usb_mode = T2_USB_MODE_ULPI, | 430 | .usb_mode = T2_USB_MODE_ULPI, |
436 | }; | 431 | }; |
437 | 432 | ||
438 | static struct twl4030_codec_audio_data beagle_audio_data = { | 433 | static struct twl4030_codec_audio_data beagle_audio_data; |
439 | .audio_mclk = 26000000, | ||
440 | }; | ||
441 | 434 | ||
442 | static struct twl4030_codec_data beagle_codec_data = { | 435 | static struct twl4030_codec_data beagle_codec_data = { |
443 | .audio_mclk = 26000000, | 436 | .audio_mclk = 26000000, |
@@ -536,11 +529,15 @@ static struct platform_device keys_gpio = { | |||
536 | }, | 529 | }, |
537 | }; | 530 | }; |
538 | 531 | ||
539 | static void __init omap3_beagle_init_irq(void) | 532 | static void __init omap3_beagle_init_early(void) |
540 | { | 533 | { |
541 | omap2_init_common_infrastructure(); | 534 | omap2_init_common_infrastructure(); |
542 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | 535 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, |
543 | mt46h32m32lf6_sdrc_params); | 536 | mt46h32m32lf6_sdrc_params); |
537 | } | ||
538 | |||
539 | static void __init omap3_beagle_init_irq(void) | ||
540 | { | ||
544 | omap_init_irq(); | 541 | omap_init_irq(); |
545 | #ifdef CONFIG_OMAP_32K_TIMER | 542 | #ifdef CONFIG_OMAP_32K_TIMER |
546 | omap2_gp_clockevent_set_gptimer(12); | 543 | omap2_gp_clockevent_set_gptimer(12); |
@@ -550,7 +547,6 @@ static void __init omap3_beagle_init_irq(void) | |||
550 | static struct platform_device *omap3_beagle_devices[] __initdata = { | 547 | static struct platform_device *omap3_beagle_devices[] __initdata = { |
551 | &leds_gpio, | 548 | &leds_gpio, |
552 | &keys_gpio, | 549 | &keys_gpio, |
553 | &beagle_dss_device, | ||
554 | }; | 550 | }; |
555 | 551 | ||
556 | static void __init omap3beagle_flash_init(void) | 552 | static void __init omap3beagle_flash_init(void) |
@@ -610,6 +606,52 @@ static struct omap_musb_board_data musb_board_data = { | |||
610 | .power = 100, | 606 | .power = 100, |
611 | }; | 607 | }; |
612 | 608 | ||
609 | static void __init beagle_opp_init(void) | ||
610 | { | ||
611 | int r = 0; | ||
612 | |||
613 | /* Initialize the omap3 opp table */ | ||
614 | if (omap3_opp_init()) { | ||
615 | pr_err("%s: opp default init failed\n", __func__); | ||
616 | return; | ||
617 | } | ||
618 | |||
619 | /* Custom OPP enabled for XM */ | ||
620 | if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) { | ||
621 | struct omap_hwmod *mh = omap_hwmod_lookup("mpu"); | ||
622 | struct omap_hwmod *dh = omap_hwmod_lookup("iva"); | ||
623 | struct device *dev; | ||
624 | |||
625 | if (!mh || !dh) { | ||
626 | pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", | ||
627 | __func__, mh, dh); | ||
628 | return; | ||
629 | } | ||
630 | /* Enable MPU 1GHz and lower opps */ | ||
631 | dev = &mh->od->pdev.dev; | ||
632 | r = opp_enable(dev, 800000000); | ||
633 | /* TODO: MPU 1GHz needs SR and ABB */ | ||
634 | |||
635 | /* Enable IVA 800MHz and lower opps */ | ||
636 | dev = &dh->od->pdev.dev; | ||
637 | r |= opp_enable(dev, 660000000); | ||
638 | /* TODO: DSP 800MHz needs SR and ABB */ | ||
639 | if (r) { | ||
640 | pr_err("%s: failed to enable higher opp %d\n", | ||
641 | __func__, r); | ||
642 | /* | ||
643 | * Cleanup - disable the higher freqs - we dont care | ||
644 | * about the results | ||
645 | */ | ||
646 | dev = &mh->od->pdev.dev; | ||
647 | opp_disable(dev, 800000000); | ||
648 | dev = &dh->od->pdev.dev; | ||
649 | opp_disable(dev, 660000000); | ||
650 | } | ||
651 | } | ||
652 | return; | ||
653 | } | ||
654 | |||
613 | static void __init omap3_beagle_init(void) | 655 | static void __init omap3_beagle_init(void) |
614 | { | 656 | { |
615 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 657 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
@@ -617,6 +659,7 @@ static void __init omap3_beagle_init(void) | |||
617 | omap3_beagle_i2c_init(); | 659 | omap3_beagle_i2c_init(); |
618 | platform_add_devices(omap3_beagle_devices, | 660 | platform_add_devices(omap3_beagle_devices, |
619 | ARRAY_SIZE(omap3_beagle_devices)); | 661 | ARRAY_SIZE(omap3_beagle_devices)); |
662 | omap_display_init(&beagle_dss_data); | ||
620 | omap_serial_init(); | 663 | omap_serial_init(); |
621 | 664 | ||
622 | omap_mux_init_gpio(170, OMAP_PIN_INPUT); | 665 | omap_mux_init_gpio(170, OMAP_PIN_INPUT); |
@@ -633,13 +676,15 @@ static void __init omap3_beagle_init(void) | |||
633 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); | 676 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); |
634 | 677 | ||
635 | beagle_display_init(); | 678 | beagle_display_init(); |
679 | beagle_opp_init(); | ||
636 | } | 680 | } |
637 | 681 | ||
638 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") | 682 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") |
639 | /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ | 683 | /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ |
640 | .boot_params = 0x80000100, | 684 | .boot_params = 0x80000100, |
641 | .map_io = omap3_map_io, | ||
642 | .reserve = omap_reserve, | 685 | .reserve = omap_reserve, |
686 | .map_io = omap3_map_io, | ||
687 | .init_early = omap3_beagle_init_early, | ||
643 | .init_irq = omap3_beagle_init_irq, | 688 | .init_irq = omap3_beagle_init_irq, |
644 | .init_machine = omap3_beagle_init, | 689 | .init_machine = omap3_beagle_init, |
645 | .timer = &omap_timer, | 690 | .timer = &omap_timer, |