summaryrefslogtreecommitdiffstats
path: root/drivers/clk
Commit message (Collapse)AuthorAgeFilesLines
* clk: socfpga: fix compiler warnings for Cyclone5Ian Abbott2019-04-101-3/+3
| | | | | | | | | | | | | | | When building for Cyclone5 SoCFPGA, the socfpga_a10_pll_init(), socfpga_a10_perith_init() and socfpga_a10_gate_init() functions are defined as dummy functions returning ERR_PTR(-ENOSYS). They are defined with external linkage. With '-Wmissing-prototypes' GCC warns about externally linked function definitions with no preceding prototype. Define them as 'static inline' to avoid the compiler warnings. (Note: Arria10 uses non-dummy versions of these functions declared 'extern' but defined elsewhere.) Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/zynqmp'Sascha Hauer2019-04-098-0/+1162
|\
| * clk: add ZynqMP clock driverMichael Tretter2019-03-188-0/+1162
| | | | | | | | | | | | | | | | | | | | | | | | The ZynqMP has a platform management unit (PMU) that is responsible for managing the clocks. Therefore, the clock driver uses the firmware driver to control the clocks. The Barebox driver is based on the Linux driver, but contains deviations to make the driver more readable and more consistent. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/warnings'Sascha Hauer2019-04-093-4/+4
|\ \
| * | treewide: Make locally used functions staticSascha Hauer2019-03-183-4/+4
| |/ | | | | | | | | | | | | Many functions are only used locally but still are globally visible. Make these function static. Avoids warnings generated with -Wmissing-prototypes Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/stm32'Sascha Hauer2019-04-0916-56/+2069
|\ \
| * | ARM: stm32mp1: Add clk driverSascha Hauer2019-03-112-0/+1989
| | | | | | | | | | | | | | | | | | | | | Taken from Linux v5.0-rc2. Mostly as-is, only adopted to the differences between the Linux and barebox clk API. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clk: mux: Support CLK_SET_RATE_NO_REPARENT flagSascha Hauer2019-03-112-4/+0
| | | | | | | | | | | | | | | | | | | | | Since barebox doesn't do reparenting on rate changes we only have to define the flag. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clk: mux: Support CLK_MUX_READ_ONLY flagSascha Hauer2019-03-111-0/+7
| | | | | | | | | | | | | | | | | | Support readonly dividers using the CLK_MUX_READ_ONLY flag. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clk: mux: Support mux specific flagsSascha Hauer2019-03-116-24/+27
| | | | | | | | | | | | | | | | | | | | | We'll need mux specific flags in the future, so add a parameter to the mux initialization functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clk: divider: Support CLK_DIVIDER_READ_ONLY flagSascha Hauer2019-03-113-2/+7
| | | | | | | | | | | | | | | | | | To support a readonly divider add the CLK_DIVIDER_READ_ONLY flag. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clk: divider: pass divider flagsSascha Hauer2019-03-114-21/+29
| | | | | | | | | | | | | | | | | | | | | The generic clk divider needs clock flags and divider flags. Fix prototypes to take both as separate arguments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clk: Support CLK_IS_CRITICAL flagSascha Hauer2019-03-111-0/+3
| | | | | | | | | | | | | | | | | | | | | Support CLK_IS_CRITICAL flag. Simply do not disable the clock even when the enable count is zero. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clk: Make CLK_IGNORE_UNUSED genericSascha Hauer2019-03-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | barebox will never disable unused clocks, so add CLK_IGNORE_UNUSED as a no-op flag. With this we can keep the changes to the imported kernel code smaller. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clk: export clk_gate_is_enabled()Sascha Hauer2019-03-111-1/+1
| | | | | | | | | | | | | | | | | | Will be needed by stm32 clk support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clk: parent_names should be constSascha Hauer2019-03-112-3/+3
| | | | | | | | | | | | | | | | | | | | | Not only the array of pointers should be const, but also the strings they point to. Add missing const. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clk: clk-composite: return parent_rate if no rate clkSascha Hauer2019-03-111-1/+4
| |/ | | | | | | | | | | | | When a composite clock has no rate clock then it should output the parents rate. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / clk: Add Layerscape clk supportSascha Hauer2019-03-132-0/+666
|/ | | | | | | | | | This adds support for the clock controller found on Layerscape SoCs. This is mostly an adoption of the corresponding Linux driver. This is tested on the LS1046a SoC. Other ARM based Layerscape SoCs should work aswell, support for the PowerPC based SoCs has been removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imx8-usb'Sascha Hauer2019-03-073-6/+104
|\
| * clk: Import a subset of clk_bulk API from LinuxAndrey Smirnov2019-02-222-1/+104
| | | | | | | | | | | | | | | | Import a subset of clk_bulk API from Linux to support porting kernel code that uses it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: Drop separate definitions of clk_put()Andrey Smirnov2019-02-221-5/+0
| | | | | | | | | | | | | | | | | | Regardless of the value of CONFIG_HAVE_CLK, clk_put() implementation is always a no-op. Move the definition to linux/clk.h and drop the rest of the code implementing it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk: at91: update to PMC bindingsSam Ravnborg2019-02-2516-970/+567
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on kernel 5.0-rc6 update at91 clk support to match the new PMC bindings. Manually added all changes done in the kernel from 4.9-rc3 to 5.0-rc6. New drivers required was added as seperate commits. This includes dt-compat code required to support at91sam5d3, as this is not yet ported to use the new PMC bindings. clk-programmable saw some extra changes - it had never been bulit. It is used only by at91sama5d2 - and barebox has no board support for this cpu (yet). The CONFIG_SOC symbols is used to select the relevant drivers. CONFIG_SOC_SAM9 selects several drivers, and in the future this can be split to keep the image size down. In the kernel CLK_OF_DECLARE_DRIVER() can be used for a two step init. In barebox this is a simple one step init. It was added to have less differences between the kernel and the barebox versions of the drivers. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk: at91: add dt-compat to PMC bindingsAhmad Fatoum2019-02-251-0/+961
| | | | | | | | | | | | | | | | | | | | | | As the sama5d3 based microchip-ksz9477-evb board still uses the old bindings, the dt-compat.c code is ported as well. This can be removed when all in-kernel at91 boards have been ported to the new bindings. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk: at91: add sama5d4Sam Ravnborg2019-02-251-0/+270
| | | | | | | | | | | | | | | | | | | | | | | | Add sama5d4 as part of supporting the PMC bindings for ARM at91. The file will be wired into the build in a follow-up patch. The file is a copy from kernel 5.0-rc6 modified to build with barebox. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk: at91: add sama5d2Sam Ravnborg2019-02-251-0/+342
| | | | | | | | | | | | | | | | | | | | | | | | Add sama5d2 as part of supporting the PMC bindings for ARM at91. The file will be wired into the build in a follow-up patch. The file is a copy from kernel 5.0-rc6 modified to build with barebox. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk: at91: add at91sam9x5Sam Ravnborg2019-02-251-0/+315
| | | | | | | | | | | | | | | | | | | | | | | | Add at91sam9x5 as part of supporting the PMC bindings for ARM at91. The file will be wired into the build in a follow-up patch. The file is a copy from kernel 5.0-rc6 modified to build with barebox. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk: at91: add at91sam9rlSam Ravnborg2019-02-251-0/+177
| | | | | | | | | | | | | | | | | | | | | | | | Add at91sam9rl as part of supporting the PMC bindings for ARM at91. The file will be wired into the build in a follow-up patch. The file is a copy from kernel 5.0-rc6 modified to build with barebox. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk: at91: add at91sam9260Sam Ravnborg2019-02-251-0/+497
|/ | | | | | | | | | | | Add at91sam9260 as part of supporting the PMC bindings for ARM at91. The file will be wired into the build in a follow-up patch. The file is a copy from kernel 5.0-rc6 modified to build with barebox. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Remove trailing whitespaces and tabsAlexander Shiyan2019-01-211-1/+1
| | | | | | | Just a cleanup over barebox tree Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: imx: sync imx8mq clock driver with upstream kernelLucas Stach2019-01-152-277/+265
| | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: imx: add imx8mq composite clockLucas Stach2019-01-153-0/+184
| | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: add divider_recalc_rate helperLucas Stach2019-01-151-8/+22
| | | | | | | | Closer to Linux kernel implementation and needed for imx8mq composite clock. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: move struct clk_mux into headerLucas Stach2019-01-151-10/+1
| | | | | | | To make it reusable in a composite clock. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: move struct clk_gate into headerLucas Stach2019-01-151-11/+1
| | | | | | | To make it reusable in a composite clock. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: imx5: add di_predLucas Stach2018-12-131-0/+3
| | | | | | | | | This was missing, so the default external DI clock source on i.MX51 was missing. Also set the divider to a division ratio of 1 initially, to avoid complicating the logic in the IPU driver further. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/missing-prototypes'Sascha Hauer2018-12-071-8/+1
|\
| * clk: imx: Avoid missing prototype warningsSascha Hauer2018-11-121-8/+1
| | | | | | | | | | | | | | clk_gate2_free() is unused, so remove it. clk_gate2_alloc() is only used locally, so make it static. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2018-12-071-0/+9
|\ \
| * | ARM: i.MX5 clock: add clock provider supportMichael Grzeschik2018-11-191-0/+9
| |/ | | | | | | | | | | | | | | Currently it is impossible to get clks with clk_get(&clk, "name"); on the mx5 platform. Change that by adding clk-imx5 as clk_provider. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/checkpatch'Sascha Hauer2018-12-071-1/+3
|\ \
| * | clk: imx: cpu: avoid use after free on errorOleksij Rempel2018-11-191-1/+3
| |/ | | | | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / clk: fix NULL deref without OF node in debug messageMatthias Schiffer2018-11-231-1/+1
|/ | | | | | | | | | | | of_clk_add_provider() may be called for devices added via add_generic_device(). There is no OF node in this case, leading to a crash when debug logs are enabled. This affects various i.MX CPUs, which add imx*-ccm clock devices using add_generic_device(). Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/missing-prototypes'Sascha Hauer2018-11-091-3/+3
|\
| * drivers: clk: imx5: Make locally used functions staticSascha Hauer2018-10-231-3/+3
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: clk: rk3188: don't set same clk rate twiceperachet7@gmail.com2018-11-091-0/+3
|/ | | | | | | | | | | We found setting a clock rate which has already been set, rk3188 (radxa rock pro) bails out. This is a quick fix only. Underlying situation not (yet) investigated: why it is even trying to set it to the same rate again. It remains to state that some but not all rrpro boards exhibit this behaviour, no other rk3188 boards have been tested. Signed-off-by: P. Rachet <perachet7@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: i.MX8MQ: Add missing IMX8MQ_CLK_TMU_ROOT clockAndrey Smirnov2018-09-241-0/+1
| | | | | | | Add missing IMX8MQ_CLK_TMU_ROOT clock needed for CPU thermal sensor. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: i.MX8MQ: Bump refcounters of various important clocksAndrey Smirnov2018-09-241-0/+12
| | | | | | | | | Bump refcounters of various important clocks in order to make sure their parents are not disabled during clock re-configuration added by commits that follow. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: i.MX28: Add APBH clk supportOleksij Rempel2018-09-181-0/+1
| | | | | | | | | | i.MX28 fails to use DMA and NAND because it cannot find its clock. Add the clock for APBH. Fixes: 6eb2ba6f1b ("dma: apbh: Enable clock as a part of probing") Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: clk-sccg-pll: Remove leftover debug outputAndrey Smirnov2018-08-311-2/+0
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imx'Sascha Hauer2018-07-092-18/+0
|\