diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 006dc26..fc7c79e 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -45,10 +46,12 @@ #include #include #include +#include #include "mux.h" #include "hsmmc.h" #include "timer-gp.h" +#include "pm.h" #define NAND_BLOCK_SIZE SZ_128K @@ -698,6 +701,44 @@ static void __init omap3_beagle_init_irq(void) #ifdef CONFIG_OMAP_32K_TIMER omap2_gp_clockevent_set_gptimer(12); #endif + /* initialize the omap3 opp table */ + omap3_opp_init(); + + struct omap_hwmod *mh = omap_hwmod_lookup("mpu"); + struct omap_hwmod *dh = omap_hwmod_lookup("iva"); + struct device *dev; + int r = 0; + printk(KERN_INFO "OPP layer: checkpoint alpha"); + if (!mh || !dh) { + printk(KERN_INFO "OPP layer: checkpoint beta"); + pr_err("%s: aiee.. no mpu/dsp devices! %p %p\n", + __func__, mh, dh); + r = -EINVAL; + } else { + if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) { + /* enable mpu 1GHz and lower opps */ + printk(KERN_INFO "OPP layer: trying to enable 1GHz"); + dev = &mh->od->pdev.dev; + r = opp_enable(dev, 800000000); + r |= opp_enable(dev, 1000000000); + /* enable dsp 800MHz and lower opps */ + dev = &dh->od->pdev.dev; + r |= opp_enable(dev, 660000000); + r |= opp_enable(dev, 800000000); + } else if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4) { + /* enable mpu 720MHz opp */ + printk(KERN_INFO "OPP layer: trying to enable 720MHz"); + dev = &mh->od->pdev.dev; + r = opp_enable(dev, 720000000); + /* enable dsp 600MHz oop */ + dev = &dh->od->pdev.dev; + r |= opp_enable(dev, 600000000); + } + } + if (r) { + pr_err("%s: failed to enable higher opp %d\n", + __func__, r); + } } static struct platform_device *omap3_beagle_devices[] __initdata = { diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c index 0486fce..fd3a1af 100644 --- a/arch/arm/mach-omap2/opp3xxx_data.c +++ b/arch/arm/mach-omap2/opp3xxx_data.c @@ -21,6 +21,7 @@ #include #include "omap_opp_data.h" +#include "pm.h" static struct omap_opp_def __initdata omap34xx_opp_def_list[] = { /* MPU OPP1 */ @@ -88,7 +89,7 @@ static struct omap_opp_def __initdata omap36xx_opp_def_list[] = { /** * omap3_opp_init() - initialize omap3 opp table */ -static int __init omap3_opp_init(void) +int __init omap3_opp_init(void) { int r = -ENODEV;