summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuofei Ma <ruofeim@google.com>2022-06-10 13:39:10 -0700
committerRuofei Ma <ruofeim@google.com>2022-06-13 17:22:39 +0000
commitb326d6fdc32a5cd5da577d41928ee87603711fc7 (patch)
tree90d69760058b3e64c27665bc410b930e973ad2ad
parent2679f20bd6f94cac4c16cc01c0dd45e3f2e8f332 (diff)
downloadgchips-b326d6fdc32a5cd5da577d41928ee87603711fc7.tar.gz
Kernel changes for bringup
Make sure the bigwave driver builds with kernel structure and flags change. Bug: 195687338 Signed-off-by: Ruofei Ma <ruofeim@google.com> Change-Id: I27d577ef28f1790924fb58d3391d52b32e2fc626
-rw-r--r--bigo.c7
-rw-r--r--bigo_of.c12
-rw-r--r--bigo_pm.c12
-rw-r--r--bigo_priv.h1
4 files changed, 17 insertions, 15 deletions
diff --git a/bigo.c b/bigo.c
index eb72d91..e7a1648 100644
--- a/bigo.c
+++ b/bigo.c
@@ -645,14 +645,13 @@ static int bigo_probe(struct platform_device *pdev)
goto err_io;
}
- /* TODO ON SILICON*/
- #if 0
+#ifndef BW_BRINGUP
rc = iommu_register_device_fault_handler(&pdev->dev, bigo_iommu_fault_handler, core);
if (rc) {
pr_err("failed to register iommu fault handler: %d\n", rc);
goto err_fault_handler;
}
- #endif
+#endif
rc = bigo_pt_client_register(pdev->dev.of_node, core);
if (rc == -EPROBE_DEFER) {
pr_warn("pt_client returns -EPROBE_DEFER, try again later\n");
@@ -670,8 +669,10 @@ static int bigo_probe(struct platform_device *pdev)
err_pt_client:
iommu_unregister_device_fault_handler(&pdev->dev);
+#ifndef BW_BRINGUP
err_fault_handler:
pm_runtime_disable(&pdev->dev);
+#endif
err_io:
bigo_of_dt_release(core);
err_dt_parse:
diff --git a/bigo_of.c b/bigo_of.c
index 21a1361..16d9e6a 100644
--- a/bigo_of.c
+++ b/bigo_of.c
@@ -41,8 +41,7 @@ static int bigo_of_get_resource(struct bigo_core *core)
core->regs_size = res->end - res->start + 1;
core->paddr = (phys_addr_t)res->start;
- /* TODO ON SILICON*/
- #if 0
+#ifndef BW_BRINGUP
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ssmt_bo_pid");
if (IS_ERR_OR_NULL(res)) {
rc = PTR_ERR(res);
@@ -55,7 +54,7 @@ static int bigo_of_get_resource(struct bigo_core *core)
PTR_ERR(core->slc.ssmt_pid_base));
core->slc.ssmt_pid_base = NULL;
}
- #endif
+#endif
core->irq = platform_get_irq(pdev, 0);
if (core->irq < 0) {
@@ -78,6 +77,7 @@ static void bigo_of_remove_opp_table(struct bigo_core *core)
}
}
+#ifndef BW_BRINGUP
static void bigo_of_remove_bw_table(struct bigo_core *core)
{
struct bigo_bw *bw, *tmp;
@@ -173,6 +173,7 @@ err_entry:
err_add_table:
return rc;
}
+#endif
int bigo_of_dt_parse(struct bigo_core *core)
{
@@ -184,8 +185,7 @@ int bigo_of_dt_parse(struct bigo_core *core)
goto err_get_res;
}
- /* TODO ON SILICON*/
- #if 0
+#ifndef BW_BRINGUP
rc = bigo_of_parse_opp_table(core);
if (rc < 0) {
pr_err("failed to parse bigocean OPP table\n");
@@ -203,13 +203,13 @@ int bigo_of_dt_parse(struct bigo_core *core)
rc = core->pm.bwindex;
goto err_bwindex;
}
- #endif
return rc;
err_bwindex:
bigo_of_remove_bw_table(core);
err_parse_bw_table:
bigo_of_remove_opp_table(core);
err_parse_opp_table:
+#endif
err_get_res:
return rc;
}
diff --git a/bigo_pm.c b/bigo_pm.c
index 85ae5c5..395ab6c 100644
--- a/bigo_pm.c
+++ b/bigo_pm.c
@@ -67,15 +67,15 @@ static inline void bigo_set_freq(struct bigo_core *core, u32 freq)
{
if (core->debugfs.set_freq)
freq = core->debugfs.set_freq;
- /* TODO ON SILICON*/
- #if 0
+#ifndef BW_BRINGUP
if (!exynos_pm_qos_request_active(&core->pm.qos_bigo))
exynos_pm_qos_add_request(&core->pm.qos_bigo, PM_QOS_BO_THROUGHPUT, freq);
else
exynos_pm_qos_update_request(&core->pm.qos_bigo, freq);
- #endif
+#endif
}
+#ifndef BW_BRINGUP
static void bigo_scale_freq(struct bigo_core *core)
{
u64 load = bigo_get_total_load(core);
@@ -102,12 +102,12 @@ static int bigo_scale_bw(struct bigo_core *core)
bigo_get_bw(core, &bw);
return bts_update_bw(core->pm.bwindex, bw);
}
+#endif
void bigo_update_qos(struct bigo_core *core)
{
pr_warn("%s is not supported\n", __func__);
- /* TODO ON SILICON*/
- #if 0
+#ifndef BW_BRINGUP
int rc;
mutex_lock(&core->lock);
@@ -118,7 +118,7 @@ void bigo_update_qos(struct bigo_core *core)
bigo_scale_freq(core);
mutex_unlock(&core->lock);
- #endif
+#endif
}
/*
diff --git a/bigo_priv.h b/bigo_priv.h
index ccd25d3..48ccece 100644
--- a/bigo_priv.h
+++ b/bigo_priv.h
@@ -21,6 +21,7 @@
#include <soc/google/pt.h>
#endif
+#define BW_BRINGUP
#define AVG_CNT 30
#define PEAK_CNT 5