Commit b1511f7a authored by Stephen Boyd's avatar Stephen Boyd
Browse files

Merge branches 'clk-bcm63xx', 'clk-silabs', 'clk-lochnagar' and 'clk-rockchip' into clk-next

 - Support gated clk controller on MIPS based BCM63XX SoCs
 - Small frequency support for SiLabs Si544 chips
 - Support SiLabs Si5341 and Si5340 chips

* clk-bcm63xx:
  clk: add BCM63XX gated clock controller driver
  devicetree: document the BCM63XX gated clock bindings

* clk-silabs:
  clk: Add Si5341/Si5340 driver
  dt-bindings: clock: Add silabs,si5341
  clk: clk-si544: Implement small frequency change support

* clk-lochnagar:
  clk: lochnagar: Update DT binding doc to include the primary SPDIF MCLK
  clk: lochnagar: Use new parent_data approach to register clock parents

* clk-rockchip:
  clk: rockchip: export HDMIPHY clock on rk3228
  clk: rockchip: add watchdog pclk on rk3328
  clk: rockchip: add clock id for hdmi_phy special clock on rk3228
  clk: rockchip: add clock id for watchdog pclk on rk3328
  clk: rockchip: convert pclk_wdt boilerplat to new SGRF_GATE macro
  clk: rockchip: add a type from SGRF-controlled gate clocks
  clk: rockchip: Remove 48 MHz PLL rate from rk3288
  clk: rockchip: add 1.464GHz cpu-clock rate to rk3228
  clk: rockchip: Slightly more accurate math in rockchip_mmc_get_phase()
  clk: rockchip: Don't yell about bad mmc phases when getting
  clk: rockchip: Use clk_hw_get_rate() in MMC phase calculation
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
Gated Clock Controller Bindings for MIPS based BCM63XX SoCs

Required properties:
- compatible: must be one of:
	 "brcm,bcm3368-clocks"
	 "brcm,bcm6328-clocks"
	 "brcm,bcm6358-clocks"
	 "brcm,bcm6362-clocks"
	 "brcm,bcm6368-clocks"
	 "brcm,bcm63268-clocks"

- reg: Address and length of the register set
- #clock-cells: must be <1>


Example:

clkctl: clock-controller@10000004 {
	compatible = "brcm,bcm6328-clocks";
	reg = <0x10000004 0x4>;
	#clock-cells = <1>;
};
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ Optional properties:
       input audio clocks from host system.
     - ln-psia1-mclk, ln-psia2-mclk : Optional input audio clocks from
       external connector.
     - ln-spdif-mclk : Optional input audio clock from SPDIF.
     - ln-spdif-clkout : Optional input audio clock from SPDIF.
     - ln-adat-mclk : Optional input audio clock from ADAT.
     - ln-pmic-32k : On board fixed clock.
+162 −0
Original line number Diff line number Diff line
Binding for Silicon Labs Si5341 and Si5340 programmable i2c clock generator.

Reference
[1] Si5341 Data Sheet
    https://www.silabs.com/documents/public/data-sheets/Si5341-40-D-DataSheet.pdf
[2] Si5341 Reference Manual
    https://www.silabs.com/documents/public/reference-manuals/Si5341-40-D-RM.pdf

The Si5341 and Si5340 are programmable i2c clock generators with up to 10 output
clocks. The chip contains a PLL that sources 5 (or 4) multisynth clocks, which
in turn can be directed to any of the 10 (or 4) outputs through a divider.
The internal structure of the clock generators can be found in [2].

The driver can be used in "as is" mode, reading the current settings from the
chip at boot, in case you have a (pre-)programmed device. If the PLL is not
configured when the driver probes, it assumes the driver must fully initialize
it.

The device type, speed grade and revision are determined runtime by probing.

The driver currently only supports XTAL input mode, and does not support any
fancy input configurations. They can still be programmed into the chip and
the driver will leave them "as is".

==I2C device node==

Required properties:
- compatible: shall be one of the following:
	"silabs,si5340" - Si5340 A/B/C/D
	"silabs,si5341" - Si5341 A/B/C/D
- reg: i2c device address, usually 0x74
- #clock-cells: from common clock binding; shall be set to 2.
	The first value is "0" for outputs, "1" for synthesizers.
	The second value is the output or synthesizer index.
- clocks: from common clock binding; list of parent clock  handles,
	corresponding to inputs. Use a fixed clock for the "xtal" input.
	At least one must be present.
- clock-names: One of: "xtal", "in0", "in1", "in2"
- vdd-supply: Regulator node for VDD

Optional properties:
- vdda-supply: Regulator node for VDDA
- vdds-supply: Regulator node for VDDS
- silabs,pll-m-num, silabs,pll-m-den: Numerator and denominator for PLL
  feedback divider. Must be such that the PLL output is in the valid range. For
  example, to create 14GHz from a 48MHz xtal, use m-num=14000 and m-den=48. Only
  the fraction matters, using 3500 and 12 will deliver the exact same result.
  If these are not specified, and the PLL is not yet programmed when the driver
  probes, the PLL will be set to 14GHz.
- silabs,reprogram: When present, the driver will always assume the device must
  be initialized, and always performs the soft-reset routine. Since this will
  temporarily stop all output clocks, don't do this if the chip is generating
  the CPU clock for example.
- interrupts: Interrupt for INTRb pin.
- #address-cells: shall be set to 1.
- #size-cells: shall be set to 0.


== Child nodes: Outputs ==

The child nodes list the output clocks.

Each of the clock outputs can be overwritten individually by using a child node.
If a child node for a clock output is not set, the configuration remains
unchanged.

Required child node properties:
- reg: number of clock output.

Optional child node properties:
- vdd-supply: Regulator node for VDD for this output. The driver selects default
	values for common-mode and amplitude based on the voltage.
- silabs,format: Output format, one of:
	1 = differential (defaults to LVDS levels)
	2 = low-power (defaults to HCSL levels)
	4 = LVCMOS
- silabs,common-mode: Manually override output common mode, see [2] for values
- silabs,amplitude: Manually override output amplitude, see [2] for values
- silabs,synth-master: boolean. If present, this output is allowed to change the
	multisynth frequency dynamically.
- silabs,silabs,disable-high: boolean. If set, the clock output is driven HIGH
	when disabled, otherwise it's driven LOW.

==Example==

/* 48MHz reference crystal */
ref48: ref48M {
	compatible = "fixed-clock";
	#clock-cells = <0>;
	clock-frequency = <48000000>;
};

i2c-master-node {
	/* Programmable clock (for logic) */
	si5341: clock-generator@74 {
		reg = <0x74>;
		compatible = "silabs,si5341";
		#clock-cells = <2>;
		#address-cells = <1>;
		#size-cells = <0>;
		clocks = <&ref48>;
		clock-names = "xtal";

		silabs,pll-m-num = <14000>; /* PLL at 14.0 GHz */
		silabs,pll-m-den = <48>;
		silabs,reprogram; /* Chips are not programmed, always reset */

		out@0 {
			reg = <0>;
			silabs,format = <1>; /* LVDS 3v3 */
			silabs,common-mode = <3>;
			silabs,amplitude = <3>;
			silabs,synth-master;
		};

		/*
		 * Output 6 configuration:
		 *  LVDS 1v8
		 */
		out@6 {
			reg = <6>;
			silabs,format = <1>; /* LVDS 1v8 */
			silabs,common-mode = <13>;
			silabs,amplitude = <3>;
		};

		/*
		 * Output 8 configuration:
		 *  HCSL 3v3
		 */
		out@8 {
			reg = <8>;
			silabs,format = <2>;
			silabs,common-mode = <11>;
			silabs,amplitude = <3>;
		};
	};
};

some-video-node {
	/* Standard clock bindings */
	clock-names = "pixel";
	clocks = <&si5341 0 7>; /* Output 7 */

	/* Set output 7 to use syntesizer 3 as its parent */
	assigned-clocks = <&si5341 0 7>, <&si5341 1 3>;
	assigned-clock-parents = <&si5341 1 3>;
	/* Set output 7 to 148.5 MHz using a synth frequency of 594 MHz */
	assigned-clock-rates = <148500000>, <594000000>;
};

some-audio-node {
	clock-names = "i2s-clk";
	clocks = <&si5341 0 0>;
	/*
	 * since output 0 is a synth-master, the synth will be automatically set
	 * to an appropriate frequency when the audio driver requests another
	 * frequency. We give control over synth 2 to this output here.
	 */
	assigned-clocks = <&si5341 0 0>;
	assigned-clock-parents = <&si5341 1 2>;
};
+11 −0
Original line number Diff line number Diff line
@@ -91,6 +91,17 @@ config COMMON_CLK_SCPI
	  This driver uses SCPI Message Protocol to interact with the
	  firmware providing all the clock controls.

config COMMON_CLK_SI5341
	tristate "Clock driver for SiLabs 5341 and 5340 A/B/C/D devices"
	depends on I2C
	select REGMAP_I2C
	help
	  This driver supports Silicon Labs Si5341 and Si5340 programmable clock
	  generators. Not all features of these chips are currently supported
	  by the driver, in particular it only supports XTAL input. The chip can
	  be pre-programmed to support other configurations and features not yet
	  implemented in the driver.

config COMMON_CLK_SI5351
	tristate "Clock driver for SiLabs 5351A/B/C"
	depends on I2C
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ obj-$(CONFIG_COMMON_CLK_HI655X) += clk-hi655x.o
obj-$(CONFIG_COMMON_CLK_S2MPS11)	+= clk-s2mps11.o
obj-$(CONFIG_COMMON_CLK_SCMI)           += clk-scmi.o
obj-$(CONFIG_COMMON_CLK_SCPI)           += clk-scpi.o
obj-$(CONFIG_COMMON_CLK_SI5341)		+= clk-si5341.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
Loading