mbox series

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

Message ID 20231024-b4-qcom-clk-v2-0-6572bc2be690@linaro.org
Headers show
Series arm: mach-snapdragon: Qualcomm clock driver cleanup | expand

Message

Caleb Connolly Oct. 30, 2023, 10:23 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 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

---
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

 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                      | 309 +++++++++++++++++++++
 drivers/clk/qcom/clock-qcom.h                      | 100 +++++++
 .../clk/qcom}/clock-qcs404.c                       | 167 +++++++++--
 drivers/clk/qcom/clock-sdm845.c                    | 190 +++++++++++++
 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 ------
 34 files changed, 1057 insertions(+), 898 deletions(-)
---
base-commit: 30d01b582f2274eb8c808026c5fb4c33e9f2210d

// Caleb (they/them)

Comments

Sumit Garg Nov. 2, 2023, 12:25 p.m. UTC | #1
Hi Caleb,

On Tue, 31 Oct 2023 at 03:53, Caleb Connolly <caleb.connolly@linaro.org> 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.
>
> 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 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
>
> ---
> 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
>

This patch-set fails to apply on the u-boot mainline for me. Care to rebase?

-Sumit

>  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                      | 309 +++++++++++++++++++++
>  drivers/clk/qcom/clock-qcom.h                      | 100 +++++++
>  .../clk/qcom}/clock-qcs404.c                       | 167 +++++++++--
>  drivers/clk/qcom/clock-sdm845.c                    | 190 +++++++++++++
>  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 ------
>  34 files changed, 1057 insertions(+), 898 deletions(-)
> ---
> base-commit: 30d01b582f2274eb8c808026c5fb4c33e9f2210d
>
> // Caleb (they/them)
>