Skip to content

Commit

Permalink
msm: pm: Add support to query cpu status
Browse files Browse the repository at this point in the history
During hotplug operation primary core is required to query
cpu registers to determine whether secondary core has
successfully shutdown.

Change-Id: I81bd47ba851698e86269652afe381b0571ca912a
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
  • Loading branch information
Anji Jonnala authored and hellsgod committed Aug 14, 2013
1 parent 2dea70a commit 6788ca0
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/mach-msm/board-8064.c
Original file line number Diff line number Diff line change
Expand Up @@ -2542,6 +2542,7 @@ static struct platform_device *cdp_devices[] __initdata = {
&msm_rotator_device,
#endif
&msm8064_pc_cntr,
&msm8064_cpu_slp_status,
};

static struct platform_device
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-msm/board-8930.c
Original file line number Diff line number Diff line change
Expand Up @@ -2463,6 +2463,7 @@ static struct platform_device *common_devices[] __initdata = {
&msm_tsens_device,
&msm8930_cache_dump_device,
&msm8930_pc_cntr,
&msm8930_cpu_slp_status,
};

static struct platform_device *cdp_devices[] __initdata = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-msm/board-8960.c
Original file line number Diff line number Diff line change
Expand Up @@ -2951,6 +2951,7 @@ static struct platform_device *common_devices[] __initdata = {
&msm8960_iommu_domain_device,
&msm_tsens_device,
&msm8960_pc_cntr,
&msm8960_cpu_slp_status,
};

static struct platform_device *cdp_devices[] __initdata = {
Expand Down
14 changes: 14 additions & 0 deletions arch/arm/mach-msm/devices-8064.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <mach/msm_rtb.h>
#include <linux/msm_ion.h>
#include "clock.h"
#include "pm.h"
#include "devices.h"
#include "footswitch.h"
#include "msm_watchdog.h"
Expand Down Expand Up @@ -121,6 +122,19 @@ struct platform_device msm8064_pc_cntr = {
.resource = msm8064_resources_pccntr,
};

static struct msm_pm_sleep_status_data msm_pm_slp_sts_data = {
.base_addr = MSM_ACC0_BASE + 0x08,
.cpu_offset = MSM_ACC1_BASE - MSM_ACC0_BASE,
.mask = 1UL << 13,
};
struct platform_device msm8064_cpu_slp_status = {
.name = "cpu_slp_status",
.id = -1,
.dev = {
.platform_data = &msm_pm_slp_sts_data,
},
};

static struct msm_watchdog_pdata msm_watchdog_pdata = {
.pet_time = 10000,
.bark_time = 11000,
Expand Down
15 changes: 15 additions & 0 deletions arch/arm/mach-msm/devices-8930.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "rpm_rbcpr_stats.h"
#include "footswitch.h"
#include "acpuclock-krait.h"
#include "pm.h"

#ifdef CONFIG_MSM_MPM
#include <mach/mpm.h>
Expand All @@ -40,6 +41,20 @@
#define MSM8930_PC_CNTR_PHYS (MSM8930_IMEM_PHYS + 0x664)
#define MSM8930_PC_CNTR_SIZE 0x40

static struct msm_pm_sleep_status_data msm_pm_slp_sts_data = {
.base_addr = MSM_ACC0_BASE + 0x08,
.cpu_offset = MSM_ACC1_BASE - MSM_ACC0_BASE,
.mask = 1UL << 13,
};

struct platform_device msm8930_cpu_slp_status = {
.name = "cpu_slp_status",
.id = -1,
.dev = {
.platform_data = &msm_pm_slp_sts_data,
},
};

static struct resource msm8930_resources_pccntr[] = {
{
.start = MSM8930_PC_CNTR_PHYS,
Expand Down
14 changes: 14 additions & 0 deletions arch/arm/mach-msm/devices-8960.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include <mach/msm_dcvs.h>
#include <mach/iommu_domains.h>
#include <mach/socinfo.h>
#include "pm.h"

#ifdef CONFIG_MSM_MPM
#include <mach/mpm.h>
Expand Down Expand Up @@ -1634,6 +1635,19 @@ struct platform_device msm_device_bam_dmux = {
.id = -1,
};

static struct msm_pm_sleep_status_data msm_pm_slp_sts_data = {
.base_addr = MSM_ACC0_BASE + 0x08,
.cpu_offset = MSM_ACC1_BASE - MSM_ACC0_BASE,
.mask = 1UL << 13,
};
struct platform_device msm8960_cpu_slp_status = {
.name = "cpu_slp_status",
.id = -1,
.dev = {
.platform_data = &msm_pm_slp_sts_data,
},
};

static struct msm_watchdog_pdata msm_watchdog_pdata = {
.pet_time = 10000,
.bark_time = 11000,
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/mach-msm/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ extern struct platform_device msm_device_hsusb_host;
extern struct platform_device msm_device_hsusb_host2;
extern struct platform_device msm_device_hsic_host;

extern struct platform_device msm8960_cpu_slp_status;
extern struct platform_device msm8064_cpu_slp_status;
extern struct platform_device msm8930_cpu_slp_status;

extern struct platform_device msm_device_otg;
extern struct platform_device msm_android_usb_device;
extern struct platform_device msm_android_usb_hsic_device;
Expand Down
8 changes: 8 additions & 0 deletions arch/arm/mach-msm/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ struct msm_pm_time_params {
uint32_t modified_time_us;
};

struct msm_pm_sleep_status_data {
void *base_addr;
uint32_t cpu_offset;
uint32_t mask;
};

struct msm_pm_platform_data {
u8 idle_supported; /* Allow device to enter mode during idle */
u8 suspend_supported; /* Allow device to enter mode during suspend */
Expand Down Expand Up @@ -103,9 +109,11 @@ void __init msm_pm_set_tz_retention_flag(unsigned int flag);
#ifdef CONFIG_MSM_PM8X60
void msm_pm_set_rpm_wakeup_irq(unsigned int irq);
void msm_pm_set_sleep_ops(struct msm_pm_sleep_ops *ops);
int msm_pm_wait_cpu_shutdown(unsigned int cpu);
#else
static inline void msm_pm_set_rpm_wakeup_irq(unsigned int irq) {}
static inline void msm_pm_set_sleep_ops(struct msm_pm_sleep_ops *ops) {}
static inline int msm_pm_wait_cpu_shutdown(unsigned int cpu) { return 0; }
#endif
#ifdef CONFIG_HOTPLUG_CPU
int msm_platform_secondary_init(unsigned int cpu);
Expand Down

0 comments on commit 6788ca0

Please sign in to comment.