clk: qcom: clk-cpu-osm: Update logic to check if OSMs been enabled in TZ
On SDM845v2, the OSM_ENABLE register has a new WDOG_DEBUG_EN bit
that's set by default. This breaks the logic in the OSM driver
code which assumes that the ENABLE_OSM bit is the only one that's
set in that register. Fix this.
Change-Id: I5c7925aa248f34f3308259446708b262f4a80f4a
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
diff --git a/drivers/clk/qcom/clk-cpu-osm.c b/drivers/clk/qcom/clk-cpu-osm.c
index 4158e65..f93aba1 100644
--- a/drivers/clk/qcom/clk-cpu-osm.c
+++ b/drivers/clk/qcom/clk-cpu-osm.c
@@ -66,6 +66,7 @@
#define PERFCL_EFUSE_MASK 0x7
#define ENABLE_REG 0x0
+#define ENABLE_OSM BIT(0)
#define FREQ_REG 0x110
#define VOLT_REG 0x114
#define OVERRIDE_REG 0x118
@@ -2629,7 +2630,7 @@ static int clk_osm_resources_init(struct platform_device *pdev)
}
/* Check if OSM has been enabled already by trustzone. */
- if (readl_relaxed(l3_clk.vbases[OSM_BASE] + ENABLE_REG)) {
+ if (readl_relaxed(l3_clk.vbases[OSM_BASE] + ENABLE_REG) & ENABLE_OSM) {
dev_info(&pdev->dev, "OSM has been initialized and enabled by TZ software\n");
osm_tz_enabled = true;
}