Skip to content

Commit

Permalink
Merge tag 'clk-for-linus-3.12' of git://git.linaro.org/people/mturque…
Browse files Browse the repository at this point in the history
…tte/linux

Pull clock framework changes from Michael Turquette:
 "The common clk framework changes for 3.12 are dominated by clock
  driver patches, both new drivers and fixes to existing.  A high
  percentage of these are for Samsung platforms like Exynos.  Core
  framework fixes and some new features like automagical clock
  re-parenting round out the patches"

* tag 'clk-for-linus-3.12' of git://git.linaro.org/people/mturquette/linux: (102 commits)
  clk: only call get_parent if there is one
  clk: samsung: exynos5250: Simplify registration of PLL rate tables
  clk: samsung: exynos4: Register PLL rate tables for Exynos4x12
  clk: samsung: exynos4: Register PLL rate tables for Exynos4210
  clk: samsung: exynos4: Reorder registration of mout_vpllsrc
  clk: samsung: pll: Add support for rate configuration of PLL46xx
  clk: samsung: pll: Use new registration method for PLL46xx
  clk: samsung: pll: Add support for rate configuration of PLL45xx
  clk: samsung: pll: Use new registration method for PLL45xx
  clk: samsung: exynos4: Rename exynos4_plls to exynos4x12_plls
  clk: samsung: exynos4: Remove checks for DT node
  clk: samsung: exynos4: Remove unused static clkdev aliases
  clk: samsung: Modify _get_rate() helper to use __clk_lookup()
  clk: samsung: exynos4: Use separate aliases for cpufreq related clocks
  clocksource: samsung_pwm_timer: Get clock from device tree
  ARM: dts: exynos4: Specify PWM clocks in PWM node
  pwm: samsung: Update DT bindings documentation to cover clocks
  clk: Move symbol export to proper location
  clk: fix new_parent dereference before null check
  clk: wm831x: Initialise wm831x pointer on init
  ...
  • Loading branch information
torvalds committed Sep 9, 2013
2 parents 7eb6952 + 12d2988 commit bef4a0a
Show file tree
Hide file tree
Showing 64 changed files with 3,592 additions and 1,098 deletions.
46 changes: 26 additions & 20 deletions Documentation/clk.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ the operations defined in clk.h:
unsigned long parent_rate);
long (*round_rate)(struct clk_hw *hw, unsigned long,
unsigned long *);
long (*determine_rate)(struct clk_hw *hw,
unsigned long rate,
unsigned long *best_parent_rate,
struct clk **best_parent_clk);
int (*set_parent)(struct clk_hw *hw, u8 index);
u8 (*get_parent)(struct clk_hw *hw);
int (*set_rate)(struct clk_hw *hw, unsigned long);
Expand Down Expand Up @@ -179,26 +183,28 @@ mandatory, a cell marked as "n" implies that either including that
callback is invalid or otherwise unnecessary. Empty cells are either
optional or must be evaluated on a case-by-case basis.

clock hardware characteristics
-----------------------------------------------------------
| gate | change rate | single parent | multiplexer | root |
|------|-------------|---------------|-------------|------|
.prepare | | | | | |
.unprepare | | | | | |
| | | | | |
.enable | y | | | | |
.disable | y | | | | |
.is_enabled | y | | | | |
| | | | | |
.recalc_rate | | y | | | |
.round_rate | | y | | | |
.set_rate | | y | | | |
| | | | | |
.set_parent | | | n | y | n |
.get_parent | | | n | y | n |
| | | | | |
.init | | | | | |
-----------------------------------------------------------
clock hardware characteristics
-----------------------------------------------------------
| gate | change rate | single parent | multiplexer | root |
|------|-------------|---------------|-------------|------|
.prepare | | | | | |
.unprepare | | | | | |
| | | | | |
.enable | y | | | | |
.disable | y | | | | |
.is_enabled | y | | | | |
| | | | | |
.recalc_rate | | y | | | |
.round_rate | | y [1] | | | |
.determine_rate | | y [1] | | | |
.set_rate | | y | | | |
| | | | | |
.set_parent | | | n | y | n |
.get_parent | | | n | y | n |
| | | | | |
.init | | | | | |
-----------------------------------------------------------
[1] either one of round_rate or determine_rate is required.

Finally, register your clock at run-time with a hardware-specific
registration function. This function simply populates struct clk_foo's
Expand Down
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/clock/exynos4-clock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ Exynos4 SoC and this is specified where applicable.
spi0_isp_sclk 380 Exynos4x12
spi1_isp_sclk 381 Exynos4x12
uart_isp_sclk 382 Exynos4x12
tmu_apbif 383

[Mux Clocks]

Expand Down
14 changes: 13 additions & 1 deletion Documentation/devicetree/bindings/clock/exynos5250-clock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ clock which they consume.
sclk_spi0 154
sclk_spi1 155
sclk_spi2 156
div_i2s1 157
div_i2s2 158
sclk_hdmiphy 159


[Peripheral Clock Gates]
Expand Down Expand Up @@ -154,7 +157,16 @@ clock which they consume.
dsim0 341
dp 342
mixer 343
hdmi 345
hdmi 344
g2d 345


[Clock Muxes]

Clock ID
----------------------------
mout_hdmi 1024


Example 1: An example of a clock controller node is listed below.

Expand Down
12 changes: 12 additions & 0 deletions Documentation/devicetree/bindings/clock/exynos5420-clock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ clock which they consume.
sclk_pwm 155
sclk_gscl_wa 156
sclk_gscl_wb 157
sclk_hdmiphy 158

[Peripheral Clock Gates]

Expand Down Expand Up @@ -179,6 +180,17 @@ clock which they consume.
fimc_lite3 495
aclk_g3d 500
g3d 501
smmu_mixer 502

Mux ID
----------------------------

mout_hdmi 640

Divider ID
----------------------------

dout_pixel 768

Example 1: An example of a clock controller node is listed below.

Expand Down
77 changes: 77 additions & 0 deletions Documentation/devicetree/bindings/clock/samsung,s3c64xx-clock.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
* Samsung S3C64xx Clock Controller

The S3C64xx clock controller generates and supplies clock to various controllers
within the SoC. The clock binding described here is applicable to all SoCs in
the S3C64xx family.

Required Properties:

- compatible: should be one of the following.
- "samsung,s3c6400-clock" - controller compatible with S3C6400 SoC.
- "samsung,s3c6410-clock" - controller compatible with S3C6410 SoC.

- reg: physical base address of the controller and length of memory mapped
region.

- #clock-cells: should be 1.

Each clock is assigned an identifier and client nodes can use this identifier
to specify the clock which they consume. Some of the clocks are available only
on a particular S3C64xx SoC and this is specified where applicable.

All available clocks are defined as preprocessor macros in
dt-bindings/clock/samsung,s3c64xx-clock.h header and can be used in device
tree sources.

External clocks:

There are several clocks that are generated outside the SoC. It is expected
that they are defined using standard clock bindings with following
clock-output-names:
- "fin_pll" - PLL input clock (xtal/extclk) - required,
- "xusbxti" - USB xtal - required,
- "iiscdclk0" - I2S0 codec clock - optional,
- "iiscdclk1" - I2S1 codec clock - optional,
- "iiscdclk2" - I2S2 codec clock - optional,
- "pcmcdclk0" - PCM0 codec clock - optional,
- "pcmcdclk1" - PCM1 codec clock - optional, only S3C6410.

Example: Clock controller node:

clock: clock-controller@7e00f000 {
compatible = "samsung,s3c6410-clock";
reg = <0x7e00f000 0x1000>;
#clock-cells = <1>;
};

Example: Required external clocks:

fin_pll: clock-fin-pll {
compatible = "fixed-clock";
clock-output-names = "fin_pll";
clock-frequency = <12000000>;
#clock-cells = <0>;
};

xusbxti: clock-xusbxti {
compatible = "fixed-clock";
clock-output-names = "xusbxti";
clock-frequency = <48000000>;
#clock-cells = <0>;
};

Example: UART controller node that consumes the clock generated by the clock
controller (refer to the standard clock bindings for information about
"clocks" and "clock-names" properties):

uart0: serial@7f005000 {
compatible = "samsung,s3c6400-uart";
reg = <0x7f005000 0x100>;
interrupt-parent = <&vic1>;
interrupts = <5>;
clock-names = "uart", "clk_uart_baud2",
"clk_uart_baud3";
clocks = <&clock PCLK_UART0>, <&clocks PCLK_UART0>,
<&clock SCLK_UART>;
status = "disabled";
};
12 changes: 12 additions & 0 deletions Documentation/devicetree/bindings/clock/sunxi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,31 @@ Required properties:
- compatible : shall be one of the following:
"allwinner,sun4i-osc-clk" - for a gatable oscillator
"allwinner,sun4i-pll1-clk" - for the main PLL clock
"allwinner,sun6i-a31-pll1-clk" - for the main PLL clock on A31
"allwinner,sun4i-cpu-clk" - for the CPU multiplexer clock
"allwinner,sun4i-axi-clk" - for the AXI clock
"allwinner,sun4i-axi-gates-clk" - for the AXI gates
"allwinner,sun4i-ahb-clk" - for the AHB clock
"allwinner,sun4i-ahb-gates-clk" - for the AHB gates on A10
"allwinner,sun5i-a13-ahb-gates-clk" - for the AHB gates on A13
"allwinner,sun5i-a10s-ahb-gates-clk" - for the AHB gates on A10s
"allwinner,sun7i-a20-ahb-gates-clk" - for the AHB gates on A20
"allwinner,sun6i-a31-ahb1-mux-clk" - for the AHB1 multiplexer on A31
"allwinner,sun6i-a31-ahb1-gates-clk" - for the AHB1 gates on A31
"allwinner,sun4i-apb0-clk" - for the APB0 clock
"allwinner,sun4i-apb0-gates-clk" - for the APB0 gates on A10
"allwinner,sun5i-a13-apb0-gates-clk" - for the APB0 gates on A13
"allwinner,sun5i-a10s-apb0-gates-clk" - for the APB0 gates on A10s
"allwinner,sun7i-a20-apb0-gates-clk" - for the APB0 gates on A20
"allwinner,sun4i-apb1-clk" - for the APB1 clock
"allwinner,sun4i-apb1-mux-clk" - for the APB1 clock muxing
"allwinner,sun4i-apb1-gates-clk" - for the APB1 gates on A10
"allwinner,sun5i-a13-apb1-gates-clk" - for the APB1 gates on A13
"allwinner,sun5i-a10s-apb1-gates-clk" - for the APB1 gates on A10s
"allwinner,sun6i-a31-apb1-gates-clk" - for the APB1 gates on A31
"allwinner,sun7i-a20-apb1-gates-clk" - for the APB1 gates on A20
"allwinner,sun6i-a31-apb2-div-clk" - for the APB2 gates on A31
"allwinner,sun6i-a31-apb2-gates-clk" - for the APB2 gates on A31

Required properties for all clocks:
- reg : shall be the control register address for the clock.
Expand Down
75 changes: 75 additions & 0 deletions Documentation/devicetree/bindings/clock/sunxi/sun5i-a10s-gates.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Gate clock outputs
------------------

* AXI gates ("allwinner,sun4i-axi-gates-clk")

DRAM 0

* AHB gates ("allwinner,sun5i-a10s-ahb-gates-clk")

USB0 0
EHCI0 1
OHCI0 2

SS 5
DMA 6
BIST 7
MMC0 8
MMC1 9
MMC2 10

NAND 13
SDRAM 14

EMAC 17
TS 18

SPI0 20
SPI1 21
SPI2 22

GPS 26

HSTIMER 28

VE 32

TVE 34

LCD 36

CSI 40

HDMI 43
DE_BE 44

DE_FE 46

IEP 51
MALI400 52

* APB0 gates ("allwinner,sun5i-a10s-apb0-gates-clk")

CODEC 0

IIS 3

PIO 5
IR 6

KEYPAD 10

* APB1 gates ("allwinner,sun5i-a10s-apb1-gates-clk")

I2C0 0
I2C1 1
I2C2 2

UART0 16
UART1 17
UART2 18
UART3 19

Notation:
[*]: The datasheet didn't mention these, but they are present on AW code
[**]: The datasheet had this marked as "NC" but they are used on AW code
83 changes: 83 additions & 0 deletions Documentation/devicetree/bindings/clock/sunxi/sun6i-a31-gates.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Gate clock outputs
------------------

* AHB1 gates ("allwinner,sun6i-a31-ahb1-gates-clk")

MIPI DSI 1

SS 5
DMA 6

MMC0 8
MMC1 9
MMC2 10
MMC3 11

NAND1 12
NAND0 13
SDRAM 14

GMAC 17
TS 18
HSTIMER 19
SPI0 20
SPI1 21
SPI2 22
SPI3 23
USB_OTG 24

EHCI0 26
EHCI1 27

OHCI0 29
OHCI1 30
OHCI2 31
VE 32

LCD0 36
LCD1 37

CSI 40

HDMI 43
DE_BE0 44
DE_BE1 45
DE_FE1 46
DE_FE1 47

MP 50

GPU 52

DEU0 55
DEU1 56
DRC0 57
DRC1 58

* APB1 gates ("allwinner,sun6i-a31-apb1-gates-clk")

CODEC 0

DIGITAL MIC 4
PIO 5

DAUDIO0 12
DAUDIO1 13

* APB2 gates ("allwinner,sun6i-a31-apb2-gates-clk")

I2C0 0
I2C1 1
I2C2 2
I2C3 3

UART0 16
UART1 17
UART2 18
UART3 19
UART4 20
UART5 21

Notation:
[*]: The datasheet didn't mention these, but they are present on AW code
[**]: The datasheet had this marked as "NC" but they are used on AW code
Loading

0 comments on commit bef4a0a

Please sign in to comment.