Commit graph

962 commits

Author SHA1 Message Date
Emilio López 2226013972 clk: sunxi: fix some calculations
Some divisor calculations were misrounded, causing higher than requested
rates on some clocks. Fix them up using DIV_ROUND_UP, and replace one
homebrew instance of it as well with the right macro.

Reported-by: Boris BREZILLON <b.brezillon.dev@gmail.com>
Signed-off-by: Emilio López <emilio@elopez.com.ar>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-03-19 12:34:56 -07:00
Emilio López 5a8ddf2682 clk: sunxi: fix A20 PLL4 calculation
Allwinner actually reworked the PLL4 on A20; now it's compatible with
the sun4i PLL5/6 design previous to any divisions, as well as to the new
PLL8 in sun7i.

Signed-off-by: Emilio López <emilio@elopez.com.ar>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-03-19 12:34:39 -07:00
Mike Turquette df21f62bbb Merge tag 'sunxi-clk-for-3.15' of https://bitbucket.org/emiliolopez/linux into clk-next-sunxi
Allwinner sunXi SoCs clock changes

This adds support for the new, more correct clock node naming and gets
the A10 compatibles in line with the rest of the other SoCs. It also
adds support for the USB, GMAC and A31's PLL6 clocks. Some of these
changes also require DT modifications that will be merged via arm-soc.
2014-03-19 12:14:11 -07:00
Dinh Nguyen 95bb9f515f clk: socfpga: Fix section mismatch warning
WARNING: drivers/clk/socfpga/built-in.o(.data+0xc0): Section mismatch in
reference from the variable socfpga_child_clocks to the function
.init.text:socfpga_pll_init()
The variable socfpga_child_clocks references
the function __init socfpga_pll_init()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

WARNING: drivers/clk/socfpga/built-in.o(.data+0x184): Section mismatch in
reference from the variable socfpga_child_clocks to the function
.init.text:socfpga_periph_init()
The variable socfpga_child_clocks references
the function __init socfpga_periph_init()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

WARNING: drivers/clk/socfpga/built-in.o(.data+0x248): Section mismatch in
reference from the variable socfpga_child_clocks to the function
.init.text:socfpga_gate_init()
The variable socfpga_child_clocks references
the function __init socfpga_gate_init()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

Reported-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-03-18 23:42:35 -07:00
Mike Turquette 06fa5ab32a clock: mvebu new SoC changes for v3.15 (incremental pull #2)
- mvebu (Armada 375)
     - fix ratio register offest
 
  - mvebu (Armada 380)
     - expand core divider clock driver to support 380 SoC (enables nand support)
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJTIwnaAAoJEP45WPkGe8ZnqzcQALBc089kYIWoWK4aQanMxUPb
 o86G/p3bUYiOQOI/jLCDlaSxRPehQzSns/II1PgOjbRVCXi+6HEqrOy5yVhRW3JL
 8RPaIdZvZlTYOxcF7Zelni2s/j1YPUbgfzXtawzNH9QdM+iQuSLMXCrStoIkJXUz
 rCcg2KBNNW5aBcmQtLcDgavdNtT/QCa524uGYQTR5YZNFQlL8a78GrqjkUkgD6e0
 RH0guVmu5Wd5l7McHjq/mbcMg6gguPJI7Y3ddDjdB+02zAoKzlQ05HJLfDp6sybS
 8e7DPYnA7TRJV2LG2jwsA5yGy3yrW5nmPBlfogZD7KlKl/pbTgEXyzf0OiP+OiDQ
 7DGFAnSX7mDX3gRiwaac6YbyLCC6aVnPPsPzO/9zm5jy2c+u3BJjC6QHN4CVciYk
 OMyZzllrEJ3iGubFZb3I0smZcmopmoDyZMIz+abnqFi71jQmWZnjpjoE7qHJqSCe
 RObuI4V9w6kcJjhriPI8HRK2sMiQQwfZ+OGofffHiyWLJ/EtvruTyayO5IIjjVXE
 aDuHKa0z8s7sS/QDRyIFqr2N32T4mPczPaUvk4B3OmF6z1m5v3kKSYj4kzgZFOYx
 3DwBdxKITxcWqlHuNU0lGmV2n75cTISH3NXCO3bIsC1ZQAKjzLRuqBzypxrHzE6m
 CyRu1U7m5LHo7yqSg4gv
 =tx7z
 -----END PGP SIGNATURE-----

Merge tag 'clk-mvebu-3xx-3.15-2' of git://git.infradead.org/linux-mvebu into clk-next-mvebu

clock: mvebu new SoC changes for v3.15 (incremental pull #2)

 - mvebu (Armada 375)
    - fix ratio register offest

 - mvebu (Armada 380)
    - expand core divider clock driver to support 380 SoC (enables nand support)
2014-03-18 21:34:45 -07:00
Tushar Behera e8e6b840c4 clk: clk-s2mps11: Add support for clocks in S5M8767 MFD
Since clock operation within S2MPS11 and S5M8767 are similar, we can
support both the devices within a single driver.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Reviewed-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-03-18 17:13:24 -07:00
Tushar Behera 64d64c3573 clk: clk-s2mps11: Refactor for including support for other MFD clocks
The clocks in S2MPS11 and S5M8767 are managed in the same way, baring
a difference in the register offset. It would be better to update
existing S2MPS11 driver to support the clocks in S5M8767, rather than
creating an almost duplicate driver altogether.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Reviewed-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-03-18 17:13:16 -07:00
Jonas Jensen c7bb4fc16e clk: add MOXA ART SoCs clock driver
MOXA ART SoCs allow to determine PLL output and APB frequencies
by reading registers holding multiplier and divisor information.

Add a clock driver for this SoC.

Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-03-18 17:13:14 -07:00
Ezequiel Garcia 0737c15ff5 clk: mvebu: Support Armada 380 SoC on the core divider clock
This commit adds support for the Core Divider clocks of the Armada
380 SoCs. Similarly to Armada 370 and XP, the Core Divider clocks of
the 380 have gate capabilities. The only difference is the register layout.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Link: https://lkml.kernel.org/r/1394742273-5113-2-git-send-email-ezequiel.garcia@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
2014-03-13 23:24:23 +00:00
Ezequiel Garcia 8230a5ab43 clk: mvebu: Fix ratio register offset on A375 SoC
This commit fixes the ratio register offset which is 0x4,
as per the Armada 375 SoC specification.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Link: https://lkml.kernel.org/r/1394638901-13368-2-git-send-email-ezequiel.garcia@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
2014-03-13 23:20:27 +00:00
Mike Turquette 5ba8dac012 Merge branch 'clk-fixes' into clk-next 2014-02-26 18:33:51 -08:00
Tomi Valkeinen 7e50e7e176 clk: ti/divider: fix rate calculation for fractional rates
ti/clk-divider.c does not calculate the rates consistently at the moment.

As an example, on OMAP3 we have a clock divider with a source clock of
864000000 Hz. With dividers 6, 7 and 8 the theoretical rates are:

6: 144000000
7: 123428571.428571...
8: 108000000

Calling clk_round_rate() with the rate in the first column will give the
rate in the second column:

144000000 -> 144000000
143999999 -> 123428571
123428572 -> 123428571
123428571 -> 108000000

Note how clk_round_rate() returns 123428571 for rates from 123428572 to
143999999, which is mathematically correct, but when clk_round_rate() is
called with 123428571, the returned value is surprisingly 108000000.

This means that the following code works a bit oddly:

rate = clk_round_rate(clk, 123428572);
clk_set_rate(clk, rate);

As clk_set_rate() also does clock rate rounding, the result is that the
clock is set to the rate of 108000000, not 123428571 returned by the
clk_round_rate.

This patch changes the ti/clk-divider.c to use DIV_ROUND_UP when
calculating the rate. This gives the following behavior which fixes the
inconsistency:

144000000 -> 144000000
143999999 -> 123428572
123428572 -> 123428572
123428571 -> 108000000

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-26 18:23:58 -08:00
Tomi Valkeinen b11d282dbe clk: divider: fix rate calculation for fractional rates
clk-divider.c does not calculate the rates consistently at the moment.

As an example, on OMAP3 we have a clock divider with a source clock of
864000000 Hz. With dividers 6, 7 and 8 the theoretical rates are:

6: 144000000
7: 123428571.428571...
8: 108000000

Calling clk_round_rate() with the rate in the first column will give the
rate in the second column:

144000000 -> 144000000
143999999 -> 123428571
123428572 -> 123428571
123428571 -> 108000000

Note how clk_round_rate() returns 123428571 for rates from 123428572 to
143999999, which is mathematically correct, but when clk_round_rate() is
called with 123428571, the returned value is surprisingly 108000000.

This means that the following code works a bit oddly:

rate = clk_round_rate(clk, 123428572);
clk_set_rate(clk, rate);

As clk_set_rate() also does clock rate rounding, the result is that the
clock is set to the rate of 108000000, not 123428571 returned by the
clk_round_rate.

This patch changes the clk-divider.c to use DIV_ROUND_UP when
calculating the rate. This gives the following behavior which fixes the
inconsistency:

144000000 -> 144000000
143999999 -> 123428572
123428572 -> 123428572
123428571 -> 108000000

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-26 18:23:46 -08:00
Masanari Iida f63fcc90a3 clk:at91: Fix memory leak in of_at91_clk_master_setup()
cppcheck detected following error
[clk-master.c:245]: (error) Memory leak: characteristics

The original code forgot to free characteristics when
irq_of_parse_and_map() failed.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by Boris BREZILLON <b.brezillon@overkiz.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-26 18:00:56 -08:00
Lars-Peter Clausen 1887c3a64f clk: axi-clkgen: Add support for v2
This patch adds support for the new v2 version of the axi-clkgen core.
Unfortunately the method of accessing the registers is quite different on v2,
while the content still stays largely the same. So the patch adds a small
abstraction layer which implements the specific read and write functions for v1
and v2 in callback functions.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2014-02-26 17:02:29 -08:00
Zhangfei Gao 62ac983b61 clk: hisilicon: add hi3620_mmc_clks
Suggest by Arnd: abstract mmc tuning as clock behavior,
also because different soc have different tuning method and registers.
hi3620_mmc_clks is added to handle mmc clock specifically on hi3620.

Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-26 16:03:56 -08:00
Dinh Nguyen b89cd950cb clk: socfpga: Support multiple parents for the pll clocks
The PLLs can be from 3 different sources: osc1, osc2, or the f2s_ref_clk.
Update the clock driver to be able to get the correct parent.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-26 12:23:40 -08:00
Dinh Nguyen 5585f73175 clk: socfpga: Fix integer overflow in clock calculation
Use 64-bit integer for calculating clock rate. Also use do_div for the
64-bit division.

Signed-off-by: Graham Moore <grmoore@altera.com>
Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-26 12:23:29 -08:00
Linus Walleij ec6deea1a1 clk: nomadik: fix multiplatform problem
The Nomadik debugfs screws up multiplatform boots if debugfs
is enabled on the multiplatform image, since it's a simple
initcall that is unconditionally executed and reads from certain
memory locations.

Fix this by checking that the driver has been properly
initialized, so a base offset to the Nomadik SRC controller
exists, before proceeding to register debugfs files.

Reported-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-26 11:14:44 -08:00
Michal Simek 2c97ec5842 clk: zynq: Use clk_readl/clk_writel helper function
Do not use readl/writel directly because the whole
clk subsystem is using clk_readl/clk_writel functions.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-25 14:08:48 -08:00
Wolfram Sang 95aa4f9b5f clk: shmobile: div6: use proper description in kernel doc
These variable clocks have nothing to do with MSTP gating, probably a
copy&paste leftover.

Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-25 00:26:37 -08:00
Mike Turquette ad077ceb8a Merge branch 'clk-fixes' into clk-next 2014-02-24 23:07:53 -08:00
Nishanth Menon c05ab9a0cc clk: ti: am335x: remove unecessary cpu0 clk node
cpu0 clock node has no functionality, since cpufreq-cpu0 is already
capable of picking up the clock from dts.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-24 22:56:38 -08:00
Sylwester Nawrocki 00efcb1c8e clk: Correct handling of NULL clk in __clk_{get, put}
Ensure clk->kref is dereferenced only when clk is not NULL.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tested-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-24 21:58:38 -08:00
Jean-Francois Moine a34cd4666f clk: return probe defer when DT clock not yet ready
At probe time, a clock device may not be ready when some other device
wants to use it.

This patch lets the functions clk_get/devm_clk_get return a probe defer
when the clock is defined in the DT but not yet available.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-24 17:14:56 -08:00
Mike Turquette 86bcfa2e87 clk: add pr_debug & kerneldoc around clk notifiers
Both the pr_err and the additional kerneldoc aim to help when debugging
errors thrown from within a clock rate-change notifier callback.

Reported-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-24 17:13:55 -08:00
Mike Turquette 624009a7f3 Merge branch 'clk-tegra-more-fixes-3.14' of git://nv-tegra.nvidia.com/user/pdeschrijver/linux into clk-fixes
Fixes stray access to undefined registers, use of wrong clock parents &
running clocks at wrong rates. All of these issues cause regressions in
the form of boards that are unable to boot or crash and die horrible
deaths.
2014-02-24 15:15:25 -08:00
Mike Turquette 05135b4cb4 clock: mvebu new SoC changes for v3.15
- mvebu (Armada 375/380/385)
     - extend corediv clock driver to support new SoCs
     - add core and gating clock drivers for new SoCs
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJTCDYfAAoJEP45WPkGe8ZnWmIP/1+nOfhLVcHhZTn/eu0TKblX
 gD/Sd7goRArfFU/JnOYrwx8iqe8U2IgRVhndRHc3FRouvFF/u3CS0f9BHcUZ1CRb
 jWHN0FAw7ZzD3Qp3mFtnjs4ltqdGSqvmtqYC66AlkB7ssppr0Esfvei8bcrsB1Y7
 J9L6p6xgQhBXO8VZWmQqvJdUls2d0KyJRP+GQVwFcCxHXLLyYM2SW+ypKpDHSsej
 Ux0qmLxGsj+YEvlJk/s7F6JFcRT7PTzAfd+0zzXTip+gG0euDm3mB/IvxY4tBTCt
 qscgB/JFJ1tu02CXJpznBLm4VGcTtEq4SfGGWUxUx92ZDodUratzqEjKTN0Hti84
 t7IsYb+Miz1X3/+BlEzHf91V2nVW96CHAJiwcukPvjrbGV+KTAKBpOA7f8GUy1CD
 kEvebiKSZgwROCcO+vfLYAAgirc2Bu8tI5SL55VbX6NnmTa+B986Ebxw8orIM6lb
 9KmwkClkquHM/0hFqvHYDPi4IRT5rki6ayZRvXVV0tSDBDRiELdLeFe90e+UMzs8
 g0pWCb6q5ozXnwrELJSuQCxwu85I0K78FCGAbXw4UTWnorxNTu2kzMnsABVMFy6j
 /Hp2hYyCaTvxinVUld2Kg3Eqvi6w4N+FBW30zqh9yyJpEgQfKLqwzPDwoiJ7+c/k
 daqB4goGPLbc00RdNr1B
 =Aah7
 -----END PGP SIGNATURE-----

Merge tag 'clk-mvebu-3xx-3.15' of git://git.infradead.org/linux-mvebu into clk-next-mvebu

clock: mvebu new SoC changes for v3.15

 - mvebu (Armada 375/380/385)
    - extend corediv clock driver to support new SoCs
    - add core and gating clock drivers for new SoCs
2014-02-23 16:19:08 -08:00
Sachin Kamat c112c1d8ef clk: ux500: Staticize ux500_twocell_get
ux500_twocell_get is a local symbol.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-23 15:04:40 -08:00
Sachin Kamat 22e5de816b clk: tegra: Staticize tegra_clk_periph_no_gate_ops
tegra_clk_periph_no_gate_ops is a local symbol.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-23 14:46:05 -08:00
Ben Dooks 7a0fc1a3df clk: add clock-indices support
Add a property called clock-indices to allow clock-output-names
to be used where the index used to lookup a clock is not a 1:1
mapping to the array position in the clock-output-names

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-23 12:40:20 -08:00
Peter De Schrijver c7fbd41584 clk: tegra124: remove gr2d and gr3d clocks
Tegra124 does not have gr2d and gr3d clocks. They have been replaced by the
vic03 and gpu clocks respectively.

Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
2014-02-20 19:10:58 +02:00
Peter De Schrijver a9952a76bc clk: tegra: Fix vic03 mux index
The vic03 mux uses a linear mapping.

Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
2014-02-20 10:45:28 +02:00
Mike Turquette 7364001478 Merge branch 'for_3.14-rcx/clk-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone into clk-fixes 2014-02-18 22:18:52 -08:00
Mike Turquette 37a4493ee7 mvebu clock fixes for v3.14
- kirkwood, dove, armada-xp, armada-370
     - force clock init order broken by sorting DT ocp nodes by address
     - fixes boot failures on affected platforms
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJS9mjbAAoJEP45WPkGe8ZnkcYP/0R2kke0sfzO/KKbTH9srAh1
 OUDmVPguhGCZfhsJoaQyzUE9vf3dX0G3ZuZlriPIlaFoZp8U2QTvMspG0byrHrTv
 V1+Wt9yKYrIRcJm0kfFNPwON+WaZk004TqSR7aCVm7CqRrgKQ91wQ5o42coPBznZ
 Vfu13wM9oHwy2nT/w42laHZOQuMYYW0GQYsdzxECPledURA0dh/iW8UZ48WMoCjO
 9QWLGO3NOm+xR3n9KsfIkQ44WbL3FGjzRWq62jPjtquanMR4h0nOSTVEGPveqSbw
 o/OA8Ft/j3Bcfj7uGYeQ7GxHW0kpA50e8rzFQ8RYaRsGVBI5bTNsGzk17eEUswqZ
 uXm0V+MV8fklVhRtRMU93gYvvhi4adCj9DauLEhevKBW9XDaAkEi577uCjnpOijF
 aXg9TqV5mmUuH3iapMb/QD2+MOkL9qQOjOHQUBUAv6fUZxNwyZoNYP7KEmvDvMyY
 nyZv4Ve7u9ock2ZNUVn7COv9/9HTwusa1Z3Woi9eKy2eWriNM4bxcqP89601cZid
 HJbn6iwG5zDkhOqf9rgcrWVQPU6jBu/7ZKA2zYtbOUTsrxTOuMSMnTNO0XqZ2L27
 Hu1h9ezlJPQBD6tQcxjpSk7s8LB3iZYExQyNbIeGRbKdPQXg/3N05mMb4xWZ/Y2d
 hTgivwr3/voXq1s+ZHbk
 =MWFb
 -----END PGP SIGNATURE-----

Merge tag 'mvebu-clk-fixes-3.14' of git://git.infradead.org/linux-mvebu into clk-fixes

mvebu clock fixes for v3.14

 - kirkwood, dove, armada-xp, armada-370
    - force clock init order broken by sorting DT ocp nodes by address
    - fixes boot failures on affected platforms
2014-02-18 21:41:40 -08:00
Laurent Pinchart 8510e7263a clk: shmobile: rcar-gen2: Fix qspi divisor
The qspi clock divisor is incorrectly set to twice the value it should
have, possibly because it has been computed based on PLL1 as the clock
parent instead of PLL1 / 2 (the datasheets specifies the qspi nominal
frequencies, not the divisor values). Fix it.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-18 21:41:03 -08:00
Laurent Pinchart 995a9190ac clk: shmobile: rcar-gen2: Fix clock parent all non-PLL clocks
The lb, qspi, sdh, sd0 and sd1 clocks have the PLL1 (divided by 2) as
their parent, not the main clock. Fix it.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-18 21:41:01 -08:00
Mike Turquette 29d43ddf73 Merge tag 'socfpga-clk-for-3.15' of git://git.rocketboards.org/linux-socfpga-next into clk-next
SOCFPGA clk updates for v3.15
2014-02-18 14:08:15 -08:00
Dinh Nguyen 044abbde7b clk: socfpga: Add a clk-phase property to the "altr,socfpga-gate-clk"
The clk-phase property is used to represent the 2 clock phase values that is
needed for the SD/MMC driver. Add a prepare function to the clk_ops, that will
use the syscon driver to set sdmmc_clk's phase shift that is located in the
system manager.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
---
v9: none
v8: Use degrees in the clk-phase binding property
v7: Add dts property to represent the clk phase of the sdmmc_clk. Add a
    prepare function to the gate clk that will toggle clock phase setting.
    Remove the "altr,socfpga-sdmmc-sdr-clk" clock type.
v6: Add a new clock type "altr,socfpga-sdmmc-sdr-clk" that will be used to
    set the phase shift settings.
v5: Use the "snps,dw-mshc" binding
v4: Use the sdmmc_clk prepare function to set the phase shift settings
v3: Not use the syscon driver because as of 3.13-rc1, the syscon driver is
    loaded after the clock driver.
v2: Use the syscon driver
2014-02-18 14:08:14 -08:00
Steffen Trumtrar 97259e99bd clk: socfpga: split clk code
Move the different kinds of clocks into their own files. The reason is to aid
readability of the code. This also goes along with the other SoC-specific
clock drivers.

The split introduces new structs for the three types of clocks and uses them.
Other changes are not done to the code.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
2014-02-18 14:08:13 -08:00
Steffen Trumtrar 0c5a1872ba clk: socfpga: fix define typo
It should be SOCFPGA instead of SOCFGPA.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
2014-02-18 14:08:12 -08:00
Steffen Trumtrar ef5043c2d9 clk: socfpga: remove unused field
The clk_name field from the socfpga_clk struct is unused.
Remove it.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
2014-02-18 14:08:10 -08:00
Dinh Nguyen 77f1057777 clk: socfpga: Remove socfpga_init_clocks
The only thing that socfpga_init_clocks was doing is setting up the smp_twd clk.
Now that twd-timer's clock phandle is populated in the DTS, we can remove
this function.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
2014-02-18 14:08:09 -08:00
Dinh Nguyen b7cec13f08 clk: socfpga: Look for the GPIO_DB_CLK by its offset
After the patch:
"clk: socfpga: Map the clk manager base address in the clock driver"

The clk->name field in socfpga_clk_recalc_rate() was getting cleared. Replace
looking for the GPIO_DB_CLK by its divider offset instead.

Also rename the define SOCFPGA_DB_CLK_OFFSET -> SOCFPGA_GPIO_DB_CLK_OFFSET, as
this represents the GPIO_DB_CLK.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
2014-02-18 14:08:08 -08:00
Dinh Nguyen 6a7e71221d clk: socfpga: Map the clk manager base address in the clock driver
The clk manager's base address was being mapped in SOCFPGA's arch code and
being extern'ed out to the clock driver. This method is not correct, and the
arch code was not really doing anything with that clk manager anyways.

This patch moves the mapping of the clk manager's base address in the clock
driver itself. Cleans up CLK_OF_DECLARE() into a single registration of all
the clocks.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2: Use a static declaration for the clk_mgr_base_addr. Clean up the
    CLK_OF_DECLARE() as suggested by Arnd.
2014-02-18 14:08:07 -08:00
Soren Brinkmann 5324fda79e clk: Fix notifier documentation
Contradicting to documenation, the notifier callbacks do receive
the original clock rate in struct clk_notifier_data.old_rate and the new
frequency struct clk_notifier_data.new_rate, independent of the
notification reason.

This behavior also seems to make more sense, since callbacks can use the
same code to deterimine whether clocks are scaled up or down. Something
which would not even possible in the post-rate-change case if the
behavior was as documented.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-02-18 14:08:05 -08:00
Maxime Ripard fd1b22f6fb clk: sunxi: Add new clock compatibles
The Allwinner A10 compatibles were following a slightly different compatible
patterns than the rest of the SoCs for historical reasons. Add compatibles
matching the other pattern to the clock driver for consistency, and keep the
older one for backward compatibility.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Emilio López <emilio@elopez.com.ar>
2014-02-18 10:34:28 -03:00
Chen-Yu Tsai e4c6d6c11b clk: sunxi: Add Allwinner A20/A31 GMAC clock unit
The Allwinner A20/A31 clock module controls the transmit clock source
and interface type of the GMAC ethernet controller. Model this as
a single clock for GMAC drivers to use.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Emilio López <emilio@elopez.com.ar>
2014-02-18 10:34:28 -03:00
Maxime Ripard 92ef67c53a clk: sunxi: Add support for PLL6 on the A31
The A31 has a slightly different PLL6 clock. Add support for this new clock in
our driver.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Emilio López <emilio@elopez.com.ar>
2014-02-18 09:45:13 -03:00
Roman Byshko 5abdbf2f49 clk: sunxi: Add USB clock register defintions
Add register definitions for the usb-clk register found on sun4i, sun5i and
sun7i SoCs.

Signed-off-by: Roman Byshko <rbyshko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Emilio López <emilio@elopez.com.ar>
2014-02-18 09:35:20 -03:00