msm: rpm_stats: Add support to read master PC stats from RPM MSG RAM.

RPM maintains PC stats for each master in MSG RAM and it allocates
256 bytes for this use. No of masters differs for different targets.

Initialize the resources for rpm_master_stat platform device.

Signed-off-by: Anji Jonnala <anjir@codeaurora.org>

Change-Id: I0a44b083fd01a852ba214ecf1d2e6d953c154ed5
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
This commit is contained in:
Anji Jonnala 2012-11-01 13:11:42 +05:30 committed by Stephen Boyd
parent 9ae712dd89
commit 0b73a54445
10 changed files with 148 additions and 0 deletions

View file

@ -2315,6 +2315,7 @@ static struct platform_device *common_devices[] __initdata = {
&apq8064_rpm_device,
&apq8064_rpm_log_device,
&apq8064_rpm_stat_device,
&apq8064_rpm_master_stat_device,
&apq_device_tz_log,
&msm_bus_8064_apps_fabric,
&msm_bus_8064_sys_fabric,

View file

@ -2323,6 +2323,7 @@ static struct platform_device *common_devices[] __initdata = {
&msm8930_rpm_log_device,
&msm8930_rpm_rbcpr_device,
&msm8930_rpm_stat_device,
&msm8930_rpm_master_stat_device,
#ifdef CONFIG_ION_MSM
&msm8930_ion_dev,
#endif

View file

@ -2687,6 +2687,7 @@ static struct platform_device *common_devices[] __initdata = {
&msm8960_rpm_device,
&msm8960_rpm_log_device,
&msm8960_rpm_stat_device,
&msm8960_rpm_master_stat_device,
&msm_device_tz_log,
&coresight_tpiu_device,
&coresight_etb_device,

View file

@ -932,6 +932,7 @@ static struct platform_device *common_devices[] = {
&msm_bus_def_fab,
&msm9615_rpm_log_device,
&msm9615_rpm_stat_device,
&msm9615_rpm_master_stat_device,
&msm_tsens_device,
};

View file

@ -101,6 +101,7 @@
/* Address of PCIE20 */
#define PCIE20_PHYS 0x1b500000
#define PCIE20_SIZE SZ_4K
#define MSM8064_RPM_MASTER_STATS_BASE 0x10BB00
static struct msm_watchdog_pdata msm_watchdog_pdata = {
.pet_time = 10000,
@ -2291,6 +2292,37 @@ struct platform_device apq8064_rpm_stat_device = {
},
};
static struct resource resources_rpm_master_stats[] = {
{
.start = MSM8064_RPM_MASTER_STATS_BASE,
.end = MSM8064_RPM_MASTER_STATS_BASE + SZ_256,
.flags = IORESOURCE_MEM,
},
};
static char *master_names[] = {
"KPSS",
"MPSS",
"LPASS",
"RIVA",
"DSPS",
};
static struct msm_rpm_master_stats_platform_data msm_rpm_master_stat_pdata = {
.masters = master_names,
.nomasters = ARRAY_SIZE(master_names),
};
struct platform_device apq8064_rpm_master_stat_device = {
.name = "msm_rpm_master_stat",
.id = -1,
.num_resources = ARRAY_SIZE(resources_rpm_master_stats),
.resource = resources_rpm_master_stats,
.dev = {
.platform_data = &msm_rpm_master_stat_pdata,
},
};
static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
.phys_addr_base = 0x0010C000,
.reg_offsets = {

View file

@ -36,6 +36,7 @@
#ifdef CONFIG_MSM_MPM
#include <mach/mpm.h>
#endif
#define MSM8930_RPM_MASTER_STATS_BASE 0x10B100
struct msm_rpm_platform_data msm8930_rpm_data __initdata = {
.reg_base_addrs = {
@ -541,6 +542,36 @@ struct platform_device msm8930_rpm_stat_device = {
},
};
static struct resource resources_rpm_master_stats[] = {
{
.start = MSM8930_RPM_MASTER_STATS_BASE,
.end = MSM8930_RPM_MASTER_STATS_BASE + SZ_256,
.flags = IORESOURCE_MEM,
},
};
static char *master_names[] = {
"KPSS",
"MPSS",
"LPASS",
"RIVA",
};
static struct msm_rpm_master_stats_platform_data msm_rpm_master_stat_pdata = {
.masters = master_names,
.nomasters = ARRAY_SIZE(master_names),
};
struct platform_device msm8930_rpm_master_stat_device = {
.name = "msm_rpm_master_stat",
.id = -1,
.num_resources = ARRAY_SIZE(resources_rpm_master_stats),
.resource = resources_rpm_master_stats,
.dev = {
.platform_data = &msm_rpm_master_stat_pdata,
},
};
static struct resource msm_rpm_rbcpr_resource = {
.start = 0x0010CB00,
.end = 0x0010CB00 + SZ_8K - 1,

View file

@ -101,6 +101,7 @@
#define MSM8960_HSUSB_PHYS 0x12500000
#define MSM8960_HSUSB_SIZE SZ_4K
#define MSM8960_RPM_MASTER_STATS_BASE 0x10BB00
static struct resource resources_otg[] = {
{
@ -3712,6 +3713,37 @@ struct platform_device msm8960_rpm_stat_device = {
},
};
static struct resource resources_rpm_master_stats[] = {
{
.start = MSM8960_RPM_MASTER_STATS_BASE,
.end = MSM8960_RPM_MASTER_STATS_BASE + SZ_256,
.flags = IORESOURCE_MEM,
},
};
static char *master_names[] = {
"KPSS",
"GPSS",
"LPASS",
"RIVA",
"DSPS",
};
static struct msm_rpm_master_stats_platform_data msm_rpm_master_stat_pdata = {
.masters = master_names,
.nomasters = ARRAY_SIZE(master_names),
};
struct platform_device msm8960_rpm_master_stat_device = {
.name = "msm_rpm_master_stat",
.id = -1,
.num_resources = ARRAY_SIZE(resources_rpm_master_stats),
.resource = resources_rpm_master_stats,
.dev = {
.platform_data = &msm_rpm_master_stat_pdata,
},
};
struct platform_device msm_bus_sys_fabric = {
.name = "msm_bus_fabric",
.id = MSM_BUS_FAB_SYSTEM,

View file

@ -64,6 +64,7 @@
#define MSM_GPIO_I2C_CLK 16
#define MSM_GPIO_I2C_SDA 17
#define MSM9615_RPM_MASTER_STATS_BASE 0x10A700
static struct msm_watchdog_pdata msm_watchdog_pdata = {
.pet_time = 10000,
@ -1328,6 +1329,35 @@ struct platform_device msm9615_rpm_stat_device = {
},
};
static struct resource resources_rpm_master_stats[] = {
{
.start = MSM9615_RPM_MASTER_STATS_BASE,
.end = MSM9615_RPM_MASTER_STATS_BASE + SZ_256,
.flags = IORESOURCE_MEM,
},
};
static char *master_names[] = {
"KPSS",
"MPSS",
"LPASS",
};
static struct msm_rpm_master_stats_platform_data msm_rpm_master_stat_pdata = {
.masters = master_names,
.nomasters = ARRAY_SIZE(master_names),
};
struct platform_device msm9615_rpm_master_stat_device = {
.name = "msm_rpm_master_stat",
.id = -1,
.num_resources = ARRAY_SIZE(resources_rpm_master_stats),
.resource = resources_rpm_master_stats,
.dev = {
.platform_data = &msm_rpm_master_stat_pdata,
},
};
static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
.phys_addr_base = 0x0010AC00,
.reg_offsets = {

View file

@ -330,10 +330,12 @@ extern struct platform_device led_pdev;
extern struct platform_device msm8960_rpm_device;
extern struct platform_device msm8960_rpm_stat_device;
extern struct platform_device msm8960_rpm_master_stat_device;
extern struct platform_device msm8960_rpm_log_device;
extern struct platform_device msm8930_rpm_device;
extern struct platform_device msm8930_rpm_stat_device;
extern struct platform_device msm8930_rpm_master_stat_device;
extern struct platform_device msm8930_rpm_log_device;
extern struct platform_device msm8930_rpm_rbcpr_device;
@ -343,10 +345,12 @@ extern struct platform_device msm8660_rpm_log_device;
extern struct platform_device msm9615_rpm_device;
extern struct platform_device msm9615_rpm_stat_device;
extern struct platform_device msm9615_rpm_master_stat_device;
extern struct platform_device msm9615_rpm_log_device;
extern struct platform_device apq8064_rpm_device;
extern struct platform_device apq8064_rpm_stat_device;
extern struct platform_device apq8064_rpm_master_stat_device;
extern struct platform_device apq8064_rpm_log_device;
extern struct platform_device msm_device_rng;

View file

@ -20,4 +20,19 @@ struct msm_rpmstats_platform_data {
phys_addr_t phys_addr_base;
u32 phys_size;
};
struct msm_rpm_master_stats_platform_data {
phys_addr_t phys_addr_base;
u32 phys_size;
char **masters;
/*
* RPM maintains PC stats for each master in MSG RAM,
* it allocates 256 bytes for this use.
* No of masters differs for different targets.
* Based on the number of masters, linux rpm stat
* driver reads (32 * nomasters) bytes to display
* master stats.
*/
u32 nomasters;
};
#endif