Commit graph

31 commits

Author SHA1 Message Date
Geert Uytterhoeven
21bffe57f8 clk: renesas: r8a7795: Correct parent clock of INTC-AP
According to the R-Car Gen3 Hardware Manual Errata for Rev 0.55 of
September 8, 2017, the parent clock of the INTC-AP module clock on R-Car
H3 ES2.0 is S0D3.

This change has no functional impact.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2017-10-16 09:38:38 +02:00
Geert Uytterhoeven
09a7dea9d5 clk: renesas: rcar-gen3: Add divider support for PLL1 and PLL3
On some R-Car Gen3 SoCs (e.g. R-Car D3), PLL1 and PLL3 use a divider
value different from one.  Extend struct rcar_gen3_cpg_pll_config to handle
this.  As all multipliers and dividers are small, table size increase
can be kept limited by storing them in u8s instead of unsigned ints,
which saves ca. 0.5 KiB for a generic kernel.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
2017-08-16 09:51:47 +02:00
Geert Uytterhoeven
c5c3bdaace clk: renesas: r8a7795: Correct pwm, gpio, and i2c parent clocks on ES2.0
Cfr. the errata of April 14, 2017, for the R-Car Gen3 Hardware Manual
Rev. 0.53E.

These have no user-visible effect, as the clock frequencies stay the
same.

Fixes: 5573d19412 ("clk: renesas: r8a7795: Add support for R-Car H3 ES2.0")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
2017-05-15 09:46:31 +02:00
Takeshi Kihara
f5ca01141c clk: renesas: r8a7795: Add HS-USB ch3 clock
This patch adds valid HS-USB ch3 clock from R8A7795 ES2.0 SoC.

Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2017-05-15 09:46:31 +02:00
Takeshi Kihara
0a12c4400c clk: renesas: r8a7795: Add USB-DMAC ch3 clock
This patch supports the clock of USB-DMAC ch3 module added from R8A7795
ES2.0 SoC.

Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2017-05-15 09:46:31 +02:00
Takeshi Kihara
66fbee35d5 clk: renesas: r8a7795: Add EHCI/OHCI ch3 clock
This patch supports the clock of EHCI/OHCI ch3 module added from R8A7795
ES2.0 SoC.

Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2017-05-15 09:46:31 +02:00
Geert Uytterhoeven
5573d19412 clk: renesas: r8a7795: Add support for R-Car H3 ES2.0
The Clock Pulse Generator / Module Standby and Software Reset module in
R-Car H3 ES2.0 differs from ES1.x in the following areas:
  - More core clocks (S0D2, S0D3, S0D6, S0D8, S0D12),
  - Different parent clocks for AUDMAC, EtherAVB, FCP, FDP, IMR,
    SYS-DMAC, VIN, VSPB, VSPI,
  - Removal of modules CSI21, FCPCI, FCPF2, FCPVD3, FCPVI2, FDP1-2,
    USB3-IF1, VSPD3, VSPI2,
  - Addition of modules EHCI3, HS-USB-IF3, USB-DMAC3-0, USB-DMAC3-1.

The goal is twofold:
  1. Support both the ES1.x and ES2.0 SoC revisions in a single binary
     for now,
  2. Make it clear which code supports ES1.x, so it can easily be
     identified and removed later, when production SoCs are deemed
     ubiquitous.

This is achieved by:
  - Updating the clock tables for the latest revision (ES2.0), but not
    removing clocks that only exist on earlier revisions (ES1.x),
  - Detecting the SoC revision at runtime using the new soc_device_match()
    API, and fixing up the clocks tables to match the actual SoC
    revision, by:
      - NULLifying core and module clocks of modules that do not exist,
      - Reparenting module clocks that have a different parent on ES1.x.

Based on R-Car Gen3 Hardware User's Manual rev. 0.53E.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2017-03-30 13:25:50 +02:00
Geert Uytterhoeven
5f3a432a44 clk: renesas: rcar-gen3-cpg: Pass mode pins to rcar_gen3_cpg_init()
Pass the mode pin states from the SoC-specific CPG/MSSR driver to the
R-Car Gen3 CPG driver core, as their state will be needed to make some
core clock configuration decisions.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2017-03-21 11:12:23 +01:00
Geert Uytterhoeven
3c969cec16 clk: renesas: r8a7795: Reformat core clock table
For easier comparison with other clock drivers.
No functional changes.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2017-03-21 11:12:22 +01:00
Geert Uytterhoeven
2122b56d30 clk: renesas: r8a7795: Correct name of watchdog clock
There's only a single watchdog clock, and it's named "rwdt".

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2017-03-21 11:12:21 +01:00
Geert Uytterhoeven
a843ed3f6c clk: renesas: r8a7795: Correct parent clock and sort order for Audio DMACs
The parent clock of the Audio DMACs is the "ZS" AXI bus clock, which
maps to S3D1 on R-Car H3 ES1.x.
All module clocks must be sorted by clock ID.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
2017-03-21 11:12:07 +01:00
Sergei Shtylyov
7d0a7c7bdf clk: renesas: r8a7795: Add IMR clocks
Add the IMR[0-3] clocks to the R8A7795 CPG/MSSR driver.

Based on the original (and large) patch by Konstantin Kozhevnikov
<Konstantin.Kozhevnikov@cogentembedded.com>.

Signed-off-by: Konstantin Kozhevnikov <Konstantin.Kozhevnikov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2017-03-06 11:48:33 +01:00
Keita Kobayashi
2c8e79898c clk: renesas: r8a7795: Add IIC-DVFS clock
This patch adds DVFS clock for R8A7795 SoC.

Signed-off-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
Signed-off-by: Dien Pham <dien.pham.ry@rvc.renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2017-01-27 08:59:00 +01:00
Takeshi Kihara
0a30284b9f clk: renesas: r8a7795: Fix HDMI parent clock
Correct HDMI parent clock so that the rate of the
HDMI clock is 1/4 rather than 1/2 of the rate of PLL1
as per the v0.52 (Jun, 15) manual.

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-11-07 15:16:18 +01:00
Geert Uytterhoeven
969921e0d2 clk: renesas: r8a7795: Obtain mode pin values from R-Car RST driver
Obtain the values of the mode pins from the R-Car RST driver, which
relies on the presence in DT of a device node for the RST module.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-11-02 20:43:51 +01:00
Stephen Boyd
209370566e clk: renesas: Updates for v4.9 (take three)
- External crystal selection for RZ/A1,
   - CMT clocks for R-Car H3 and M3-W,
   - RAVB and Thermal clocks for R-Car M3-W.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJX2P+AAAoJEEgEtLw/Ve77gqkP/R1qaA2sPGC2WntSVyYohD6y
 8ILwLkZl/1yr+tJO9+31io5dP1Bpzl9EbsPp+c1VbnT9Y/1k4LTPRx+8fk6HP/Hv
 L6VOyCgLRwnFr3RxdIeUC+q/2LVzekcsohHXDGRhUku8Und/dZwYjvqYbgKpmFDG
 mAe5vDDIRlJDN0wAWPcyepqc5MCQFn9ln0BlMyVgRyPb2bE2e0J6p3l0WXrHM/WB
 +lH0hOiWrV8SWXQpgVUcdlwA2OHspJcfUQzFdfO/Dih41EflLO/8GON/d/yWinZS
 PUXNYOwwLriDLEcIY8nQNd94WawA7TjKRgqaaXB1GSd6YB8HAhuos/RhVo/dCz2+
 IoRy0eq9Z5VHTH1xfHrqit/4x801wimDTADZV1McVmxGciQnljmJP7zcwodaX+bs
 dcRYt9VpJgQy8/lrPTgBmWkgp0xLld6W8IjCAgO5YsqAoKxb8IJ5TE8QDfyFwsgo
 8lWSxtA2gTl4MWE7nyAy4pj6useRRWpyVAWD6Hh7c4XHF1n0qNr0cT17X82xPwkO
 JWswWkp05zxh7rSbfBcA1DcJDKlmveE2PxiPY+5baX7eis7RJf9Vb4cJRydM0Sqw
 L9AzlYU/7Mhc6tf8IFTsa7PhajObGbkOgBTiTq9IqR8qGLUxtRWR8UHQ3kE8StdK
 tF38JRnHVHp/akk8kDTn
 =YlKA
 -----END PGP SIGNATURE-----

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

Pull renesas clk driver updates from Geert Uytterhoeven:

  - External crystal selection for RZ/A1,
  - CMT clocks for R-Car H3 and M3-W,
  - RAVB and Thermal clocks for R-Car M3-W.

* tag 'clk-renesas-for-v4.9-tag3' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers:
  clk: renesas: r8a7796: Add CMT clocks
  clk: renesas: r8a7795: Add CMT clocks
  clk: renesas: r8a7796: Add RAVB clock
  clk: renesas: r8a7796: Add THS/TSC clock
  clk: renesas: rz: Select EXTAL vs USB clock
2016-09-14 11:15:03 -07:00
Bui Duc Phuc
591d7b145a clk: renesas: r8a7795: Add CMT clocks
This patch adds CMT module clocks for r8a7795 SoC.

Signed-off-by: Bui Duc Phuc <bd-phuc@jinso.co.jp>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-09-12 11:08:00 +02: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
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
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
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
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
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
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
Renamed from drivers/clk/shmobile/r8a7795-cpg-mssr.c (Browse further)