|
@@ -1,7 +1,7 @@
|
|
|
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only
|
|
/* SPDX-License-Identifier: GPL-2.0-only
|
|
*
|
|
*
|
|
- * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
|
|
|
|
|
|
+ * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
|
|
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
|
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
|
*/
|
|
*/
|
|
|
|
|
|
@@ -144,15 +144,15 @@ static int adjust_bw_freqs(void)
|
|
{
|
|
{
|
|
struct msm_cvp_core *core;
|
|
struct msm_cvp_core *core;
|
|
struct iris_hfi_device *hdev;
|
|
struct iris_hfi_device *hdev;
|
|
- struct bus_info *bus;
|
|
|
|
|
|
+ struct bus_info *bus = NULL;
|
|
struct clock_set *clocks;
|
|
struct clock_set *clocks;
|
|
struct clock_info *cl;
|
|
struct clock_info *cl;
|
|
struct allowed_clock_rates_table *tbl = NULL;
|
|
struct allowed_clock_rates_table *tbl = NULL;
|
|
unsigned int tbl_size;
|
|
unsigned int tbl_size;
|
|
- unsigned int cvp_min_rate, cvp_max_rate, max_bw, min_bw;
|
|
|
|
|
|
+ unsigned int cvp_min_rate, cvp_max_rate, max_bw = 0, min_bw = 0;
|
|
struct cvp_power_level rt_pwr = {0}, nrt_pwr = {0};
|
|
struct cvp_power_level rt_pwr = {0}, nrt_pwr = {0};
|
|
unsigned long tmp, core_sum, op_core_sum, bw_sum;
|
|
unsigned long tmp, core_sum, op_core_sum, bw_sum;
|
|
- int i, rc = 0;
|
|
|
|
|
|
+ int i, rc = 0, bus_count = 0;
|
|
unsigned long ctrl_freq;
|
|
unsigned long ctrl_freq;
|
|
|
|
|
|
core = list_first_entry(&cvp_driver->cores, struct msm_cvp_core, list);
|
|
core = list_first_entry(&cvp_driver->cores, struct msm_cvp_core, list);
|
|
@@ -164,9 +164,18 @@ static int adjust_bw_freqs(void)
|
|
tbl_size = core->resources.allowed_clks_tbl_size;
|
|
tbl_size = core->resources.allowed_clks_tbl_size;
|
|
cvp_min_rate = tbl[0].clock_rate;
|
|
cvp_min_rate = tbl[0].clock_rate;
|
|
cvp_max_rate = tbl[tbl_size - 1].clock_rate;
|
|
cvp_max_rate = tbl[tbl_size - 1].clock_rate;
|
|
- bus = &core->resources.bus_set.bus_tbl[1];
|
|
|
|
- max_bw = bus->range[1];
|
|
|
|
- min_bw = max_bw/10;
|
|
|
|
|
|
+
|
|
|
|
+ for (bus_count = 0; bus_count < core->resources.bus_set.count; bus_count++) {
|
|
|
|
+ if (!strcmp(core->resources.bus_set.bus_tbl[bus_count].name, "cvp-ddr")) {
|
|
|
|
+ bus = &core->resources.bus_set.bus_tbl[bus_count];
|
|
|
|
+ max_bw = bus->range[1];
|
|
|
|
+ min_bw = max_bw/10;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!bus) {
|
|
|
|
+ dprintk(CVP_ERR, "bus node is NULL for cvp-ddr\n");
|
|
|
|
+ return -EINVAL;
|
|
|
|
+ }
|
|
|
|
|
|
aggregate_power_update(core, &nrt_pwr, &rt_pwr, cvp_max_rate);
|
|
aggregate_power_update(core, &nrt_pwr, &rt_pwr, cvp_max_rate);
|
|
dprintk(CVP_PWR, "PwrUpdate nrt %u %u rt %u %u\n",
|
|
dprintk(CVP_PWR, "PwrUpdate nrt %u %u rt %u %u\n",
|