~ubuntu-branches/ubuntu/precise/linux-linaro-u8500/precise

« back to all changes in this revision

Viewing changes to arch/arm/mach-omap2/board-omap3beagle.c

  • Committer: Bazaar Package Importer
  • Author(s): John Rigby, Upstream Fixes, Andy Green, John Rigby
  • Date: 2011-04-14 12:16:06 UTC
  • Revision ID: james.westby@ubuntu.com-20110414121606-b77podkyqgr2oix7
Tags: 2.6.38-1002.3
[ Upstream Fixes ]

* MUSB: shutdown: Make sure block is awake before doing shutdown
  - LP: #745737
* Fixed gpio polarity of gpio USB-phy reset.
  - LP: #747639

[ Andy Green ]

* LINARO: SAUCE: disable CONFIG_OMAP_RESET_CLOCKS
  - LP: #752900

[ John Rigby ]

* Rebase to new upstreams:
  Linux v2.6.38.1
  linaro-linux-2.6.38-upstream-29Mar2011
  Ubuntu-2.6.38-7.35
* SAUCE: OMAP4: clock: wait for module to become accessible on
  a clk enable
  - LP: #745737
* Rebase to new upstreams:
  Linux v2.6.38.2
  linaro-linux-2.6.38-upstream-5Apr2011
  Ubuntu-2.6.38-8.41
  - LP: #732842
* Update configs for device tree, dvfs and lttng
* LINARO: add building of dtb's
* LINARO: SAUCE: Disable lowest operating freqs on omap34xx
  - LP: #732912

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <linux/gpio.h>
24
24
#include <linux/input.h>
25
25
#include <linux/gpio_keys.h>
 
26
#include <linux/opp.h>
26
27
 
27
28
#include <linux/mtd/mtd.h>
28
29
#include <linux/mtd/partitions.h>
45
46
#include <plat/gpmc.h>
46
47
#include <plat/nand.h>
47
48
#include <plat/usb.h>
 
49
#include <plat/omap_device.h>
48
50
 
49
51
#include "mux.h"
50
52
#include "hsmmc.h"
51
53
#include "timer-gp.h"
 
54
#include "pm.h"
52
55
 
53
56
#define NAND_BLOCK_SIZE         SZ_128K
54
57
 
229
232
};
230
233
 
231
234
static struct regulator_consumer_supply beagle_vdac_supply =
232
 
        REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
235
        REGULATOR_SUPPLY("vdda_dac", "omapdss_venc");
233
236
 
234
237
static struct regulator_consumer_supply beagle_vdvi_supplies[] = {
235
 
        REGULATOR_SUPPLY("vdds_dsi", "omap_display"),
236
 
        REGULATOR_SUPPLY("vdds_sdi", "omap_display"),
237
 
        REGULATOR_SUPPLY("vdds_dsi", "omap_dsi1"),
 
238
        REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
 
239
        REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
238
240
};
239
241
 
240
242
static void __init beagle_display_init(void)
414
416
/* VPLL2 for digital video outputs */
415
417
static struct regulator_init_data beagle_vpll2 = {
416
418
        .constraints = {
 
419
                .name                   = "VDVI",
417
420
                .min_uV                 = 1800000,
418
421
                .max_uV                 = 1800000,
419
422
                .valid_modes_mask       = REGULATOR_MODE_NORMAL
429
432
        .usb_mode       = T2_USB_MODE_ULPI,
430
433
};
431
434
 
432
 
static struct twl4030_codec_audio_data beagle_audio_data = {
433
 
        .audio_mclk = 26000000,
434
 
};
 
435
static struct twl4030_codec_audio_data beagle_audio_data;
435
436
 
436
437
static struct twl4030_codec_data beagle_codec_data = {
437
438
        .audio_mclk = 26000000,
530
531
        },
531
532
};
532
533
 
533
 
static void __init omap3_beagle_init_irq(void)
 
534
static void __init omap3_beagle_init_early(void)
534
535
{
535
536
        omap2_init_common_infrastructure();
536
537
        omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
537
538
                                  mt46h32m32lf6_sdrc_params);
 
539
}
 
540
 
 
541
static void __init omap3_beagle_init_irq(void)
 
542
{
538
543
        omap_init_irq();
539
544
#ifdef CONFIG_OMAP_32K_TIMER
540
545
        omap2_gp_clockevent_set_gptimer(12);
579
584
        }
580
585
}
581
586
 
582
 
static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
 
587
static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
583
588
 
584
 
        .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
585
 
        .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
586
 
        .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
 
589
        .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
 
590
        .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
 
591
        .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
587
592
 
588
593
        .phy_reset  = true,
589
594
        .reset_gpio_port[0]  = -EINVAL,
603
608
        .power                  = 100,
604
609
};
605
610
 
 
611
static void __init beagle_opp_init(void)
 
612
{
 
613
        int r = 0;
 
614
 
 
615
        /* Initialize the omap3 opp table */
 
616
        if (omap3_opp_init()) {
 
617
                pr_err("%s: opp default init failed\n", __func__);
 
618
                return;
 
619
        }
 
620
 
 
621
        /* Custom OPP enabled for XM */
 
622
        if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
 
623
                struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
 
624
                struct omap_hwmod *dh = omap_hwmod_lookup("iva");
 
625
                struct device *dev;
 
626
 
 
627
                if (!mh || !dh) {
 
628
                        pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
 
629
                                __func__, mh, dh);
 
630
                        return;
 
631
                }
 
632
                /* Enable MPU 1GHz and lower opps */
 
633
                dev = &mh->od->pdev.dev;
 
634
                r = opp_enable(dev, 800000000);
 
635
                /* TODO: MPU 1GHz needs SR and ABB */
 
636
 
 
637
                /* Enable IVA 800MHz and lower opps */
 
638
                dev = &dh->od->pdev.dev;
 
639
                r |= opp_enable(dev, 660000000);
 
640
                /* TODO: DSP 800MHz needs SR and ABB */
 
641
                if (r) {
 
642
                        pr_err("%s: failed to enable higher opp %d\n",
 
643
                                __func__, r);
 
644
                        /*
 
645
                         * Cleanup - disable the higher freqs - we dont care
 
646
                         * about the results
 
647
                         */
 
648
                        dev = &mh->od->pdev.dev;
 
649
                        opp_disable(dev, 800000000);
 
650
                        dev = &dh->od->pdev.dev;
 
651
                        opp_disable(dev, 660000000);
 
652
                }
 
653
        }
 
654
        return;
 
655
}
 
656
 
606
657
static void __init omap3_beagle_init(void)
607
658
{
608
659
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
614
665
        omap_serial_init();
615
666
 
616
667
        usb_musb_init(&musb_board_data);
617
 
        usb_ehci_init(&ehci_pdata);
 
668
        usbhs_init(&usbhs_bdata);
618
669
        omap3beagle_flash_init();
619
670
 
620
671
        /* Ensure SDRC pins are mux'd for self-refresh */
622
673
        omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
623
674
 
624
675
        beagle_display_init();
 
676
        beagle_opp_init();
625
677
}
626
678
 
 
679
static const char *omap3_beagle_dt_match[] __initdata = {
 
680
       "ti,omap3-beagle",
 
681
       NULL
 
682
};
 
683
 
627
684
MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
628
685
        /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
629
686
        .boot_params    = 0x80000100,
 
687
        .reserve        = omap_reserve,
630
688
        .map_io         = omap3_map_io,
631
 
        .reserve        = omap_reserve,
 
689
        .init_early     = omap3_beagle_init_early,
632
690
        .init_irq       = omap3_beagle_init_irq,
633
691
        .init_machine   = omap3_beagle_init,
634
692
        .timer          = &omap_timer,
 
693
        .dt_compat      = omap3_beagle_dt_match,
635
694
MACHINE_END