Commit Graph

85 Commits

Author SHA1 Message Date
Chris Brandt b452dfe92f clk: renesas: rz: Select EXTAL vs USB clock
Check the MD_CLK pin to determine the current clock mode in order to set
the pll clock parent correctly.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-09-05 14:16:25 +02:00
Stephen Boyd 911d49c7a0 clk: renesas: r8a7796: Add SDHI clocks
Add all clocks needed to use the SDHI interfaces on the Renesas R-Car M3-W
 (r8a7796) SoC.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXxZzSAAoJEEgEtLw/Ve778BIQALrIpDRhYct/n1dT1TmEcpQr
 1DCcpxLDZJy4qY746X8clUD93ObG/03t6/VPlW3DnH7yvCSgNLXpE4KQ2KhMRAt/
 wQ6RvroBA0VlVpJePXbBHpfVBtVo5JXBGpcY0KEvppPzo1MAFxaXU+cP6OXcMqhx
 AZrW9fylOfxR5ft90sLGv7KrJpSZMuZt5CcrgdT7DPwO+AR2VHFjMg8Xtc35gqze
 EGD7RCt5mWGdAaiywC7fHx5m1NhezOXYeICHgU+NnoHX/+PYXrCze4jZrvpTa4QM
 LtVD/fOJiN8vQkG7UyyYmj/L9Pxy7BkCL1FQcIfCLNc8j6scF/5s/2222Vk9xya+
 ibEGZWdCDAm0Lbi3Qmuxa5Dd0eksyWMXcaziNqszYQCwDoudLnLj/ldjhbaUwKIA
 fWr5ZSS8ZRLzUdXdQ1UgFNbZkOP+cDWmY54TJxpvniZsZ2SmyJ7gPmlkEkWCy0CN
 CK5OlkgAjdHHWkpIx37xPMxVJOgQJ7NFmaul7zWGZQLZqftJPKi8+0XebVFhhplL
 uYUuRNcLRnBW+KwnvpNHlxi+El1nJx+u3CXxi54c00UE8sDp+4BtW077X9/BrijR
 xcQLG/QQ4Ro+sehWqBL7JiDWwVadcF/Urt0X/EqAusCwcyaz6TeXOFzCXkU3FEAr
 cOzPmKid6m9S6v/+/hns
 =rh+1
 -----END PGP SIGNATURE-----

Merge tag 'clk-renesas-for-v4.9-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-next

Pull renesas r8a7796 SDHI clock support from Geert Uytterhoeven:

Add all clocks needed to use the SDHI interfaces on the Renesas R-Car M3-W
(r8a7796) SoC.

* tag 'clk-renesas-for-v4.9-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers:
  clk: renesas: r8a7796: Add SDIF clocks
  clk: renesas: r8a7796: Add GPIO clocks
2016-08-30 11:49:02 -07:00
Simon Horman 0749698133 clk: renesas: r8a7796: Add SDIF clocks
This patch adds SDIF clocks for R8A7796 SoC.

Based on work by Ai Kyuse and Yoshihiro Shimoda for the r8a7795 SoC.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-08-23 10:30:41 +02:00
Takeshi Kihara 4e09508a89 clk: renesas: r8a7796: Add GPIO clocks
Add GPIO clocks for the R8A7796 SoC.

Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-08-19 09:38:40 +02:00
Stephen Boyd 91d17dc341 clk: renesas: r8a7796: Add watchdog clocks
Add all clocks related to the Watchdog Timer (WDT) controller on the
 Renesas R-Car M3-W (r8a7796) SoC.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXtHgSAAoJEEgEtLw/Ve77DgcP/1620tFIcsgBC5bGlbA54+Zh
 z9r4cFiCgR7Xsi45UZijKvs8JtiBF5UwQIPokjHP7/KrQFyiQPga7IMUDDC3GwG2
 K50zK9q+d1pRl3Gjw8TCvfzYx+ooaGryNrvxyxrMSc5oFG3NtiBLiBdY2muPzTY0
 CYMW4dOy33FzG5wsYHEmUQAI+VOW65ovE2j0zoJ8Juj3KHJoe0kvf5dN4Pk0hUCR
 zZjGqUQ+9P5ZJG8/ToR8lrvOm8B6r9WmN9BLFD2eDmyU6osuPcmQ86pIICA9fHQS
 uoVv3qjmSqBenEhOKBB6Jp0fhAwwyu1XVSCmb17Rw93QfKDuy4yB1ZP8L+aTQoG9
 y1k4H80FFZTVoL5DLHGnB7iJMKUP0ROovoLYs1teGhIj8825C4EtxTITKKHwdbKy
 8hOCQBAENxIlX5y7cyhUkdR0O+8kV7r8NYt4LDnYp2oAMD6hgN/7kXf92+QeALxl
 B5u9Z2sKmPjfmXHE8eH2Z4/aAgMTqRfwaW6U8WFndF6IVsmGWz/p5fhvaLJY1zNf
 jK5LJWJmKiIkkpiGLhrhVVfl0pyJLQtmIxPv/fIMxUbp1rynT5o6jFOKaWsNRuA2
 8Stmca2L/8/BfLpk6z5vRZ95U00++LS5GPSr3PGBfg45HrOVAEUSvvj+vjaggkXR
 1YvK2hqYXGZ34pZcFA4i
 =0CHq
 -----END PGP SIGNATURE-----

Merge tag 'clk-renesas-for-v4.9-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-next

Merge r8a7796 watchdog clk support from Geert Uytterhoeven:

Add all clocks related to the Watchdog Timer (WDT) controller on the
Renesas R-Car M3-W (r8a7796) SoC.

* tag 'clk-renesas-for-v4.9-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers:
  clk: renesas: r8a7796: Add watchdog module clock
  clk: renesas: r8a7796: Add watchdog core clocks
2016-08-18 16:41:05 -07:00
Yoshihiro Shimoda e0cb1b8416 clk: renesas: r8a7795: Fix SD clocks
According to the datasheet, SDn clocks are from the SDSRC clock. And
the SDSRC has a 1/2 divider. So, we should have ".sdsrc" as an internal
core clock. Otherwise, since the sdhi driver will calculate clock for
a sd card using the wrong parent clock rate, and then performance will
be not good.

Fixes: 90c073e539 ("clk: shmobile: r8a7795: Add SD divider support")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: stable@vger.kernel.org
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-11 17:47:56 -07:00
Geert Uytterhoeven b51d527501 clk: renesas: r8a7796: Add watchdog module clock
Add the module clock for the Watchdog Timer (WDT) controller on the
Renesas R-Car M3-W (r8a7796) SoC.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-08-09 09:53:47 +02:00
Geert Uytterhoeven 2570d4005d clk: renesas: r8a7796: Add watchdog core clocks
Add all core clocks related to the Watchdog Timer (WDT) controller on
the Renesas R-Car M3-W (r8a7796) SoC: OSC, Internal RCLK, and RCLK.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-08-09 09:53:47 +02:00
Khiem Nguyen e4c82863fd clk: renesas: r8a7795: Add THS/TSC clock
Signed-off-by: Khiem Nguyen <khiem.nguyen.xt@rvc.renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-06-21 09:21:06 +02:00
Ramesh Shanmugasundaram 7d6cc0cddb clk: renesas: r8a7795: Add DRIF clock
This patch adds DRIF module clocks for r8a7795 SoC.

Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-06-21 09:21:06 +02:00
Geert Uytterhoeven f7bb887fb8 clk: renesas: r8a7795: Correct lvds clock parent
According to the latest information, the parent clock of the LVDS module
clock is the S0D4 clock, not the S2D1 clock.

Note that this change has no influence on actual operation, as the
rcar-du LVDS encoder driver doesn't use the parent clock's rate.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-21 09:21:05 +02:00
Kieran Bingham a209568042 clk: renesas: r8a7795: Provide FDP1 clocks
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran@bingham.xyz>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-06-21 09:21:05 +02:00
Sergei Shtylyov a233bffb6b clk: renesas: Add R8A7792 support
Renesas R-Car V2H (R8A7792) clocks are handled by R-Car gen2 clock driver.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-06-21 09:19:41 +02:00
Geert Uytterhoeven e4e2d7c388 clk: renesas: cpg-mssr: Add support for R-Car M3-W
Initial support for R-Car M3-W (r8a7796), including basic core clocks,
and SCIF2 (console) and INTC-AP (GIC) module clocks.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
2016-06-06 11:58:35 +02:00
Geert Uytterhoeven 5b1defde70 clk: renesas: cpg-mssr: Extract common R-Car Gen3 support code
Extract the code to support parts common to all members of the R-Car
Gen3 SoC family into a separate file, to ease sharing among SoC-specific
drivers.

Note that while the cpg_pll_configs[] arrays and the selection of the
config based on the MODE bits are identical on R-Car H3 and R-Car M3-W,
they are not common, and may be different on other R-Car Gen3 SoCs.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
2016-06-06 11:58:31 +02:00
Geert Uytterhoeven d04a75af45 clk: renesas: cpg-mssr: Use always-on governor for Clock Domain
As a pure Clock Domain does not have the concept of powering the domain
itself, the CPG/MSTP driver does not provide power_off() and power_on()
callbacks.
However, the genpd core may still perform a dummy power down, causing
/sys/kernel/debug/pm_genpd/pm_genpd_summary to report the domain's
status being "off-0".

Use the always-on governor to make sure the domain is never powered
down, and always shows up as "on" in pm_genpd_summary.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-04-28 10:32:55 +02:00
Geert Uytterhoeven 93662500a1 clk: renesas: cpg-mssr: Postpone call to pm_genpd_init()
All local setup of the generic_pm_domain structure should have been
completed before calling pm_genpd_init().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-04-28 10:32:53 +02:00
Geert Uytterhoeven 20729300ca clk: renesas: mstp: Use always-on governor for Clock Domain
As a pure Clock Domain does not have the concept of powering the domain
itself, the CPG/MSTP driver does not provide power_off() and power_on()
callbacks.
However, the genpd core may still perform a dummy power down, causing
/sys/kernel/debug/pm_genpd/pm_genpd_summary to report the domain's
status being "off-0".

Use the always-on governor to make sure the domain is never powered
down, and always shows up as "on" in pm_genpd_summary.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-04-28 10:32:51 +02:00
Geert Uytterhoeven b3a52d75bc clk: renesas: mstp: Postpone call to pm_genpd_init()
All local setup of the generic_pm_domain structure should have been
completed before calling pm_genpd_init().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-04-28 10:32:41 +02:00
Niklas Söderlund ccce262de1 clk: renesas: r8a7795: Add VIN clocks
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-04-26 08:59:49 +02:00
Niklas Söderlund 0187d321a5 clk: renesas: r8a7795: Add CSI2 clocks
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-04-26 08:59:43 +02:00
Geert Uytterhoeven 2066390ad4 clk: renesas: cpg-mssr: Export cpg_mssr_{at,de}tach_dev()
The R-Car SYSC PM Domain driver has to power manage devices in power
areas using clocks. To reuse code and to share knowledge of clocks
suitable for power management, this is ideally done through the existing
cpg_mssr_attach_dev() and cpg_mssr_detach_dev() callbacks.

Hence these callbacks can no longer rely on their "domain" parameter
pointing to the CPG/MSSR Clock Domain. To handle this, keep a pointer to
the clock domain in a static variable. cpg_mssr_attach_dev() has to
support probe deferral, as the R-Car SYSC PM Domain may be initialized,
and devices may be added to it, before the CPG/MSSR Clock Domain is
initialized.

Dummy callbacks are provided for the case where CPG/MSTP support is not
included, so the rcar-sysc driver won't have to care about this.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-04-20 09:17:07 +02:00
Geert Uytterhoeven a5bd7f7a72 clk: renesas: Provide Kconfig symbols for CPG/MSSR and CPG/MSTP support
Currently the decision whether to build the renesas-cpg-mssr and
clk-mstp drivers is handled by Makefile logic.  However, the rcar-sysc
driver will need to know whether CPG/MSSR and/or CPG/MSTP support are
available or not.

To avoid having to duplicate this logic, move it to Kconfig. Provide
non-visible CLK_RENESAS_CPG_MSSR and CLK_RENESAS_CPG_MSTP Kconfig
symbols, which can be used by both Makefiles and C code.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-04-20 09:16:58 +02:00
Geert Uytterhoeven 12a56817b3 clk: renesas: mstp: Clarify cpg_mstp_{at,de}tach_dev() domain parameter
Make it clear that the "domain" parameter of the cpg_mstp_attach_dev()
and cpg_mstp_detach_dev() functions is not used.

The cpg_mstp_attach_dev() and cpg_mstp_detach_dev() callbacks are not
only used by the CPG/MSTP Clock Domain driver, but also by the R-Mobile
SYSC PM Domain driver.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-04-07 17:27:13 +02:00
Geert Uytterhoeven da437d2d09 clk: renesas: cpg-mssr: Drop check for CONFIG_PM_GENERIC_DOMAINS_OF
As of commit 71d076ceb2 ("ARM: shmobile: Enable PM and
PM_GENERIC_DOMAINS for SoCs with PM Domains"),
CONFIG_PM_GENERIC_DOMAINS_OF is always enabled for SoCs with a CPG/MSSR
block.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-04-07 17:27:10 +02:00
Geert Uytterhoeven 848fc67da5 clk: renesas: mstp: Drop check for CONFIG_PM_GENERIC_DOMAINS_OF
As of commit 71d076ceb2 ("ARM: shmobile: Enable PM and
PM_GENERIC_DOMAINS for SoCs with PM Domains"),
CONFIG_PM_GENERIC_DOMAINS_OF is always enabled for SoCs with MSTP
clocks.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-04-07 17:27:05 +02:00
Wolfram Sang 6248620b30 clk: renesas: r8a7795: add RWDT clock
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-04-06 09:48:49 +02:00
Wolfram Sang 1e6237e32e clk: renesas: r8a7795: add R clk
R can select between two parents. We deal with it like this: During
initialization, check if EXTALR is populated. If so, use it for R. If
not, use R_Internal. clk_mux doesn't help here because we don't want to
switch parents depending on the clock rate. The clock rate (and source)
should stay constant for the watchdog, so I think a setup like this
during initialization makes sense.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-04-06 09:48:46 +02:00
Wolfram Sang 5524a67f3a clk: renesas: r8a7795: add OSC and RINT clocks
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-04-06 09:48:44 +02:00
Wolfram Sang 5d3927f655 clk: renesas: cpg-mssr: add generic support for read-only DIV6 clocks
Gen3 has two clocks (OSC and R) which look like a DIV6 clock but their
divider value is read-only and depends on MD pins at bootup. Add support
for such clocks by reading the value and adding a fixed clock.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-04-06 09:48:37 +02:00
Wolfram Sang ba8c1a81d4 clk: renesas: r8a7795: make SD clk definition specific for GEN3
About SD clocks: The clock type is Gen3 specific, the callbacks are all
Gen3 specific; I think the clock definition should also be Gen3 specific
and not in the general header file.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-03-29 09:24:02 +02:00
Ulrich Hecht 847e87920c clk: renesas: r8a7795: add PWM clock
Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-03-29 09:24:02 +02:00
Simon Horman e8087b5b90 clk: renesas: div6: use RENESAS for #define
Name the #define guarding compilation of this header
__RENESAS_CLK_DIV6_H__ rather than __SHMOBILE_CLK_DIV6_H__.

This is a follow-up to renaming the directory in which this file lives from
shmobile to renesas which is in turn part of an ongoing process to migrate
from ARCH_SHMOBILE to ARCH_RENESAS the motivation for which being that
RENESAS seems to be a more appropriate name than SHMOBILE for the majority
of Renesas ARM based SoCs.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-03-15 18:13:02 -07:00
Simon Horman 09c32427c9 clk: renesas: Rename header file renesas.h
This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.

Along with the above mentioned Kconfig changes it seems appropriate
to also rename files.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-03-15 18:12:14 -07:00
Simon Horman b3a33077c0 clk: renesas: move drivers to renesas directory
This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.

Along with the above mentioned Kconfig changes it seems appropriate
to also rename directories that only hold drivers for such SoCs.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-03-03 11:22:53 -08:00