mirror of
https://github.com/armbian/linux-cix.git
synced 2026-01-06 12:30:45 -08:00
Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
Pull clk updates from Stephen Boyd: "The large diff this time around is from the addition of a new clk driver for the TI Davinci family of SoCs. So far those clks have been supported with a custom implementation of the clk API in the arch port instead of in the CCF. With this driver merged we're one step closer to having a single clk API implementation. The other large diff is from the Amlogic clk driver that underwent some major surgery to use regmap. Beyond that, the biggest hitter is Samsung which needed some reworks to properly handle clk provider power domains and a bunch of PLL rate updates. The core framework was fairly quiet this round, just getting some cleanups and small fixes for some of the more esoteric features. And the usual set of driver non-critical fixes, cleanups, and minor additions are here as well. Core: - Rejig clk_ops::init() to be a little earlier for phase/accuracy ops - debugfs ops macroized to shave some lines of boilerplate code - Always calculate the phase instead of caching it in clk_get_phase() - More __must_check on bulk clk APIs New Drivers: - TI's Davinci family of SoCs - Intel's Stratix10 SoC - stm32mp157 SoC - Allwinner H6 CCU - Silicon Labs SI544 clock generator chip - Renesas R-Car M3-N and V3H SoCs - i.MX6SLL SoCs Removed Drivers: - ST-Ericsson AB8540/9540 Updates: - Mediatek MT2701 and MT7622 audsys support and MT2712 updates - STM32F469 DSI and STM32F769 sdmmc2 support - GPIO clks can sleep now - Spreadtrum SC9860 RTC clks - Nvidia Tegra MBIST workarounds and various minor fixes - Rockchip phase handling fixes and a memory leak plugged - Renesas drivers switch to readl/writel from clk_readl/clk_writel - Renesas gained CPU (Z/Z2) and watchdog support - Rockchip rk3328 display clks and rk3399 1.6GHz PLL support - Qualcomm PM8921 PMIC XO buffers - Amlogic migrates to regmap APIs - TI Keystone clk latching support - Allwinner H3 and H5 video clk fixes - Broadcom BCM2835 PLLs needed another bit to enable - i.MX6SX CKO mux fix and i.MX7D Video PLL divider fix - i.MX6UL/ULL epdc_podf support - Hi3798CV200 COMBPHY0 and USB2_OTG_UTMI and phase support for eMMC" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (233 commits) clk: davinci: add a reset lookup table for psc0 clk: imx: add clock driver for imx6sll dt-bindings: imx: update clock doc for imx6sll clk: imx: add new gate/gate2 wrapper funtion clk: imx: Add CLK_IS_CRITICAL flag for busy divider and busy mux clk: cs2000: set pm_ops in hibernate-compatible way clk: bcm2835: De-assert/assert PLL reset signal when appropriate clk: imx7d: Move clks_init_on before any clock operations clk: imx7d: Correct ahb clk parent select clk: imx7d: Correct dram pll type clk: imx7d: Add USB clock information clk: socfpga: stratix10: add clock driver for Stratix10 platform dt-bindings: documentation: add clock bindings information for Stratix10 clk: ti: fix flag space conflict with clkctrl clocks clk: uniphier: add additional ethernet clock lines for Pro4 clk: uniphier: add SATA clock control support clk: uniphier: add PCIe clock control support clk: Add driver for the si544 clock generator chip clk: davinci: Remove redundant dev_err calls clk: uniphier: add ethernet clock control support for PXs3 ...
This commit is contained in:
@@ -268,9 +268,19 @@ The common clock framework uses two global locks, the prepare lock and the
|
||||
enable lock.
|
||||
|
||||
The enable lock is a spinlock and is held across calls to the .enable,
|
||||
.disable and .is_enabled operations. Those operations are thus not allowed to
|
||||
sleep, and calls to the clk_enable(), clk_disable() and clk_is_enabled() API
|
||||
functions are allowed in atomic context.
|
||||
.disable operations. Those operations are thus not allowed to sleep,
|
||||
and calls to the clk_enable(), clk_disable() API functions are allowed in
|
||||
atomic context.
|
||||
|
||||
For clk_is_enabled() API, it is also designed to be allowed to be used in
|
||||
atomic context. However, it doesn't really make any sense to hold the enable
|
||||
lock in core, unless you want to do something else with the information of
|
||||
the enable state with that lock held. Otherwise, seeing if a clk is enabled is
|
||||
a one-shot read of the enabled state, which could just as easily change after
|
||||
the function returns because the lock is released. Thus the user of this API
|
||||
needs to handle synchronizing the read of the state with whatever they're
|
||||
using it for to make sure that the enable state doesn't change during that
|
||||
time.
|
||||
|
||||
The prepare lock is a mutex and is held across calls to all other operations.
|
||||
All those operations are allowed to sleep, and calls to the corresponding API
|
||||
|
||||
@@ -6,6 +6,7 @@ The MediaTek AUDSYS controller provides various clocks to the system.
|
||||
Required Properties:
|
||||
|
||||
- compatible: Should be one of:
|
||||
- "mediatek,mt2701-audsys", "syscon"
|
||||
- "mediatek,mt7622-audsys", "syscon"
|
||||
- #clock-cells: Must be 1
|
||||
|
||||
@@ -13,10 +14,19 @@ The AUDSYS controller uses the common clk binding from
|
||||
Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||
The available clocks are defined in dt-bindings/clock/mt*-clk.h.
|
||||
|
||||
Required sub-nodes:
|
||||
-------
|
||||
For common binding part and usage, refer to
|
||||
../sonud/mt2701-afe-pcm.txt.
|
||||
|
||||
Example:
|
||||
|
||||
audsys: audsys@11220000 {
|
||||
compatible = "mediatek,mt7622-audsys", "syscon";
|
||||
reg = <0 0x11220000 0 0x1000>;
|
||||
#clock-cells = <1>;
|
||||
};
|
||||
audsys: clock-controller@11220000 {
|
||||
compatible = "mediatek,mt7622-audsys", "syscon";
|
||||
reg = <0 0x11220000 0 0x2000>;
|
||||
#clock-cells = <1>;
|
||||
|
||||
afe: audio-controller {
|
||||
...
|
||||
};
|
||||
};
|
||||
|
||||
36
Documentation/devicetree/bindings/clock/imx6sll-clock.txt
Normal file
36
Documentation/devicetree/bindings/clock/imx6sll-clock.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
* Clock bindings for Freescale i.MX6 SLL
|
||||
|
||||
Required properties:
|
||||
- compatible: Should be "fsl,imx6sll-ccm"
|
||||
- reg: Address and length of the register set
|
||||
- #clock-cells: Should be <1>
|
||||
- clocks: list of clock specifiers, must contain an entry for each required
|
||||
entry in clock-names
|
||||
- clock-names: should include entries "ckil", "osc", "ipp_di0" and "ipp_di1"
|
||||
|
||||
The clock consumer should specify the desired clock by having the clock
|
||||
ID in its "clocks" phandle cell. See include/dt-bindings/clock/imx6sll-clock.h
|
||||
for the full list of i.MX6 SLL clock IDs.
|
||||
|
||||
Examples:
|
||||
|
||||
#include <dt-bindings/clock/imx6sll-clock.h>
|
||||
|
||||
clks: clock-controller@20c4000 {
|
||||
compatible = "fsl,imx6sll-ccm";
|
||||
reg = <0x020c4000 0x4000>;
|
||||
interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>;
|
||||
#clock-cells = <1>;
|
||||
clocks = <&ckil>, <&osc>, <&ipp_di0>, <&ipp_di1>;
|
||||
clock-names = "ckil", "osc", "ipp_di0", "ipp_di1";
|
||||
};
|
||||
|
||||
uart1: serial@2020000 {
|
||||
compatible = "fsl,imx6sl-uart", "fsl,imx6q-uart", "fsl,imx21-uart";
|
||||
reg = <0x02020000 0x4000>;
|
||||
interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clks IMX6SLL_CLK_UART1_IPG>,
|
||||
<&clks IMX6SLL_CLK_UART1_SERIAL>;
|
||||
clock-names = "ipg", "per";
|
||||
};
|
||||
20
Documentation/devicetree/bindings/clock/intc_stratix10.txt
Normal file
20
Documentation/devicetree/bindings/clock/intc_stratix10.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
Device Tree Clock bindings for Intel's SoCFPGA Stratix10 platform
|
||||
|
||||
This binding uses the common clock binding[1].
|
||||
|
||||
[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||
|
||||
Required properties:
|
||||
- compatible : shall be
|
||||
"intel,stratix10-clkmgr"
|
||||
|
||||
- reg : shall be the control register offset from CLOCK_MANAGER's base for the clock.
|
||||
|
||||
- #clock-cells : from common clock binding, shall be set to 1.
|
||||
|
||||
Example:
|
||||
clkmgr: clock-controller@ffd10000 {
|
||||
compatible = "intel,stratix10-clkmgr";
|
||||
reg = <0xffd10000 0x1000>;
|
||||
#clock-cells = <1>;
|
||||
};
|
||||
@@ -22,7 +22,9 @@ Required Properties:
|
||||
- "renesas,r8a7794-cpg-mssr" for the r8a7794 SoC (R-Car E2)
|
||||
- "renesas,r8a7795-cpg-mssr" for the r8a7795 SoC (R-Car H3)
|
||||
- "renesas,r8a7796-cpg-mssr" for the r8a7796 SoC (R-Car M3-W)
|
||||
- "renesas,r8a77965-cpg-mssr" for the r8a77965 SoC (R-Car M3-N)
|
||||
- "renesas,r8a77970-cpg-mssr" for the r8a77970 SoC (R-Car V3M)
|
||||
- "renesas,r8a77980-cpg-mssr" for the r8a77980 SoC (R-Car V3H)
|
||||
- "renesas,r8a77995-cpg-mssr" for the r8a77995 SoC (R-Car D3)
|
||||
|
||||
- reg: Base address and length of the memory resource used by the CPG/MSSR
|
||||
@@ -32,8 +34,8 @@ Required Properties:
|
||||
clock-names
|
||||
- clock-names: List of external parent clock names. Valid names are:
|
||||
- "extal" (r8a7743, r8a7745, r8a7790, r8a7791, r8a7792, r8a7793, r8a7794,
|
||||
r8a7795, r8a7796, r8a77970, r8a77995)
|
||||
- "extalr" (r8a7795, r8a7796, r8a77970)
|
||||
r8a7795, r8a7796, r8a77965, r8a77970, r8a77980, r8a77995)
|
||||
- "extalr" (r8a7795, r8a7796, r8a77965, r8a77970, r8a77980)
|
||||
- "usb_extal" (r8a7743, r8a7745, r8a7790, r8a7791, r8a7793, r8a7794)
|
||||
|
||||
- #clock-cells: Must be 2
|
||||
|
||||
@@ -32,6 +32,7 @@ clock-output-names:
|
||||
- "clkin_i2s" - external I2S clock - optional,
|
||||
- "gmac_clkin" - external GMAC clock - optional
|
||||
- "phy_50m_out" - output clock of the pll in the mac phy
|
||||
- "hdmi_phy" - output clock of the hdmi phy pll - optional
|
||||
|
||||
Example: Clock controller node:
|
||||
|
||||
|
||||
25
Documentation/devicetree/bindings/clock/silabs,si544.txt
Normal file
25
Documentation/devicetree/bindings/clock/silabs,si544.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
Binding for Silicon Labs 544 programmable I2C clock generator.
|
||||
|
||||
Reference
|
||||
This binding uses the common clock binding[1]. Details about the device can be
|
||||
found in the datasheet[2].
|
||||
|
||||
[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||
[2] Si544 datasheet
|
||||
https://www.silabs.com/documents/public/data-sheets/si544-datasheet.pdf
|
||||
|
||||
Required properties:
|
||||
- compatible: One of "silabs,si514a", "silabs,si514b" "silabs,si514c" according
|
||||
to the speed grade of the chip.
|
||||
- reg: I2C device address.
|
||||
- #clock-cells: From common clock bindings: Shall be 0.
|
||||
|
||||
Optional properties:
|
||||
- clock-output-names: From common clock bindings. Recommended to be "si544".
|
||||
|
||||
Example:
|
||||
si544: clock-controller@55 {
|
||||
reg = <0x55>;
|
||||
#clock-cells = <0>;
|
||||
compatible = "silabs,si544b";
|
||||
};
|
||||
60
Documentation/devicetree/bindings/clock/st,stm32mp1-rcc.txt
Normal file
60
Documentation/devicetree/bindings/clock/st,stm32mp1-rcc.txt
Normal file
@@ -0,0 +1,60 @@
|
||||
STMicroelectronics STM32 Peripheral Reset Clock Controller
|
||||
==========================================================
|
||||
|
||||
The RCC IP is both a reset and a clock controller.
|
||||
|
||||
RCC makes also power management (resume/supend and wakeup interrupt).
|
||||
|
||||
Please also refer to reset.txt for common reset controller binding usage.
|
||||
|
||||
Please also refer to clock-bindings.txt for common clock controller
|
||||
binding usage.
|
||||
|
||||
|
||||
Required properties:
|
||||
- compatible: "st,stm32mp1-rcc", "syscon"
|
||||
- reg: should be register base and length as documented in the datasheet
|
||||
- #clock-cells: 1, device nodes should specify the clock in their
|
||||
"clocks" property, containing a phandle to the clock device node,
|
||||
an index specifying the clock to use.
|
||||
- #reset-cells: Shall be 1
|
||||
- interrupts: Should contain a general interrupt line and a interrupt line
|
||||
to the wake-up of processor (CSTOP).
|
||||
|
||||
Example:
|
||||
rcc: rcc@50000000 {
|
||||
compatible = "st,stm32mp1-rcc", "syscon";
|
||||
reg = <0x50000000 0x1000>;
|
||||
#clock-cells = <1>;
|
||||
#reset-cells = <1>;
|
||||
interrupts = <GIC_SPI 5 IRQ_TYPE_NONE>,
|
||||
<GIC_SPI 145 IRQ_TYPE_NONE>;
|
||||
};
|
||||
|
||||
Specifying clocks
|
||||
=================
|
||||
|
||||
All available clocks are defined as preprocessor macros in
|
||||
dt-bindings/clock/stm32mp1-clks.h header and can be used in device
|
||||
tree sources.
|
||||
|
||||
Specifying softreset control of devices
|
||||
=======================================
|
||||
|
||||
Device nodes should specify the reset channel required in their "resets"
|
||||
property, containing a phandle to the reset device node and an index specifying
|
||||
which channel to use.
|
||||
The index is the bit number within the RCC registers bank, starting from RCC
|
||||
base address.
|
||||
It is calculated as: index = register_offset / 4 * 32 + bit_offset.
|
||||
Where bit_offset is the bit offset within the register.
|
||||
|
||||
For example on STM32MP1, for LTDC reset:
|
||||
ltdc = APB4_RSTSETR_offset / 4 * 32 + LTDC_bit_offset
|
||||
= 0x180 / 4 * 32 + 0 = 3072
|
||||
|
||||
The list of valid indices for STM32MP1 is available in:
|
||||
include/dt-bindings/reset-controller/stm32mp1-resets.h
|
||||
|
||||
This file implements defines like:
|
||||
#define LTDC_R 3072
|
||||
@@ -20,6 +20,7 @@ Required properties :
|
||||
- "allwinner,sun50i-a64-ccu"
|
||||
- "allwinner,sun50i-a64-r-ccu"
|
||||
- "allwinner,sun50i-h5-ccu"
|
||||
- "allwinner,sun50i-h6-ccu"
|
||||
- "nextthing,gr8-ccu"
|
||||
|
||||
- reg: Must contain the registers base address and length
|
||||
@@ -31,6 +32,9 @@ Required properties :
|
||||
- #clock-cells : must contain 1
|
||||
- #reset-cells : must contain 1
|
||||
|
||||
For the main CCU on H6, one more clock is needed:
|
||||
- "iosc": the SoC's internal frequency oscillator
|
||||
|
||||
For the PRCM CCUs on A83T/H3/A64, two more clocks are needed:
|
||||
- "pll-periph": the SoC's peripheral PLL from the main CCU
|
||||
- "iosc": the SoC's internal frequency oscillator
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
Binding for TI DA8XX/OMAP-L13X/AM17XX/AM18XX CFGCHIP clocks
|
||||
|
||||
TI DA8XX/OMAP-L13X/AM17XX/AM18XX SoCs contain a general purpose set of
|
||||
registers call CFGCHIPn. Some of these registers function as clock
|
||||
gates. This document describes the bindings for those clocks.
|
||||
|
||||
All of the clock nodes described below must be child nodes of a CFGCHIP node
|
||||
(compatible = "ti,da830-cfgchip").
|
||||
|
||||
USB PHY clocks
|
||||
--------------
|
||||
Required properties:
|
||||
- compatible: shall be "ti,da830-usb-phy-clocks".
|
||||
- #clock-cells: from common clock binding; shall be set to 1.
|
||||
- clocks: phandles to the parent clocks corresponding to clock-names
|
||||
- clock-names: shall be "fck", "usb_refclkin", "auxclk"
|
||||
|
||||
This node provides two clocks. The clock at index 0 is the USB 2.0 PHY 48MHz
|
||||
clock and the clock at index 1 is the USB 1.1 PHY 48MHz clock.
|
||||
|
||||
eHRPWM Time Base Clock (TBCLK)
|
||||
------------------------------
|
||||
Required properties:
|
||||
- compatible: shall be "ti,da830-tbclksync".
|
||||
- #clock-cells: from common clock binding; shall be set to 0.
|
||||
- clocks: phandle to the parent clock
|
||||
- clock-names: shall be "fck"
|
||||
|
||||
PLL DIV4.5 divider
|
||||
------------------
|
||||
Required properties:
|
||||
- compatible: shall be "ti,da830-div4p5ena".
|
||||
- #clock-cells: from common clock binding; shall be set to 0.
|
||||
- clocks: phandle to the parent clock
|
||||
- clock-names: shall be "pll0_pllout"
|
||||
|
||||
EMIFA clock source (ASYNC1)
|
||||
---------------------------
|
||||
Required properties:
|
||||
- compatible: shall be "ti,da850-async1-clksrc".
|
||||
- #clock-cells: from common clock binding; shall be set to 0.
|
||||
- clocks: phandles to the parent clocks corresponding to clock-names
|
||||
- clock-names: shall be "pll0_sysclk3", "div4.5"
|
||||
|
||||
ASYNC3 clock source
|
||||
-------------------
|
||||
Required properties:
|
||||
- compatible: shall be "ti,da850-async3-clksrc".
|
||||
- #clock-cells: from common clock binding; shall be set to 0.
|
||||
- clocks: phandles to the parent clocks corresponding to clock-names
|
||||
- clock-names: shall be "pll0_sysclk2", "pll1_sysclk2"
|
||||
|
||||
Examples:
|
||||
|
||||
cfgchip: syscon@1417c {
|
||||
compatible = "ti,da830-cfgchip", "syscon", "simple-mfd";
|
||||
reg = <0x1417c 0x14>;
|
||||
|
||||
usb_phy_clk: usb-phy-clocks {
|
||||
compatible = "ti,da830-usb-phy-clocks";
|
||||
#clock-cells = <1>;
|
||||
clocks = <&psc1 1>, <&usb_refclkin>, <&pll0_auxclk>;
|
||||
clock-names = "fck", "usb_refclkin", "auxclk";
|
||||
};
|
||||
ehrpwm_tbclk: ehrpwm_tbclk {
|
||||
compatible = "ti,da830-tbclksync";
|
||||
#clock-cells = <0>;
|
||||
clocks = <&psc1 17>;
|
||||
clock-names = "fck";
|
||||
};
|
||||
div4p5_clk: div4.5 {
|
||||
compatible = "ti,da830-div4p5ena";
|
||||
#clock-cells = <0>;
|
||||
clocks = <&pll0_pllout>;
|
||||
clock-names = "pll0_pllout";
|
||||
};
|
||||
async1_clk: async1 {
|
||||
compatible = "ti,da850-async1-clksrc";
|
||||
#clock-cells = <0>;
|
||||
clocks = <&pll0_sysclk 3>, <&div4p5_clk>;
|
||||
clock-names = "pll0_sysclk3", "div4.5";
|
||||
};
|
||||
async3_clk: async3 {
|
||||
compatible = "ti,da850-async3-clksrc";
|
||||
#clock-cells = <0>;
|
||||
clocks = <&pll0_sysclk 2>, <&pll1_sysclk 2>;
|
||||
clock-names = "pll0_sysclk2", "pll1_sysclk2";
|
||||
};
|
||||
};
|
||||
|
||||
Also see:
|
||||
- Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||
|
||||
96
Documentation/devicetree/bindings/clock/ti/davinci/pll.txt
Normal file
96
Documentation/devicetree/bindings/clock/ti/davinci/pll.txt
Normal file
@@ -0,0 +1,96 @@
|
||||
Binding for TI DaVinci PLL Controllers
|
||||
|
||||
The PLL provides clocks to most of the components on the SoC. In addition
|
||||
to the PLL itself, this controller also contains bypasses, gates, dividers,
|
||||
an multiplexers for various clock signals.
|
||||
|
||||
Required properties:
|
||||
- compatible: shall be one of:
|
||||
- "ti,da850-pll0" for PLL0 on DA850/OMAP-L138/AM18XX
|
||||
- "ti,da850-pll1" for PLL1 on DA850/OMAP-L138/AM18XX
|
||||
- reg: physical base address and size of the controller's register area.
|
||||
- clocks: phandles corresponding to the clock names
|
||||
- clock-names: names of the clock sources - depends on compatible string
|
||||
- for "ti,da850-pll0", shall be "clksrc", "extclksrc"
|
||||
- for "ti,da850-pll1", shall be "clksrc"
|
||||
|
||||
Optional properties:
|
||||
- ti,clkmode-square-wave: Indicates that the the board is supplying a square
|
||||
wave input on the OSCIN pin instead of using a crystal oscillator.
|
||||
This property is only valid when compatible = "ti,da850-pll0".
|
||||
|
||||
|
||||
Optional child nodes:
|
||||
|
||||
pllout
|
||||
Describes the main PLL clock output (before POSTDIV). The node name must
|
||||
be "pllout".
|
||||
|
||||
Required properties:
|
||||
- #clock-cells: shall be 0
|
||||
|
||||
sysclk
|
||||
Describes the PLLDIVn divider clocks that provide the SYSCLKn clock
|
||||
domains. The node name must be "sysclk". Consumers of this node should
|
||||
use "n" in "SYSCLKn" as the index parameter for the clock cell.
|
||||
|
||||
Required properties:
|
||||
- #clock-cells: shall be 1
|
||||
|
||||
auxclk
|
||||
Describes the AUXCLK output of the PLL. The node name must be "auxclk".
|
||||
This child node is only valid when compatible = "ti,da850-pll0".
|
||||
|
||||
Required properties:
|
||||
- #clock-cells: shall be 0
|
||||
|
||||
obsclk
|
||||
Describes the OBSCLK output of the PLL. The node name must be "obsclk".
|
||||
|
||||
Required properties:
|
||||
- #clock-cells: shall be 0
|
||||
|
||||
|
||||
Examples:
|
||||
|
||||
pll0: clock-controller@11000 {
|
||||
compatible = "ti,da850-pll0";
|
||||
reg = <0x11000 0x1000>;
|
||||
clocks = <&ref_clk>, <&pll1_sysclk 3>;
|
||||
clock-names = "clksrc", "extclksrc";
|
||||
ti,clkmode-square-wave;
|
||||
|
||||
pll0_pllout: pllout {
|
||||
#clock-cells = <0>;
|
||||
};
|
||||
|
||||
pll0_sysclk: sysclk {
|
||||
#clock-cells = <1>;
|
||||
};
|
||||
|
||||
pll0_auxclk: auxclk {
|
||||
#clock-cells = <0>;
|
||||
};
|
||||
|
||||
pll0_obsclk: obsclk {
|
||||
#clock-cells = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
pll1: clock-controller@21a000 {
|
||||
compatible = "ti,da850-pll1";
|
||||
reg = <0x21a000 0x1000>;
|
||||
clocks = <&ref_clk>;
|
||||
clock-names = "clksrc";
|
||||
|
||||
pll0_sysclk: sysclk {
|
||||
#clock-cells = <1>;
|
||||
};
|
||||
|
||||
pll0_obsclk: obsclk {
|
||||
#clock-cells = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
Also see:
|
||||
- Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||
71
Documentation/devicetree/bindings/clock/ti/davinci/psc.txt
Normal file
71
Documentation/devicetree/bindings/clock/ti/davinci/psc.txt
Normal file
@@ -0,0 +1,71 @@
|
||||
Binding for TI DaVinci Power Sleep Controller (PSC)
|
||||
|
||||
The PSC provides power management, clock gating and reset functionality. It is
|
||||
primarily used for clocking.
|
||||
|
||||
Required properties:
|
||||
- compatible: shall be one of:
|
||||
- "ti,da850-psc0" for PSC0 on DA850/OMAP-L138/AM18XX
|
||||
- "ti,da850-psc1" for PSC1 on DA850/OMAP-L138/AM18XX
|
||||
- reg: physical base address and size of the controller's register area
|
||||
- #clock-cells: from common clock binding; shall be set to 1
|
||||
- #power-domain-cells: from generic power domain binding; shall be set to 1.
|
||||
- clocks: phandles to clocks corresponding to the clock-names property
|
||||
- clock-names: list of parent clock names - depends on compatible value
|
||||
- for "ti,da850-psc0", shall be "pll0_sysclk1", "pll0_sysclk2",
|
||||
"pll0_sysclk4", "pll0_sysclk6", "async1"
|
||||
- for "ti,da850-psc1", shall be "pll0_sysclk2", "pll0_sysclk4", "async3"
|
||||
|
||||
Optional properties:
|
||||
- #reset-cells: from reset binding; shall be set to 1 - only applicable when
|
||||
at least one local domain provides a local reset.
|
||||
|
||||
Consumers:
|
||||
|
||||
Clock, power domain and reset consumers shall use the local power domain
|
||||
module ID (LPSC) as the index corresponding to the clock cell. Refer to
|
||||
the device-specific datasheet to find these numbers. NB: Most local
|
||||
domains only provide a clock/power domain and not a reset.
|
||||
|
||||
Examples:
|
||||
|
||||
psc0: clock-controller@10000 {
|
||||
compatible = "ti,da850-psc0";
|
||||
reg = <0x10000 0x1000>;
|
||||
#clock-cells = <1>;
|
||||
#power-domain-cells = <1>;
|
||||
#reset-cells = <1>;
|
||||
clocks = <&pll0_sysclk 1>, <&pll0_sysclk 2>,
|
||||
<&pll0_sysclk 4>, <&pll0_sysclk 6>, <&async1_clk>;
|
||||
clock_names = "pll0_sysclk1", "pll0_sysclk2",
|
||||
"pll0_sysclk4", "pll0_sysclk6", "async1";
|
||||
};
|
||||
psc1: clock-controller@227000 {
|
||||
compatible = "ti,da850-psc1";
|
||||
reg = <0x227000 0x1000>;
|
||||
#clock-cells = <1>;
|
||||
#power-domain-cells = <1>;
|
||||
clocks = <&pll0_sysclk 2>, <&pll0_sysclk 4>, <&async3_clk>;
|
||||
clock_names = "pll0_sysclk2", "pll0_sysclk4", "async3";
|
||||
};
|
||||
|
||||
/* consumer */
|
||||
dsp: dsp@11800000 {
|
||||
compatible = "ti,da850-dsp";
|
||||
reg = <0x11800000 0x40000>,
|
||||
<0x11e00000 0x8000>,
|
||||
<0x11f00000 0x8000>,
|
||||
<0x01c14044 0x4>,
|
||||
<0x01c14174 0x8>;
|
||||
reg-names = "l2sram", "l1pram", "l1dram", "host1cfg", "chipsig";
|
||||
interrupt-parent = <&intc>;
|
||||
interrupts = <28>;
|
||||
clocks = <&psc0 15>;
|
||||
power-domains = <&psc0 15>;
|
||||
resets = <&psc0 15>;
|
||||
};
|
||||
|
||||
Also see:
|
||||
- Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||
- Documentation/devicetree/bindings/power/power_domain.txt
|
||||
- Documentation/devicetree/bindings/reset/reset.txt
|
||||
@@ -75,6 +75,9 @@ Optional properties:
|
||||
- ti,invert-autoidle-bit : autoidle is enabled by setting the bit to 0,
|
||||
see [2]
|
||||
- ti,set-rate-parent : clk_set_rate is propagated to parent
|
||||
- ti,latch-bit : latch the divider value to HW, only needed if the register
|
||||
access requires this. As an example dra76x DPLL_GMAC H14 divider implements
|
||||
such behavior.
|
||||
|
||||
Examples:
|
||||
dpll_usb_m2_ck: dpll_usb_m2_ck@4a008190 {
|
||||
|
||||
@@ -48,6 +48,9 @@ Optional properties:
|
||||
zero
|
||||
- ti,set-rate-parent : clk_set_rate is propagated to parent clock,
|
||||
not supported by the composite-mux-clock subtype
|
||||
- ti,latch-bit : latch the mux value to HW, only needed if the register
|
||||
access requires this. As an example, dra7x DPLL_GMAC H14 muxing
|
||||
implements such behavior.
|
||||
|
||||
Examples:
|
||||
|
||||
|
||||
@@ -12365,6 +12365,7 @@ M: Tomasz Figa <tomasz.figa@gmail.com>
|
||||
M: Chanwoo Choi <cw00.choi@samsung.com>
|
||||
S: Supported
|
||||
L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk.git
|
||||
F: drivers/clk/samsung/
|
||||
F: include/dt-bindings/clock/exynos*.h
|
||||
F: Documentation/devicetree/bindings/clock/exynos*.txt
|
||||
@@ -14001,6 +14002,13 @@ F: arch/arm/mach-davinci/
|
||||
F: drivers/i2c/busses/i2c-davinci.c
|
||||
F: arch/arm/boot/dts/da850*
|
||||
|
||||
TI DAVINCI SERIES CLOCK DRIVER
|
||||
M: David Lechner <david@lechnology.com>
|
||||
R: Sekhar Nori <nsekhar@ti.com>
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/clock/ti/davinci/
|
||||
F: drivers/clk/davinci/
|
||||
|
||||
TI DAVINCI SERIES GPIO DRIVER
|
||||
M: Keerthy <j-keerthy@ti.com>
|
||||
L: linux-gpio@vger.kernel.org
|
||||
|
||||
@@ -55,8 +55,10 @@ config COMMON_CLK_RK808
|
||||
by control register.
|
||||
|
||||
config COMMON_CLK_HI655X
|
||||
tristate "Clock driver for Hi655x"
|
||||
depends on MFD_HI655X_PMIC || COMPILE_TEST
|
||||
tristate "Clock driver for Hi655x" if EXPERT
|
||||
depends on (MFD_HI655X_PMIC || COMPILE_TEST)
|
||||
depends on REGMAP
|
||||
default MFD_HI655X_PMIC
|
||||
---help---
|
||||
This driver supports the hi655x PMIC clock. This
|
||||
multi-function device has one fixed-rate oscillator, clocked
|
||||
@@ -101,6 +103,15 @@ config COMMON_CLK_SI514
|
||||
This driver supports the Silicon Labs 514 programmable clock
|
||||
generator.
|
||||
|
||||
config COMMON_CLK_SI544
|
||||
tristate "Clock driver for SiLabs 544 devices"
|
||||
depends on I2C
|
||||
select REGMAP_I2C
|
||||
help
|
||||
---help---
|
||||
This driver supports the Silicon Labs 544 programmable clock
|
||||
generator.
|
||||
|
||||
config COMMON_CLK_SI570
|
||||
tristate "Clock driver for SiLabs 570 and compatible devices"
|
||||
depends on I2C
|
||||
@@ -248,6 +259,26 @@ config COMMON_CLK_VC5
|
||||
This driver supports the IDT VersaClock 5 and VersaClock 6
|
||||
programmable clock generators.
|
||||
|
||||
config COMMON_CLK_STM32MP157
|
||||
def_bool COMMON_CLK && MACH_STM32MP157
|
||||
help
|
||||
---help---
|
||||
Support for stm32mp157 SoC family clocks
|
||||
|
||||
config COMMON_CLK_STM32F
|
||||
bool "Clock driver for stm32f4 and stm32f7 SoC families"
|
||||
depends on MACH_STM32F429 || MACH_STM32F469 || MACH_STM32F746
|
||||
help
|
||||
---help---
|
||||
Support for stm32f4 and stm32f7 SoC families clocks
|
||||
|
||||
config COMMON_CLK_STM32H7
|
||||
bool "Clock driver for stm32h7 SoC family"
|
||||
depends on MACH_STM32H743
|
||||
help
|
||||
---help---
|
||||
Support for stm32h7 SoC family clocks
|
||||
|
||||
source "drivers/clk/bcm/Kconfig"
|
||||
source "drivers/clk/hisilicon/Kconfig"
|
||||
source "drivers/clk/imgtec/Kconfig"
|
||||
|
||||
@@ -45,9 +45,11 @@ obj-$(CONFIG_COMMON_CLK_SCMI) += clk-scmi.o
|
||||
obj-$(CONFIG_COMMON_CLK_SCPI) += clk-scpi.o
|
||||
obj-$(CONFIG_COMMON_CLK_SI5351) += clk-si5351.o
|
||||
obj-$(CONFIG_COMMON_CLK_SI514) += clk-si514.o
|
||||
obj-$(CONFIG_COMMON_CLK_SI544) += clk-si544.o
|
||||
obj-$(CONFIG_COMMON_CLK_SI570) += clk-si570.o
|
||||
obj-$(CONFIG_ARCH_STM32) += clk-stm32f4.o
|
||||
obj-$(CONFIG_ARCH_STM32) += clk-stm32h7.o
|
||||
obj-$(CONFIG_COMMON_CLK_STM32F) += clk-stm32f4.o
|
||||
obj-$(CONFIG_COMMON_CLK_STM32H7) += clk-stm32h7.o
|
||||
obj-$(CONFIG_COMMON_CLK_STM32MP157) += clk-stm32mp1.o
|
||||
obj-$(CONFIG_ARCH_TANGO) += clk-tango4.o
|
||||
obj-$(CONFIG_CLK_TWL6040) += clk-twl6040.o
|
||||
obj-$(CONFIG_ARCH_U300) += clk-u300.o
|
||||
@@ -62,6 +64,7 @@ obj-$(CONFIG_ARCH_ARTPEC) += axis/
|
||||
obj-$(CONFIG_ARC_PLAT_AXS10X) += axs10x/
|
||||
obj-y += bcm/
|
||||
obj-$(CONFIG_ARCH_BERLIN) += berlin/
|
||||
obj-$(CONFIG_ARCH_DAVINCI) += davinci/
|
||||
obj-$(CONFIG_H8300) += h8300/
|
||||
obj-$(CONFIG_ARCH_HISI) += hisilicon/
|
||||
obj-y += imgtec/
|
||||
@@ -89,6 +92,7 @@ obj-$(CONFIG_ARCH_SOCFPGA) += socfpga/
|
||||
obj-$(CONFIG_PLAT_SPEAR) += spear/
|
||||
obj-$(CONFIG_ARCH_SPRD) += sprd/
|
||||
obj-$(CONFIG_ARCH_STI) += st/
|
||||
obj-$(CONFIG_ARCH_STRATIX10) += socfpga/
|
||||
obj-$(CONFIG_ARCH_SUNXI) += sunxi/
|
||||
obj-$(CONFIG_ARCH_SUNXI) += sunxi-ng/
|
||||
obj-$(CONFIG_ARCH_TEGRA) += tegra/
|
||||
|
||||
@@ -602,9 +602,7 @@ static void bcm2835_pll_off(struct clk_hw *hw)
|
||||
const struct bcm2835_pll_data *data = pll->data;
|
||||
|
||||
spin_lock(&cprman->regs_lock);
|
||||
cprman_write(cprman, data->cm_ctrl_reg,
|
||||
cprman_read(cprman, data->cm_ctrl_reg) |
|
||||
CM_PLL_ANARST);
|
||||
cprman_write(cprman, data->cm_ctrl_reg, CM_PLL_ANARST);
|
||||
cprman_write(cprman, data->a2w_ctrl_reg,
|
||||
cprman_read(cprman, data->a2w_ctrl_reg) |
|
||||
A2W_PLL_CTRL_PWRDN);
|
||||
@@ -640,6 +638,10 @@ static int bcm2835_pll_on(struct clk_hw *hw)
|
||||
cpu_relax();
|
||||
}
|
||||
|
||||
cprman_write(cprman, data->a2w_ctrl_reg,
|
||||
cprman_read(cprman, data->a2w_ctrl_reg) |
|
||||
A2W_PLL_CTRL_PRST_DISABLE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -549,7 +549,7 @@ static int cs2000_resume(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops cs2000_pm_ops = {
|
||||
.resume_early = cs2000_resume,
|
||||
SET_LATE_SYSTEM_SLEEP_PM_OPS(NULL, cs2000_resume)
|
||||
};
|
||||
|
||||
static struct i2c_driver cs2000_driver = {
|
||||
|
||||
@@ -28,12 +28,10 @@
|
||||
* parent - fixed parent. No clk_set_parent support
|
||||
*/
|
||||
|
||||
#define div_mask(width) ((1 << (width)) - 1)
|
||||
|
||||
static unsigned int _get_table_maxdiv(const struct clk_div_table *table,
|
||||
u8 width)
|
||||
{
|
||||
unsigned int maxdiv = 0, mask = div_mask(width);
|
||||
unsigned int maxdiv = 0, mask = clk_div_mask(width);
|
||||
const struct clk_div_table *clkt;
|
||||
|
||||
for (clkt = table; clkt->div; clkt++)
|
||||
@@ -57,12 +55,12 @@ static unsigned int _get_maxdiv(const struct clk_div_table *table, u8 width,
|
||||
unsigned long flags)
|
||||
{
|
||||
if (flags & CLK_DIVIDER_ONE_BASED)
|
||||
return div_mask(width);
|
||||
return clk_div_mask(width);
|
||||
if (flags & CLK_DIVIDER_POWER_OF_TWO)
|
||||
return 1 << div_mask(width);
|
||||
return 1 << clk_div_mask(width);
|
||||
if (table)
|
||||
return _get_table_maxdiv(table, width);
|
||||
return div_mask(width) + 1;
|
||||
return clk_div_mask(width) + 1;
|
||||
}
|
||||
|
||||
static unsigned int _get_table_div(const struct clk_div_table *table,
|
||||
@@ -84,7 +82,7 @@ static unsigned int _get_div(const struct clk_div_table *table,
|
||||
if (flags & CLK_DIVIDER_POWER_OF_TWO)
|
||||
return 1 << val;
|
||||
if (flags & CLK_DIVIDER_MAX_AT_ZERO)
|
||||
return val ? val : div_mask(width) + 1;
|
||||
return val ? val : clk_div_mask(width) + 1;
|
||||
if (table)
|
||||
return _get_table_div(table, val);
|
||||
return val + 1;
|
||||
@@ -109,7 +107,7 @@ static unsigned int _get_val(const struct clk_div_table *table,
|
||||
if (flags & CLK_DIVIDER_POWER_OF_TWO)
|
||||
return __ffs(div);
|
||||
if (flags & CLK_DIVIDER_MAX_AT_ZERO)
|
||||
return (div == div_mask(width) + 1) ? 0 : div;
|
||||
return (div == clk_div_mask(width) + 1) ? 0 : div;
|
||||
if (table)
|
||||
return _get_table_val(table, div);
|
||||
return div - 1;
|
||||
@@ -141,7 +139,7 @@ static unsigned long clk_divider_recalc_rate(struct clk_hw *hw,
|
||||
unsigned int val;
|
||||
|
||||
val = clk_readl(divider->reg) >> divider->shift;
|
||||
val &= div_mask(divider->width);
|
||||
val &= clk_div_mask(divider->width);
|
||||
|
||||
return divider_recalc_rate(hw, parent_rate, val, divider->table,
|
||||
divider->flags, divider->width);
|
||||
@@ -344,19 +342,43 @@ long divider_round_rate_parent(struct clk_hw *hw, struct clk_hw *parent,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(divider_round_rate_parent);
|
||||
|
||||
long divider_ro_round_rate_parent(struct clk_hw *hw, struct clk_hw *parent,
|
||||
unsigned long rate, unsigned long *prate,
|
||||
const struct clk_div_table *table, u8 width,
|
||||
unsigned long flags, unsigned int val)
|
||||
{
|
||||
int div;
|
||||
|
||||
div = _get_div(table, val, flags, width);
|
||||
|
||||
/* Even a read-only clock can propagate a rate change */
|
||||
if (clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) {
|
||||
if (!parent)
|
||||
return -EINVAL;
|
||||
|
||||
*prate = clk_hw_round_rate(parent, rate * div);
|
||||
}
|
||||
|
||||
return DIV_ROUND_UP_ULL((u64)*prate, div);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(divider_ro_round_rate_parent);
|
||||
|
||||
|
||||
static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long *prate)
|
||||
{
|
||||
struct clk_divider *divider = to_clk_divider(hw);
|
||||
int bestdiv;
|
||||
|
||||
/* if read only, just return current value */
|
||||
if (divider->flags & CLK_DIVIDER_READ_ONLY) {
|
||||
bestdiv = clk_readl(divider->reg) >> divider->shift;
|
||||
bestdiv &= div_mask(divider->width);
|
||||
bestdiv = _get_div(divider->table, bestdiv, divider->flags,
|
||||
divider->width);
|
||||
return DIV_ROUND_UP_ULL((u64)*prate, bestdiv);
|
||||
u32 val;
|
||||
|
||||
val = clk_readl(divider->reg) >> divider->shift;
|
||||
val &= clk_div_mask(divider->width);
|
||||
|
||||
return divider_ro_round_rate(hw, rate, prate, divider->table,
|
||||
divider->width, divider->flags,
|
||||
val);
|
||||
}
|
||||
|
||||
return divider_round_rate(hw, rate, prate, divider->table,
|
||||
@@ -376,7 +398,7 @@ int divider_get_val(unsigned long rate, unsigned long parent_rate,
|
||||
|
||||
value = _get_val(table, div, flags, width);
|
||||
|
||||
return min_t(unsigned int, value, div_mask(width));
|
||||
return min_t(unsigned int, value, clk_div_mask(width));
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(divider_get_val);
|
||||
|
||||
@@ -399,10 +421,10 @@ static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
|
||||
__acquire(divider->lock);
|
||||
|
||||
if (divider->flags & CLK_DIVIDER_HIWORD_MASK) {
|
||||
val = div_mask(divider->width) << (divider->shift + 16);
|
||||
val = clk_div_mask(divider->width) << (divider->shift + 16);
|
||||
} else {
|
||||
val = clk_readl(divider->reg);
|
||||
val &= ~(div_mask(divider->width) << divider->shift);
|
||||
val &= ~(clk_div_mask(divider->width) << divider->shift);
|
||||
}
|
||||
val |= (u32)value << divider->shift;
|
||||
clk_writel(val, divider->reg);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user