|
@@ -75,11 +75,6 @@ struct busfreq_opp_info {
|
|
unsigned long volt;
|
|
unsigned long volt;
|
|
};
|
|
};
|
|
|
|
|
|
-struct busfreq_ppmu_data {
|
|
|
|
- struct exynos_ppmu *ppmu;
|
|
|
|
- int ppmu_end;
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
struct busfreq_data {
|
|
struct busfreq_data {
|
|
enum exynos4_busf_type type;
|
|
enum exynos4_busf_type type;
|
|
struct device *dev;
|
|
struct device *dev;
|
|
@@ -515,49 +510,6 @@ static int exynos4x12_set_busclk(struct busfreq_data *data,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static void busfreq_mon_reset(struct busfreq_ppmu_data *ppmu_data)
|
|
|
|
-{
|
|
|
|
- unsigned int i;
|
|
|
|
-
|
|
|
|
- for (i = 0; i < ppmu_data->ppmu_end; i++) {
|
|
|
|
- void __iomem *ppmu_base = ppmu_data->ppmu[i].hw_base;
|
|
|
|
-
|
|
|
|
- /* Reset the performance and cycle counters */
|
|
|
|
- exynos_ppmu_reset(ppmu_base);
|
|
|
|
-
|
|
|
|
- /* Setup count registers to monitor read/write transactions */
|
|
|
|
- ppmu_data->ppmu[i].event[PPMU_PMNCNT3] = RDWR_DATA_COUNT;
|
|
|
|
- exynos_ppmu_setevent(ppmu_base, PPMU_PMNCNT3,
|
|
|
|
- ppmu_data->ppmu[i].event[PPMU_PMNCNT3]);
|
|
|
|
-
|
|
|
|
- exynos_ppmu_start(ppmu_base);
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static void exynos4_read_ppmu(struct busfreq_ppmu_data *ppmu_data)
|
|
|
|
-{
|
|
|
|
- int i, j;
|
|
|
|
-
|
|
|
|
- for (i = 0; i < ppmu_data->ppmu_end; i++) {
|
|
|
|
- void __iomem *ppmu_base = ppmu_data->ppmu[i].hw_base;
|
|
|
|
-
|
|
|
|
- exynos_ppmu_stop(ppmu_base);
|
|
|
|
-
|
|
|
|
- /* Update local data from PPMU */
|
|
|
|
- ppmu_data->ppmu[i].ccnt = __raw_readl(ppmu_base + PPMU_CCNT);
|
|
|
|
-
|
|
|
|
- for (j = PPMU_PMNCNT0; j < PPMU_PMNCNT_MAX; j++) {
|
|
|
|
- if (ppmu_data->ppmu[i].event[j] == 0)
|
|
|
|
- ppmu_data->ppmu[i].count[j] = 0;
|
|
|
|
- else
|
|
|
|
- ppmu_data->ppmu[i].count[j] =
|
|
|
|
- exynos_ppmu_read(ppmu_base, j);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- busfreq_mon_reset(ppmu_data);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static int exynos4x12_get_intspec(unsigned long mifclk)
|
|
static int exynos4x12_get_intspec(unsigned long mifclk)
|
|
{
|
|
{
|
|
int i = 0;
|
|
int i = 0;
|
|
@@ -681,24 +633,6 @@ out:
|
|
return err;
|
|
return err;
|
|
}
|
|
}
|
|
|
|
|
|
-static int exynos4_get_busier_ppmu(struct busfreq_ppmu_data *ppmu_data)
|
|
|
|
-{
|
|
|
|
- int i, j;
|
|
|
|
- int busy = 0;
|
|
|
|
- unsigned int temp = 0;
|
|
|
|
-
|
|
|
|
- for (i = 0; i < ppmu_data->ppmu_end; i++) {
|
|
|
|
- for (j = PPMU_PMNCNT0; j < PPMU_PMNCNT_MAX; j++) {
|
|
|
|
- if (ppmu_data->ppmu[i].count[j] > temp) {
|
|
|
|
- temp = ppmu_data->ppmu[i].count[j];
|
|
|
|
- busy = i;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return busy;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static int exynos4_bus_get_dev_status(struct device *dev,
|
|
static int exynos4_bus_get_dev_status(struct device *dev,
|
|
struct devfreq_dev_status *stat)
|
|
struct devfreq_dev_status *stat)
|
|
{
|
|
{
|
|
@@ -706,8 +640,8 @@ static int exynos4_bus_get_dev_status(struct device *dev,
|
|
struct busfreq_ppmu_data *ppmu_data = &data->ppmu_data;
|
|
struct busfreq_ppmu_data *ppmu_data = &data->ppmu_data;
|
|
int busier;
|
|
int busier;
|
|
|
|
|
|
- exynos4_read_ppmu(ppmu_data);
|
|
|
|
- busier = exynos4_get_busier_ppmu(ppmu_data);
|
|
|
|
|
|
+ exynos_read_ppmu(ppmu_data);
|
|
|
|
+ busier = exynos_get_busier_ppmu(ppmu_data);
|
|
stat->current_frequency = data->curr_oppinfo.rate;
|
|
stat->current_frequency = data->curr_oppinfo.rate;
|
|
|
|
|
|
/* Number of cycles spent on memory access */
|
|
/* Number of cycles spent on memory access */
|