linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] Marvell Berlin full clock support
@ 2014-05-11 20:24 Sebastian Hesselbarth
  2014-05-11 20:24 ` [PATCH 1/8] clk: add helper for unique DT clock names Sebastian Hesselbarth
                   ` (8 more replies)
  0 siblings, 9 replies; 39+ messages in thread
From: Sebastian Hesselbarth @ 2014-05-11 20:24 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Mike Turquette, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Russell King, Alexandre Belloni,
	Antoine Tenart, devicetree, linux-arm-kernel, linux-kernel

This is a patch set combining initial effort from Alexandre Belloni [1][2]
and a bad one from me [3] to bring proper DT based clocks to Marvell Berlin
SoCs. As I was unsure, how Alexandre's initial patch sets fit in the whole
picture, I had to look at it myself. It took me a while to sort out the messy
clk related registers of Berlin, but finally IMHO I found a good compromise
between DT and driver registered clocks.

As I don't have any access to BG2Q code/documentation, it needs some
additional patches from Alexandre. This is basically berlin2q.dtsi changes
and a core clock driver for BG2Q. Anyway, this is nothing that should stall
a proper driver-/DT-related review.

Apoloigies for the noise the three approaches may have caused, but anybody
who takes a closer look at either this patches or the corresponding GPL'd
Chromecast SDK [4][5] will quickly see that Marvell HW engineers really hate
those who have to write the drivers for their register sets. It is full of
"similar" registers for the same IP that received some TLC, like one register
is shifted by 4 bits with respect to the other registers dealing with the
same functionalities. *sigh*

The patches are based on v3.15-rc1 and I have compared the resulting clock
frequencies with u-boot's reported frequencies where possible on Chromecast
(BG2CD) and NSZ-GS7 (BG2).

I'd love to see them in for v3.16 as it will allow us to proceed with working
on drivers that actually need those clocks. Current support for Marvell Berlin
SoCs is almost limited to serial console, so there is absolutely nothing to
break. To make sure it will not break others, I prepared a topic branch and
added it to berlin's linux-next branch.

The topic branch can be found at
https://github.com/shesselba/linux-berlin.git topic/clk

Patch 1 first adds a helper function to derive a unique clock name out of
the DT nodes name and either the reg property or a magic number. This is
taken from DT's platform code, that derives similar unique names for proper
platform devices.

Patch 2 adds the whole binding documentation for all clock related IP.

Patches 3, 4, and 5 then add clock drivers for the Audio/Video PLL, simple
PLLs, and complex clock divider cells found on Berlin SoCs. Where required,
currently known differences between BG2/BG2CD and BG2Q are taken care of.

Patch 6 adds a clock driver for the remaining core clocks of BG2/BG2CD. The
register set dealing with it, is shared among input and bypass muxes, clock
dividers and clock gates.

Patches 7 and 8 finally convert the DT SoC include for BG2 and BG2CD to make
use of the new clock related DT nodes.

[1] https://lkml.org/lkml/2014/4/23/831
[2] https://lkml.org/lkml/2014/4/24/624
[3] https://lkml.org/lkml/2014/5/8/592
[4] https://code.google.com/p/chromecast-mirrored-source/source/browse/bootloader/berlin_tools/bootloader/clock/galois_speed.c?repo=sdk
[5] https://code.google.com/p/chromecast-mirrored-source/source/browse/bootloader/berlin_tools/bootloader/include/Firmware_Berlin_BG2CD_A0/global.h?repo=sdk

Alexandre Belloni (2):
  clk: berlin: add driver for BG2x simple PLLs
  clk: berlin: add driver for BG2x complex divider cells

Sebastian Hesselbarth (6):
  clk: add helper for unique DT clock names
  clk: berlin: add clock binding docs for Marvell Berlin2 SoCs
  clk: berlin: add driver for BG2x audio/video PLL
  clk: berlin: add core clock driver for BG2/BG2CD
  ARM: dts: berlin: convert BG2CD to DT clock nodes
  ARM: dts: berlin: convert BG2 to DT clock nodes

 .../devicetree/bindings/clock/berlin2-clock.txt    | 169 +++++++
 arch/arm/boot/dts/berlin2.dtsi                     | 200 ++++++--
 arch/arm/boot/dts/berlin2cd.dtsi                   | 198 ++++++--
 drivers/clk/Makefile                               |   1 +
 drivers/clk/berlin/Makefile                        |   3 +
 drivers/clk/berlin/berlin2-avpll.c                 | 373 +++++++++++++++
 drivers/clk/berlin/berlin2-div.c                   | 326 +++++++++++++
 drivers/clk/berlin/berlin2-div.h                   |  80 ++++
 drivers/clk/berlin/berlin2-pll.c                   | 171 +++++++
 drivers/clk/berlin/bg2.c                           | 509 +++++++++++++++++++++
 drivers/clk/clk.c                                  |  29 ++
 include/dt-bindings/clock/berlin2.h                |  35 ++
 include/linux/clk-provider.h                       |   5 +
 13 files changed, 2042 insertions(+), 57 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/berlin2-clock.txt
 create mode 100644 drivers/clk/berlin/Makefile
 create mode 100644 drivers/clk/berlin/berlin2-avpll.c
 create mode 100644 drivers/clk/berlin/berlin2-div.c
 create mode 100644 drivers/clk/berlin/berlin2-div.h
 create mode 100644 drivers/clk/berlin/berlin2-pll.c
 create mode 100644 drivers/clk/berlin/bg2.c
 create mode 100644 include/dt-bindings/clock/berlin2.h

---
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Antoine Tenart <antoine.tenart@free-electrons.com>
Cc: devicetree@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
-- 
1.9.1


^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2014-05-15 16:55 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-11 20:24 [PATCH 0/8] Marvell Berlin full clock support Sebastian Hesselbarth
2014-05-11 20:24 ` [PATCH 1/8] clk: add helper for unique DT clock names Sebastian Hesselbarth
2014-05-13 19:49   ` Mike Turquette
2014-05-13 20:19     ` Sebastian Hesselbarth
     [not found]       ` <20140513205111.5943.12709@quantum>
2014-05-13 21:25         ` Sebastian Hesselbarth
2014-05-11 20:24 ` [PATCH 2/8] clk: berlin: add clock binding docs for Marvell Berlin2 SoCs Sebastian Hesselbarth
2014-05-13  8:38   ` Sebastian Hesselbarth
2014-05-13 14:47   ` Alexandre Belloni
2014-05-14 22:32   ` Mike Turquette
2014-05-14 23:17     ` Sebastian Hesselbarth
     [not found]       ` <20140515044106.19795.57249@quantum>
2014-05-15  6:53         ` Sebastian Hesselbarth
2014-05-15  8:34         ` Alexandre Belloni
2014-05-11 20:24 ` [PATCH 3/8] clk: berlin: add driver for BG2x audio/video PLL Sebastian Hesselbarth
2014-05-11 20:24 ` [PATCH 4/8] clk: berlin: add driver for BG2x simple PLLs Sebastian Hesselbarth
2014-05-11 20:24 ` [PATCH 5/8] clk: berlin: add driver for BG2x complex divider cells Sebastian Hesselbarth
2014-05-13  8:40   ` Sebastian Hesselbarth
2014-05-11 20:24 ` [PATCH 6/8] clk: berlin: add core clock driver for BG2/BG2CD Sebastian Hesselbarth
2014-05-14 11:43   ` Alexandre Belloni
2014-05-14 11:48     ` Sebastian Hesselbarth
2014-05-11 20:24 ` [PATCH 7/8] ARM: dts: berlin: convert BG2CD to DT clock nodes Sebastian Hesselbarth
2014-05-12 19:55   ` Sebastian Hesselbarth
2014-05-13  8:42   ` Sebastian Hesselbarth
2014-05-11 20:24 ` [PATCH 8/8] ARM: dts: berlin: convert BG2 " Sebastian Hesselbarth
2014-05-14 20:15 ` [PATCH v2 00/10] Marvell Berlin full clock support Sebastian Hesselbarth
2014-05-14 20:15   ` [PATCH v2 01/10] dt-binding: clk: add clock binding docs for Marvell Berlin2 SoCs Sebastian Hesselbarth
2014-05-14 20:15   ` [PATCH v2 02/10] clk: berlin: add binding include for BG2/BG2CD clock ids Sebastian Hesselbarth
2014-05-14 20:15   ` [PATCH v2 03/10] clk: berlin: add driver for BG2x audio/video PLL Sebastian Hesselbarth
2014-05-14 20:15   ` [PATCH v2 04/10] clk: berlin: add driver for BG2x simple PLLs Sebastian Hesselbarth
2014-05-14 20:15   ` [PATCH v2 05/10] clk: berlin: add driver for BG2x complex divider cells Sebastian Hesselbarth
2014-05-15  7:56     ` Alexandre Belloni
2014-05-14 20:15   ` [PATCH v2 06/10] clk: berlin: add core clock driver for BG2/BG2CD Sebastian Hesselbarth
2014-05-15  8:09     ` Alexandre Belloni
2014-05-15 15:43       ` Sebastian Hesselbarth
2014-05-15 16:55         ` Alexandre Belloni
2014-05-14 20:15   ` [PATCH v2 07/10] clk: berlin: add core clock driver for BG2Q Sebastian Hesselbarth
2014-05-15  7:46     ` Alexandre Belloni
2014-05-14 20:15   ` [PATCH v2 08/10] ARM: dts: berlin: convert BG2CD to DT clock nodes Sebastian Hesselbarth
2014-05-14 20:15   ` [PATCH v2 09/10] ARM: dts: berlin: convert BG2 " Sebastian Hesselbarth
2014-05-14 20:15   ` [PATCH v2 10/10] ARM: dts: berlin: convert BG2Q " Sebastian Hesselbarth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).