linux.git
15 months agoMerge branch 'clk-rs9' into clk-next
Stephen Boyd [Tue, 9 Jan 2024 19:55:47 +0000 (11:55 -0800)]
Merge branch 'clk-rs9' into clk-next

* clk-rs9:
  clk: rs9: Add support for 9FGV0841
  clk: rs9: Replace model check with bitshift from chip data
  clk: rs9: Limit check to vendor ID in VID register
  dt-bindings: clk: rs9: Add 9FGV0841

15 months agoMerge branches 'clk-zynq', 'clk-xilinx' and 'clk-stm' into clk-next
Stephen Boyd [Tue, 9 Jan 2024 19:55:06 +0000 (11:55 -0800)]
Merge branches 'clk-zynq', 'clk-xilinx' and 'clk-stm' into clk-next

 - Update Zynqmp driver for Versal NET platforms
 - Add clk driver for Versal clocking wizard IP

* clk-zynq:
  drivers: clk: zynqmp: update divider round rate logic
  drivers: clk: zynqmp: calculate closest mux rate

* clk-xilinx:
  clocking-wizard: Add support for versal clocking wizard
  dt-bindings: clock: xilinx: add versal compatible

* clk-stm:
  dt-bindings: stm32: add clocks and reset binding for stm32mp25 platform
  clk: stm32mp1: use stm32mp13 reset driver
  clk: stm32mp1: move stm32mp1 clock driver into stm32 directory

15 months agoMerge branches 'clk-imx', 'clk-qcom', 'clk-amlogic' and 'clk-mediatek' into clk-next
Stephen Boyd [Tue, 9 Jan 2024 19:52:49 +0000 (11:52 -0800)]
Merge branches 'clk-imx', 'clk-qcom', 'clk-amlogic' and 'clk-mediatek' into clk-next

* clk-imx:
  clk: imx: pll14xx: change naming of fvco to fout
  clk: imx: clk-imx8qxp: fix LVDS bypass, pixel and phy clocks
  clk: imx: scu: Fix memory leak in __imx_clk_gpr_scu()
  dt-bindings: clock: support i.MX93 ANATOP clock module

* clk-qcom: (41 commits)
  clk: qcom: dispcc-sm8650: Add test_ctl parameters to PLL config
  clk: qcom: gpucc-sm8650: Add test_ctl parameters to PLL config
  clk: qcom: dispcc-sm8550: Use the correct PLL configuration function
  clk: qcom: dispcc-sm8550: Update disp PLL settings
  clk: qcom: gpucc-sm8550: Update GPU PLL settings
  clk: qcom: gcc-sm8550: Mark RCGs shared where applicable
  clk: qcom: gcc-sm8550: use collapse-voting for PCIe GDSCs
  clk: qcom: gcc-sm8550: Mark the PCIe GDSCs votable
  clk: qcom: gcc-sm8550: Add the missing RETAIN_FF_ENABLE GDSC flag
  clk: qcom: camcc-sc8280xp: Prevent error pointer dereference
  clk: qcom: videocc-sm8150: Add runtime PM support
  clk: qcom: videocc-sm8150: Add missing PLL config property
  clk: qcom: videocc-sm8150: Update the videocc resets
  dt-bindings: clock: Update the videocc resets for sm8150
  clk: qcom: rpmh: Add support for X1E80100 rpmh clocks
  clk: qcom: Add Global Clock controller (GCC) driver for X1E80100
  dt-bindings: clock: qcom-rpmhcc: Add RPMHCC bindings for X1E80100
  dt-bindings: clock: qcom: Add X1E80100 GCC clocks
  clk: qcom: Add ECPRICC driver support for QDU1000 and QRU1000
  clk: qcom: branch: Add mem ops support for branch2 clocks
  ...

* clk-amlogic:
  clk: meson: g12a: add CSI & ISP gates clocks
  clk: meson: g12a: add MIPI ISP clocks
  dt-bindings: clock: g12a-clkc: add MIPI ISP & CSI PHY clock ids
  clk: meson: g12a: add CTS_ENCL & CTS_ENCL_SEL clocks
  dt-bindings: clk: g12a-clkc: add CTS_ENCL clock ids

* clk-mediatek:
  clk: mediatek: add drivers for MT7988 SoC
  clk: mediatek: add pcw_chg_bit control for PLLs of MT7988
  dt-bindings: clock: mediatek: add clock controllers of MT7988
  dt-bindings: reset: mediatek: add MT7988 ethwarp reset IDs
  dt-bindings: clock: mediatek: add MT7988 clock IDs
  clk: mediatek: mt8188-topckgen: Refactor parents for top_dp/edp muxes
  clk: mediatek: mt8195-topckgen: Refactor parents for top_dp/edp muxes
  clk: mediatek: clk-mux: Support custom parent indices for muxes
  dt-bindings: clock: brcm,kona-ccu: convert to YAML
  dt-bindings: arm: mediatek: move ethsys controller & convert to DT schema
  dt-bindings: Remove alt_ref from versal

15 months agoMerge branches 'clk-versa', 'clk-silabs', 'clk-samsung', 'clk-starfive' and 'clk...
Stephen Boyd [Tue, 9 Jan 2024 19:52:35 +0000 (11:52 -0800)]
Merge branches 'clk-versa', 'clk-silabs', 'clk-samsung', 'clk-starfive' and 'clk-sophgo' into clk-next

 - Add glitch free PLL setting support to si5351 clk driver

* clk-versa:
  clk: versaclock3: Drop ret variable
  clk: versaclock3: Add missing space between ')' and '{'
  clk: versaclock3: Use u8 return type for get_parent() callback
  clk: versaclock3: Avoid unnecessary padding
  clk: versaclock3: Update vc3_get_div() to avoid divide by zero

* clk-silabs:
  clk: si5351: allow PLLs to be adjusted without reset
  dt-bindings: clock: si5351: add PLL reset mode property
  dt-bindings: clock: si5351: convert to yaml

* clk-samsung:
  clk: samsung: Improve kernel-doc comments
  clk: samsung: Fix kernel-doc comments

* clk-starfive:
  clk: starfive: jh7100: Add CLK_SET_RATE_PARENT to gmac_tx
  clk: starfive: Add flags argument to JH71X0__MUX macro

* clk-sophgo:
  dt-bindings: clock: sophgo: Add clock controller of CV1800 series SoC

15 months agoMerge branches 'clk-renesas', 'clk-rockchip', 'clk-allwinner' and 'clk-cleanup' into...
Stephen Boyd [Tue, 9 Jan 2024 19:52:28 +0000 (11:52 -0800)]
Merge branches 'clk-renesas', 'clk-rockchip', 'clk-allwinner' and 'clk-cleanup' into clk-next

* clk-renesas:
  clk: renesas: r9a08g045: Add clock and reset support for ETH0 and ETH1
  clk: renesas: rzg2l: Check reset monitor registers
  clk: renesas: r9a08g045: Add IA55 pclk and its reset
  clk: renesas: rzg2l-cpg: Reuse code in rzg2l_cpg_reset()
  clk: renesas: r8a779g0: Add PCIe clocks
  clk: renesas: r8a779g0: Add EtherTSN clock

* clk-rockchip:
  clk: rockchip: rk3568: Mark pclk_usb as critical
  clk: rockchip: rk3568: Add PLL rate for 126.4MHz
  clk: rockchip: rk3568: Add PLL rate for 115.2MHz

* clk-allwinner:
  clk: sunxi-ng: nkm: remove redundant initialization of tmp_parent

* clk-cleanup:
  clk: fixed-rate: fix clk_hw_register_fixed_rate_with_accuracy_parent_hw
  clk: si5341: fix an error code problem in si5341_output_clk_set_rate
  clk: microchip: mpfs-ccc: replace include of asm-generic/errno-base.h
  clk: rs9: Fix DIF OEn bit placement on 9FGV0241
  clk: mmp: pxa168: Fix memory leak in pxa168_clk_init()
  clk: hi3620: Fix memory leak in hi3620_mmc_clk_init()
  clk: sp7021: fix return value check in sp7021_clk_probe()

15 months agoclk: mediatek: add drivers for MT7988 SoC
Sam Shih [Sun, 17 Dec 2023 21:50:15 +0000 (21:50 +0000)]
clk: mediatek: add drivers for MT7988 SoC

Add APMIXED, ETH, INFRACFG and TOPCKGEN clock drivers which are
typical MediaTek designs.

Also add driver for XFIPLL clock generating the 156.25MHz clock for
the XFI SerDes. It needs an undocumented software workaround and has
an unknown internal design.

Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/c7574d808e2da1a530182f0fd790c1337c336e1b.1702849494.git.daniel@makrotopia.org
[sboyd@kernel.org: Add module license to infracfg file]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: mediatek: add pcw_chg_bit control for PLLs of MT7988
Sam Shih [Sun, 17 Dec 2023 21:50:07 +0000 (21:50 +0000)]
clk: mediatek: add pcw_chg_bit control for PLLs of MT7988

Introduce pcw_chg_bit member to struct mtk_pll_data and use it instead
of the previously hardcoded PCW_CHG_MASK macro if set.
This will needed for clocks on the MT7988 SoC.

Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/3b9c65ddb08c8bedf790aacf29871af026b6f0b7.1702849494.git.daniel@makrotopia.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agodt-bindings: clock: mediatek: add clock controllers of MT7988
Daniel Golle [Sun, 17 Dec 2023 21:49:55 +0000 (21:49 +0000)]
dt-bindings: clock: mediatek: add clock controllers of MT7988

Add various clock controllers found in the MT7988 SoC to existing
bindings (if applicable) and add files for the new ethwarp, mcusys
and xfi-pll clock controllers not previously present in any SoC.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/07e76a544ce4392bcb88e34d5480e99bb7994618.1702849494.git.daniel@makrotopia.org
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agodt-bindings: reset: mediatek: add MT7988 ethwarp reset IDs
Daniel Golle [Sun, 17 Dec 2023 21:49:45 +0000 (21:49 +0000)]
dt-bindings: reset: mediatek: add MT7988 ethwarp reset IDs

Add reset ID for ethwarp subsystem allowing to reset the built-in
Ethernet switch of the MediaTek MT7988 SoC.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/0c14bbacf471683af67ffa7572bfa1d5c45a0b5d.1702849494.git.daniel@makrotopia.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agodt-bindings: clock: mediatek: add MT7988 clock IDs
Sam Shih [Sun, 17 Dec 2023 21:49:33 +0000 (21:49 +0000)]
dt-bindings: clock: mediatek: add MT7988 clock IDs

Add MT7988 clock dt-bindings for topckgen, apmixedsys, infracfg,
ethernet and xfipll subsystem clocks.

Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/27f99db432e9ccc804cc5b6501d7d17d72cae879.1702849494.git.daniel@makrotopia.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: mediatek: mt8188-topckgen: Refactor parents for top_dp/edp muxes
AngeloGioacchino Del Regno [Fri, 3 Nov 2023 10:25:33 +0000 (11:25 +0100)]
clk: mediatek: mt8188-topckgen: Refactor parents for top_dp/edp muxes

The top_dp and top_edp muxes can be both parented to either TVDPLL1
or TVDPLL2, two identically specced PLLs for the specific purpose of
giving out pixel clock: this becomes a problem when the MediaTek
DisplayPort Interface (DPI) driver tries to set the pixel clock rate.

In the usecase of two simultaneous outputs (using two controllers),
it was seen that one of the displays would sometimes display garbled
output (if any at all) and this was because:
 - top_edp was set to TVDPLL1, outputting X GHz
 - top_dp was set to TVDPLL2, outputting Y GHz
   - mtk_dpi calls clk_set_rate(top_edp, Z GHz)
 - top_dp is switched to TVDPLL1
 - TVDPLL1 changes its rate, top_edp outputs the wrong rate.
 - eDP display is garbled

To solve this issue, remove all TVDPLL1 parents from `top_dp` and
all TVDPLL2 parents from `top_edp`, plus, necessarily switch both
clocks to use the new MUX_GATE_CLR_SET_UPD_INDEXED() macro to be
able to use the right bit index for the new parents list.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20231103102533.69280-4-angelogioacchino.delregno@collabora.com
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Fei Shao <fshao@chromium.org>
Reviewed-by: Fei Shao <fshao@chromium.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: mediatek: mt8195-topckgen: Refactor parents for top_dp/edp muxes
AngeloGioacchino Del Regno [Fri, 3 Nov 2023 10:25:32 +0000 (11:25 +0100)]
clk: mediatek: mt8195-topckgen: Refactor parents for top_dp/edp muxes

The top_dp and top_edp muxes can be both parented to either TVDPLL1
or TVDPLL2, two identically specced PLLs for the specific purpose of
giving out pixel clock: this becomes a problem when the MediaTek
DisplayPort Interface (DPI) driver tries to set the pixel clock rate.

In the usecase of two simultaneous outputs (using two controllers),
it was seen that one of the displays would sometimes display garbled
output (if any at all) and this was because:
 - top_edp was set to TVDPLL1, outputting X GHz
 - top_dp was set to TVDPLL2, outputting Y GHz
   - mtk_dpi calls clk_set_rate(top_edp, Z GHz)
     - top_dp is switched to TVDPLL1
     - TVDPLL1 changes its rate, top_edp outputs the wrong rate.
     - eDP display is garbled

To solve this issue, remove all TVDPLL1 parents from `top_dp` and
all TVDPLL2 parents from `top_edp`, plus, necessarily switch both
clocks to use the new MUX_GATE_CLR_SET_UPD_INDEXED() macro to be
able to use the right bit index for the new parents list.

Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20231103102533.69280-3-angelogioacchino.delregno@collabora.com
Reviewed-by: Fei Shao <fshao@chromium.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: mediatek: clk-mux: Support custom parent indices for muxes
AngeloGioacchino Del Regno [Fri, 3 Nov 2023 10:25:31 +0000 (11:25 +0100)]
clk: mediatek: clk-mux: Support custom parent indices for muxes

Add support for customized parent indices for MediaTek muxes: this is
necessary for the case in which we want to exclude some clocks from
a mux's parent clocks list, where the exclusions are not from the
very bottom of the list but either in the middle or the beginning.

Example:
- MUX1 (all parents)
  - parent1; idx=0
  - parent2; idx=1
  - parent3; idx=2

- MUX1 (wanted parents)
  - parent1; idx=0
  - parent3; idx=2

To achieve that add a `parent_index` array pointer to struct mtk_mux,
then in .set_parent(), .get_parent() callbacks check if this array
was populated and eventually get the index from that.

Also, to avoid updating all clock drivers for all SoCs, rename the
"main" macro to __GATE_CLR_SET_UPD_FLAGS (so, `__` was added) and
add the new member to it; furthermore, GATE_CLK_SET_UPD_FLAGS has
been reintroduced as being fully compatible with the older version.

The new parent_index can be specified with the new `_INDEXED`
variants of the MUX_GATE_CLR_SET_UPD_xxxx macros.

Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20231103102533.69280-2-angelogioacchino.delregno@collabora.com
Tested-by: Fei Shao <fshao@chromium.org>
Reviewed-by: Fei Shao <fshao@chromium.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoMerge tag 'clk-meson-v6.8-1' of https://github.com/BayLibre/clk-meson into clk-amlogic
Stephen Boyd [Wed, 3 Jan 2024 23:54:05 +0000 (15:54 -0800)]
Merge tag 'clk-meson-v6.8-1' of https://github.com/BayLibre/clk-meson into clk-amlogic

Pull Amlogic clk driver updates from Jerome Brunet:

 - Add DSI clocks on Amlogic g12/sm1
 - Add CSI and ISP clocks on Amlogic g12/sm1

* tag 'clk-meson-v6.8-1' of https://github.com/BayLibre/clk-meson:
  clk: meson: g12a: add CSI & ISP gates clocks
  clk: meson: g12a: add MIPI ISP clocks
  dt-bindings: clock: g12a-clkc: add MIPI ISP & CSI PHY clock ids
  clk: meson: g12a: add CTS_ENCL & CTS_ENCL_SEL clocks
  dt-bindings: clk: g12a-clkc: add CTS_ENCL clock ids

15 months agoMerge tag 'clk-imx-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa...
Stephen Boyd [Wed, 3 Jan 2024 23:53:49 +0000 (15:53 -0800)]
Merge tag 'clk-imx-6.8' of git://git./linux/kernel/git/abelvesa/linux into clk-imx

Pull i.MX clk driver updates from Abel Vesa:

 - Document bindings for i.MX93 ANATOP clock driver
 - Free clk_node in SCU driver for resource with different owner
 - Update the LVDS clocks to be compatible with SCU firmware 1.15
 - Fix the name of the fvco in pll14xx by renaming it to fout

* tag 'clk-imx-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux:
  clk: imx: pll14xx: change naming of fvco to fout
  clk: imx: clk-imx8qxp: fix LVDS bypass, pixel and phy clocks
  clk: imx: scu: Fix memory leak in __imx_clk_gpr_scu()
  dt-bindings: clock: support i.MX93 ANATOP clock module

15 months agoMerge tag 'qcom-clk-for-6.8' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom...
Stephen Boyd [Wed, 3 Jan 2024 23:53:09 +0000 (15:53 -0800)]
Merge tag 'qcom-clk-for-6.8' of https://git./linux/kernel/git/qcom/linux into clk-qcom

Pull Qualcomm clk driver updates from Bjorn Andersson:

 - New drivers to support global, display, gpu, tcsr, and rpmh clocks on
   Qualcomm SM8650
 - Global and RPMh clock support for the Qualcomm X1E80100 SoC
 - Support for the Stromer APCS PLL found in Qualcomm IPQ5018
 - Add a new type of branch clock, with support for controlling separate
   memory control bits, to the Qualcomm clk driver
 - Use new branch type in Qualcomm ECPRI clk driver for QDU1000 and
   QRU1000
 - Add a number of missing clocks related to CSI2 on Qualcomm MSM8939
 - Add support for the camera clock controller on Qualcomm SC8280XP
 - Correct PLL configuration in GPU and video clock controllers for
   Qualcomm SM8150
 - Add runtime PM support and a few missing resets to Qualcomm SM8150
   video clock controller
 - Fix configuration of various GCC GDSCs on Qualcomm SM8550
 - Mark shared RCGs appropriately in the Qualcomm SM8550 GCC driver
 - Fix up GPU and display clock controllers PLL configuration settings
   on Qualcomm SM8550

* tag 'qcom-clk-for-6.8' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (41 commits)
  clk: qcom: dispcc-sm8650: Add test_ctl parameters to PLL config
  clk: qcom: gpucc-sm8650: Add test_ctl parameters to PLL config
  clk: qcom: dispcc-sm8550: Use the correct PLL configuration function
  clk: qcom: dispcc-sm8550: Update disp PLL settings
  clk: qcom: gpucc-sm8550: Update GPU PLL settings
  clk: qcom: gcc-sm8550: Mark RCGs shared where applicable
  clk: qcom: gcc-sm8550: use collapse-voting for PCIe GDSCs
  clk: qcom: gcc-sm8550: Mark the PCIe GDSCs votable
  clk: qcom: gcc-sm8550: Add the missing RETAIN_FF_ENABLE GDSC flag
  clk: qcom: camcc-sc8280xp: Prevent error pointer dereference
  clk: qcom: videocc-sm8150: Add runtime PM support
  clk: qcom: videocc-sm8150: Add missing PLL config property
  clk: qcom: videocc-sm8150: Update the videocc resets
  dt-bindings: clock: Update the videocc resets for sm8150
  clk: qcom: rpmh: Add support for X1E80100 rpmh clocks
  clk: qcom: Add Global Clock controller (GCC) driver for X1E80100
  dt-bindings: clock: qcom-rpmhcc: Add RPMHCC bindings for X1E80100
  dt-bindings: clock: qcom: Add X1E80100 GCC clocks
  clk: qcom: Add ECPRICC driver support for QDU1000 and QRU1000
  clk: qcom: branch: Add mem ops support for branch2 clocks
  ...

15 months agodt-bindings: clock: sophgo: Add clock controller of CV1800 series SoC
Inochi Amaoto [Mon, 18 Dec 2023 04:04:03 +0000 (12:04 +0800)]
dt-bindings: clock: sophgo: Add clock controller of CV1800 series SoC

Add definition for the clock controller of the CV1800 series SoC.

For CV181X, it has a clock that CV180X does not have. To avoid misuse,
also add a compatible string to identify CV181X series SoC.

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
Link: https://github.com/milkv-duo/duo-files/blob/main/hardware/CV1800B/CV1800B-CV1801B-Preliminary-Datasheet-full-en.pdf
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/IA1PR20MB49535E448097F6FFC1218C39BB90A@IA1PR20MB4953.namprd20.prod.outlook.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: starfive: jh7100: Add CLK_SET_RATE_PARENT to gmac_tx
Emil Renner Berthing [Tue, 19 Dec 2023 23:24:40 +0000 (01:24 +0200)]
clk: starfive: jh7100: Add CLK_SET_RATE_PARENT to gmac_tx

This is needed by the dwmac-starfive ethernet driver to set the clock
for 1000, 100 and 10 Mbps links properly.

Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20231219232442.2460166-3-cristian.ciocaltea@collabora.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: starfive: Add flags argument to JH71X0__MUX macro
Emil Renner Berthing [Tue, 19 Dec 2023 23:24:39 +0000 (01:24 +0200)]
clk: starfive: Add flags argument to JH71X0__MUX macro

This flag is needed to add the CLK_SET_RATE_PARENT flag on the gmac_tx
clock on the JH7100, which in turn is needed by the dwmac-starfive
driver to set the clock properly for 1000, 100 and 10 Mbps links.

This change was mostly made using coccinelle:

@ match @
expression idx, name, nparents;
@@
 JH71X0__MUX(
-idx, name, nparents,
+idx, name, 0, nparents,
 ...)

Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20231219232442.2460166-2-cristian.ciocaltea@collabora.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: imx: pll14xx: change naming of fvco to fout
Shengjiu Wang [Wed, 20 Dec 2023 10:33:09 +0000 (18:33 +0800)]
clk: imx: pll14xx: change naming of fvco to fout

pll14xx_calc_rate() output the fout clock not the fvco clock
The relation of fvco and fout is:
fout = fvco / (1 << sdiv)

So use correct naming for the clock.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.kernel.org/r/1703068389-6130-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
15 months agoMerge tag 'samsung-clk-6.8' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk...
Stephen Boyd [Wed, 20 Dec 2023 19:54:42 +0000 (11:54 -0800)]
Merge tag 'samsung-clk-6.8' of https://git./linux/kernel/git/krzk/linux into clk-samsung

Pull Samsung SoC clk driver changes from Krzysztof Kozlowski:

Few kernel-doc fixes for Samsung SoC clock controllers.

* tag 'samsung-clk-6.8' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
  clk: samsung: Improve kernel-doc comments
  clk: samsung: Fix kernel-doc comments

15 months agoclk: imx: clk-imx8qxp: fix LVDS bypass, pixel and phy clocks
Alexander Stein [Mon, 18 Dec 2023 12:24:07 +0000 (13:24 +0100)]
clk: imx: clk-imx8qxp: fix LVDS bypass, pixel and phy clocks

To be compatible with SCU firmware based on 1.15 a different clock
routing for LVDS is needed.

Signed-off-by: Oliver F. Brown <oliver.brown@oss.nxp.com>
Signed-off-by: Ranjani Vaidyanathan <ranjani.vaidyanathan@nxp.com>
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20231218122407.2757175-1-alexander.stein@ew.tq-group.com/
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
15 months agoclk: imx: scu: Fix memory leak in __imx_clk_gpr_scu()
Kuan-Wei Chiu [Sun, 10 Dec 2023 17:19:07 +0000 (01:19 +0800)]
clk: imx: scu: Fix memory leak in __imx_clk_gpr_scu()

In cases where imx_clk_is_resource_owned() returns false, the code path
does not handle the failure gracefully, potentially leading to a memory
leak. This fix ensures proper cleanup by freeing the allocated memory
for 'clk_node' before returning.

Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/all/20231210171907.3410922-1-visitorckw@gmail.com/
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
15 months agoclk: fixed-rate: fix clk_hw_register_fixed_rate_with_accuracy_parent_hw
Théo Lebrun [Mon, 18 Dec 2023 17:14:16 +0000 (18:14 +0100)]
clk: fixed-rate: fix clk_hw_register_fixed_rate_with_accuracy_parent_hw

Add missing comma and remove extraneous NULL argument. The macro is
currently used by no one which explains why the typo slipped by.

Fixes: 2d34f09e79c9 ("clk: fixed-rate: Add support for specifying parents via DT/pointers")
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20231218-mbly-clk-v1-1-44ce54108f06@bootlin.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: qcom: dispcc-sm8650: Add test_ctl parameters to PLL config
Konrad Dybcio [Tue, 19 Dec 2023 18:55:33 +0000 (19:55 +0100)]
clk: qcom: dispcc-sm8650: Add test_ctl parameters to PLL config

These values were missing. Add them.

Fixes: 9e939f008338 ("clk: qcom: add the SM8650 Display Clock Controller driver")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231219-topic-8650_clks-v1-2-5672bfa0eb05@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
15 months agoclk: qcom: gpucc-sm8650: Add test_ctl parameters to PLL config
Konrad Dybcio [Tue, 19 Dec 2023 18:55:32 +0000 (19:55 +0100)]
clk: qcom: gpucc-sm8650: Add test_ctl parameters to PLL config

These values were missing. Add them.

Fixes: 8676fd4f3874 ("clk: qcom: add the SM8650 GPU Clock Controller driver")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231219-topic-8650_clks-v1-1-5672bfa0eb05@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
15 months agoclk: qcom: dispcc-sm8550: Use the correct PLL configuration function
Konrad Dybcio [Mon, 18 Dec 2023 16:02:10 +0000 (17:02 +0100)]
clk: qcom: dispcc-sm8550: Use the correct PLL configuration function

To ensure that all fields (particularly CAL_L and CAL_L_RINGOSC) are
filled properly, use the correct prepare function for OLE PLLs.

Fixes: 90114ca11476 ("clk: qcom: add SM8550 DISPCC driver")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231218-topic-8550_fixes-v1-9-ce1272d77540@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
15 months agoclk: qcom: dispcc-sm8550: Update disp PLL settings
Konrad Dybcio [Mon, 18 Dec 2023 16:02:09 +0000 (17:02 +0100)]
clk: qcom: dispcc-sm8550: Update disp PLL settings

The settings in the driver seem to have been taken from an older
release. Update them to match the latest values.

Fixes: 90114ca11476 ("clk: qcom: add SM8550 DISPCC driver")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231218-topic-8550_fixes-v1-8-ce1272d77540@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
15 months agoclk: qcom: gpucc-sm8550: Update GPU PLL settings
Konrad Dybcio [Mon, 18 Dec 2023 16:02:08 +0000 (17:02 +0100)]
clk: qcom: gpucc-sm8550: Update GPU PLL settings

The settings in the driver seem to have been taken from an older
release. Update them to match the latest values.

Fixes: bfae40744b33 ("clk: qcom: gpucc-sm8550: Add support for graphics clock controller")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231218-topic-8550_fixes-v1-7-ce1272d77540@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
15 months agoclk: qcom: gcc-sm8550: Mark RCGs shared where applicable
Konrad Dybcio [Mon, 18 Dec 2023 16:02:07 +0000 (17:02 +0100)]
clk: qcom: gcc-sm8550: Mark RCGs shared where applicable

The vast majority of shared RCGs were not marked as such. Fix it.

Fixes: 955f2ea3b9e9 ("clk: qcom: Add GCC driver for SM8550")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231218-topic-8550_fixes-v1-6-ce1272d77540@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
15 months agoclk: qcom: gcc-sm8550: use collapse-voting for PCIe GDSCs
Konrad Dybcio [Mon, 18 Dec 2023 16:02:06 +0000 (17:02 +0100)]
clk: qcom: gcc-sm8550: use collapse-voting for PCIe GDSCs

The PCIe GDSCs can be shared with other masters and should use the APCS
collapse-vote register when updating the power state.

This is specifically also needed to be able to disable power domains
that have been enabled by boot firmware using the vote register.

Following other recent Qualcomm platforms, describe this register and
the corresponding mask for the PCIe (and _phy) GDSCs.

Fixes: 955f2ea3b9e9 ("clk: qcom: Add GCC driver for SM8550")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231218-topic-8550_fixes-v1-5-ce1272d77540@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
15 months agoclk: qcom: gcc-sm8550: Mark the PCIe GDSCs votable
Konrad Dybcio [Mon, 18 Dec 2023 16:02:05 +0000 (17:02 +0100)]
clk: qcom: gcc-sm8550: Mark the PCIe GDSCs votable

The PCIe GDSCs on most Qualcomm platforms expect the OS to always
consider collapse requests as successful. This also concerns SM8550.

Add the VOTABLE flag to the GDSCs in question to comply with these
expectations.

Fixes: 955f2ea3b9e9 ("clk: qcom: Add GCC driver for SM8550")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231218-topic-8550_fixes-v1-4-ce1272d77540@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
15 months agoclk: qcom: gcc-sm8550: Add the missing RETAIN_FF_ENABLE GDSC flag
Konrad Dybcio [Mon, 18 Dec 2023 16:02:04 +0000 (17:02 +0100)]
clk: qcom: gcc-sm8550: Add the missing RETAIN_FF_ENABLE GDSC flag

All of the 8550's GCC GDSCs can and should use the retain registers so
as not to lose their state when entering lower power modes.

Fixes: 955f2ea3b9e9 ("clk: qcom: Add GCC driver for SM8550")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231218-topic-8550_fixes-v1-3-ce1272d77540@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
15 months agoclk: si5351: allow PLLs to be adjusted without reset
Alvin Šipraga [Fri, 24 Nov 2023 13:17:44 +0000 (14:17 +0100)]
clk: si5351: allow PLLs to be adjusted without reset

Introduce a new PLL reset mode flag which controls whether or not to
reset a PLL after adjusting its rate. The mode can be configured through
platform data or device tree.

Since commit 6dc669a22c77 ("clk: si5351: Add PLL soft reset"), the
driver unconditionally resets a PLL whenever its rate is adjusted.
The rationale was that a PLL reset was required to get three outputs
working at the same time. Before this change, the driver never reset the
PLLs.

Commit b26ff127c52c ("clk: si5351: Apply PLL soft reset before enabling
the outputs") subsequently introduced an option to reset the PLL when
enabling a clock output that sourced it. Here, the rationale was that
this is required to get a deterministic phase relationship between
multiple output clocks.

This clearly shows that it is useful to reset the PLLs in applications
where multiple clock outputs are used. However, the Si5351 also allows
for glitch-free rate adjustment of its PLLs if one avoids resetting the
PLL. In our audio application where a single Si5351 clock output is used
to supply a runtime adjustable bit clock, this unconditional PLL reset
behaviour introduces unwanted glitches in the clock output.

It would appear that the problem being solved in the former commit
may be solved by using the optional device tree property introduced in
the latter commit, obviating the need for an unconditional PLL reset
after rate adjustment. But it's not OK to break the default behaviour of
the driver, and it cannot be assumed that all device trees are using the
property introduced in the latter commit. Hence, the new behaviour is
made opt-in.

Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Rabeeh Khoury <rabeeh@solid-run.com>
Cc: Jacob Siverskog <jacob@teenage.engineering>
Cc: Sergej Sawazki <sergej@taudac.com>
Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Link: https://lore.kernel.org/r/20231124-alvin-clk-si5351-no-pll-reset-v6-3-69b82311cb90@bang-olufsen.dk
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agodt-bindings: clock: si5351: add PLL reset mode property
Alvin Šipraga [Fri, 24 Nov 2023 13:17:43 +0000 (14:17 +0100)]
dt-bindings: clock: si5351: add PLL reset mode property

For applications where the PLL must be adjusted without glitches in the
clock output(s), a new silabs,pll-reset-mode property is added. It
can be used to specify whether or not the PLL should be reset after
adjustment. Resetting is known to cause glitches.

For compatibility with older device trees, it must be assumed that the
default PLL reset mode is to unconditionally reset after adjustment.

Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Rabeeh Khoury <rabeeh@solid-run.com>
Cc: Jacob Siverskog <jacob@teenage.engineering>
Cc: Sergej Sawazki <sergej@taudac.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
Link: https://lore.kernel.org/r/20231124-alvin-clk-si5351-no-pll-reset-v6-2-69b82311cb90@bang-olufsen.dk
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agodt-bindings: clock: si5351: convert to yaml
Alvin Šipraga [Fri, 24 Nov 2023 13:17:42 +0000 (14:17 +0100)]
dt-bindings: clock: si5351: convert to yaml

The following additional properties are described:

  - clock-names
  - clock-frequency of the clkout child nodes

In order to suppress warnings from the DT schema validator, the clkout
child nodes are prescribed names clkout@[0-7] rather than clkout[0-7].

The example is refined as follows:

  - correct the usage of property pll-master -> silabs,pll-master
  - give an example of how the silabs,pll-reset property can be used

I made myself maintainer of the file as I cannot presume that anybody
else wants the responsibility.

Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Rabeeh Khoury <rabeeh@solid-run.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
Link: https://lore.kernel.org/r/20231124-alvin-clk-si5351-no-pll-reset-v6-1-69b82311cb90@bang-olufsen.dk
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: si5341: fix an error code problem in si5341_output_clk_set_rate
Su Hui [Wed, 1 Nov 2023 03:16:36 +0000 (11:16 +0800)]
clk: si5341: fix an error code problem in si5341_output_clk_set_rate

regmap_bulk_write() return zero or negative error code, return the value
of regmap_bulk_write() rather than '0'.

Fixes: 3044a860fd09 ("clk: Add Si5341/Si5340 driver")
Acked-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Su Hui <suhui@nfschina.com>
Link: https://lore.kernel.org/r/20231101031633.996124-1-suhui@nfschina.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: versaclock3: Drop ret variable
Biju Das [Wed, 22 Nov 2023 14:23:10 +0000 (14:23 +0000)]
clk: versaclock3: Drop ret variable

Drop ret variable from vc3_clk_mux_determine_rate().

While at it, return the value returned by regmap_*
wherever possible instead of returning 0.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20231122142310.203169-6-biju.das.jz@bp.renesas.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: versaclock3: Add missing space between ')' and '{'
Biju Das [Wed, 22 Nov 2023 14:23:09 +0000 (14:23 +0000)]
clk: versaclock3: Add missing space between ')' and '{'

Add missing space between ')' and '{' for hw.init initialization.

While at it, update the macro VC3_PLL1_LOOP_FILTER_N_DIV_MSB
0x0a->0xa.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20231122142310.203169-5-biju.das.jz@bp.renesas.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: versaclock3: Use u8 return type for get_parent() callback
Biju Das [Wed, 22 Nov 2023 14:23:08 +0000 (14:23 +0000)]
clk: versaclock3: Use u8 return type for get_parent() callback

The return type of get_parent() member in struct clk_ops is u8.
Use same return type for corresponding callback function as well.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20231122142310.203169-4-biju.das.jz@bp.renesas.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: versaclock3: Avoid unnecessary padding
Biju Das [Wed, 22 Nov 2023 14:23:07 +0000 (14:23 +0000)]
clk: versaclock3: Avoid unnecessary padding

Move long/pointer variables at the beginning of struct to avoid
unnecessary padding.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20231122142310.203169-3-biju.das.jz@bp.renesas.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: versaclock3: Update vc3_get_div() to avoid divide by zero
Biju Das [Wed, 22 Nov 2023 14:23:06 +0000 (14:23 +0000)]
clk: versaclock3: Update vc3_get_div() to avoid divide by zero

Update vc3_get_div() to avoid divide by zero operation on
vc3_div_round_rate() by returning1, if there is no table match
found.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20231122142310.203169-2-biju.das.jz@bp.renesas.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agodt-bindings: stm32: add clocks and reset binding for stm32mp25 platform
Gabriel Fernandez [Fri, 8 Dec 2023 14:36:58 +0000 (15:36 +0100)]
dt-bindings: stm32: add clocks and reset binding for stm32mp25 platform

Adds clock and reset binding entries for STM32MP25 SoC family

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231208143700.354785-4-gabriel.fernandez@foss.st.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: stm32mp1: use stm32mp13 reset driver
Gabriel Fernandez [Fri, 8 Dec 2023 14:36:57 +0000 (15:36 +0100)]
clk: stm32mp1: use stm32mp13 reset driver

STM32MP15 is now using the same reset driver as STM32MP13 as they
have the same binding requirement.

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Link: https://lore.kernel.org/r/20231208143700.354785-3-gabriel.fernandez@foss.st.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: stm32mp1: move stm32mp1 clock driver into stm32 directory
Gabriel Fernandez [Fri, 8 Dec 2023 14:36:56 +0000 (15:36 +0100)]
clk: stm32mp1: move stm32mp1 clock driver into stm32 directory

Move all STM32MP clock drivers into same directory (stm32).

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Link: https://lore.kernel.org/r/20231208143700.354785-2-gabriel.fernandez@foss.st.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: rs9: Add support for 9FGV0841
Marek Vasut [Mon, 13 Nov 2023 22:18:54 +0000 (23:18 +0100)]
clk: rs9: Add support for 9FGV0841

This model is similar to 9FGV0441, the DIFx bits start at bit 0 again,
except this chip has 8 outputs.

Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://lore.kernel.org/r/20231113221949.111964-4-marek.vasut+renesas@mailbox.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: rs9: Replace model check with bitshift from chip data
Marek Vasut [Mon, 13 Nov 2023 22:18:53 +0000 (23:18 +0100)]
clk: rs9: Replace model check with bitshift from chip data

Adjust rs9_calc_dif() to special-case the 9FGV0241 where DIFx bits
start at 1, encode this shift into chip data and drop the model
check entirely.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://lore.kernel.org/r/20231113221949.111964-3-marek.vasut+renesas@mailbox.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: rs9: Limit check to vendor ID in VID register
Marek Vasut [Mon, 13 Nov 2023 22:18:52 +0000 (23:18 +0100)]
clk: rs9: Limit check to vendor ID in VID register

Extract only vendor ID from VID register, the top 4 bits are
revision ID which are not useful for the vendor ID check.

Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://lore.kernel.org/r/20231113221949.111964-2-marek.vasut+renesas@mailbox.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agodt-bindings: clk: rs9: Add 9FGV0841
Marek Vasut [Mon, 13 Nov 2023 22:18:51 +0000 (23:18 +0100)]
dt-bindings: clk: rs9: Add 9FGV0841

This is an 8-channel variant of 9FGV series.

Acked-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://lore.kernel.org/r/20231113221949.111964-1-marek.vasut+renesas@mailbox.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agodt-bindings: clock: brcm,kona-ccu: convert to YAML
Stanislav Jakubek [Sun, 12 Nov 2023 16:56:51 +0000 (17:56 +0100)]
dt-bindings: clock: brcm,kona-ccu: convert to YAML

Convert Broadcom Kona family clock controller unit (CCU) bindings
to DT schema.

Changes during conversion:
  - remove "dmac" from clock-output-names for brcm,bcm11351-master-ccu,
    such a clock doesn't exist
  - remove "uartb4" from clock-output-names for brcm,bcm21664-slave-ccu,
    such a clock doesn't exist

Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/ZVED01t3+coBd44x@standask-GA-A55M-S2HP
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agodt-bindings: arm: mediatek: move ethsys controller & convert to DT schema
Rafał Miłecki [Sun, 19 Nov 2023 21:24:16 +0000 (22:24 +0100)]
dt-bindings: arm: mediatek: move ethsys controller & convert to DT schema

DT schema helps validating DTS files. Binding was moved to clock/ as
this hardware is a clock provider. Example required a small fix for
"reg" value (1 address cell + 1 size cell).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231119212416.2682-1-zajec5@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclocking-wizard: Add support for versal clocking wizard
Shubhrajyoti Datta [Thu, 14 Dec 2023 10:51:25 +0000 (16:21 +0530)]
clocking-wizard: Add support for versal clocking wizard

Add support for Clocking Wizard for Versal adaptive compute
acceleration platforms. The Versal clocking wizard differs
in the programming model and the register layout.
The CLKFBOUT_1 registers are at offset of 0x200
instead of the 0x330 in Versal. In Versal clocking wizard the low and
high time is programmed instead of the divisor.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
Link: https://lore.kernel.org/r/20231214105125.26919-3-shubhrajyoti.datta@amd.com
[sboyd@kernel.org: Stop initializing spinlock flags]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agodt-bindings: clock: xilinx: add versal compatible
Shubhrajyoti Datta [Thu, 14 Dec 2023 10:51:24 +0000 (16:21 +0530)]
dt-bindings: clock: xilinx: add versal compatible

Add the devicetree compatible for Versal clocking wizard.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
Link: https://lore.kernel.org/r/20231214105125.26919-2-shubhrajyoti.datta@amd.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: microchip: mpfs-ccc: replace include of asm-generic/errno-base.h
Conor Dooley [Thu, 14 Dec 2023 10:59:57 +0000 (10:59 +0000)]
clk: microchip: mpfs-ccc: replace include of asm-generic/errno-base.h

As evidenced by the fact that only 2 other drivers include this header,
it is not a normal thing to do. Including the regular version of this
header is far more conventional for drivers.

Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20231214-dipper-earshot-72eef3059961@spud
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agodt-bindings: Remove alt_ref from versal
Shubhrajyoti Datta [Tue, 28 Nov 2023 10:43:48 +0000 (16:13 +0530)]
dt-bindings: Remove alt_ref from versal

The alt_ref is present only in Versal-net devices.
Other versal devices do not have it. So remove alt_ref
for versal.

Fixes: 352546805a44 ("dt-bindings: clock: Add bindings for versal clock driver")
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
Link: https://lore.kernel.org/r/20231128104348.16372-1-shubhrajyoti.datta@amd.com
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: rs9: Fix DIF OEn bit placement on 9FGV0241
Marek Vasut [Sun, 5 Nov 2023 20:06:15 +0000 (21:06 +0100)]
clk: rs9: Fix DIF OEn bit placement on 9FGV0241

On 9FGV0241, the DIF OE0 is BIT(1) and DIF OE1 is BIT(2), on the other
chips like 9FGV0441 and 9FGV0841 DIF OE0 is BIT(0) and so on. Increment
the index in BIT() macro instead of the result of BIT() macro to shift
the bit correctly on 9FGV0241.

Fixes: 603df193ec51 ("clk: rs9: Support device specific dif bit calculation")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://lore.kernel.org/r/20231105200642.62792-1-marek.vasut+renesas@mailbox.org
Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agodrivers: clk: zynqmp: update divider round rate logic
Jay Buddhabhatti [Wed, 29 Nov 2023 11:29:16 +0000 (03:29 -0800)]
drivers: clk: zynqmp: update divider round rate logic

Currently zynqmp divider round rate is considering single parent and
calculating rate and parent rate accordingly. But if divider clock flag
is set to SET_RATE_PARENT then its not trying to traverse through all
parent rate and not selecting best parent rate from that. So use common
divider_round_rate() which is traversing through all clock parents and
its rate and calculating proper parent rate.

Fixes: 3fde0e16d016 ("drivers: clk: Add ZynqMP clock driver")
Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Link: https://lore.kernel.org/r/20231129112916.23125-3-jay.buddhabhatti@amd.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agodrivers: clk: zynqmp: calculate closest mux rate
Jay Buddhabhatti [Wed, 29 Nov 2023 11:29:15 +0000 (03:29 -0800)]
drivers: clk: zynqmp: calculate closest mux rate

Currently zynqmp clock driver is not calculating closest mux rate and
because of that Linux is not setting proper frequency for CPU and
not able to set given frequency for dynamic frequency scaling.

E.g., In current logic initial acpu clock parent and frequency as below
apll1                  0    0    0  2199999978    0     0  50000      Y
    acpu0_mux          0    0    0  2199999978    0     0  50000      Y
        acpu0_idiv1    0    0    0  2199999978    0     0  50000      Y
            acpu0      0    0    0  2199999978    0     0  50000      Y

After changing acpu frequency to 549999994 Hz using CPU freq scaling its
selecting incorrect parent which is not closest frequency.
rpll_to_xpd            0    0    0  1599999984    0     0  50000      Y
    acpu0_mux          0    0    0  1599999984    0     0  50000      Y
        acpu0_div1     0    0    0   533333328    0     0  50000      Y
            acpu0      0    0    0   533333328    0     0  50000      Y

Parent should remain same since 549999994 = 2199999978 / 4.

So use __clk_mux_determine_rate_closest() generic function to calculate
closest rate for mux clock. After this change its selecting correct
parent and correct clock rate.
apll1                  0    0    0  2199999978    0     0  50000      Y
    acpu0_mux          0    0    0  2199999978    0     0  50000      Y
        acpu0_div1     0    0    0   549999995    0     0  50000      Y
            acpu0      0    0    0   549999995    0     0  50000      Y

Fixes: 3fde0e16d016 ("drivers: clk: Add ZynqMP clock driver")
Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Link: https://lore.kernel.org/r/20231129112916.23125-2-jay.buddhabhatti@amd.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: mmp: pxa168: Fix memory leak in pxa168_clk_init()
Kuan-Wei Chiu [Sun, 10 Dec 2023 17:52:32 +0000 (01:52 +0800)]
clk: mmp: pxa168: Fix memory leak in pxa168_clk_init()

In cases where mapping of mpmu/apmu/apbc registers fails, the code path
does not handle the failure gracefully, potentially leading to a memory
leak. This fix ensures proper cleanup by freeing the allocated memory
for 'pxa_unit' before returning.

Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Link: https://lore.kernel.org/r/20231210175232.3414584-1-visitorckw@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: hi3620: Fix memory leak in hi3620_mmc_clk_init()
Kuan-Wei Chiu [Sun, 10 Dec 2023 16:50:40 +0000 (00:50 +0800)]
clk: hi3620: Fix memory leak in hi3620_mmc_clk_init()

In cases where kcalloc() fails for the 'clk_data->clks' allocation, the
code path does not handle the failure gracefully, potentially leading
to a memory leak. This fix ensures proper cleanup by freeing the
allocated memory for 'clk_data' before returning.

Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Link: https://lore.kernel.org/r/20231210165040.3407545-1-visitorckw@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoclk: sp7021: fix return value check in sp7021_clk_probe()
Yang Yingliang [Tue, 28 Nov 2023 13:30:16 +0000 (21:30 +0800)]
clk: sp7021: fix return value check in sp7021_clk_probe()

devm_platform_ioremap_resource() never returns NULL pointer,
it will return ERR_PTR() when it fails, so replace the check
with IS_ERR().

Fixes: d54c1fd4a51e ("clk: Add Sunplus SP7021 clock driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20231128133016.2494699-1-yangyingliang@huawei.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 months agoMerge tag 'renesas-clk-for-v6.8-tag2' of git://git.kernel.org/pub/scm/linux/kernel...
Stephen Boyd [Sun, 17 Dec 2023 00:36:25 +0000 (16:36 -0800)]
Merge tag 'renesas-clk-for-v6.8-tag2' of git://git./linux/kernel/git/geert/renesas-drivers into clk-renesas

Pull Renesas clk driver updates from Geert Uytterhoeven:

 - Add interrupt controller and Ethernet clocks and resets on Renesas RZ/G3S
 - Check reset monitor registers on Renesas RZ/G2L-alike SoCs

* tag 'renesas-clk-for-v6.8-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers:
  clk: renesas: r9a08g045: Add clock and reset support for ETH0 and ETH1
  clk: renesas: rzg2l: Check reset monitor registers
  clk: renesas: r9a08g045: Add IA55 pclk and its reset

15 months agoMerge tag 'sunxi-clk-for-6.8-1' of https://git.kernel.org/pub/scm/linux/kernel/git...
Stephen Boyd [Sun, 17 Dec 2023 00:30:45 +0000 (16:30 -0800)]
Merge tag 'sunxi-clk-for-6.8-1' of https://git./linux/kernel/git/sunxi/linux into clk-allwinner

Pull an Allwinner clk driver update from Jernej Skrabec:

 - cleanup variable init in Allwinner nkm module

* tag 'sunxi-clk-for-6.8-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  clk: sunxi-ng: nkm: remove redundant initialization of tmp_parent

15 months agoMerge tag 'v6.8-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind...
Stephen Boyd [Sun, 17 Dec 2023 00:28:56 +0000 (16:28 -0800)]
Merge tag 'v6.8-rockchip-clk1' of git://git./linux/kernel/git/mmind/linux-rockchip into clk-rockchip

Pull Rockchip clk driver updates from Heiko Stuebner:

Two new pll rates and an additional critical clock on rk3568.

* tag 'v6.8-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
  clk: rockchip: rk3568: Mark pclk_usb as critical
  clk: rockchip: rk3568: Add PLL rate for 126.4MHz
  clk: rockchip: rk3568: Add PLL rate for 115.2MHz

15 months agoclk: qcom: camcc-sc8280xp: Prevent error pointer dereference
Dan Carpenter [Tue, 12 Dec 2023 09:21:51 +0000 (12:21 +0300)]
clk: qcom: camcc-sc8280xp: Prevent error pointer dereference

If "regmap" is an error pointer then calling regmap_update_bits() will
crash.  We only need to call regmap_update_bits() if we had written to
it earlier.

Fixes: ff93872a9c61 ("clk: qcom: camcc-sc8280xp: Add sc8280xp CAMCC")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/210d48ce-6ebc-4a6b-b30f-866d10d41a16@moroto.mountain
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
15 months agoclk: qcom: videocc-sm8150: Add runtime PM support
Satya Priya Kakitapalli [Fri, 1 Dec 2023 09:50:27 +0000 (15:20 +0530)]
clk: qcom: videocc-sm8150: Add runtime PM support

Add runtime PM support to ensure the supply rails are enabled
when necessary.

Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231201-videocc-8150-v3-4-56bec3a5e443@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
15 months agoclk: qcom: videocc-sm8150: Add missing PLL config property
Satya Priya Kakitapalli [Fri, 1 Dec 2023 09:50:26 +0000 (15:20 +0530)]
clk: qcom: videocc-sm8150: Add missing PLL config property

When the driver was ported upstream, PLL test_ctl_hi1 register value
was omitted. Add it to ensure the PLLs are fully configured.

Fixes: 5658e8cf1a8a ("clk: qcom: add video clock controller driver for SM8150")
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231201-videocc-8150-v3-3-56bec3a5e443@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
15 months agoclk: qcom: videocc-sm8150: Update the videocc resets
Satya Priya Kakitapalli [Fri, 1 Dec 2023 09:50:25 +0000 (15:20 +0530)]
clk: qcom: videocc-sm8150: Update the videocc resets

Add all the available resets for the video clock controller
on sm8150.

Fixes: 5658e8cf1a8a ("clk: qcom: add video clock controller driver for SM8150")
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231201-videocc-8150-v3-2-56bec3a5e443@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
15 months agoMerge branch '20231201-videocc-8150-v3-1-56bec3a5e443@quicinc.com' into clk-for-6.8
Bjorn Andersson [Sat, 16 Dec 2023 04:59:48 +0000 (22:59 -0600)]
Merge branch '20231201-videocc-8150-v3-1-56bec3a5e443@quicinc.com' into clk-for-6.8

Merge SM8150 Video clock controller through a topic branch, to allow
constants to be made available in the DeviceTree branch as well.

15 months agodt-bindings: clock: Update the videocc resets for sm8150
Satya Priya Kakitapalli [Fri, 1 Dec 2023 09:50:24 +0000 (15:20 +0530)]
dt-bindings: clock: Update the videocc resets for sm8150

Add all the available resets for the video clock controller
on sm8150.

Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231201-videocc-8150-v3-1-56bec3a5e443@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoclk: renesas: r9a08g045: Add clock and reset support for ETH0 and ETH1
Claudiu Beznea [Thu, 7 Dec 2023 07:06:51 +0000 (09:06 +0200)]
clk: renesas: r9a08g045: Add clock and reset support for ETH0 and ETH1

RZ/G3S has 2 Gigabit Ethernet interfaces available.  Add clock and reset
support for both of them.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20231207070700.4156557-3-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
16 months agoclk: renesas: rzg2l: Check reset monitor registers
Claudiu Beznea [Thu, 7 Dec 2023 07:06:50 +0000 (09:06 +0200)]
clk: renesas: rzg2l: Check reset monitor registers

The hardware manual of both RZ/G2L and RZ/G3S specifies that the reset
monitor registers need to be interrogated when the reset signals are
toggled (chapters "Procedures for Supplying and Stopping Reset Signals"
and "Procedure for Activating Modules").  Without this, there is a
chance that different modules (e.g. Ethernet) are not ready after their
reset signal is toggled, leading to failures (on probe or resume from
deep sleep states).

The same indications are available for RZ/V2M for TYPE-B reset controls.

Fixes: ef3c613ccd68 ("clk: renesas: Add CPG core wrapper for RZ/G2L SoC")
Fixes: 8090bea32484 ("clk: renesas: rzg2l: Add support for RZ/V2M reset monitor reg")
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20231207070700.4156557-2-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
16 months agoclk: renesas: r9a08g045: Add IA55 pclk and its reset
Claudiu Beznea [Mon, 20 Nov 2023 11:18:12 +0000 (13:18 +0200)]
clk: renesas: r9a08g045: Add IA55 pclk and its reset

An IA55 interrupt controller is available on the RZ/G3S SoC.  Add the
IA55 pclk and its reset.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20231120111820.87398-2-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
16 months agoclk: qcom: rpmh: Add support for X1E80100 rpmh clocks
Rajendra Nayak [Tue, 5 Dec 2023 06:10:02 +0000 (11:40 +0530)]
clk: qcom: rpmh: Add support for X1E80100 rpmh clocks

Adds the RPMH clocks present in X1E80100 SoC

Co-developed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Rajendra Nayak <quic_rjendra@quicinc.com>
Co-developed-by: Sibi Sankar <quic_sibis@quicinc.com>
Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231205061002.30759-5-quic_sibis@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoclk: qcom: Add Global Clock controller (GCC) driver for X1E80100
Rajendra Nayak [Tue, 5 Dec 2023 06:10:00 +0000 (11:40 +0530)]
clk: qcom: Add Global Clock controller (GCC) driver for X1E80100

Add support for the global clock controller found on X1E80100
based devices.

Co-developed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Rajendra Nayak <quic_rjendra@quicinc.com>
Co-developed-by: Sibi Sankar <quic_sibis@quicinc.com>
Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Link: https://lore.kernel.org/r/20231205061002.30759-3-quic_sibis@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoMerge branch '20231205061002.30759-4-quic_sibis@quicinc.com' into clk-for-6.8
Bjorn Andersson [Fri, 8 Dec 2023 04:19:15 +0000 (20:19 -0800)]
Merge branch '20231205061002.30759-4-quic_sibis@quicinc.com' into clk-for-6.8

Merge the X1E80100 DeviceTree bindings through a topic branch, to allow
the clock constants to be shared with the DeviceTree branch.

16 months agodt-bindings: clock: qcom-rpmhcc: Add RPMHCC bindings for X1E80100
Rajendra Nayak [Tue, 5 Dec 2023 06:10:01 +0000 (11:40 +0530)]
dt-bindings: clock: qcom-rpmhcc: Add RPMHCC bindings for X1E80100

Add bindings and update documentation for clock rpmh driver on X1E80100
SoCs.

Signed-off-by: Rajendra Nayak <quic_rjendra@quicinc.com>
Co-developed-by: Sibi Sankar <quic_sibis@quicinc.com>
Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231205061002.30759-4-quic_sibis@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agodt-bindings: clock: qcom: Add X1E80100 GCC clocks
Rajendra Nayak [Tue, 5 Dec 2023 06:09:59 +0000 (11:39 +0530)]
dt-bindings: clock: qcom: Add X1E80100 GCC clocks

Add device tree bindings for global clock controller on X1E80100 SoCs.

Signed-off-by: Rajendra Nayak <quic_rjendra@quicinc.com>
Co-developed-by: Sibi Sankar <quic_sibis@quicinc.com>
Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231205061002.30759-2-quic_sibis@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoclk: qcom: Add ECPRICC driver support for QDU1000 and QRU1000
Imran Shaik [Thu, 23 Nov 2023 06:47:34 +0000 (12:17 +0530)]
clk: qcom: Add ECPRICC driver support for QDU1000 and QRU1000

Add ECPRI Clock Controller (ECPRICC) support for QDU1000 and QRU1000 SoCs.

Signed-off-by: Imran Shaik <quic_imrashai@quicinc.com>
Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231123064735.2979802-4-quic_imrashai@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoclk: qcom: branch: Add mem ops support for branch2 clocks
Taniya Das [Thu, 23 Nov 2023 06:47:33 +0000 (12:17 +0530)]
clk: qcom: branch: Add mem ops support for branch2 clocks

Add the support for mem ops implementation to handle the sequence of
enable/disable of the memories in ethernet PHY, prior to enable/disable
of the respective clocks, which helps retain the respecive block's
register contents.

Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
Signed-off-by: Imran Shaik <quic_imrashai@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231123064735.2979802-3-quic_imrashai@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoMerge branch '20231123064735.2979802-2-quic_imrashai@quicinc.com' into clk-for-6.8
Bjorn Andersson [Thu, 7 Dec 2023 16:46:01 +0000 (08:46 -0800)]
Merge branch '20231123064735.2979802-2-quic_imrashai@quicinc.com' into clk-for-6.8

Merge the ECPI clock controller through a topic branch to make it
possible to merge the clock constants into the DeviceTree branch as
well.

16 months agodt-bindings: clock: qcom: Add ECPRICC clocks for QDU1000 and QRU1000
Imran Shaik [Thu, 23 Nov 2023 06:47:32 +0000 (12:17 +0530)]
dt-bindings: clock: qcom: Add ECPRICC clocks for QDU1000 and QRU1000

Add device tree bindings for qcom ecpri clock controller on QDU1000 and
QRU1000 SoCs.

Signed-off-by: Imran Shaik <quic_imrashai@quicinc.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231123064735.2979802-2-quic_imrashai@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoclk: qcom: gpucc-sm8150: Update the gpu_cc_pll1 config
Satya Priya Kakitapalli [Wed, 22 Nov 2023 04:28:14 +0000 (09:58 +0530)]
clk: qcom: gpucc-sm8150: Update the gpu_cc_pll1 config

Update the test_ctl_hi_val and test_ctl_hi1_val of gpu_cc_pll1
as per latest HW recommendation.

Fixes: 0cef71f2ccc8 ("clk: qcom: Add graphics clock controller driver for SM8150")
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231122042814.4158076-1-quic_skakitap@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoclk: qcom: rpmh: add clocks for SM8650
Neil Armstrong [Mon, 6 Nov 2023 08:26:04 +0000 (09:26 +0100)]
clk: qcom: rpmh: add clocks for SM8650

Add RPMH Clocks for the SM8650 platform.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231106-topic-sm8650-upstream-clocks-v3-11-761a6fadb4c0@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoclk: qcom: add the SM8650 GPU Clock Controller driver
Neil Armstrong [Mon, 6 Nov 2023 08:26:03 +0000 (09:26 +0100)]
clk: qcom: add the SM8650 GPU Clock Controller driver

Add Graphics Clock Controller (GPUCC) support for SM8650 platform.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231106-topic-sm8650-upstream-clocks-v3-10-761a6fadb4c0@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoclk: qcom: add the SM8650 Display Clock Controller driver
Neil Armstrong [Mon, 6 Nov 2023 08:26:02 +0000 (09:26 +0100)]
clk: qcom: add the SM8650 Display Clock Controller driver

Add Display Clock Controller (DISPCC) support for SM8650 platform.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231106-topic-sm8650-upstream-clocks-v3-9-761a6fadb4c0@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoclk: qcom: add the SM8650 TCSR Clock Controller driver
Neil Armstrong [Mon, 6 Nov 2023 08:26:01 +0000 (09:26 +0100)]
clk: qcom: add the SM8650 TCSR Clock Controller driver

Add TCSR Clock Controller support for SM8650 platform.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231106-topic-sm8650-upstream-clocks-v3-8-761a6fadb4c0@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoclk: qcom: add the SM8650 Global Clock Controller driver, part 2
Neil Armstrong [Mon, 6 Nov 2023 08:26:00 +0000 (09:26 +0100)]
clk: qcom: add the SM8650 Global Clock Controller driver, part 2

Add Global Clock Controller (GCC) driver plumbing for the SM8650 platform.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231106-topic-sm8650-upstream-clocks-v3-7-761a6fadb4c0@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoclk: qcom: add the SM8650 Global Clock Controller driver, part 1
Neil Armstrong [Mon, 6 Nov 2023 08:25:59 +0000 (09:25 +0100)]
clk: qcom: add the SM8650 Global Clock Controller driver, part 1

Add Global Clock Controller (GCC) tables for the SM8650 platform,
the driver plumbing will be added afterwards.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231106-topic-sm8650-upstream-clocks-v3-6-761a6fadb4c0@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoMerge branch '20231106-topic-sm8650-upstream-clocks-v3-5-761a6fadb4c0@linaro.org...
Bjorn Andersson [Thu, 7 Dec 2023 16:08:54 +0000 (08:08 -0800)]
Merge branch '20231106-topic-sm8650-upstream-clocks-v3-5-761a6fadb4c0@linaro.org' into clk-for-6.8

Merge SM8650 GCC, TCSRCC, DISPCC, GPUCC and RPMHCC bindings through a
topic branch to make it possible to also merge and use the constants in
the DeviceTree branch.

16 months agodt-bindings: clock: qcom: Document the SM8650 RPMH Clock Controller
Neil Armstrong [Mon, 6 Nov 2023 08:25:58 +0000 (09:25 +0100)]
dt-bindings: clock: qcom: Document the SM8650 RPMH Clock Controller

Add bindings documentation for the SM8650 RPMH Clock Controller.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231106-topic-sm8650-upstream-clocks-v3-5-761a6fadb4c0@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agodt-bindings: clock: qcom: document the SM8650 GPU Clock Controller
Neil Armstrong [Mon, 6 Nov 2023 08:25:57 +0000 (09:25 +0100)]
dt-bindings: clock: qcom: document the SM8650 GPU Clock Controller

Add bindings documentation for the SM8650 Graphics Clock Controller.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231106-topic-sm8650-upstream-clocks-v3-4-761a6fadb4c0@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agodt-bindings: clock: qcom: document the SM8650 Display Clock Controller
Neil Armstrong [Mon, 6 Nov 2023 08:25:56 +0000 (09:25 +0100)]
dt-bindings: clock: qcom: document the SM8650 Display Clock Controller

Add bindings documentation for the SM8650 Display Clock Controller.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231106-topic-sm8650-upstream-clocks-v3-3-761a6fadb4c0@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agodt-bindings: clock: qcom: document the SM8650 General Clock Controller
Neil Armstrong [Mon, 6 Nov 2023 08:25:55 +0000 (09:25 +0100)]
dt-bindings: clock: qcom: document the SM8650 General Clock Controller

Add bindings documentation for the SM8650 General Clock Controller.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231106-topic-sm8650-upstream-clocks-v3-2-761a6fadb4c0@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agodt-bindings: clock: qcom: document the SM8650 TCSR Clock Controller
Neil Armstrong [Mon, 6 Nov 2023 08:25:54 +0000 (09:25 +0100)]
dt-bindings: clock: qcom: document the SM8650 TCSR Clock Controller

Add bindings documentation for the SM8650 TCSR Clock Controller.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231106-topic-sm8650-upstream-clocks-v3-1-761a6fadb4c0@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoclk: qcom: gcc-msm8939: Add missing CSI2 related clocks
Vincent Knecht [Sun, 29 Oct 2023 06:19:48 +0000 (07:19 +0100)]
clk: qcom: gcc-msm8939: Add missing CSI2 related clocks

When adding in the indexes for this clock-controller we missed
GCC_CAMSS_CSI2_AHB_CLK, GCC_CAMSS_CSI2_CLK, GCC_CAMSS_CSI2PHY_CLK,
GCC_CAMSS_CSI2PIX_CLK and GCC_CAMSS_CSI2RDI_CLK.

Add them in now and rename ftbl_gcc_camss_csi0_1_clk
to account for csi2 also using it.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Link: https://lore.kernel.org/r/20231029061948.505883-2-vincent.knecht@mailoo.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agodt-bindings: clock: qcom,gcc-msm8939: Add CSI2 related clocks
Vincent Knecht [Sun, 29 Oct 2023 06:19:47 +0000 (07:19 +0100)]
dt-bindings: clock: qcom,gcc-msm8939: Add CSI2 related clocks

When adding in the indexes for this clock-controller we missed
GCC_CAMSS_CSI2_AHB_CLK, GCC_CAMSS_CSI2_CLK, GCC_CAMSS_CSI2PHY_CLK,
GCC_CAMSS_CSI2PIX_CLK and GCC_CAMSS_CSI2RDI_CLK.

Add them in now.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231029061948.505883-1-vincent.knecht@mailoo.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoclk: qcom: camcc-sc8280xp: Add sc8280xp CAMCC
Bryan O'Donoghue [Thu, 26 Oct 2023 10:53:44 +0000 (11:53 +0100)]
clk: qcom: camcc-sc8280xp: Add sc8280xp CAMCC

Add the sc8280xp CAMCC driver which follows the sdm845 CAMCC lineage
with additional CCI and IFE blocks and more granular clock parentage.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Link: https://lore.kernel.org/r/20231026105345.3376-4-bryan.odonoghue@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
16 months agoMerge branch '20231026105345.3376-3-bryan.odonoghue@linaro.org' into clk-for-6.8
Bjorn Andersson [Thu, 7 Dec 2023 16:00:59 +0000 (08:00 -0800)]
Merge branch '20231026105345.3376-3-bryan.odonoghue@linaro.org' into clk-for-6.8

Merge the SC8280XP Camera Clock Controller binding changes through a
topic branch to allow them to be merged and used in the DeviceTree
source branch as well.

16 months agodt-bindings: clock: Add SC8280XP CAMCC
Bryan O'Donoghue [Thu, 26 Oct 2023 10:53:43 +0000 (11:53 +0100)]
dt-bindings: clock: Add SC8280XP CAMCC

Add device tree bindings for the camera clock controller on
Qualcomm SC8280XP platform.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231026105345.3376-3-bryan.odonoghue@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>