From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@codeaurora.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Magnus Damm <damm+renesas@opensource.se>,
Simon Horman <horms+renesas@verge.net.au>,
Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>
Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
linux-sh@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH/RFC v4 0/5] clk: shmobile: Add new Renesas CPG/MSSR DT bindings
Date: Fri, 16 Oct 2015 14:49:15 +0200 [thread overview]
Message-ID: <1444999760-15750-1-git-send-email-geert+renesas@glider.be> (raw)
Hi Mike, Stephen, et al.,
As discussed at ELCE last week, here's my RFC introducing a new unified
binding and driver for the Renesas CPG (Clock Pulse Generator) and MSSR
(Module Standby and Software Reset) blocks. This is supposed to be more
in-line with current CCF best practices, and allows expansion to cover
the module reset functionality in the future.
The new bindings are intended to be used initially for the new R-Car
Gen3 SoCs (r8a7795), but we may decide to migrate older SoCs somewhen in
the future.
- Patch 1 introduces the new bindings,
- Patch 2 introduces clock definitions for r8a7795, which are
technically also part of the binding,
- Patch 3 prepares the existing div6 driver for reuse,
- Patch 4 introduces the new CPG/MSSR driver core, to be used by
several SoC-specific drivers,
- Patch 5 introduces the new r8a7795-specific driver.
The idea is to get the bindings (for r8a7795, i.e. patches 1 and 2)
accepted in v4.4, so we can continue developing and prepare final
support for r8a7795 in v4.5.
Compared to v3, the major change is the addition of a preliminary
version of the actual driver.
Implementation notes:
- The driver contains lots of pr_debug() and WARN_ON() calls. Many of
these will be removed in future versions,
- Conversion between (sparse) clock IDs and (packed) clock indices
will be reworked. Probably most of it can be handled in a macro when
populating the r8a779*_mod_clks[] arrays,
- Probably r8a779*_clk_types can be removed in favor of just using
CLK_TYPE_CUSTOM, and differentiating based on cpg_core_clk.id. But
the clk_types may make it easier to share code between different
SoCs of the same family.
- Most clock data is __initconst, to save memory in multi-platform
kernels,
- Setting CLK_ENABLE_HAND_OFF for critical clocks (e.g. the GIC clock)
is implemented (if CLK_ENABLE_HAND_OFF is available),
- Support for using special core clocks for power management (e.g. the
ZB clock on r8a73a4/sh7a0) is not yet fully implemented,
- Module clocks in DTS are no longer defines, but literal numbers
matching the numbers in the datasheet (just like IRQs),
- include/dt-bindings/clock/*-cpg-mssr.h now contains all core clock
outputs, as listed in the datasheet,
- Should include/dt-bindings/clock/*-cpg-mssr.h use contiguous
numbering, or should the same clock use the same number for
different SoCs of the same family?
Memory considerations on r8a7791/koelsch:
- Static size impact:
- DTB: -7.5 KiB
- initdata: +8 KiB (due to PAGE_SIZE rounding, actual + ca. 5 KiB)
- reserved: -24 KiB (includes unflattened DTB)
- However, the big saving seems to be in the runtime memory usage.
MemAvailable has increased by 248 KiB, presumably due to less
memory being used by the in-memory device tree representation.
For your convenience, I pushed these patches, the r8a7795 DTS
conversion, and a Proof-of-Concept for R-Car M2-W (r8a7791) to the
topic/cpg-mssr-v4 branch (based on topic/gen3-latest) of my
renesas-drivers repository at
https://git.kernel.org/cgit/linux/kernel/git/geert/renesas-drivers.git/log/?h=topic/cpg-mssr-v4
Thanks for your comments!
References:
- v3 = "[PATCH/RFC v3 0/3] clk: shmobile: Add new Renesas CPG/MSSR DT
bindings" (http://www.spinics.net/lists/linux-sh/msg45870.html)
- v2+ ≈ "[PATCH v8 00/05] Renesas R-Car Gen3 CPG support V8"
(http://www.spinics.net/lists/linux-clk/msg03288.html)
- v2 = "[PATCH/RFC v2 0/4] Renesas CPG/MSTP DT Binding Proposal"
(http://www.spinics.net/lists/linux-clk/msg03132.html)
- v1 = "Renesas CPG/MSTP DT Binding Proposal"
(http://www.spinics.net/lists/linux-clk/msg01189.html)
Geert Uytterhoeven (5):
[RFC] clk: shmobile: Add new Renesas CPG/MSSR DT bindings
[RFC] clk: shmobile: Add r8a7795 CPG Core Clock Definitions
[RFC] clk: shmobile: div6: Extract cpg_div6_register()
[RFC] clk: shmobile: cpg-mssr: Add new CPG/MSSR driver core
[RFC] clk: shmobile: r8a7795: Add new CPG/MSSR driver
.../devicetree/bindings/clock/renesas,cpg-mssr.txt | 71 +++
drivers/clk/shmobile/Makefile | 3 +-
drivers/clk/shmobile/clk-cpg-mssr.c | 578 +++++++++++++++++++++
drivers/clk/shmobile/clk-cpg-mssr.h | 118 +++++
drivers/clk/shmobile/clk-div6.c | 119 +++--
drivers/clk/shmobile/clk-div6.h | 3 +
drivers/clk/shmobile/clk-r8a7795-cpg-mssr.c | 373 +++++++++++++
include/dt-bindings/clock/r8a7795-cpg-mssr.h | 63 +++
include/dt-bindings/clock/renesas-cpg-mssr.h | 15 +
9 files changed, 1297 insertions(+), 46 deletions(-)
create mode 100644 Documentation/devicetree/bindings/clock/renesas,cpg-mssr.txt
create mode 100644 drivers/clk/shmobile/clk-cpg-mssr.c
create mode 100644 drivers/clk/shmobile/clk-cpg-mssr.h
create mode 100644 drivers/clk/shmobile/clk-div6.h
create mode 100644 drivers/clk/shmobile/clk-r8a7795-cpg-mssr.c
create mode 100644 include/dt-bindings/clock/r8a7795-cpg-mssr.h
create mode 100644 include/dt-bindings/clock/renesas-cpg-mssr.h
--
1.9.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next reply other threads:[~2015-10-16 12:49 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-16 12:49 Geert Uytterhoeven [this message]
2015-10-16 12:49 ` [PATCH v4 1/5] [RFC] clk: shmobile: Add new Renesas CPG/MSSR DT bindings Geert Uytterhoeven
2015-10-20 10:15 ` Michael Turquette
[not found] ` <1444999760-15750-2-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2015-10-20 12:16 ` Geert Uytterhoeven
[not found] ` <CAMuHMdVhBipbf13o0jb3H6qmcewh6CCtq3=Hj-9nvgar+AYdFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-20 16:01 ` Magnus Damm
[not found] ` <CANqRtoS6QpWJY99aD8KyGHgySxqzzBPic-k_a-VcZE6LVFFRow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-23 11:05 ` Laurent Pinchart
2015-10-23 11:09 ` Geert Uytterhoeven
2015-10-23 11:11 ` Laurent Pinchart
2015-10-23 11:10 ` Laurent Pinchart
2015-10-26 19:02 ` Geert Uytterhoeven
2015-10-27 1:34 ` Laurent Pinchart
2015-10-27 8:14 ` Geert Uytterhoeven
2015-10-30 13:30 ` Laurent Pinchart
2015-10-16 12:49 ` [PATCH v4 2/5] [RFC] clk: shmobile: Add r8a7795 CPG Core Clock Definitions Geert Uytterhoeven
2015-10-20 10:09 ` Geert Uytterhoeven
2015-10-20 16:21 ` Magnus Damm
2015-10-23 11:21 ` Laurent Pinchart
2015-10-23 11:25 ` Geert Uytterhoeven
2015-10-16 12:49 ` [PATCH v4 3/5] [RFC] clk: shmobile: div6: Extract cpg_div6_register() Geert Uytterhoeven
2015-10-23 11:28 ` Laurent Pinchart
2015-10-16 12:49 ` [PATCH v4 4/5] [RFC] clk: shmobile: cpg-mssr: Add new CPG/MSSR driver core Geert Uytterhoeven
2015-10-16 12:49 ` [PATCH v4 5/5] [RFC] clk: shmobile: r8a7795: Add new CPG/MSSR driver Geert Uytterhoeven
2015-10-20 12:24 ` Michael Turquette
2015-10-20 12:31 ` Geert Uytterhoeven
2015-10-20 13:00 ` Michael Turquette
2015-10-20 13:07 ` Geert Uytterhoeven
2015-10-22 12:58 ` Geert Uytterhoeven
2015-10-24 1:10 ` Stephen Boyd
2015-10-24 17:34 ` Geert Uytterhoeven
2015-10-26 2:25 ` Laurent Pinchart
2015-10-26 8:03 ` Geert Uytterhoeven
2015-10-30 13:12 ` Laurent Pinchart
2015-10-29 14:03 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444999760-15750-1-git-send-email-geert+renesas@glider.be \
--to=geert+renesas@glider.be \
--cc=damm+renesas@opensource.se \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=horms+renesas@verge.net.au \
--cc=ijc+devicetree@hellion.org.uk \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mturquette@baylibre.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).