diff options
author | Ohad Sharabi <osharabi@habana.ai> | 2022-07-24 09:23:05 +0200 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2022-09-18 12:29:50 +0200 |
commit | 68c82ba9a96f47dac9963c9f22b8c6bf4af00e02 (patch) | |
tree | 94d39b074bf8bf34300d37a3c9464f6d842b501a /drivers/misc/habanalabs/gaudi/gaudi.c | |
parent | habanalabs/gaudi: fix print format for div_sel (diff) | |
download | linux-68c82ba9a96f47dac9963c9f22b8c6bf4af00e02.tar.xz linux-68c82ba9a96f47dac9963c9f22b8c6bf4af00e02.zip |
habanalabs/gaudi: read div_sel value from firmware
Even when running with unsecured f/w, we should read the PLL div_sel
value from the f/w as this register is always privileged.
Signed-off-by: Ohad Sharabi <osharabi@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/gaudi/gaudi.c')
-rw-r--r-- | drivers/misc/habanalabs/gaudi/gaudi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c index 866dc4b891d6..7f52935dc603 100644 --- a/drivers/misc/habanalabs/gaudi/gaudi.c +++ b/drivers/misc/habanalabs/gaudi/gaudi.c @@ -899,12 +899,13 @@ static int gaudi_early_fini(struct hl_device *hdev) */ static int gaudi_fetch_psoc_frequency(struct hl_device *hdev) { - struct asic_fixed_properties *prop = &hdev->asic_prop; u32 nr = 0, nf = 0, od = 0, div_fctr = 0, pll_clk, div_sel; + struct asic_fixed_properties *prop = &hdev->asic_prop; u16 pll_freq_arr[HL_PLL_NUM_OUTPUTS], freq; int rc; - if (hdev->asic_prop.fw_security_enabled) { + if ((hdev->fw_components & FW_TYPE_LINUX) && + (prop->fw_app_cpu_boot_dev_sts0 & CPU_BOOT_DEV_STS0_PLL_INFO_EN)) { struct gaudi_device *gaudi = hdev->asic_specific; if (!(gaudi->hw_cap_initialized & HW_CAP_CPU_Q)) |