Skip to content

clk: samsung: Add CPU clocks for Exynos850

Sam Protsenko linux-arm-kernel linux-clk linux-devicetree linux-samsung-soc lkml 3 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest15 patches 15 repliesApplied
  2. v215 patches 0 repliesSuperseded
  3. v116 patches 11 repliesSuperseded

Changes in v3 from the cover letter

- Merged struct exynos850_cpuclk_regs fields into struct exynos_cpuclk_regs ("one-size-fits-all" approach)

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/15dt-bindings: clock: exynos850: Add CMU_CPUCLK0 and CMU_CPUCL1Documentation/devicetree/bindings/clock/samsung,exynos850-clock.yaml include/dt-bindings/clock/exynos850.h+96 -01 reply
2/15clk: samsung: Improve clk-cpu.c styledrivers/clk/samsung/clk-cpu.c+33 -321 reply
3/15clk: samsung: Pull struct exynos_cpuclk into clk-cpu.cdrivers/clk/samsung/clk-cpu.c drivers/clk/samsung/clk-cpu.h+35 -351 reply
4/15clk: samsung: Reduce params count in exynos_register_cpu_clock()drivers/clk/samsung/clk-cpu.c+23 -231 reply
5/15clk: samsung: Use single CPU clock notifier callback for all chipsdrivers/clk/samsung/clk-cpu.c+28 -351 reply
6/15clk: samsung: Group CPU clock functions by chipdrivers/clk/samsung/clk-cpu.c+61 -531 reply
7/15clk: samsung: Pass actual CPU clock registers base to CPU_CLK()drivers/clk/samsung/clk-cpu.c drivers/clk/samsung/clk-exynos3250.c drivers/clk/samsung/clk-exynos4.c +3 more+40 -391 reply
8/15clk: samsung: Pass register layout type explicitly to CLK_CPU()drivers/clk/samsung/clk-cpu.c drivers/clk/samsung/clk-cpu.h drivers/clk/samsung/clk-exynos3250.c +5 more+29 -171 reply
9/15clk: samsung: Keep CPU clock chip specific data in a dedicated structdrivers/clk/samsung/clk-cpu.c+26 -141 reply
10/15clk: samsung: Keep register offsets in chip specific structuredrivers/clk/samsung/clk-cpu.c+86 -702 replies
11/15clk: samsung: Pass mask to wait_until_mux_stable()drivers/clk/samsung/clk-cpu.c+7 -71 reply
12/15clk: samsung: Add CPU clock support for Exynos850drivers/clk/samsung/clk-cpu.c drivers/clk/samsung/clk-cpu.h+181 -01 reply
13/15clk: samsung: Implement manual PLL control for ARM64 SoCsdrivers/clk/samsung/clk-exynos-arm64.c drivers/clk/samsung/clk.h+33 -152 replies
14/15clk: samsung: exynos850: Add CMU_CPUCL0 and CMU_CPUCL1drivers/clk/samsung/clk-exynos850.c+439 -10 replies
15/15arm64: dts: exynos: Add CPU clocks for Exynos850arch/arm64/boot/dts/exynos/exynos850.dtsi+26 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 00/15] clk: samsung: Add CPU clocks for Exynos850

The series implements CPU clock support for Exynos850, adds CPU CMUs to the clock driver and enables those in dts. This is the first step towards cpufreq implementation.

If possible, all patches should go through Krzysztof's tree. As inter-series dependencies go:

* All driver changes (patch 02..14) must be taken together following the order established in this series
* Patch 15 (dts changes) depends on patch 01 (bindings additions)
* Patch 14 (driver changes) depends on patch 01 (bindings additions)

The series was tested on E850-96 board, via DebugFS with CLOCK_ALLOW_WRITE_DEBUGFS enabled, by setting different CPU clock rates, like this:

  # cd /sys/kernel/debug/clk/cluster0_clk/
  # cat clk_rate
  1053000000
  # echo 10000000 > clk_rate
  # cat clk_rate
  130000000

Of course, DVFS/cpufreq is not implemented yet, so the CPU can't be overclocked too much right now, and the cpufreq interface is not available too. As per the TRM, the CPU operates at a voltage level of 0.65 V, 0.75 V, 0.85 V and 1.05 V. When the voltage is 0.85 V, A55 quad-core operates at 1.6 GHz and CoreSight at 200 MHz.

To check the actual frequency, the "perf" tool was used:

  # perf stat sleep 1

And to check that on a particular CPU core:

  # taskset -c 4 perf stat sleep 1

Some takeaways:

* Max functional frequency right now is 1.586 GHz
* 1.742 GHz or more leads to the system freeze, as it requires more voltage to be operational
* Max possible frequency: 2.210 GHz
* The lowest possible frequency: 130 MHz
* Default boot up frequency: 1.053 GHz

Changes in v3:
- Merged struct exynos850_cpuclk_regs fields into struct exynos_cpuclk_regs ("one-size-fits-all" approach)

Changes in v2:
- Removed confusing "breakup by patch" list from patch #0 commit message
- Dropped the patch for making clk.h a single included header
- Rebased the series on top of the latest linux-next
- See per-patch changes in each patch's changelog

Sam Protsenko (15):
dt-bindings: clock: exynos850: Add CMU_CPUCLK0 and CMU_CPUCL1
clk: samsung: Improve clk-cpu.c style
clk: samsung: Pull struct exynos_cpuclk into clk-cpu.c
clk: samsung: Reduce params count in exynos_register_cpu_clock()
clk: samsung: Use single CPU clock notifier callback for all chips
clk: samsung: Group CPU clock functions by chip
clk: samsung: Pass actual CPU clock registers base to CPU_CLK()
clk: samsung: Pass register layout type explicitly to CLK_CPU()
clk: samsung: Keep CPU clock chip specific data in a dedicated struct
clk: samsung: Keep register offsets in chip specific structure
clk: samsung: Pass mask to wait_until_mux_stable()
clk: samsung: Add CPU clock support for Exynos850
clk: samsung: Implement manual PLL control for ARM64 SoCs
clk: samsung: exynos850: Add CMU_CPUCL0 and CMU_CPUCL1
arm64: dts: exynos: Add CPU clocks for Exynos850

 .../clock/samsung,exynos850-clock.yaml        |  42 ++
 arch/arm64/boot/dts/exynos/exynos850.dtsi     |  26 +
 drivers/clk/samsung/clk-cpu.c                 | 556 +++++++++++++-----
 drivers/clk/samsung/clk-cpu.h                 |  53 +-
 drivers/clk/samsung/clk-exynos-arm64.c        |  44 +-
 drivers/clk/samsung/clk-exynos3250.c          |   2 +-
 drivers/clk/samsung/clk-exynos4.c             |   9 +-
 drivers/clk/samsung/clk-exynos5250.c          |   5 +-
 drivers/clk/samsung/clk-exynos5420.c          |  16 +-
 drivers/clk/samsung/clk-exynos5433.c          |  10 +-
 drivers/clk/samsung/clk-exynos850.c           | 440 +++++++++++++-
 drivers/clk/samsung/clk.h                     |   9 +-
 include/dt-bindings/clock/exynos850.h         |  54 ++
 13 files changed, 1034 insertions(+), 232 deletions(-)
Signature · 1 line
2.39.2