Commit 8a324583 authored by Srinivas Kandagatla's avatar Srinivas Kandagatla
Browse files

WIP:clk : qcom: Add rpm clock controller.



This patch adds rpm clock controller which manages all the fabric clocks
in the system.
This driver has a sub driver which tries to do proper clock hand overs
from bootloader and set the fabric clock frequency accordingly.

This patch also fixes issues raised due to incorrect clk handovers from
bootloader to Linux in relation with new RPM firmware version 3.0.16842958
and above. This new version of rpm firmware comes preloaded on latest
IFC6410 boards. The issue is some of the fabric clocks get turned off,
this is due to many reasons, one of them being "dynamic clock gating"
and other from rpm firmware which can gate clocks which do not have any users.

There was no such issue prior to RPM version 3.0.16842958, which indicates
that rpm firmware is gating some of the fabric clocks. Gating of one of such
fabric clock APPS Fabric clock has direct effect on halt status check in
linux kernel. Without proper handoff of clks from bootloader to linux
kernel, the halt status check during clk_enable() and clk_disable()
would fail and stops the board from booting.

Without this patch kernel would crash with below log:
drivers/clk/qcom/clk-branch.c:97 clk_branch_wait+0xd0/0x120()
mdp_clk status stuck at 'off'
Modules linked in:
CPU: 3 PID: 51 Comm: kworker/u8:1 Not tainted 3.18.0-rc1 #912
Workqueue: deferwq deferred_probe_work_func
[<c02160fc>] (unwind_backtrace) from [<c0211afc>]
(show_stack+0x10/0x14)
[<c0211afc>] (show_stack) from [<c0909864>]
(dump_stack+0x88/0x98)
[<c0909864>] (dump_stack) from [<c0249fa4>]
(warn_slowpath_common+0x6c/0x88)
[<c0249fa4>] (warn_slowpath_common) from [<c0249ff0>]
(warn_slowpath_fmt+0x30/0x40)
[<c0249ff0>] (warn_slowpath_fmt) from [<c0792964>]
(clk_branch_wait+0xd0/0x120)
[<c0792964>] (clk_branch_wait) from [<c0787f78>]
(__clk_enable+0x5c/0x9c)
[<c0787f78>] (__clk_enable) from [<c0788464>]
(clk_enable+0x18/0x2c)
[<c0788464>] (clk_enable) from [<c054121c>]
(mdp4_enable+0xe4/0x110)
[<c054121c>] (mdp4_enable) from [<c0541270>]
(mdp4_hw_init+0x28/0x344)
[<c0541270>] (mdp4_hw_init) from [<c0547e60>]
(msm_load+0x1c8/0x34c)
[<c0547e60>] (msm_load) from [<c052596c>]
(drm_dev_register+0xa8/0x104)
[<c052596c>] (drm_dev_register) from [<c0527824>]
(drm_platform_init+0x44/0xdc)
[<c0527824>] (drm_platform_init) from [<c0566538>]
(try_to_bring_up_master.part.3+0xc8/0x108)
[<c0566538>] (try_to_bring_up_master.part.3) from
[<c0566620>] (component_master_add_with_match+0xa8/0x120)

Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
parent 59c8ce2b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment