Skip to content

Commit

Permalink
dpll_cascading (wip)
Browse files Browse the repository at this point in the history
Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
  • Loading branch information
lucize committed Mar 9, 2015
1 parent 9d56009 commit 4f08701
Show file tree
Hide file tree
Showing 16 changed files with 335 additions and 178 deletions.
2 changes: 1 addition & 1 deletion arch/arm/configs/mapphone_mmi_defconfig
Expand Up @@ -338,7 +338,7 @@ CONFIG_OMAP_REBOOT_REASON=y
CONFIG_OMAP_RAM_CONSOLE=y
CONFIG_OMAP4_PPA_CPU1_ONLINE_BUG=y
# CONFIG_OMAP4_DPLL_CASCADING is not set
# CONFIG_OMAP4_ONLY_OMAP4430_DPLL_CASCADING is not set
CONFIG_OMAP4_ONLY_OMAP4430_DPLL_CASCADING=y

#
# System MMU
Expand Down
111 changes: 80 additions & 31 deletions arch/arm/mach-omap2/Kconfig
Expand Up @@ -336,6 +336,8 @@ config MACH_OMAP_4430SDP
select TWL6030_GPADC
select OMAP_REBOOT_REASON
select OMAP_RAM_CONSOLE
select CDC_TCXO
select OMAP_RFKILL_STE_MODEM

config MACH_OMAP_BLAZE
bool "OMAP 44xx Tablet2 Board"
Expand All @@ -344,6 +346,7 @@ config MACH_OMAP_BLAZE
select OMAP_PACKAGE_CBL
select OMAP_PACKAGE_CBS
select TOUCHSCREEN_QUANTUM_OBP
select TOUCHSCREEN_CYPRESS_TTSP
select LEDS_OMAP4430_SDP_DISPLAY
select LEDS_OMAP4430_SDP_KEYPAD
select INPUT_TSL2771
Expand All @@ -356,6 +359,7 @@ config MACH_OMAP_BLAZE
select TWL6040_VIB
select OMAP_REBOOT_REASON
select OMAP_RAM_CONSOLE
select CDC_TCXO

config MACH_OMAP4_PANDA
bool "OMAP4 Panda Board"
Expand Down Expand Up @@ -401,6 +405,7 @@ config EMU_UART_DEBUG
config OMAP3_EMU
bool "OMAP3 debugging peripherals"
depends on ARCH_OMAP3
select ARM_AMBA
select OC_ETM
help
Say Y here to enable debugging hardware of omap3
Expand Down Expand Up @@ -456,47 +461,46 @@ config PM_DEEPSLEEP
kernel ignore all key press except long press power key.

config MOT_ENG_PHONE_RESET
bool "Set reset mode for engineering phone"
default n
help
Select this option to set dedicated reset mode for engineering phone.
bool "Set reset mode for engineering phone"
default n
help
Select this option to set dedicated reset mode for engineering phone.

config OMAP_REBOOT_REASON
depends on ARCH_OMAP4
bool

config OMAP3_EXPORT_DIE_ID
bool "Export DIE ID code under /proc/socinfo"
depends on ARCH_OMAP3
default n
help
Say Y here if you need DIE ID code to be exported via /proc/socinfo
in production systems. You will need also to explicitly flag it by
appending the "omap3_die_id" parameter to your boot command line.
bool "Export DIE ID code under /proc/socinfo"
depends on ARCH_OMAP3
default n
help
Say Y here if you need DIE ID code to be exported via /proc/socinfo
in production systems. You will need also to explicitly flag it by
appending the "omap3_die_id" parameter to your boot command line.

config OMAP4_DPLL_CASCADING
bool "Enable DPLL Cascading for OMAP4"
depends on ARCH_OMAP4
depends on PM
depends on HAS_EARLYSUSPEND
default y
help
Select this option to enable DPLL Cascading during Low power mp3
playback. It will enter DPLL cascade when :
- Head set is inserted.
- Display is Off.
- No USB.
bool "Enable DPLL Cascading for OMAP4"
depends on ARCH_OMAP4
depends on PM
depends on HAS_EARLYSUSPEND
default y
help
Select this option to enable DPLL Cascading during Low power mp3
playback. It will enter DPLL cascade when :
- Head set is inserted.
- Display is Off.
- No USB.

config OMAP4_ONLY_OMAP4430_DPLL_CASCADING
bool "Enable DPLL Cascading for OMAP4430 only"
depends on OMAP4_DPLL_CASCADING
default y
help
Enables DPLL Cascading only for OMAP4430.
Current DPLL cascading implementation is going to be used
only on OMAP4430, where it provides significant power savings.
Keeps DPLL cascading disabled for other OMAPs.

bool "Enable DPLL Cascading for OMAP4430 only"
depends on OMAP4_DPLL_CASCADING
default n
help
Enables DPLL Cascading only for OMAP4430.
Current DPLL cascading implementation is going to be used
only on OMAP4430, where it provides significant power savings.
Keeps DPLL cascading disabled for other OMAPs.

config OMAP_RAM_CONSOLE
bool "Enable OMAP support for Android RAM console"
Expand Down Expand Up @@ -525,6 +529,51 @@ config OMAP4_PPA_CPU1_ONLINE_BUG
If, on the other hand, you do not understand the change, leave the
default as enabled.

config OMAP4_ARM_ERRATA_742230
bool "Enables the workaround for ARM errata 742230 on GP devices"
default y
help
Enables the ARM errata 742230 on OMAP443x and OMAP446x (GP) devices.
This involves setting bit 4 of the CP15 diagnostic control register.
This is handled for HS devices in the PPA code and does not need to be
enabled."

config OMAP4_ARM_ERRATA_751472
bool "Enables the workaround for ARM errata 751472 on GP devices"
default y
help
Enables the ARM errata 751472 on OMAP443x and OMAP446x (GP) devices.
This involves setting bit 11 of the CP15 diagnostic control register.
This is handled for HS devices in the PPA code and does not need to be
enabled."

config OMAP4_ARM_ERRATA_743622
bool "Enabled the workaround for ARM errata 743622 on GP devices"
default y
help
Enables the workaround for ARM errata 743622 on OMAP4.
This involves setting bit 6 of the CP15 diagnostic control register.
This is handled for HS devices in the PPA code and does not need to be
enabled."

config OMAP4_HSOTG_ED_CORRECTION
bool "OMAP 44XX HSOTG Eye diagram correction"
depends on ARCH_OMAP4
default y
help
Select this option to overrive HSOTG PHY settings in
order to improve Eye Diagramm. On 4430 CPUs this should
improve Eye Diagram at least 8%.

config OMAP_RFKILL_STE_MODEM
bool "Enable OMAP RFKILL driver for ST-E modem"
depends on RFKILL || !RFKILL
help
Select this option to enable usage of RFKILL driver for ST-E modem on
OMAP platforms. This will permit control of power on and off sequences
of the modem as well as necessary dynamic pin muxing of AP/CP
interfaces (platform data dependant)

endmenu

endif
10 changes: 5 additions & 5 deletions arch/arm/mach-omap2/board-mapphone-usb.c
Expand Up @@ -81,16 +81,16 @@ static void set_usb_performance_mode(struct device *dev, bool enabled)
dev_dbg(dev, "Performance Mode %s\n", enabled ? "Set" : "Cleared");

if (enabled) {
if (andusb_plat.bp_tools_mode)
omap_cpufreq_scale(dev, 800000);
else
omap_cpufreq_scale(dev, 600000);
// if (andusb_plat.bp_tools_mode)
// omap_cpufreq_scale(dev, 800000);
// else
// omap_cpufreq_scale(dev, 600000);
if (num_possible_cpus() > 1
&& cpu_online(num_possible_cpus()-1))
irq_set_affinity(EHCI_IRQ,
cpumask_of(num_possible_cpus()-1));
} else {
omap_cpufreq_scale(dev, 300000);
// omap_cpufreq_scale(dev, 300000);
irq_set_affinity(EHCI_IRQ, cpu_online_mask);
}

Expand Down
25 changes: 23 additions & 2 deletions arch/arm/mach-omap2/devices.c
Expand Up @@ -909,6 +909,7 @@ static struct resource omap_hdq_resources[] = {
.flags = IORESOURCE_IRQ,
},
};

struct platform_device omap_hdq_device = {
.name = "omap_hdq",
.id = 0,
Expand All @@ -918,6 +919,17 @@ struct platform_device omap_hdq_device = {
.num_resources = ARRAY_SIZE(omap_hdq_resources),
.resource = omap_hdq_resources,
};

static struct platform_device omap_hdq_dev = {
.name = "omap_hdq",
.id = 0,
.dev = {
.platform_data = NULL,
},
.num_resources = ARRAY_SIZE(omap_hdq_resources),
.resource = omap_hdq_resources,
};

void omap_hdq1w_init(struct omap2_hdq_platform_config *pdata)
{
int l;
Expand Down Expand Up @@ -950,6 +962,12 @@ void omap_hdq1w_init(struct omap2_hdq_platform_config *pdata)
WARN(IS_ERR(od), "Could not build omap_device for %s %s\n",
name, oh_name);
}
static inline void omap_hdq_init(void)
{
(void) platform_device_register(&omap_hdq_dev);
}
#else
static inline void omap_hdq_init(void) {}
#endif

/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -992,16 +1010,18 @@ int omap_device_scale_gpu(struct device *req_dev, struct device *target_dev,
unsigned long rate)
{
unsigned long freq = 0;
int ret;

/* find lowest frequency */
opp_find_freq_ceil(target_dev, &freq);

if (rate > freq)
omap4_dpll_cascading_blocker_hold(target_dev);
else
ret = omap_device_scale(req_dev, target_dev, rate);
if (!ret && rate <= freq)
omap4_dpll_cascading_blocker_release(target_dev);

return omap_device_scale(req_dev, target_dev, rate);
return ret;
}
#endif

Expand Down Expand Up @@ -1075,6 +1095,7 @@ static int __init omap2_init_devices(void)
omap_init_mcasp();
omap_init_mcspi();
omap_init_pmu();
omap_hdq_init();
omap_init_sti();
omap_init_sham();
omap_init_aes();
Expand Down

0 comments on commit 4f08701

Please sign in to comment.