msm: allow for platform-specific memory power routines
We now support more than one platform whose memory can be turned on and off and whose way of doing so differs from platform to platform, so call the appropriate platform-specific routine if one exists. Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
This commit is contained in:
committed by
Bryan Huntsman
parent
7835f31704
commit
a7eadeaa24
@@ -740,6 +740,12 @@ static void __init msm8960_reserve(void)
|
||||
msm_reserve();
|
||||
}
|
||||
|
||||
static int msm8960_change_memory_power(unsigned long start_pfn,
|
||||
unsigned long nr_pages, int change_type)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MSM_CAMERA
|
||||
|
||||
static int msm_cam_gpio_tbl[] = {
|
||||
@@ -3377,6 +3383,7 @@ static void __init msm8960_cdp_init(void)
|
||||
msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
|
||||
msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
|
||||
msm_pm_data);
|
||||
change_memory_power = &msm8960_change_memory_power;
|
||||
}
|
||||
|
||||
MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
|
||||
|
||||
@@ -67,6 +67,8 @@ int platform_physical_remove_pages(unsigned long, unsigned long);
|
||||
int platform_physical_active_pages(unsigned long, unsigned long);
|
||||
int platform_physical_low_power_pages(unsigned long, unsigned long);
|
||||
|
||||
extern int (*change_memory_power)(unsigned long, unsigned long, int);
|
||||
|
||||
#if defined(CONFIG_ARCH_MSM_ARM11) || defined(CONFIG_ARCH_MSM_CORTEX_A5)
|
||||
void write_to_strongly_ordered_memory(void);
|
||||
void map_page_strongly_ordered(void);
|
||||
|
||||
@@ -194,25 +194,32 @@ void *alloc_bootmem_aligned(unsigned long size, unsigned long alignment)
|
||||
return (void *)addr;
|
||||
}
|
||||
|
||||
int (*change_memory_power)(unsigned long, unsigned long, int);
|
||||
|
||||
int platform_physical_remove_pages(unsigned long start_pfn,
|
||||
unsigned long nr_pages)
|
||||
{
|
||||
return 1;
|
||||
if (!change_memory_power)
|
||||
return 0;
|
||||
return change_memory_power(start_pfn, nr_pages, MEMORY_DEEP_POWERDOWN);
|
||||
}
|
||||
|
||||
int platform_physical_active_pages(unsigned long start_pfn,
|
||||
unsigned long nr_pages)
|
||||
{
|
||||
return 1;
|
||||
if (!change_memory_power)
|
||||
return 0;
|
||||
return change_memory_power(start_pfn, nr_pages, MEMORY_ACTIVE);
|
||||
}
|
||||
|
||||
int platform_physical_low_power_pages(unsigned long start_pfn,
|
||||
unsigned long nr_pages)
|
||||
{
|
||||
return 1;
|
||||
if (!change_memory_power)
|
||||
return 0;
|
||||
return change_memory_power(start_pfn, nr_pages, MEMORY_SELF_REFRESH);
|
||||
}
|
||||
|
||||
|
||||
char *memtype_name[] = {
|
||||
"SMI_KERNEL",
|
||||
"SMI",
|
||||
|
||||
Reference in New Issue
Block a user