mbox series

[v4,0/7] arm: mach-snapdragon: Qualcomm clock driver cleanup

Message ID 20231107-b4-qcom-clk-v4-0-82bbaf1a796d@linaro.org
Headers show
Series arm: mach-snapdragon: Qualcomm clock driver cleanup | expand

Message

Caleb Connolly Nov. 7, 2023, 12:40 p.m. UTC
This series begins making some headway towards cleaning up Qualcomm
platform support in u-boot. The following is a rough overview of the
changes:

* Move the Qualcomm clock drivers out of mach-snapdragon and into clk/qcom
* Introduce per-platform clock driver configs to decouple Qualcomm platform
  support from mach-snapdragon targets.
* Add the IPQ4019 clock driver, removing it from mach-ipq40xx and introducing
  the reset map.
* Merge the qcom reset driver is into clk/qcom and rework it to be
  compatible with upstream devicetrees.
* A callback model is added so that multiple clock drivers can be
  compiled in at once.
* SDM845 gains support for enabling/disabling all gate clocks (CBC's) by
  way of a new "gate_clk" abstraction.
* Preperatory cleanup work is done to simplify the bringup process for
  new platforms.

Further details are included in each commit.

The primary goal of this series is to prepare for enabling several new
Qualcomm platforms in u-boot as well as additional peripherals, while
minimising the amount of copy/pasted board-specific code.

This series conflicts with a previous series introducing support for the
Qualcomm RB2 board [1], I plan to resend this initial support pending
acceptance of this series and several other cleanups.

[1]: https://lore.kernel.org/u-boot/20230324080418.3856409-1-bhupesh.sharma@linaro.org/

---
Changes in v4:
* Fixed mnd_width for UART clock on apq8016, apq8096, and qcs404
* Link to v3: https://lore.kernel.org/r/20231103-b4-qcom-clk-v3-0-8d2d460ece84@linaro.org

Changes in v3:
* Rebased on qcom-next [1]
* Dropped erroneous LOG_DEBUG define
* Add drivers/clk/qcom to MAINTAINERS
* Link to v2: https://lore.kernel.org/r/20231024-b4-qcom-clk-v2-0-6572bc2be690@linaro.org

Changes in v2:
* Added missing headers in clock-qcom.c for "fix rcg divider value"
  patch
* Use writel() instead of setbits_le32() in "fix rcg divider value"
  patch to ensure that writes are propagated to hardware.
* Adjust RCG configuration to be more similar to Linux
* Remove sysmap headers and define macros directly in platform clock
  code.
* avoid renaming msm_* to qcom_* for now
* only add relevant gate_clks for sdm845
* Link to v1: https://lore.kernel.org/r/20231024-b4-qcom-clk-v1-0-9d96359b9a82@linaro.org

[1]: https://source.denx.de/u-boot/custodians/u-boot-snapdragon

---
Caleb Connolly (6):
      clk/qcom: move from mach-snapdragon
      clk/qcom: move ipq4019 driver from mach-ipq40xx
      clk/qcom: sdm845: add register map for simple gate clocks
      clk/qcom: use function pointers for enable and set_rate
      clk/qcom: add mnd_width to clk_rcg_set_rate_mnd()
      clk/qcom: fix rcg divider value

Konrad Dybcio (1):
      clk/qcom: handle resets and clocks in one device

 MAINTAINERS                                        |   1 +
 arch/arm/Kconfig                                   |   2 +
 arch/arm/dts/qcom-ipq4019.dtsi                     |  14 +-
 arch/arm/dts/qcs404-evb.dts                        |  19 +-
 arch/arm/mach-ipq40xx/Makefile                     |   1 -
 arch/arm/mach-ipq40xx/clock-ipq4019.c              |  88 ------
 arch/arm/mach-snapdragon/Kconfig                   |   4 +
 arch/arm/mach-snapdragon/Makefile                  |   5 -
 arch/arm/mach-snapdragon/clock-sdm845.c            |  98 -------
 arch/arm/mach-snapdragon/clock-snapdragon.c        | 181 ------------
 arch/arm/mach-snapdragon/clock-snapdragon.h        |  48 ----
 .../mach-snapdragon/include/mach/sysmap-apq8016.h  |  39 ---
 .../mach-snapdragon/include/mach/sysmap-apq8096.h  |  37 ---
 .../mach-snapdragon/include/mach/sysmap-qcs404.h   |  88 ------
 .../mach-snapdragon/include/mach/sysmap-sdm845.h   |  42 ---
 board/qualcomm/dragonboard820c/dragonboard820c.c   |   6 +-
 drivers/clk/Kconfig                                |   1 +
 drivers/clk/Makefile                               |   1 +
 drivers/clk/qcom/Kconfig                           |  52 ++++
 drivers/clk/qcom/Makefile                          |  10 +
 .../clk/qcom}/clock-apq8016.c                      |  60 +++-
 .../clk/qcom}/clock-apq8096.c                      |  56 +++-
 .../reset-qcom.c => clk/qcom/clock-ipq4019.c}      | 160 ++++-------
 drivers/clk/qcom/clock-qcom.c                      | 307 +++++++++++++++++++++
 drivers/clk/qcom/clock-qcom.h                      | 100 +++++++
 .../clk/qcom}/clock-qcs404.c                       | 167 +++++++++--
 drivers/clk/qcom/clock-sdm845.c                    | 187 +++++++++++++
 drivers/reset/Kconfig                              |   7 -
 drivers/reset/Makefile                             |   1 -
 include/configs/dragonboard410c.h                  |   1 -
 include/configs/dragonboard820c.h                  |   1 -
 include/configs/dragonboard845c.h                  |   1 -
 include/configs/qcs404-evb.h                       |   1 -
 .../{qcom,ipq4019-gcc.h => qcom,gcc-ipq4019.h}     |  73 +++++
 include/dt-bindings/reset/qcom,ipq4019-reset.h     |  92 ------
 35 files changed, 1053 insertions(+), 898 deletions(-)
---
base-commit: b9221f7d86f9511ad2a816f589d41bc02dbcd6f8

// Caleb (they/them)

Comments

Caleb Connolly Nov. 13, 2023, 11:06 p.m. UTC | #1
On Tue, 07 Nov 2023 12:40:58 +0000, Caleb Connolly wrote:
> This series begins making some headway towards cleaning up Qualcomm
> platform support in u-boot. The following is a rough overview of the
> changes:
> 
> * Move the Qualcomm clock drivers out of mach-snapdragon and into clk/qcom
> * Introduce per-platform clock driver configs to decouple Qualcomm platform
>   support from mach-snapdragon targets.
> * Add the IPQ4019 clock driver, removing it from mach-ipq40xx and introducing
>   the reset map.
> * Merge the qcom reset driver is into clk/qcom and rework it to be
>   compatible with upstream devicetrees.
> * A callback model is added so that multiple clock drivers can be
>   compiled in at once.
> * SDM845 gains support for enabling/disabling all gate clocks (CBC's) by
>   way of a new "gate_clk" abstraction.
> * Preperatory cleanup work is done to simplify the bringup process for
>   new platforms.
> 
> [...]

Applied, thanks!

[1/7] clk/qcom: move from mach-snapdragon
      commit: 5bb0df6d39dcd6fb1256535bd0b1eac747b711b1
[2/7] clk/qcom: move ipq4019 driver from mach-ipq40xx
      commit: 67d532d6354bbb0e0a03446fa0ab7b4996cf643d
[3/7] clk/qcom: handle resets and clocks in one device
      commit: d993573e5084a595a8ffcc01ac471d5fadaa634f
[4/7] clk/qcom: sdm845: add register map for simple gate clocks
      commit: 6985e30ee0310de9bbc083dd03847327691dd2d6
[5/7] clk/qcom: use function pointers for enable and set_rate
      commit: 839739c4f10f7ac0c43cffe06d3e402ccabe37e4
[6/7] clk/qcom: add mnd_width to clk_rcg_set_rate_mnd()
      commit: b49a6531738b2875f3d3b22c8d28b9dbdc5573ef
[7/7] clk/qcom: fix rcg divider value
      commit: 45b9e9165409691b02cd761fa44c8dcc5974cf29

Best regards,