[U-Boot] [PATCH V2 5/5] clk: convert API to match reset/mailbox style

Simon Glass sjg at chromium.org
Sun Jun 19 23:06:01 CEST 2016


On 17 June 2016 at 09:44, Stephen Warren <swarren at wwwdotorg.org> wrote:
> From: Stephen Warren <swarren at nvidia.com>
>
> The following changes are made to the clock API:
> * The concept of "clocks" and "peripheral clocks" are unified; each clock
>   provider now implements a single set of clocks. This provides a simpler
>   conceptual interface to clients, and better aligns with device tree
>   clock bindings.
> * Clocks are now identified with a single "struct clk", rather than
>   requiring clients to store the clock provider device and clock identity
>   values separately. For simple clock consumers, this isolates clients
>   from internal details of the clock API.
> * clk.h is split so it only contains the client/consumer API, whereas
>   clk-uclass.h contains the provider API. This aligns with the recently
>   added reset and mailbox APIs.
> * clk_ops .of_xlate(), .request(), and .free() are added so providers
>   can customize these operations if needed. This also aligns with the
>   recently added reset and mailbox APIs.
> * clk_disable() is added.
> * All users of the current clock APIs are updated.
> * Sandbox clock tests are updated to exercise clock lookup via DT, and
>   clock enable/disable.
> * rkclk_get_clk() is removed and replaced with standard APIs.
>
> Buildman shows no clock-related errors for any board for which buildman
> can download a toolchain.
>
> test/py passes for sandbox (which invokes the dm clk test amongst
> others).
>
> Signed-off-by: Stephen Warren <swarren at nvidia.com>
> Acked-by: Simon Glass <sjg at chromium.org>
> ---
> v2:
> * Renamed headers.
> * Added docs to arch/sandbox/include/asm/clk.h.
> * Fixed up a few more call-sites added in parallel to this patch.
> * Fixed a type typo in ehci-generic.c.
> ---
>  arch/arm/include/asm/arch-rockchip/clock.h   |  12 --
>  arch/arm/mach-rockchip/board.c               |  39 ++++-
>  arch/arm/mach-rockchip/rk3288/sdram_rk3288.c |  15 +-
>  arch/arm/mach-snapdragon/clock-apq8016.c     |  10 +-
>  arch/arm/mach-zynq/clk.c                     |   1 -
>  arch/mips/mach-pic32/cpu.c                   |  45 +++---
>  arch/sandbox/dts/test.dts                    |  17 ++-
>  arch/sandbox/include/asm/clk.h               | 111 ++++++++++++++
>  arch/sandbox/include/asm/test.h              |   9 --
>  board/microchip/pic32mzda/pic32mzda.c        |  21 ++-
>  drivers/clk/Makefile                         |   1 +
>  drivers/clk/clk-uclass.c                     | 202 +++++++++++++++++-------
>  drivers/clk/clk_fixed_rate.c                 |  13 +-
>  drivers/clk/clk_pic32.c                      |  32 ++--
>  drivers/clk/clk_rk3036.c                     |  83 +++-------
>  drivers/clk/clk_rk3288.c                     | 143 ++++-------------
>  drivers/clk/clk_sandbox.c                    |  85 +++++++----
>  drivers/clk/clk_sandbox_test.c               | 101 ++++++++++++
>  drivers/clk/exynos/clk-exynos7420.c          |  42 ++---
>  drivers/clk/uniphier/clk-uniphier-core.c     |  26 ++--
>  drivers/clk/uniphier/clk-uniphier-mio.c      |   1 -
>  drivers/i2c/rk_i2c.c                         |   6 +-
>  drivers/mmc/msm_sdhci.c                      |  13 +-
>  drivers/mmc/rockchip_dw_mmc.c                |   6 +-
>  drivers/mmc/uniphier-sd.c                    |  15 +-
>  drivers/serial/serial_msm.c                  |  13 +-
>  drivers/serial/serial_pic32.c                |   7 +-
>  drivers/serial/serial_s5p.c                  |   6 +-
>  drivers/spi/rk_spi.c                         |   6 +-
>  drivers/usb/host/ehci-generic.c              |  14 +-
>  drivers/video/rockchip/rk_edp.c              |  11 +-
>  drivers/video/rockchip/rk_hdmi.c             |  12 +-
>  drivers/video/rockchip/rk_lvds.c             |   1 -
>  drivers/video/rockchip/rk_vop.c              |  11 +-
>  include/clk-uclass.h                         |  95 ++++++++++++
>  include/clk.h                                | 220 ++++++++++++++++-----------
>  test/dm/clk.c                                | 110 ++++++++++----
>  37 files changed, 985 insertions(+), 570 deletions(-)
>  create mode 100644 arch/sandbox/include/asm/clk.h
>  create mode 100644 drivers/clk/clk_sandbox_test.c
>  create mode 100644 include/clk-uclass.h

Applied to u-boot-dm, thanks!


More information about the U-Boot mailing list