Search
SailfishOS Open Build Service
>
Projects
>
home:sledge
:
beagle
>
kernel-adaptation-dm3730
> 0016-medistream-setting-dpll2-clock-to-460MHz-for-DSP.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0016-medistream-setting-dpll2-clock-to-460MHz-for-DSP.patch of Package kernel-adaptation-dm3730
From 080be5b853a6e49ddad8fecc0eaafebb45f422d7 Mon Sep 17 00:00:00 2001 From: MediStream-Devel-VM <info@berlinux-solutions.de> Date: Wed, 15 Aug 2012 20:12:15 +0200 Subject: [PATCH 2/2] medistream: -setting dpll2 clock to 460MHz (for DSP) --- arch/arm/mach-omap2/board-medistream.c | 82 +++++++++++++++++++++++++++++-- 1 files changed, 76 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-omap2/board-medistream.c b/arch/arm/mach-omap2/board-medistream.c index a1ba578..c1255c8 100644 --- a/arch/arm/mach-omap2/board-medistream.c +++ b/arch/arm/mach-omap2/board-medistream.c @@ -22,6 +22,7 @@ #include <linux/input.h> #include <linux/leds.h> #include <linux/interrupt.h> +#include <linux/opp.h> #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> @@ -45,14 +46,16 @@ #include <plat/board.h> #include <plat/usb.h> -#include "common.h" #include <plat/mcspi.h> +#include <plat/omap_device.h> #include <video/omapdss.h> #include <video/omap-panel-dvi.h> #include "mux.h" #include "sdram-micron-mt46h32m32lf-6.h" #include "hsmmc.h" +#include "pm.h" +#include "common.h" #include "common-board-devices.h" #include <media/omap3isp.h> @@ -260,6 +263,12 @@ static int medistream_twl_gpio_setup(struct device *dev, mmc[0].gpio_cd = gpio + 0; omap_hsmmc_late_init(mmc); +#if 0 + gpio_request_one(gpio + TWL4030_GPIO_MAX, + (medistream_version == MEDISTREAM_BOARD_GEN_2 ? GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW), + "nEN_USB_PWR"); +#endif + return 0; } @@ -271,12 +280,13 @@ static struct twl4030_gpio_platform_data medistream_gpio_data = { .setup = medistream_twl_gpio_setup, }; -static struct regulator_consumer_supply omap3evm_vio_supply[] = { +static struct regulator_consumer_supply medistream_vio_supply[] = { REGULATOR_SUPPLY("vcc", "spi1.0"), + REGULATOR_SUPPLY("vio_1v8", NULL), }; /* VIO for ads7846 */ -static struct regulator_init_data omap3evm_vio = { +static struct regulator_init_data medistream_vio = { .constraints = { .min_uV = 1800000, .max_uV = 1800000, @@ -286,8 +296,8 @@ static struct regulator_init_data omap3evm_vio = { .valid_ops_mask = REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, }, - .num_consumer_supplies = ARRAY_SIZE(omap3evm_vio_supply), - .consumer_supplies = omap3evm_vio_supply, + .num_consumer_supplies = ARRAY_SIZE(medistream_vio_supply), + .consumer_supplies = medistream_vio_supply, }; static struct twl4030_platform_data medistream_twldata = { @@ -295,6 +305,7 @@ static struct twl4030_platform_data medistream_twldata = { .gpio = &medistream_gpio_data, .vmmc1 = &medistream_vmmc1, .vsim = &medistream_vsim, + .vio = &medistream_vio, }; static int __init medistream_i2c_init(void) @@ -386,8 +397,53 @@ static struct isp_platform_data medistream_isp_data = { NULL, NULL }; +static void __init medistream_opp_init(void) +{ + int r = 0; + + /* Initialize the omap3 opp table */ + if (omap3_opp_init()) { + pr_err("%s: opp default init failed\n", __func__); + return; + } + + /* Custom OPP enabled for all xM versions */ + if (cpu_is_omap3630()) { + struct device *mpu_dev, *iva_dev; + + mpu_dev = omap_device_get_by_hwmod_name("mpu"); + iva_dev = omap_device_get_by_hwmod_name("iva"); + + if (!mpu_dev || !iva_dev) { + pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", + __func__, mpu_dev, iva_dev); + return; + } + /* Enable MPU 1GHz and lower opps */ + r = opp_enable(mpu_dev, 800000000); + /* TODO: MPU 1GHz needs SR and ABB */ + + /* Enable IVA 800MHz and lower opps */ + r |= opp_enable(iva_dev, 660000000); + /* TODO: DSP 800MHz needs SR and ABB */ + if (r) { + pr_err("%s: failed to enable higher opp %d\n", + __func__, r); + /* + * Cleanup - disable the higher freqs - we dont care + * about the results + */ + opp_disable(mpu_dev, 800000000); + opp_disable(iva_dev, 660000000); + } + } + return; +} + static void __init medistream_init(void) { + struct clk *dpll2_ck; + pm_power_off = medistream_poweroff; medistream_get_revision(); @@ -443,10 +499,24 @@ static void __init medistream_init(void) omap_nand_flash_init(NAND_BUSWIDTH_16, medistream_nand_partitions, ARRAY_SIZE(medistream_nand_partitions)); + /* Ensure SDRC pins are mux'd for self-refresh */ + omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); + omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); + medistream_init_smsc911x(); medistream_display_init(); + medistream_opp_init(); omap3_init_camera(&medistream_isp_data); + + /* set dpll2_ck to 460MHz */ + dpll2_ck = clk_get(NULL, "dpll2_ck"); + if (IS_ERR(dpll2_ck)) { + pr_err("Cannot request dpll2_ck\n"); + return; + } + clk_set_rate(dpll2_ck, 460000000); + clk_enable(dpll2_ck); } MACHINE_START(MEDISTREAM, "Bewatec MediStream") @@ -454,7 +524,7 @@ MACHINE_START(MEDISTREAM, "Bewatec MediStream") .atag_offset = 0x100, .reserve = omap_reserve, .map_io = omap3_map_io, - .init_early = omap35xx_init_early, + .init_early = omap3_init_early, .init_irq = omap3_init_irq, .handle_irq = omap3_intc_handle_irq, .init_machine = medistream_init, -- 1.7.5.4