Stephen Boyd [Thu, 23 Feb 2023 00:32:15 +0000 (16:32 -0800)]
Merge tag 'qcom-clk-for-6.3-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into clk-qcom
Pull Qualcomm clk driver updates from Bjorn Andersson:
Support for requesting the next power_off operation for a genpd to be
synchronous is introduced, and implemented in the GDSC driver. To allow
the GPU driver to request power_off to wait for the GDSC to actually
collapse.
Support for QDU1000/QRU1000 Global clock controller, SA8775P Global
clock controller, SM8550 TCSR and display clock controller, SM6350 clock
controller, nd MSM8996 CBF and APCS clock controllers is introduced.
Parent references are updated across a large number of clock drivers, to
align with the design changes since those drivers where introduced.
Similarly, test clocks has been dropped from a range of drivers.
A range of fixes for the MSM8996 CPU clock controller is introduced.
MSM8974 GCC is transitioned off the externally defined sleep_clk.
GDSC in the global clock controller for QCS404 is added, and various
parent definitions are cleaned up.
The SDCC core clocks on SM6115 are moved for floor_ops.
Programming of clk_dis_wait for GPU CX GDSC on SC7180 and SDM845 are
moved to use the recently introduced properties in the GDSC struct.
The RPMh clock driver gains SM8550 and SA8775P clocks, and the IPA clock
is added on a variety of platforms.
The SMD RPM driver receives a big cleanup, in particular a move away
from duplicating declaration of identical clocks between multiple
platforms.
A few missing clocks across msm8998, msm8992, msm8916, qcs404 are added
as well.
Using devm_pm_runtime_enable() to clean up some duplication is done
across SM8250 display and video clock controllers, SM8450 display clock
controller and SC7280 LPASS clock controller.
Devicetree binding changes for above mentioned additions and changes are
introduced.
Support for postponing clk_disable_unused() until sync_state was
introduced, but later reverted again, awaiting an agreement on the
solution.
Lastly, a change to pad a few registers in the SM8250 DTS to 8 digits
was picked up in the wrong tree and kept here, to avoid rebasing.
* tag 'qcom-clk-for-6.3-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (142 commits)
clk: qcom: Revert sync_state based clk_disable_unused
dt-bindings: clock: Merge qcom,gpucc-sm8350 into qcom,gpucc.yaml
clk: qcom: gpucc-sdm845: fix clk_dis_wait being programmed for CX GDSC
clk: qcom: gpucc-sc7180: fix clk_dis_wait being programmed for CX GDSC
dt-bindings: clock: qcom,sa8775p-gcc: add the power-domains property
clk: qcom: cpu-8996: add missing cputype include
clk: qcom: gcc-sa8775p: remove unused variables
clk: qcom: smd-rpm: provide RPM_SMD_XO_CLK_SRC on MSM8996 platform
clk: qcom: add msm8996 Core Bus Framework (CBF) support
dt-bindings: clock: qcom,msm8996-cbf: Describe the MSM8996 CBF clock controller
clk: qcom: add the driver for the MSM8996 APCS clocks
clk: qcom: gcc-qcs404: fix duplicate initializer warning
clk: qcom: cpu-8996: change setup sequence to follow vendor kernel
clk: qcom: cpu-8996: fix PLL clock ops
clk: qcom: cpu-8996: fix ACD initialization
clk: qcom: cpu-8996: fix PLL configuration sequence
clk: qcom: cpu-8996: move qcom_cpu_clk_msm8996_acd_init call
clk: qcom: cpu-8996: setup PLLs before registering clocks
clk: qcom: cpu-8996: simplify the cpu_clk_notifier_cb
clk: qcom: cpu-8996: skip ACD init if the setup is valid
...
Bjorn Andersson [Wed, 22 Feb 2023 14:31:10 +0000 (06:31 -0800)]
clk: qcom: Revert sync_state based clk_disable_unused
Revert the postponement of clk_disable_unused() for clock providers that
implement sync_state, and the change to drivers implementing this, until
agreement on the implementation has been reached.
This reverts: 29e31415e14e ("clk: qcom: Remove need for clk_ignore_unused on sc8280xp") 99c0f7d35c4b ("clk: qcom: sdm845: Use generic clk_sync_state_disable_unused callback") 26b36df75166 ("clk: Add generic sync_state callback for disabling unused clocks")
Requested-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Dmitry Baryshkov [Mon, 6 Feb 2023 14:57:00 +0000 (16:57 +0200)]
dt-bindings: clock: Merge qcom,gpucc-sm8350 into qcom,gpucc.yaml
The GPU clock controller bindings for the Qualcomm sm8350 platform are
not correct. The driver uses .fw_name instead of using indices to bind
parent clocks, thus demanding the clock-names usage. With the proper
clock-names in place, the bindings becomes equal to the bindings defined
by qcom,gpucc.yaml, so it is impractical to keep them in a separate
file.
Dmitry Baryshkov [Wed, 1 Feb 2023 17:23:05 +0000 (19:23 +0200)]
clk: qcom: gpucc-sdm845: fix clk_dis_wait being programmed for CX GDSC
The gdsc_init() function will rewrite the CLK_DIS_WAIT field while
registering the GDSC (writing the value 0x2 by default). This will
override the setting done in the driver's probe function.
Set cx_gdsc.clk_dis_wait_val to 8 to follow the intention of the probe
function.
Fixes: 453361cdd757 ("clk: qcom: Add graphics clock controller driver for SDM845") Reviewed-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230201172305.993146-2-dmitry.baryshkov@linaro.org
Dmitry Baryshkov [Wed, 1 Feb 2023 17:23:04 +0000 (19:23 +0200)]
clk: qcom: gpucc-sc7180: fix clk_dis_wait being programmed for CX GDSC
The gdsc_init() function will rewrite the CLK_DIS_WAIT field while
registering the GDSC (writing the value 0x2 by default). This will
override the setting done in the driver's probe function.
Set cx_gdsc.clk_dis_wait_val to 8 to follow the intention of the probe
function.
Fixes: 745ff069a49c ("clk: qcom: Add graphics clock controller driver for SC7180") Reviewed-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230201172305.993146-1-dmitry.baryshkov@linaro.org
Krzysztof Kozlowski [Mon, 23 Jan 2023 20:18:10 +0000 (21:18 +0100)]
clk: qcom: cpu-8996: add missing cputype include
Include asm/cputype.h to fix ARMv7 compile test error:
drivers/clk/qcom/clk-cpu-8996.c: In function ‘qcom_cpu_clk_msm8996_acd_init’:
drivers/clk/qcom/clk-cpu-8996.c:468:16: error: implicit declaration of function ‘read_cpuid_mpidr’ [-Werror=implicit-function-declaration]
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
[bjorn: Moved asm-include after linux/, per Stephen's request] Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230123201812.1230039-1-krzysztof.kozlowski@linaro.org
Dmitry Baryshkov [Fri, 20 Jan 2023 06:14:10 +0000 (08:14 +0200)]
dt-bindings: clock: qcom,msm8996-cbf: Describe the MSM8996 CBF clock controller
MSM8996 Core Bus Fabric (CBF) clock controller clocks an interconnect
between two CPU clusters. The CBF clock should follow the CPU
frequencies to provide enough bandwidth between clusters. Thus a single
driver implements both a clock and an interconnect to set the clock
rate.
Dmitry Baryshkov [Thu, 26 Jan 2023 23:03:19 +0000 (01:03 +0200)]
clk: qcom: add the driver for the MSM8996 APCS clocks
Add a simple driver handling the APCS clocks on MSM8996. For now it
supports just a single aux clock, linking GPLL0 to CPU and CBF clocks.
Note, there is little sense in registering sys_apcs_aux as a child of
gpll0. The PLL is always-on. And listing the gpll0 as a property of the
apcs would delay its probing until the GCC has been probed (while we
would like for the apcs to be probed as early as possible).
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
[bjorn: Fixed spelling of register, per Stephen's feedback] Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230126230319.3977109-8-dmitry.baryshkov@linaro.org
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:41 +0000 (14:05 +0200)]
clk: qcom: cpu-8996: fix ACD initialization
The vendor kernel applies different order while programming SSSCTL and
L2ACDCR registers on power and performance clusters. However it was
demonstrated that doing this upstream results in the board reset. Make
both clusters use the same sequence, which fixes the reset.
Initialize ACD configuration from qcom_cpu_clk_msm8996_register_clks(),
before registering all clocks. This way we can be sure that the clock is
fully configured before letting CCF touch it.
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:38 +0000 (14:05 +0200)]
clk: qcom: cpu-8996: setup PLLs before registering clocks
Setup all PLLs before registering clocks in the common clock framework.
This ensures that the clocks are not accessed before being setup in the
known way and that the CCF is in sync with the actual HW programming.
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:37 +0000 (14:05 +0200)]
clk: qcom: cpu-8996: simplify the cpu_clk_notifier_cb
- Do not use the Alt PLL completely. Switch to smux when necessary to
prevent overvolting
- Restore the parent in case the rate change aborts for some reason
- Do not duplicate resetting the parent in set_parent operation.
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:34 +0000 (14:05 +0200)]
clk: qcom: cpu-8996: fix the init clock rate
Current multiplier (60) results in CPU getting the rate which is
unlisted in the CPU frequency tables (60 * 19.2 = 1152 MHz). This
results in warnings from the cpufreq during startup.
Change PLL programming (l = 54) to init CPU clocks to start with the
frequency of 54 * 19.2 = 1036.8 MHz which is supported by both power and
performance clusters from all speed bins.
Dmitry Baryshkov [Wed, 11 Jan 2023 06:04:01 +0000 (08:04 +0200)]
clk: qcom: mmcc-apq8084: use parent_hws/_data instead of parent_names
Convert the clock driver to specify parent data rather than parent
names, to actually bind using 'clock-names' specified in the DTS rather
than global clock names. Use parent_hws where possible to refer parent
clocks directly, skipping the lookup.
Note, the system names for xo clocks were changed from "xo" to
"xo_board" to follow the example of other platforms. This switches the
clocks to use DT-provided "xo_board" clock instead of manually
registered "xo" clock and allows us to drop qcom_cc_register_board_clk()
call from the driver at some point.
In the same way change the looked up system "sleep_clk_src" clock to
"sleep_clk", which is registered from DT.
Dmitry Baryshkov [Wed, 11 Jan 2023 06:03:56 +0000 (08:03 +0200)]
clk: qcom: gcc-apq8084: use parent_hws/_data instead of parent_names
Convert the clock driver to specify parent data rather than parent
names, to actually bind using 'clock-names' specified in the DTS rather
than global clock names. Use parent_hws where possible to refer parent
clocks directly, skipping the lookup.
Note, the system names for xo clocks were changed from "xo" to
"xo_board" to follow the example of other platforms. This switches the
clocks to use DT-provided "xo_board" clock instead of manually
registered "xo" clock and allows us to drop qcom_cc_register_board_clk()
call from the driver at some point.
In the same way change the looked up system "sleep_clk_src" clock to
"sleep_clk", which is registered from DT.
Robert Marko [Sun, 8 Jan 2023 13:04:39 +0000 (14:04 +0100)]
clk: qcom: ipq8074: populate fw_name for usb3phy-s
Having only .name populated in parent_data for clocks which are only
globally searchable currently will not work as the clk core won't copy
that name if there is no .fw_name present as well.
So, populate .fw_name for usb3phy clocks in parent_data as they were
missed by me in ("clk: qcom: ipq8074: populate fw_name for all parents").
Fixes: ae55ad32e273 ("clk: qcom: ipq8074: convert to parent data") Signed-off-by: Robert Marko <robimarko@gmail.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230108130440.670181-1-robimarko@gmail.com
Shazad Hussain [Tue, 17 Jan 2023 18:04:29 +0000 (19:04 +0100)]
clk: qcom: add the GCC driver for sa8775p
Add support for the Global Clock Controller found in the QTI SA8775P
platforms.
Signed-off-by: Shazad Hussain <quic_shazhuss@quicinc.com>
[Bartosz: made the driver ready for upstream] Co-developed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
[bjorn: Moved to core_initcall(), per request of Konrad] Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230117180429.305266-3-brgl@bgdev.pl
Krzysztof Kozlowski [Sat, 24 Dec 2022 21:44:04 +0000 (22:44 +0100)]
dt-bindings: clock: qcom,camcc-sm8250: extend clocks and power domains
Add clocks and properties (power-domains, required-opps) already used in
SM8250 DTS:
sm8250-hdk.dtb: clock-controller@ad00000: clocks: [[46, 10], [44, 0], [44, 1], [45]] is too long
sm8250-hdk.dtb: clock-controller@ad00000: clock-names:0: 'bi_tcxo' was expected
sm8250-hdk.dtb: clock-controller@ad00000: 'power-domains', 'required-opps' do not match any of the regexes: 'pinctrl-[0-9]+'
Krzysztof Kozlowski [Sat, 24 Dec 2022 15:41:52 +0000 (16:41 +0100)]
dt-bindings: clock: qcom,videocc: correct clocks per variant
Different SoCs come with a bit different clock inputs:
sm8250-mtp.dtb: clock-controller@abf0000: clock-names:0: 'bi_tcxo' was expected
sm8250-mtp.dtb: clock-controller@abf0000: clock-names: ['iface', 'bi_tcxo', 'bi_tcxo_ao'] is too long
Bjorn Andersson [Fri, 13 Jan 2023 04:10:38 +0000 (20:10 -0800)]
clk: qcom: Remove need for clk_ignore_unused on sc8280xp
With the transition of disabling unused clocks at sync_state, rather
than late_initcall() it's now possible to drop clk_ignore_unused and
unused clock disabled once client drivers have probed. Do this on
SC8280XP.
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> Reviewed-by: Abel Vesa <abel.vesa@linaro.org> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Tested-by: Andrew Halaney <ahalaney@redhat.com> # sc8280xp-lenovo-thinkpad-x13s Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230113041038.4188995-1-quic_bjorande@quicinc.com
Dmitry Baryshkov [Wed, 28 Dec 2022 20:37:25 +0000 (22:37 +0200)]
clk: qcom: gcc-msm8974: switch from sleep_clk_src to sleep_clk
gcc-msm8974 uses the registered sleep_clk_src clock, which is just a 1:1
fixed factor clock register on top of the board's sleep_clk. Switch the
driver to use the board sleep_clk directly.