aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-28 21:44:53 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-28 21:44:53 -0500
commitd30492adea3a82e7120bcf60893aaaab711f90a6 (patch)
tree082d1dff4d71ccbd722b5edd47411acad110b636
parentf1499382f114231cbd1e3dee7e656b50ce9d8236 (diff)
parentfd3fdaf09f26cd4f53fd4d7cdfe8e3dbb55a4dda (diff)
Merge tag 'clk-for-linus-3.14-part2' of git://git.linaro.org/people/mike.turquette/linux
Pull more clock framework changes from Mike Turquette: "The second half of the clock framework pull requeust for 3.14 is dominated by platform support for Qualcomm's MSM SoCs, DT binding updates for TI's OMAP-ish processors and additional support for Samsung chips. Additionally there are other smaller clock driver changes and several last minute fixes. This pull request also includes the HiSilicon support that depends on the already-merged arm-soc pull request" [ Fix up stupid compile error in the source tree with evil merge - Grumpy Linus ] * tag 'clk-for-linus-3.14-part2' of git://git.linaro.org/people/mike.turquette/linux: (49 commits) clk: sort Makefile clk: sunxi: fix overflow when setting up divided factors clk: Export more clk-provider functions dt-bindings: qcom: Fix warning with duplicate dt define clk: si5351: remove variant from platform_data clk: samsung: Remove unneeded semicolon clk: qcom: Fix modular build ARM: OMAP3: use DT clock init if DT data is available ARM: AM33xx: remove old clock data and link in new clock init code ARM: AM43xx: Enable clock init ARM: OMAP: DRA7: Enable clock init ARM: OMAP4: remove old clock data and link in new clock init code ARM: OMAP2+: io: use new clock init API ARM: OMAP2+: PRM: add support for initializing PRCM clock modules from DT ARM: OMAP3: hwmod: initialize clkdm from clkdm_name ARM: OMAP: hwmod: fix an incorrect clk type cast with _get_clkdm ARM: OMAP2+: clock: use driver API instead of direct memory read/write ARM: OMAP2+: clock: add support for indexed memmaps ARM: dts: am43xx clock data ARM: dts: AM35xx: use DT clock data ...
-rw-r--r--Documentation/devicetree/bindings/clock/ti/apll.txt31
-rw-r--r--Documentation/devicetree/bindings/clock/ti/autoidle.txt39
-rw-r--r--Documentation/devicetree/bindings/clock/ti/clockdomain.txt24
-rw-r--r--Documentation/devicetree/bindings/clock/ti/composite.txt54
-rw-r--r--Documentation/devicetree/bindings/clock/ti/divider.txt114
-rw-r--r--Documentation/devicetree/bindings/clock/ti/dpll.txt75
-rw-r--r--Documentation/devicetree/bindings/clock/ti/fixed-factor-clock.txt43
-rw-r--r--Documentation/devicetree/bindings/clock/ti/gate.txt85
-rw-r--r--Documentation/devicetree/bindings/clock/ti/interface.txt54
-rw-r--r--Documentation/devicetree/bindings/clock/ti/mux.txt76
-rw-r--r--arch/arm/boot/dts/am33xx-clocks.dtsi664
-rw-r--r--arch/arm/boot/dts/am33xx.dtsi28
-rw-r--r--arch/arm/boot/dts/am3517.dtsi3
-rw-r--r--arch/arm/boot/dts/am35xx-clocks.dtsi128
-rw-r--r--arch/arm/boot/dts/am4372.dtsi28
-rw-r--r--arch/arm/boot/dts/am43xx-clocks.dtsi656
-rw-r--r--arch/arm/boot/dts/dra7.dtsi41
-rw-r--r--arch/arm/boot/dts/dra7xx-clocks.dtsi2015
-rw-r--r--arch/arm/boot/dts/omap3.dtsi41
-rw-r--r--arch/arm/boot/dts/omap3430es1-clocks.dtsi208
-rw-r--r--arch/arm/boot/dts/omap34xx-omap36xx-clocks.dtsi268
-rw-r--r--arch/arm/boot/dts/omap34xx.dtsi4
-rw-r--r--arch/arm/boot/dts/omap36xx-am35xx-omap3430es2plus-clocks.dtsi242
-rw-r--r--arch/arm/boot/dts/omap36xx-clocks.dtsi90
-rw-r--r--arch/arm/boot/dts/omap36xx-omap3430es2plus-clocks.dtsi198
-rw-r--r--arch/arm/boot/dts/omap36xx.dtsi5
-rw-r--r--arch/arm/boot/dts/omap3xxx-clocks.dtsi1660
-rw-r--r--arch/arm/boot/dts/omap4.dtsi54
-rw-r--r--arch/arm/boot/dts/omap443x-clocks.dtsi18
-rw-r--r--arch/arm/boot/dts/omap443x.dtsi2
-rw-r--r--arch/arm/boot/dts/omap4460.dtsi2
-rw-r--r--arch/arm/boot/dts/omap446x-clocks.dtsi27
-rw-r--r--arch/arm/boot/dts/omap44xx-clocks.dtsi1651
-rw-r--r--arch/arm/boot/dts/omap5.dtsi54
-rw-r--r--arch/arm/boot/dts/omap54xx-clocks.dtsi1399
-rw-r--r--arch/arm/mach-omap2/Kconfig18
-rw-r--r--arch/arm/mach-omap2/Makefile7
-rw-r--r--arch/arm/mach-omap2/cclock33xx_data.c1064
-rw-r--r--arch/arm/mach-omap2/cclock44xx_data.c1735
-rw-r--r--arch/arm/mach-omap2/clkt_clksel.c10
-rw-r--r--arch/arm/mach-omap2/clkt_dpll.c6
-rw-r--r--arch/arm/mach-omap2/clkt_iclk.c20
-rw-r--r--arch/arm/mach-omap2/clock.c57
-rw-r--r--arch/arm/mach-omap2/clock.h179
-rw-r--r--arch/arm/mach-omap2/clock36xx.c7
-rw-r--r--arch/arm/mach-omap2/clock3xxx.h3
-rw-r--r--arch/arm/mach-omap2/common.h2
-rw-r--r--arch/arm/mach-omap2/dpll3xxx.c37
-rw-r--r--arch/arm/mach-omap2/dpll44xx.c12
-rw-r--r--arch/arm/mach-omap2/io.c44
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c5
-rw-r--r--arch/arm/mach-omap2/prm.h1
-rw-r--r--arch/arm/mach-omap2/prm_common.c66
-rw-r--r--arch/arm/mach-omap2/timer.c6
-rw-r--r--drivers/clk/Makefile77
-rw-r--r--drivers/clk/clk-si5351.c30
-rw-r--r--drivers/clk/clk-si5351.h14
-rw-r--r--drivers/clk/clk.c11
-rw-r--r--drivers/clk/qcom/Makefile12
-rw-r--r--drivers/clk/samsung/clk-pll.c2
-rw-r--r--drivers/clk/sunxi/clk-sunxi.c2
-rw-r--r--drivers/clk/ti/Makefile11
-rw-r--r--drivers/clk/ti/apll.c223
-rw-r--r--drivers/clk/ti/autoidle.c133
-rw-r--r--drivers/clk/ti/clk-33xx.c161
-rw-r--r--drivers/clk/ti/clk-3xxx.c401
-rw-r--r--drivers/clk/ti/clk-43xx.c118
-rw-r--r--drivers/clk/ti/clk-44xx.c316
-rw-r--r--drivers/clk/ti/clk-54xx.c255
-rw-r--r--drivers/clk/ti/clk-7xx.c332
-rw-r--r--drivers/clk/ti/clk.c167
-rw-r--r--drivers/clk/ti/clockdomain.c70
-rw-r--r--drivers/clk/ti/composite.c269
-rw-r--r--drivers/clk/ti/divider.c487
-rw-r--r--drivers/clk/ti/dpll.c558
-rw-r--r--drivers/clk/ti/fixed-factor.c66
-rw-r--r--drivers/clk/ti/gate.c249
-rw-r--r--drivers/clk/ti/interface.c125
-rw-r--r--drivers/clk/ti/mux.c246
-rw-r--r--include/dt-bindings/clock/qcom,mmcc-msm8974.h2
-rw-r--r--include/linux/clk-provider.h2
-rw-r--r--include/linux/clk/ti.h298
-rw-r--r--include/linux/platform_data/si5351.h16
83 files changed, 14875 insertions, 3138 deletions
diff --git a/Documentation/devicetree/bindings/clock/ti/apll.txt b/Documentation/devicetree/bindings/clock/ti/apll.txt
new file mode 100644
index 000000000000..7faf5a68b3be
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/ti/apll.txt
@@ -0,0 +1,31 @@
1Binding for Texas Instruments APLL clock.
2
3Binding status: Unstable - ABI compatibility may be broken in the future
4
5This binding uses the common clock binding[1]. It assumes a
6register-mapped APLL with usually two selectable input clocks
7(reference clock and bypass clock), with analog phase locked
8loop logic for multiplying the input clock to a desired output
9clock. This clock also typically supports different operation
10modes (locked, low power stop etc.) APLL mostly behaves like
11a subtype of a DPLL [2], although a simplified one at that.
12
13[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
14[2] Documentation/devicetree/bindings/clock/ti/dpll.txt
15
16Required properties:
17- compatible : shall be "ti,dra7-apll-clock"
18- #clock-cells : from common clock binding; shall be set to 0.
19- clocks : link phandles of parent clocks (clk-ref and clk-bypass)
20- reg : address and length of the register set for controlling the APLL.
21 It contains the information of registers in the following order:
22 "control" - contains the control register base address
23 "idlest" - contains the idlest register base address
24
25Examples:
26 apll_pcie_ck: apll_pcie_ck@4a008200 {
27 #clock-cells = <0>;
28 clocks = <&apll_pcie_in_clk_mux>, <&dpll_pcie_ref_ck>;
29 reg = <0x4a00821c 0x4>, <0x4a008220 0x4>;
30 compatible = "ti,dra7-apll-clock";
31 };
diff --git a/Documentation/devicetree/bindings/clock/ti/autoidle.txt b/Documentation/devicetree/bindings/clock/ti/autoidle.txt
new file mode 100644
index 000000000000..7c735dde9fe9
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/ti/autoidle.txt
@@ -0,0 +1,39 @@
1Binding for Texas Instruments autoidle clock.
2
3Binding status: Unstable - ABI compatibility may be broken in the future
4
5This binding uses the common clock binding[1]. It assumes a register mapped
6clock which can be put to idle automatically by hardware based on the usage
7and a configuration bit setting. Autoidle clock is never an individual
8clock, it is always a derivative of some basic clock like a gate, divider,
9or fixed-factor.
10
11[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
12
13Required properties:
14- reg : offset for the register controlling the autoidle
15- ti,autoidle-shift : bit shift of the autoidle enable bit
16- ti,invert-autoidle-bit : autoidle is enabled by setting the bit to 0
17
18Examples:
19 dpll_core_m4_ck: dpll_core_m4_ck {
20 #clock-cells = <0>;
21 compatible = "ti,divider-clock";
22 clocks = <&dpll_core_x2_ck>;
23 ti,max-div = <31>;
24 ti,autoidle-shift = <8>;
25 reg = <0x2d38>;
26 ti,index-starts-at-one;
27 ti,invert-autoidle-bit;
28 };
29
30 dpll_usb_clkdcoldo_ck: dpll_usb_clkdcoldo_ck {
31 #clock-cells = <0>;
32 compatible = "ti,fixed-factor-clock";
33 clocks = <&dpll_usb_ck>;
34 ti,clock-div = <1>;
35 ti,autoidle-shift = <8>;
36 reg = <0x01b4>;
37 ti,clock-mult = <1>;
38 ti,invert-autoidle-bit;
39 };
diff --git a/Documentation/devicetree/bindings/clock/ti/clockdomain.txt b/Documentation/devicetree/bindings/clock/ti/clockdomain.txt
new file mode 100644
index 000000000000..cb76b3f2b341
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/ti/clockdomain.txt
@@ -0,0 +1,24 @@
1Binding for Texas Instruments clockdomain.
2
3Binding status: Unstable - ABI compatibility may be broken in the future
4
5This binding uses the common clock binding[1] in consumer role.
6Every clock on TI SoC belongs to one clockdomain, but software
7only needs this information for specific clocks which require
8their parent clockdomain to be controlled when the clock is
9enabled/disabled. This binding doesn't define a new clock
10binding type, it is used to group existing clock nodes under
11hardware hierarchy.
12
13[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
14
15Required properties:
16- compatible : shall be "ti,clockdomain"
17- #clock-cells : from common clock binding; shall be set to 0.
18- clocks : link phandles of clocks within this domain
19
20Examples:
21 dss_clkdm: dss_clkdm {
22 compatible = "ti,clockdomain";
23 clocks = <&dss1_alwon_fck_3430es2>, <&dss_ick_3430es2>;
24 };
diff --git a/Documentation/devicetree/bindings/clock/ti/composite.txt b/Documentation/devicetree/bindings/clock/ti/composite.txt
new file mode 100644
index 000000000000..5f43c4706b09
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/ti/composite.txt
@@ -0,0 +1,54 @@
1Binding for TI composite clock.
2
3Binding status: Unstable - ABI compatibility may be broken in the future
4
5This binding uses the common clock binding[1]. It assumes a
6register-mapped composite clock with multiple different sub-types;
7
8a multiplexer clock with multiple input clock signals or parents, one
9of which can be selected as output, this behaves exactly as [2]
10
11an adjustable clock rate divider, this behaves exactly as [3]
12
13a gating function which can be used to enable and disable the output
14clock, this behaves exactly as [4]
15
16The binding must provide a list of the component clocks that shall be
17merged to this clock. The component clocks shall be of one of the
18"ti,*composite*-clock" types.
19
20[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
21[2] Documentation/devicetree/bindings/clock/ti/mux.txt
22[3] Documentation/devicetree/bindings/clock/ti/divider.txt
23[4] Documentation/devicetree/bindings/clock/ti/gate.txt
24
25Required properties:
26- compatible : shall be: "ti,composite-clock"
27- clocks : link phandles of component clocks
28- #clock-cells : from common clock binding; shall be set to 0.
29
30Examples:
31
32usb_l4_gate_ick: usb_l4_gate_ick {
33 #clock-cells = <0>;
34 compatible = "ti,composite-interface-clock";
35 clocks = <&l4_ick>;
36 ti,bit-shift = <5>;
37 reg = <0x0a10>;
38};
39
40usb_l4_div_ick: usb_l4_div_ick {
41 #clock-cells = <0>;
42 compatible = "ti,composite-divider-clock";
43 clocks = <&l4_ick>;
44 ti,bit-shift = <4>;
45 ti,max-div = <1>;
46 reg = <0x0a40>;
47 ti,index-starts-at-one;
48};
49
50usb_l4_ick: usb_l4_ick {
51 #clock-cells = <0>;
52 compatible = "ti,composite-clock";
53 clocks = <&usb_l4_gate_ick>, <&usb_l4_div_ick>;
54};
diff --git a/Documentation/devicetree/bindings/clock/ti/divider.txt b/Documentation/devicetree/bindings/clock/ti/divider.txt
new file mode 100644
index 000000000000..35a6f5c7e5c2
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/ti/divider.txt
@@ -0,0 +1,114 @@
1Binding for TI divider clock
2
3Binding status: Unstable - ABI compatibility may be broken in the future
4
5This binding uses the common clock binding[1]. It assumes a
6register-mapped adjustable clock rate divider that does not gate and has
7only one input clock or parent. By default the value programmed into
8the register is one less than the actual divisor value. E.g:
9
10register value actual divisor value
110 1
121 2
132 3
14
15This assumption may be modified by the following optional properties:
16
17ti,index-starts-at-one - valid divisor values start at 1, not the default
18of 0. E.g:
19register value actual divisor value
201 1
212 2
223 3
23
24ti,index-power-of-two - valid divisor values are powers of two. E.g:
25register value actual divisor value
260 1
271 2
282 4
29
30Additionally an array of valid dividers may be supplied like so:
31
32 ti,dividers = <4>, <8>, <0>, <16>;
33
34Which will map the resulting values to a divisor table by their index:
35register value actual divisor value
360 4
371 8
382 <invalid divisor, skipped>
393 16
40
41Any zero value in this array means the corresponding bit-value is invalid
42and must not be used.
43
44The binding must also provide the register to control the divider and
45unless the divider array is provided, min and max dividers. Optionally
46the number of bits to shift that mask, if necessary. If the shift value
47is missing it is the same as supplying a zero shift.
48
49This binding can also optionally provide support to the hardware autoidle
50feature, see [2].
51
52[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
53[2] Documentation/devicetree/bindings/clock/ti/autoidle.txt
54
55Required properties:
56- compatible : shall be "ti,divider-clock" or "ti,composite-divider-clock".
57- #clock-cells : from common clock binding; shall be set to 0.
58- clocks : link to phandle of parent clock
59- reg : offset for register controlling adjustable divider
60
61Optional properties:
62- clock-output-names : from common clock binding.
63- ti,dividers : array of integers defining divisors
64- ti,bit-shift : number of bits to shift the divider value, defaults to 0
65- ti,min-div : min divisor for dividing the input clock rate, only
66 needed if the first divisor is offset from the default value (1)
67- ti,max-div : max divisor for dividing the input clock rate, only needed
68 if ti,dividers is not defined.
69- ti,index-starts-at-one : valid divisor programming starts at 1, not zero,
70 only valid if ti,dividers is not defined.
71- ti,index-power-of-two : valid divisor programming must be a power of two,
72 only valid if ti,dividers is not defined.
73- ti,autoidle-shift : bit shift of the autoidle enable bit for the clock,
74 see [2]
75- ti,invert-autoidle-bit : autoidle is enabled by setting the bit to 0,
76 see [2]
77- ti,set-rate-parent : clk_set_rate is propagated to parent
78
79Examples:
80dpll_usb_m2_ck: dpll_usb_m2_ck@4a008190 {
81 #clock-cells = <0>;
82 compatible = "ti,divider-clock";
83 clocks = <&dpll_usb_ck>;
84 ti,max-div = <127>;
85 reg = <0x190>;
86 ti,index-starts-at-one;
87};
88
89aess_fclk: aess_fclk@4a004528 {
90 #clock-cells = <0>;
91 compatible = "ti,divider-clock";
92 clocks = <&abe_clk>;
93 ti,bit-shift = <24>;
94 reg = <0x528>;
95 ti,max-div = <2>;
96};
97
98dpll_core_m3x2_div_ck: dpll_core_m3x2_div_ck {
99 #clock-cells = <0>;
100 compatible = "ti,composite-divider-clock";
101 clocks = <&dpll_core_x2_ck>;
102 ti,max-div = <31>;
103 reg = <0x0134>;
104 ti,index-starts-at-one;
105};
106
107ssi_ssr_div_fck_3430es2: ssi_ssr_div_fck_3430es2 {
108 #clock-cells = <0>;
109 compatible = "ti,composite-divider-clock";
110 clocks = <&corex2_fck>;
111 ti,bit-shift = <8>;
112 reg = <0x0a40>;
113 ti,dividers = <0>, <1>, <2>, <3>, <4>, <0>, <6>, <0>, <8>;
114};
diff --git a/Documentation/devicetree/bindings/clock/ti/dpll.txt b/Documentation/devicetree/bindings/clock/ti/dpll.txt
new file mode 100644
index 000000000000..30bfdb7c9f18
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/ti/dpll.txt
@@ -0,0 +1,75 @@
1Binding for Texas Instruments DPLL clock.
2
3Binding status: Unstable - ABI compatibility may be broken in the future
4
5This binding uses the common clock binding[1]. It assumes a
6register-mapped DPLL with usually two selectable input clocks
7(reference clock and bypass clock), with digital phase locked
8loop logic for multiplying the input clock to a desired output
9clock. This clock also typically supports different operation
10modes (locked, low power stop etc.) This binding has several
11sub-types, which effectively result in slightly different setup
12for the actual DPLL clock.
13
14[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
15
16Required properties:
17- compatible : shall be one of:
18 "ti,omap3-dpll-clock",
19 "ti,omap3-dpll-core-clock",
20 "ti,omap3-dpll-per-clock",
21 "ti,omap3-dpll-per-j-type-clock",
22 "ti,omap4-dpll-clock",
23 "ti,omap4-dpll-x2-clock",
24 "ti,omap4-dpll-core-clock",
25 "ti,omap4-dpll-m4xen-clock",
26 "ti,omap4-dpll-j-type-clock",
27 "ti,am3-dpll-no-gate-clock",
28 "ti,am3-dpll-j-type-clock",
29 "ti,am3-dpll-no-gate-j-type-clock",
30 "ti,am3-dpll-clock",
31 "ti,am3-dpll-core-clock",
32 "ti,am3-dpll-x2-clock",
33
34- #clock-cells : from common clock binding; shall be set to 0.
35- clocks : link phandles of parent clocks, first entry lists reference clock
36 and second entry bypass clock
37- reg : offsets for the register set for controlling the DPLL.
38 Registers are listed in following order:
39 "control" - contains the control register base address
40 "idlest" - contains the idle status register base address
41 "mult-div1" - contains the multiplier / divider register base address
42 "autoidle" - contains the autoidle register base address (optional)
43 ti,am3-* dpll types do not have autoidle register
44
45Optional properties:
46- DPLL mode setting - defining any one or more of the following overrides
47 default setting.
48 - ti,low-power-stop : DPLL supports low power stop mode, gating output
49 - ti,low-power-bypass : DPLL output matches rate of parent bypass clock
50 - ti,lock : DPLL locks in programmed rate
51
52Examples:
53 dpll_core_ck: dpll_core_ck@44e00490 {
54 #clock-cells = <0>;
55 compatible = "ti,omap4-dpll-core-clock";
56 clocks = <&sys_clkin_ck>, <&sys_clkin_ck>;
57 reg = <0x490>, <0x45c>, <0x488>, <0x468>;
58 };
59
60 dpll2_ck: dpll2_ck@48004004 {
61 #clock-cells = <0>;
62 compatible = "ti,omap3-dpll-clock";
63 clocks = <&sys_ck>, <&dpll2_fck>;
64 ti,low-power-stop;
65 ti,low-power-bypass;
66 ti,lock;
67 reg = <0x4>, <0x24>, <0x34>, <0x40>;
68 };
69
70 dpll_core_ck: dpll_core_ck@44e00490 {
71 #clock-cells = <0>;
72 compatible = "ti,am3-dpll-core-clock";
73 clocks = <&sys_clkin_ck>, <&sys_clkin_ck>;
74 reg = <0x90>, <0x5c>, <0x68>;
75 };
diff --git a/Documentation/devicetree/bindings/clock/ti/fixed-factor-clock.txt b/Documentation/devicetree/bindings/clock/ti/fixed-factor-clock.txt
new file mode 100644
index 000000000000..662b36d53bf0
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/ti/fixed-factor-clock.txt
@@ -0,0 +1,43 @@
1Binding for TI fixed factor rate clock sources.
2
3Binding status: Unstable - ABI compatibility may be broken in the future
4
5This binding uses the common clock binding[1], and also uses the autoidle
6support from TI autoidle clock [2].
7
8[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
9[2] Documentation/devicetree/bindings/clock/ti/autoidle.txt
10
11Required properties:
12- compatible : shall be "ti,fixed-factor-clock".
13- #clock-cells : from common clock binding; shall be set to 0.
14- ti,clock-div: fixed divider.
15- ti,clock-mult: fixed multiplier.
16- clocks: parent clock.
17
18Optional properties:
19- ti,autoidle-shift: bit shift of the autoidle enable bit for the clock,
20 see [2]
21- reg: offset for the autoidle register of this clock, see [2]
22- ti,invert-autoidle-bit: autoidle is enabled by setting the bit to 0, see [2]
23- ti,set-rate-parent: clk_set_rate is propagated to parent
24
25Example:
26 clock {
27 compatible = "ti,fixed-factor-clock";
28 clocks = <&parentclk>;
29 #clock-cells = <0>;
30 ti,clock-div = <2>;
31 ti,clock-mult = <1>;
32 };
33
34 dpll_usb_clkdcoldo_ck: dpll_usb_clkdcoldo_ck {
35 #clock-cells = <0>;
36 compatible = "ti,fixed-factor-clock";
37 clocks = <&dpll_usb_ck>;
38 ti,clock-div = <1>;
39 ti,autoidle-shift = <8>;
40 reg = <0x01b4>;
41 ti,clock-mult = <1>;
42 ti,invert-autoidle-bit;
43 };
diff --git a/Documentation/devicetree/bindings/clock/ti/gate.txt b/Documentation/devicetree/bindings/clock/ti/gate.txt
new file mode 100644
index 000000000000..125281aaa4ca
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/ti/gate.txt
@@ -0,0 +1,85 @@
1Binding for Texas Instruments gate clock.
2
3Binding status: Unstable - ABI compatibility may be broken in the future
4
5This binding uses the common clock binding[1]. This clock is
6quite much similar to the basic gate-clock [2], however,
7it supports a number of additional features. If no register
8is provided for this clock, the code assumes that a clockdomain
9will be controlled instead and the corresponding hw-ops for
10that is used.
11
12[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
13[2] Documentation/devicetree/bindings/clock/gate-clock.txt
14[3] Documentation/devicetree/bindings/clock/ti/clockdomain.txt
15
16Required properties:
17- compatible : shall be one of:
18 "ti,gate-clock" - basic gate clock
19 "ti,wait-gate-clock" - gate clock which waits until clock is active before
20 returning from clk_enable()
21 "ti,dss-gate-clock" - gate clock with DSS specific hardware handling
22 "ti,am35xx-gate-clock" - gate clock with AM35xx specific hardware handling
23 "ti,clkdm-gate-clock" - clockdomain gate clock, which derives its functional
24 clock directly from a clockdomain, see [3] how
25 to map clockdomains properly
26 "ti,hsdiv-gate-clock" - gate clock with OMAP36xx specific hardware handling,
27 required for a hardware errata
28- #clock-cells : from common clock binding; shall be set to 0
29- clocks : link to phandle of parent clock
30- reg : offset for register controlling adjustable gate, not needed for
31 ti,clkdm-gate-clock type
32
33Optional properties:
34- ti,bit-shift : bit shift for programming the clock gate, invalid for
35 ti,clkdm-gate-clock type
36- ti,set-bit-to-disable : inverts default gate programming. Setting the bit
37 gates the clock and clearing the bit ungates the clock.
38
39Examples:
40 mmchs2_fck: mmchs2_fck@48004a00 {
41 #clock-cells = <0>;
42 compatible = "ti,gate-clock";
43 clocks = <&core_96m_fck>;
44 reg = <0x48004a00 0x4>;
45 ti,bit-shift = <25>;
46 };
47
48 uart4_fck_am35xx: uart4_fck_am35xx {
49 #clock-cells = <0>;
50 compatible = "ti,wait-gate-clock";
51 clocks = <&core_48m_fck>;
52 reg = <0x0a00>;
53 ti,bit-shift = <23>;
54 };
55
56 dss1_alwon_fck_3430es2: dss1_alwon_fck_3430es2@48004e00 {
57 #clock-cells = <0>;
58 compatible = "ti,dss-gate-clock";
59 clocks = <&dpll4_m4x2_ck>;
60 reg = <0x48004e00 0x4>;
61 ti,bit-shift = <0>;
62 };
63
64 emac_ick: emac_ick@4800259c {
65 #clock-cells = <0>;
66 compatible = "ti,am35xx-gate-clock";
67 clocks = <&ipss_ick>;
68 reg = <0x4800259c 0x4>;
69 ti,bit-shift = <1>;
70 };
71
72 emu_src_ck: emu_src_ck {
73 #clock-cells = <0>;
74 compatible = "ti,clkdm-gate-clock";
75 clocks = <&emu_src_mux_ck>;
76 };
77
78 dpll4_m2x2_ck: dpll4_m2x2_ck@48004d00 {
79 #clock-cells = <0>;
80 compatible = "ti,hsdiv-gate-clock";
81 clocks = <&dpll4_m2x2_mul_ck>;
82 ti,bit-shift = <0x1b>;
83 reg = <0x48004d00 0x4>;
84 ti,set-bit-to-disable;
85 };
diff --git a/Documentation/devicetree/bindings/clock/ti/interface.txt b/Documentation/devicetree/bindings/clock/ti/interface.txt
new file mode 100644
index 000000000000..064e8caccac3
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/ti/interface.txt
@@ -0,0 +1,54 @@
1Binding for Texas Instruments interface clock.
2
3Binding status: Unstable - ABI compatibility may be broken in the future
4
5This binding uses the common clock binding[1]. This clock is
6quite much similar to the basic gate-clock [2], however,
7it supports a number of additional features, including
8companion clock finding (match corresponding functional gate
9clock) and hardware autoidle enable / disable.
10
11[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
12[2] Documentation/devicetree/bindings/clock/gate-clock.txt
13
14Required properties:
15- compatible : shall be one of:
16 "ti,omap3-interface-clock" - basic OMAP3 interface clock
17 "ti,omap3-no-wait-interface-clock" - interface clock which has no hardware
18 capability for waiting clock to be ready
19 "ti,omap3-hsotgusb-interface-clock" - interface clock with USB specific HW
20 handling
21 "ti,omap3-dss-interface-clock" - interface clock with DSS specific HW handling
22 "ti,omap3-ssi-interface-clock" - interface clock with SSI specific HW handling
23 "ti,am35xx-interface-clock" - interface clock with AM35xx specific HW handling
24- #clock-cells : from common clock binding; shall be set to 0
25- clocks : link to phandle of parent clock
26- reg : base address for the control register
27
28Optional properties:
29- ti,bit-shift : bit shift for the bit enabling/disabling the clock (default 0)
30
31Examples:
32 aes1_ick: aes1_ick@48004a14 {
33 #clock-cells = <0>;
34 compatible = "ti,omap3-interface-clock";
35 clocks = <&security_l4_ick2>;
36 reg = <0x48004a14 0x4>;
37 ti,bit-shift = <3>;
38 };
39
40 cam_ick: cam_ick@48004f10 {
41 #clock-cells = <0>;
42 compatible = "ti,omap3-no-wait-interface-clock";
43 clocks = <&l4_ick>;
44 reg = <0x48004f10 0x4>;
45 ti,bit-shift = <0>;
46 };
47
48 ssi_ick_3430es2: ssi_ick_3430es2@48004a10 {
49 #clock-cells = <0>;
50 compatible = "ti,omap3-ssi-interface-clock";
51 clocks = <&ssi_l4_ick>;
52 reg = <0x48004a10 0x4>;
53 ti,bit-shift = <0>;
54 };
diff --git a/Documentation/devicetree/bindings/clock/ti/mux.txt b/Documentation/devicetree/bindings/clock/ti/mux.txt
new file mode 100644
index 000000000000..2d0d170f8001
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/ti/mux.txt
@@ -0,0 +1,76 @@
1Binding for TI mux clock.
2
3Binding status: Unstable - ABI compatibility may be broken in the future
4
5This binding uses the common clock binding[1]. It assumes a
6register-mapped multiplexer with multiple input clock signals or
7parents, one of which can be selected as output. This clock does not
8gate or adjust the parent rate via a divider or multiplier.
9
10By default the "clocks" property lists the parents in the same order
11as they are programmed into the regster. E.g:
12
13 clocks = <&foo_clock>, <&bar_clock>, <&baz_clock>;
14
15results in programming the register as follows:
16
17register value selected parent clock
180 foo_clock
191 bar_clock
202 baz_clock
21
22Some clock controller IPs do not allow a value of zero to be programmed
23into the register, instead indexing begins at 1. The optional property
24"index-starts-at-one" modified the scheme as follows:
25
26register value selected clock parent
271 foo_clock
282 bar_clock
293 baz_clock
30
31The binding must provide the register to control the mux. Optionally
32the number of bits to shift the control field in the register can be
33supplied. If the shift value is missing it is the same as supplying
34a zero shift.
35
36[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
37
38Required properties:
39- compatible : shall be "ti,mux-clock" or "ti,composite-mux-clock".
40- #clock-cells : from common clock binding; shall be set to 0.
41- clocks : link phandles of parent clocks
42- reg : register offset for register controlling adjustable mux
43
44Optional properties:
45- ti,bit-shift : number of bits to shift the bit-mask, defaults to
46 0 if not present
47- ti,index-starts-at-one : valid input select programming starts at 1, not
48 zero
49- ti,set-rate-parent : clk_set_rate is propagated to parent clock,
50 not supported by the composite-mux-clock subtype
51
52Examples:
53
54sys_clkin_ck: sys_clkin_ck@4a306110 {
55 #clock-cells = <0>;
56 compatible = "ti,mux-clock";
57 clocks = <&virt_12000000_ck>, <&virt_13000000_ck>, <&virt_16800000_ck>, <&virt_19200000_ck>, <&virt_26000000_ck>, <&virt_27000000_ck>, <&virt_38400000_ck>;
58 reg = <0x0110>;
59 ti,index-starts-at-one;
60};
61
62abe_dpll_bypass_clk_mux_ck: abe_dpll_bypass_clk_mux_ck@4a306108 {
63 #clock-cells = <0>;
64 compatible = "ti,mux-clock";
65 clocks = <&sys_clkin_ck>, <&sys_32k_ck>;
66 ti,bit-shift = <24>;
67 reg = <0x0108>;
68};
69
70mcbsp5_mux_fck: mcbsp5_mux_fck {
71 #clock-cells = <0>;
72 compatible = "ti,composite-mux-clock";
73 clocks = <&core_96m_fck>, <&mcbsp_clks>;
74 ti,bit-shift = <4>;
75 reg = <0x02d8>;
76};
diff --git a/arch/arm/boot/dts/am33xx-clocks.dtsi b/arch/arm/boot/dts/am33xx-clocks.dtsi
new file mode 100644
index 000000000000..9ccfe508dea2
--- /dev/null
+++ b/arch/arm/boot/dts/am33xx-clocks.dtsi
@@ -0,0 +1,664 @@
1/*
2 * Device Tree Source for AM33xx clock data
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10&scrm_clocks {
11 sys_clkin_ck: sys_clkin_ck {
12 #clock-cells = <0>;
13 compatible = "ti,mux-clock";
14 clocks = <&virt_19200000_ck>, <&virt_24000000_ck>, <&virt_25000000_ck>, <&virt_26000000_ck>;
15 ti,bit-shift = <22>;
16 reg = <0x0040>;
17 };
18
19 adc_tsc_fck: adc_tsc_fck {
20 #clock-cells = <0>;
21 compatible = "fixed-factor-clock";
22 clocks = <&sys_clkin_ck>;
23 clock-mult = <1>;
24 clock-div = <1>;
25 };
26
27 dcan0_fck: dcan0_fck {
28 #clock-cells = <0>;
29 compatible = "fixed-factor-clock";
30 clocks = <&sys_clkin_ck>;
31 clock-mult = <1>;
32 clock-div = <1>;
33 };
34
35 dcan1_fck: dcan1_fck {
36 #clock-cells = <0>;
37 compatible = "fixed-factor-clock";
38 clocks = <&sys_clkin_ck>;
39 clock-mult = <1>;
40 clock-div = <1>;
41 };
42
43 mcasp0_fck: mcasp0_fck {
44 #clock-cells = <0>;
45 compatible = "fixed-factor-clock";
46 clocks = <&sys_clkin_ck>;
47 clock-mult = <1>;
48 clock-div = <1>;
49 };
50
51 mcasp1_fck: mcasp1_fck {
52 #clock-cells = <0>;
53 compatible = "fixed-factor-clock";
54 clocks = <&sys_clkin_ck>;
55 clock-mult = <1>;
56 clock-div = <1>;
57 };
58
59 smartreflex0_fck: smartreflex0_fck {
60 #clock-cells = <0>;
61 compatible = "fixed-factor-clock";
62 clocks = <&sys_clkin_ck>;
63 clock-mult = <1>;
64 clock-div = <1>;
65 };
66
67 smartreflex1_fck: smartreflex1_fck {
68 #clock-cells = <0>;
69 compatible = "fixed-factor-clock";
70 clocks = <&sys_clkin_ck>;
71 clock-mult = <1>;
72 clock-div = <1>;
73 };
74
75 sha0_fck: sha0_fck {
76 #clock-cells = <0>;
77 compatible = "fixed-factor-clock";
78 clocks = <&sys_clkin_ck>;
79 clock-mult = <1>;
80 clock-div = <1>;
81 };
82
83 aes0_fck: aes0_fck {
84 #clock-cells = <0>;
85 compatible = "fixed-factor-clock";
86 clocks = <&sys_clkin_ck>;
87 clock-mult = <1>;
88 clock-div = <1>;
89 };
90
91 rng_fck: rng_fck {
92 #clock-cells = <0>;
93 compatible = "fixed-factor-clock";
94 clocks = <&sys_clkin_ck>;
95 clock-mult = <1>;
96 clock-div = <1>;
97 };
98
99 ehrpwm0_gate_tbclk: ehrpwm0_gate_tbclk {
100 #clock-cells = <0>;
101 compatible = "ti,composite-no-wait-gate-clock";
102 clocks = <&dpll_per_m2_ck>;
103 ti,bit-shift = <0>;
104 reg = <0x0664>;
105 };
106
107 ehrpwm0_tbclk: ehrpwm0_tbclk {
108 #clock-cells = <0>;
109 compatible = "ti,composite-clock";
110 clocks = <&ehrpwm0_gate_tbclk>;
111 };
112
113 ehrpwm1_gate_tbclk: ehrpwm1_gate_tbclk {
114 #clock-cells = <0>;
115 compatible = "ti,composite-no-wait-gate-clock";
116 clocks = <&dpll_per_m2_ck>;
117 ti,bit-shift = <1>;
118 reg = <0x0664>;
119 };
120
121 ehrpwm1_tbclk: ehrpwm1_tbclk {
122 #clock-cells = <0>;
123 compatible = "ti,composite-clock";
124 clocks = <&ehrpwm1_gate_tbclk>;
125 };
126
127 ehrpwm2_gate_tbclk: ehrpwm2_gate_tbclk {
128 #clock-cells = <0>;
129 compatible = "ti,composite-no-wait-gate-clock";
130 clocks = <&dpll_per_m2_ck>;
131 ti,bit-shift = <2>;
132 reg = <0x0664>;
133 };
134
135 ehrpwm2_tbclk: ehrpwm2_tbclk {
136 #clock-cells = <0>;
137 compatible = "ti,composite-clock";
138 clocks = <&ehrpwm2_gate_tbclk>;
139 };
140};
141&prcm_clocks {
142 clk_32768_ck: clk_32768_ck {
143 #clock-cells = <0>;
144 compatible = "fixed-clock";
145 clock-frequency = <32768>;
146 };
147
148 clk_rc32k_ck: clk_rc32k_ck {
149 #clock-cells = <0>;
150 compatible = "fixed-clock";
151 clock-frequency = <32000>;
152 };
153
154 virt_19200000_ck: virt_19200000_ck {
155 #clock-cells = <0>;
156 compatible = "fixed-clock";
157 clock-frequency = <19200000>;
158 };
159
160 virt_24000000_ck: virt_24000000_ck {
161 #clock-cells = <0>;
162 compatible = "fixed-clock";
163 clock-frequency = <24000000>;
164 };
165
166 virt_25000000_ck: virt_25000000_ck {
167 #clock-cells = <0>;
168 compatible = "fixed-clock";
169 clock-frequency = <25000000>;
170 };
171
172 virt_26000000_ck: virt_26000000_ck {
173 #clock-cells = <0>;
174 compatible = "fixed-clock";
175 clock-frequency = <26000000>;
176 };
177
178 tclkin_ck: tclkin_ck {
179 #clock-cells = <0>;
180 compatible = "fixed-clock";
181 clock-frequency = <12000000>;
182 };
183
184 dpll_core_ck: dpll_core_ck {
185 #clock-cells = <0>;
186 compatible = "ti,am3-dpll-core-clock";
187 clocks = <&sys_clkin_ck>, <&sys_clkin_ck>;
188 reg = <0x0490>, <0x045c>, <0x0468>;
189 };
190
191 dpll_core_x2_ck: dpll_core_x2_ck {
192 #clock-cells = <0>;
193 compatible = "ti,am3-dpll-x2-clock";
194 clocks = <&dpll_core_ck>;
195 };
196
197 dpll_core_m4_ck: dpll_core_m4_ck {
198 #clock-cells = <0>;
199 compatible = "ti,divider-clock";
200 clocks = <&dpll_core_x2_ck>;
201 ti,max-div = <31>;
202 reg = <0x0480>;
203 ti,index-starts-at-one;
204 };
205
206 dpll_core_m5_ck: dpll_core_m5_ck {
207 #clock-cells = <0>;
208 compatible = "ti,divider-clock";
209 clocks = <&dpll_core_x2_ck>;
210 ti,max-div = <31>;
211 reg = <0x0484>;
212 ti,index-starts-at-one;
213 };
214
215 dpll_core_m6_ck: dpll_core_m6_ck {
216 #clock-cells = <0>;
217 compatible = "ti,divider-clock";
218 clocks = <&dpll_core_x2_ck>;
219 ti,max-div = <31>;
220 reg = <0x04d8>;
221 ti,index-starts-at-one;
222 };
223
224 dpll_mpu_ck: dpll_mpu_ck {
225 #clock-cells = <0>;
226 compatible = "ti,am3-dpll-clock";
227 clocks = <&sys_clkin_ck>, <&sys_clkin_ck>;
228 reg = <0x0488>, <0x0420>, <0x042c>;
229 };
230
231 dpll_mpu_m2_ck: dpll_mpu_m2_ck {
232 #clock-cells = <0>;
233 compatible = "ti,divider-clock";
234 clocks = <&dpll_mpu_ck>;
235 ti,max-div = <31>;
236 reg = <0x04a8>;
237 ti,index-starts-at-one;
238 };
239
240 dpll_ddr_ck: dpll_ddr_ck {
241 #clock-cells = <0>;
242 compatible = "ti,am3-dpll-no-gate-clock";
243 clocks = <&sys_clkin_ck>, <&sys_clkin_ck>;
244 reg = <0x0494>, <0x0434>, <0x0440>;
245 };
246
247 dpll_ddr_m2_ck: dpll_ddr_m2_ck {
248 #clock-cells = <0>;
249 compatible = "ti,divider-clock";
250 clocks = <&dpll_ddr_ck>;
251 ti,max-div = <31>;
252 reg = <0x04a0>;
253 ti,index-starts-at-one;
254 };
255
256 dpll_ddr_m2_div2_ck: dpll_ddr_m2_div2_ck {
257 #clock-cells = <0>;
258 compatible = "fixed-factor-clock";
259 clocks = <&dpll_ddr_m2_ck>;
260 clock-mult = <1>;
261 clock-div = <2>;
262 };
263
264 dpll_disp_ck: dpll_disp_ck {
265 #clock-cells = <0>;
266 compatible = "ti,am3-dpll-no-gate-clock";
267 clocks = <&sys_clkin_ck>, <&sys_clkin_ck>;
268 reg = <0x0498>, <0x0448>, <0x0454>;
269 };
270
271 dpll_disp_m2_ck: dpll_disp_m2_ck {
272 #clock-cells = <0>;
273 compatible = "ti,divider-clock";
274 clocks = <&dpll_disp_ck>;
275 ti,max-div = <31>;
276 reg = <0x04a4>;
277 ti,index-starts-at-one;
278 ti,set-rate-parent;
279 };
280
281 dpll_per_ck: dpll_per_ck {
282 #clock-cells = <0>;
283 compatible = "ti,am3-dpll-no-gate-j-type-clock";
284 clocks = <&sys_clkin_ck>, <&sys_clkin_ck>;
285 reg = <0x048c>, <0x0470>, <0x049c>;
286 };
287
288 dpll_per_m2_ck: dpll_per_m2_ck {
289 #clock-cells = <0>;
290 compatible = "ti,divider-clock";
291 clocks = <&dpll_per_ck>;
292 ti,max-div = <31>;
293 reg = <0x04ac>;
294 ti,index-starts-at-one;
295 };
296
297 dpll_per_m2_div4_wkupdm_ck: dpll_per_m2_div4_wkupdm_ck {
298 #clock-cells = <0>;
299 compatible = "fixed-factor-clock";
300 clocks = <&dpll_per_m2_ck>;
301 clock-mult = <1>;
302 clock-div = <4>;
303 };
304
305 dpll_per_m2_div4_ck: dpll_per_m2_div4_ck {
306 #clock-cells = <0>;
307 compatible = "fixed-factor-clock";
308 clocks = <&dpll_per_m2_ck>;
309 clock-mult = <1>;
310 clock-div = <4>;
311 };
312
313 cefuse_fck: cefuse_fck {
314 #clock-cells = <0>;
315 compatible = "ti,gate-clock";
316 clocks = <&sys_clkin_ck>;
317 ti,bit-shift = <1>;
318 reg = <0x0a20>;
319 };
320
321 clk_24mhz: clk_24mhz {
322 #clock-cells = <0>;
323 compatible = "fixed-factor-clock";
324 clocks = <&dpll_per_m2_ck>;
325 clock-mult = <1>;
326 clock-div = <8>;
327 };
328
329 clkdiv32k_ck: clkdiv32k_ck {
330 #clock-cells = <0>;
331 compatible = "fixed-factor-clock";
332 clocks = <&clk_24mhz>;
333 clock-mult = <1>;
334 clock-div = <732>;
335 };
336
337 clkdiv32k_ick: clkdiv32k_ick {
338 #clock-cells = <0>;
339 compatible = "ti,gate-clock";
340 clocks = <&clkdiv32k_ck>;
341 ti,bit-shift = <1>;
342 reg = <0x014c>;
343 };
344
345 l3_gclk: l3_gclk {
346 #clock-cells = <0>;
347 compatible = "fixed-factor-clock";
348 clocks = <&dpll_core_m4_ck>;
349 clock-mult = <1>;
350 clock-div = <1>;
351 };
352
353 pruss_ocp_gclk: pruss_ocp_gclk {
354 #clock-cells = <0>;
355 compatible = "ti,mux-clock";
356 clocks = <&l3_gclk>, <&dpll_disp_m2_ck>;
357 reg = <0x0530>;
358 };
359
360 mmu_fck: mmu_fck {
361 #clock-cells = <0>;
362 compatible = "ti,gate-clock";
363 clocks = <&dpll_core_m4_ck>;
364 ti,bit-shift = <1>;
365 reg = <0x0914>;
366 };
367
368 timer1_fck: timer1_fck {
369 #clock-cells = <0>;
370 compatible = "ti,mux-clock";
371 clocks = <&sys_clkin_ck>, <&clkdiv32k_ick>, <&tclkin_ck>, <&clk_rc32k_ck>, <&clk_32768_ck>;
372 reg = <0x0528>;
373 };
374
375 timer2_fck: timer2_fck {
376 #clock-cells = <0>;
377 compatible = "ti,mux-clock";
378 clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>;
379 reg = <0x0508>;
380 };
381
382 timer3_fck: timer3_fck {
383 #clock-cells = <0>;
384 compatible = "ti,mux-clock";
385 clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>;
386 reg = <0x050c>;
387 };
388
389 timer4_fck: timer4_fck {
390 #clock-cells = <0>;
391 compatible = "ti,mux-clock";
392 clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>;
393 reg = <0x0510>;
394 };
395
396 timer5_fck: timer5_fck {
397 #clock-cells = <0>;
398 compatible = "ti,mux-clock";
399 clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>;
400 reg = <0x0518>;
401 };
402
403 timer6_fck: timer6_fck {
404 #clock-cells = <0>;
405 compatible = "ti,mux-clock";
406 clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>;
407 reg = <0x051c>;
408 };
409
410 timer7_fck: timer7_fck {
411 #clock-cells = <0>;
412 compatible = "ti,mux-clock";
413 clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>;
414 reg = <0x0504>;
415 };
416
417 usbotg_fck: usbotg_fck {
418 #clock-cells = <0>;
419 compatible = "ti,gate-clock";
420 clocks = <&dpll_per_ck>;
421 ti,bit-shift = <8>;
422 reg = <0x047c>;
423 };
424
425 dpll_core_m4_div2_ck: dpll_core_m4_div2_ck {
426 #clock-cells = <0>;
427 compatible = "fixed-factor-clock";
428 clocks = <&dpll_core_m4_ck>;
429 clock-mult = <1>;
430 clock-div = <2>;
431 };
432
433 ieee5000_fck: ieee5000_fck {
434 #clock-cells = <0>;
435 compatible = "ti,gate-clock";
436 clocks = <&dpll_core_m4_div2_ck>;
437 ti,bit-shift = <1>;
438 reg = <0x00e4>;
439 };
440
441 wdt1_fck: wdt1_fck {
442 #clock-cells = <0>;
443 compatible = "ti,mux-clock";
444 clocks = <&clk_rc32k_ck>, <&clkdiv32k_ick>;
445 reg = <0x0538>;
446 };
447
448 l4_rtc_gclk: l4_rtc_gclk {
449 #clock-cells = <0>;
450 compatible = "fixed-factor-clock";
451 clocks = <&dpll_core_m4_ck>;
452 clock-mult = <1>;
453 clock-div = <2>;
454 };
455
456 l4hs_gclk: l4hs_gclk {
457 #clock-cells = <0>;
458 compatible = "fixed-factor-clock";
459 clocks = <&dpll_core_m4_ck>;
460 clock-mult = <1>;
461 clock-div = <1>;
462 };
463
464 l3s_gclk: l3s_gclk {
465 #clock-cells = <0>;
466 compatible = "fixed-factor-clock";
467 clocks = <&dpll_core_m4_div2_ck>;
468 clock-mult = <1>;
469 clock-div = <1>;
470 };
471
472 l4fw_gclk: l4fw_gclk {
473 #clock-cells = <0>;
474 compatible = "fixed-factor-clock";
475 clocks = <&dpll_core_m4_div2_ck>;
476 clock-mult = <1>;
477 clock-div = <1>;
478 };
479
480 l4ls_gclk: l4ls_gclk {
481 #clock-cells = <0>;
482 compatible = "fixed-factor-clock";
483 clocks = <&dpll_core_m4_div2_ck>;
484 clock-mult = <1>;
485 clock-div = <1>;
486 };
487
488 sysclk_div_ck: sysclk_div_ck {
489 #clock-cells = <0>;
490 compatible = "fixed-factor-clock";
491 clocks = <&dpll_core_m4_ck>;
492 clock-mult = <1>;
493 clock-div = <1>;
494 };
495
496 cpsw_125mhz_gclk: cpsw_125mhz_gclk {
497 #clock-cells = <0>;
498 compatible = "fixed-factor-clock";
499 clocks = <&dpll_core_m5_ck>;
500 clock-mult = <1>;
501 clock-div = <2>;
502 };
503
504 cpsw_cpts_rft_clk: cpsw_cpts_rft_clk {
505 #clock-cells = <0>;
506 compatible = "ti,mux-clock";
507 clocks = <&dpll_core_m5_ck>, <&dpll_core_m4_ck>;
508 reg = <0x0520>;
509 };
510
511 gpio0_dbclk_mux_ck: gpio0_dbclk_mux_ck {
512 #clock-cells = <0>;
513 compatible = "ti,mux-clock";
514 clocks = <&clk_rc32k_ck>, <&clk_32768_ck>, <&clkdiv32k_ick>;
515 reg = <0x053c>;
516 };
517
518 gpio0_dbclk: gpio0_dbclk {
519 #clock-cells = <0>;
520 compatible = "ti,gate-clock";
521 clocks = <&gpio0_dbclk_mux_ck>;
522 ti,bit-shift = <18>;
523 reg = <0x0408>;
524 };
525
526 gpio1_dbclk: gpio1_dbclk {
527 #clock-cells = <0>;
528 compatible = "ti,gate-clock";
529 clocks = <&clkdiv32k_ick>;
530 ti,bit-shift = <18>;
531 reg = <0x00ac>;
532 };
533
534 gpio2_dbclk: gpio2_dbclk {
535 #clock-cells = <0>;
536 compatible = "ti,gate-clock";
537 clocks = <&clkdiv32k_ick>;
538 ti,bit-shift = <18>;
539 reg = <0x00b0>;
540 };
541
542 gpio3_dbclk: gpio3_dbclk {
543 #clock-cells = <0>;
544 compatible = "ti,gate-clock";
545 clocks = <&clkdiv32k_ick>;
546 ti,bit-shift = <18>;
547 reg = <0x00b4>;
548 };
549
550 lcd_gclk: lcd_gclk {
551 #clock-cells = <0>;
552 compatible = "ti,mux-clock";
553 clocks = <&dpll_disp_m2_ck>, <&dpll_core_m5_ck>, <&dpll_per_m2_ck>;
554 reg = <0x0534>;
555 ti,set-rate-parent;
556 };
557
558 mmc_clk: mmc_clk {
559 #clock-cells = <0>;
560 compatible = "fixed-factor-clock";
561 clocks = <&dpll_per_m2_ck>;
562 clock-mult = <1>;
563 clock-div = <2>;
564 };
565
566 gfx_fclk_clksel_ck: gfx_fclk_clksel_ck {
567 #clock-cells = <0>;
568 compatible = "ti,mux-clock";
569 clocks = <&dpll_core_m4_ck>, <&dpll_per_m2_ck>;
570 ti,bit-shift = <1>;
571 reg = <0x052c>;
572 };
573
574 gfx_fck_div_ck: gfx_fck_div_ck {
575 #clock-cells = <0>;
576 compatible = "ti,divider-clock";
577 clocks = <&gfx_fclk_clksel_ck>;
578 reg = <0x052c>;
579 ti,max-div = <2>;
580 };
581
582 sysclkout_pre_ck: sysclkout_pre_ck {
583 #clock-cells = <0>;
584 compatible = "ti,mux-clock";
585 clocks = <&clk_32768_ck>, <&l3_gclk>, <&dpll_ddr_m2_ck>, <&dpll_per_m2_ck>, <&lcd_gclk>;
586 reg = <0x0700>;
587 };
588
589 clkout2_div_ck: clkout2_div_ck {
590 #clock-cells = <0>;
591 compatible = "ti,divider-clock";
592 clocks = <&sysclkout_pre_ck>;
593 ti,bit-shift = <3>;
594 ti,max-div = <8>;
595 reg = <0x0700>;
596 };
597
598 dbg_sysclk_ck: dbg_sysclk_ck {
599 #clock-cells = <0>;
600 compatible = "ti,gate-clock";
601 clocks = <&sys_clkin_ck>;
602 ti,bit-shift = <19>;
603 reg = <0x0414>;
604 };
605
606 dbg_clka_ck: dbg_clka_ck {
607 #clock-cells = <0>;
608 compatible = "ti,gate-clock";
609 clocks = <&dpll_core_m4_ck>;
610 ti,bit-shift = <30>;
611 reg = <0x0414>;
612 };
613
614 stm_pmd_clock_mux_ck: stm_pmd_clock_mux_ck {
615 #clock-cells = <0>;
616 compatible = "ti,mux-clock";
617 clocks = <&dbg_sysclk_ck>, <&dbg_clka_ck>;
618 ti,bit-shift = <22>;
619 reg = <0x0414>;
620 };
621
622 trace_pmd_clk_mux_ck: trace_pmd_clk_mux_ck {
623 #clock-cells = <0>;
624 compatible = "ti,mux-clock";
625 clocks = <&dbg_sysclk_ck>, <&dbg_clka_ck>;
626 ti,bit-shift = <20>;
627 reg = <0x0414>;
628 };
629
630 stm_clk_div_ck: stm_clk_div_ck {
631 #clock-cells = <0>;
632 compatible = "ti,divider-clock";
633 clocks = <&stm_pmd_clock_mux_ck>;
634 ti,bit-shift = <27>;
635 ti,max-div = <64>;
636 reg = <0x0414>;
637 ti,index-power-of-two;
638 };
639
640 trace_clk_div_ck: trace_clk_div_ck {
641 #clock-cells = <0>;
642 compatible = "ti,divider-clock";
643 clocks = <&trace_pmd_clk_mux_ck>;
644 ti,bit-shift = <24>;
645 ti,max-div = <64>;
646 reg = <0x0414>;
647 ti,index-power-of-two;
648 };
649
650 clkout2_ck: clkout2_ck {
651 #clock-cells = <0>;
652 compatible = "ti,gate-clock";
653 clocks = <&clkout2_div_ck>;
654 ti,bit-shift = <7>;
655 reg = <0x0700>;
656 };
657};
658
659&prcm_clockdomains {
660 clk_24mhz_clkdm: clk_24mhz_clkdm {
661 compatible = "ti,clockdomain";
662 clocks = <&clkdiv32k_ick>;
663 };
664};
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index f6d8ffe98d0b..6d95d3df33c7 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -102,6 +102,32 @@
102 ranges; 102 ranges;
103 ti,hwmods = "l3_main"; 103 ti,hwmods = "l3_main";
104 104
105 prcm: prcm@44e00000 {
106 compatible = "ti,am3-prcm";
107 reg = <0x44e00000 0x4000>;
108
109 prcm_clocks: clocks {
110 #address-cells = <1>;
111 #size-cells = <0>;
112 };
113
114 prcm_clockdomains: clockdomains {
115 };
116 };
117
118 scrm: scrm@44e10000 {
119 compatible = "ti,am3-scrm";
120 reg = <0x44e10000 0x2000>;
121
122 scrm_clocks: clocks {
123 #address-cells = <1>;
124 #size-cells = <0>;
125 };
126
127 scrm_clockdomains: clockdomains {
128 };
129 };
130
105 intc: interrupt-controller@48200000 { 131 intc: interrupt-controller@48200000 {
106 compatible = "ti,omap2-intc"; 132 compatible = "ti,omap2-intc";
107 interrupt-controller; 133 interrupt-controller;
@@ -794,3 +820,5 @@
794 }; 820 };
795 }; 821 };
796}; 822};
823
824/include/ "am33xx-clocks.dtsi"
diff --git a/arch/arm/boot/dts/am3517.dtsi b/arch/arm/boot/dts/am3517.dtsi
index 2fbe02faa8b1..788391f91684 100644
--- a/arch/arm/boot/dts/am3517.dtsi
+++ b/arch/arm/boot/dts/am3517.dtsi
@@ -61,3 +61,6 @@
61 }; 61 };
62 }; 62 };
63}; 63};
64
65/include/ "am35xx-clocks.dtsi"
66/include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi"
diff --git a/arch/arm/boot/dts/am35xx-clocks.dtsi b/arch/arm/boot/dts/am35xx-clocks.dtsi
new file mode 100644
index 000000000000..df489d310b50
--- /dev/null
+++ b/arch/arm/boot/dts/am35xx-clocks.dtsi
@@ -0,0 +1,128 @@
1/*
2 * Device Tree Source for OMAP3 clock data
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10&scrm_clocks {
11 emac_ick: emac_ick {
12 #clock-cells = <0>;
13 compatible = "ti,am35xx-gate-clock";
14 clocks = <&ipss_ick>;
15 reg = <0x059c>;
16 ti,bit-shift = <1>;
17 };
18
19 emac_fck: emac_fck {
20 #clock-cells = <0>;
21 compatible = "ti,gate-clock";
22 clocks = <&rmii_ck>;
23 reg = <0x059c>;
24 ti,bit-shift = <9>;
25 };
26
27 vpfe_ick: vpfe_ick {
28 #clock-cells = <0>;
29 compatible = "ti,am35xx-gate-clock";
30 clocks = <&ipss_ick>;
31 reg = <0x059c>;
32 ti,bit-shift = <2>;
33 };
34
35 vpfe_fck: vpfe_fck {
36 #clock-cells = <0>;
37 compatible = "ti,gate-clock";
38 clocks = <&pclk_ck>;
39 reg = <0x059c>;
40 ti,bit-shift = <10>;
41 };
42
43 hsotgusb_ick_am35xx: hsotgusb_ick_am35xx {
44 #clock-cells = <0>;
45 compatible = "ti,am35xx-gate-clock";
46 clocks = <&ipss_ick>;
47 reg = <0x059c>;
48 ti,bit-shift = <0>;
49 };
50
51 hsotgusb_fck_am35xx: hsotgusb_fck_am35xx {
52 #clock-cells = <0>;
53 compatible = "ti,gate-clock";
54 clocks = <&sys_ck>;
55 reg = <0x059c>;
56 ti,bit-shift = <8>;
57 };
58
59 hecc_ck: hecc_ck {
60 #clock-cells = <0>;
61 compatible = "ti,am35xx-gate-clock";
62 clocks = <&sys_ck>;
63 reg = <0x059c>;
64 ti,bit-shift = <3>;
65 };
66};
67&cm_clocks {
68 ipss_ick: ipss_ick {
69 #clock-cells = <0>;
70 compatible = "ti,am35xx-interface-clock";
71 clocks = <&core_l3_ick>;
72 reg = <0x0a10>;
73 ti,bit-shift = <4>;
74 };
75
76 rmii_ck: rmii_ck {
77 #clock-cells = <0>;
78 compatible = "fixed-clock";
79 clock-frequency = <50000000>;
80 };
81
82 pclk_ck: pclk_ck {
83 #clock-cells = <0>;
84 compatible = "fixed-clock";
85 clock-frequency = <27000000>;
86 };
87
88 uart4_ick_am35xx: uart4_ick_am35xx {
89 #clock-cells = <0>;
90 compatible = "ti,omap3-interface-clock";
91 clocks = <&core_l4_ick>;
92 reg = <0x0a10>;
93 ti,bit-shift = <23>;
94 };
95
96 uart4_fck_am35xx: uart4_fck_am35xx {
97 #clock-cells = <0>;
98 compatible = "ti,wait-gate-clock";
99 clocks = <&core_48m_fck>;
100 reg = <0x0a00>;
101 ti,bit-shift = <23>;
102 };
103};
104
105&cm_clockdomains {
106 core_l3_clkdm: core_l3_clkdm {
107 compatible = "ti,clockdomain";
108 clocks = <&sdrc_ick>, <&ipss_ick>, <&emac_ick>, <&vpfe_ick>,
109 <&hsotgusb_ick_am35xx>, <&hsotgusb_fck_am35xx>,
110 <&hecc_ck>;
111 };
112
113 core_l4_clkdm: core_l4_clkdm {
114 compatible = "ti,clockdomain";
115 clocks = <&cpefuse_fck>, <&ts_fck>, <&usbtll_fck>,
116 <&usbtll_ick>, <&mmchs3_ick>, <&mmchs3_fck>,
117 <&mmchs2_fck>, <&mmchs1_fck>, <&i2c3_fck>, <&i2c2_fck>,
118 <&i2c1_fck>, <&mcspi4_fck>, <&mcspi3_fck>,
119 <&mcspi2_fck>, <&mcspi1_fck>, <&uart2_fck>,
120 <&uart1_fck>, <&hdq_fck>, <&mmchs2_ick>, <&mmchs1_ick>,
121 <&hdq_ick>, <&mcspi4_ick>, <&mcspi3_ick>,
122 <&mcspi2_ick>, <&mcspi1_ick>, <&i2c3_ick>, <&i2c2_ick>,
123 <&i2c1_ick>, <&uart2_ick>, <&uart1_ick>, <&gpt11_ick>,
124 <&gpt10_ick>, <&mcbsp5_ick>, <&mcbsp1_ick>,
125 <&omapctrl_ick>, <&aes2_ick>, <&sha12_ick>,
126 <&uart4_ick_am35xx>, <&uart4_fck_am35xx>;
127 };
128};
diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index 974d103ab3b1..c6bd4d986c29 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -67,6 +67,32 @@
67 ranges; 67 ranges;
68 ti,hwmods = "l3_main"; 68 ti,hwmods = "l3_main";
69 69
70 prcm: prcm@44df0000 {
71 compatible = "ti,am4-prcm";
72 reg = <0x44df0000 0x11000>;
73
74 prcm_clocks: clocks {
75 #address-cells = <1>;
76 #size-cells = <0>;
77 };
78
79 prcm_clockdomains: clockdomains {
80 };
81 };
82
83 scrm: scrm@44e10000 {
84 compatible = "ti,am4-scrm";
85 reg = <0x44e10000 0x2000>;
86
87 scrm_clocks: clocks {
88 #address-cells = <1>;
89 #size-cells = <0>;
90 };
91
92 scrm_clockdomains: clockdomains {
93 };
94 };
95
70 edma: edma@49000000 { 96 edma: edma@49000000 {
71 compatible = "ti,edma3"; 97 compatible = "ti,edma3";
72 ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2"; 98 ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2";
@@ -665,3 +691,5 @@
665 }; 691 };
666 }; 692 };
667}; 693};
694
695/include/ "am43xx-clocks.dtsi"
diff --git a/arch/arm/boot/dts/am43xx-clocks.dtsi b/arch/arm/boot/dts/am43xx-clocks.dtsi
new file mode 100644
index 000000000000..142009cc9332
--- /dev/null
+++ b/arch/arm/boot/dts/am43xx-clocks.dtsi
@@ -0,0 +1,656 @@
1/*
2 * Device Tree Source for AM43xx clock data
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10&scrm_clocks {
11 sys_clkin_ck: sys_clkin_ck {
12 #clock-cells = <0>;
13 compatible = "ti,mux-clock";
14 clocks = <&virt_19200000_ck>, <&virt_24000000_ck>, <&virt_25000000_ck>, <&virt_26000000_ck>;
15 ti,bit-shift = <22>;
16 reg = <0x0040>;
17 };
18
19 adc_tsc_fck: adc_tsc_fck {
20 #clock-cells = <0>;
21 compatible = "fixed-factor-clock";
22 clocks = <&sys_clkin_ck>;
23 clock-mult = <1>;
24 clock-div = <1>;
25 };
26
27 dcan0_fck: dcan0_fck {
28 #clock-cells = <0>;
29 compatible = "fixed-factor-clock";
30 clocks = <&sys_clkin_ck>;
31 clock-mult = <1>;
32 clock-div = <1>;
33 };
34
35 dcan1_fck: dcan1_fck {
36 #clock-cells = <0>;
37 compatible = "fixed-factor-clock";
38 clocks = <&sys_clkin_ck>;
39 clock-mult = <1>;
40 clock-div = <1>;
41 };
42
43 mcasp0_fck: mcasp0_fck {
44 #clock-cells = <0>;
45 compatible = "fixed-factor-clock";
46 clocks = <&sys_clkin_ck>;
47 clock-mult = <1>;
48 clock-div = <1>;
49 };
50
51 mcasp1_fck: mcasp1_fck {
52 #clock-cells = <0>;
53 compatible = "fixed-factor-clock";
54 clocks = <&sys_clkin_ck>;
55 clock-mult = <1>;
56 clock-div = <1>;
57 };
58
59 smartreflex0_fck: smartreflex0_fck {
60 #clock-cells = <0>;
61 compatible = "fixed-factor-clock";
62 clocks = <&sys_clkin_ck>;
63 clock-mult = <1>;
64 clock-div = <1>;
65 };
66
67 smartreflex1_fck: smartreflex1_fck {
68 #clock-cells = <0>;
69 compatible = "fixed-factor-clock";
70 clocks = <&sys_clkin_ck>;
71 clock-mult = <1>;
72 clock-div = <1>;
73 };
74
75 sha0_fck: sha0_fck {
76 #clock-cells = <0>;
77 compatible = "fixed-factor-clock";
78 clocks = <&sys_clkin_ck>;
79 clock-mult = <1>;
80 clock-div = <1>;
81 };
82
83 aes0_fck: aes0_fck {
84 #clock-cells = <0>;
85 compatible = "fixed-factor-clock";
86 clocks = <&sys_clkin_ck>;
87 clock-mult = <1>;
88 clock-div = <1>;
89 };
90};
91&prcm_clocks {
92 clk_32768_ck: clk_32768_ck {
93 #clock-cells = <0>;
94 compatible = "fixed-clock";
95 clock-frequency = <32768>;
96 };
97
98 clk_rc32k_ck: clk_rc32k_ck {
99 #clock-cells = <0>;
100 compatible = "fixed-clock";
101 clock-frequency = <32768>;
102 };
103
104 virt_19200000_ck: virt_19200000_ck {
105 #clock-cells = <0>;
106 compatible = "fixed-clock";
107 clock-frequency = <19200000>;
108 };
109
110 virt_24000000_ck: virt_24000000_ck {
111 #clock-cells = <0>;
112 compatible = "fixed-clock";
113 clock-frequency = <24000000>;
114 };
115
116 virt_25000000_ck: virt_25000000_ck {
117 #clock-cells = <0>;
118 compatible = "fixed-clock";
119 clock-frequency = <25000000>;
120 };
121
122 virt_26000000_ck: virt_26000000_ck {
123 #clock-cells = <0>;
124 compatible = "fixed-clock";
125 clock-frequency = <26000000>;
126 };
127
128 tclkin_ck: tclkin_ck {
129 #clock-cells = <0>;
130 compatible = "fixed-clock";
131 clock-frequency = <26000000>;
132 };
133
134 dpll_core_ck: dpll_core_ck {
135 #clock-cells = <0>;
136 compatible = "ti,am3-dpll-core-clock";
137 clocks = <&sys_clkin_ck>, <&sys_clkin_ck>;
138 reg = <0x2d20>, <0x2d24>, <0x2d2c>;
139 };
140
141 dpll_core_x2_ck: dpll_core_x2_ck {
142 #clock-cells = <0>;
143 compatible = "ti,am3-dpll-x2-clock";
144 clocks = <&dpll_core_ck>;
145 };
146
147 dpll_core_m4_ck: dpll_core_m4_ck {
148 #clock-cells = <0>;
149 compatible = "ti,divider-clock";
150 clocks = <&dpll_core_x2_ck>;
151 ti,max-div = <31>;
152 ti,autoidle-shift = <8>;
153 reg = <0x2d38>;
154 ti,index-starts-at-one;
155 ti,invert-autoidle-bit;
156 };
157
158 dpll_core_m5_ck: dpll_core_m5_ck {
159 #clock-cells = <0>;
160 compatible = "ti,divider-clock";
161 clocks = <&dpll_core_x2_ck>;
162 ti,max-div = <31>;
163 ti,autoidle-shift = <8>;
164 reg = <0x2d3c>;
165 ti,index-starts-at-one;
166 ti,invert-autoidle-bit;
167 };
168
169 dpll_core_m6_ck: dpll_core_m6_ck {
170 #clock-cells = <0>;
171 compatible = "ti,divider-clock";
172 clocks = <&dpll_core_x2_ck>;
173 ti,max-div = <31>;
174 ti,autoidle-shift = <8>;
175 reg = <0x2d40>;
176 ti,index-starts-at-one;
177 ti,invert-autoidle-bit;
178 };
179
180 dpll_mpu_ck: dpll_mpu_ck {
181 #clock-cells = <0>;
182 compatible = "ti,am3-dpll-clock";
183 clocks = <&sys_clkin_ck>, <&sys_clkin_ck>;
184 reg = <0x2d60>, <0x2d64>, <0x2d6c>;
185 };
186
187 dpll_mpu_m2_ck: dpll_mpu_m2_ck {
188 #clock-cells = <0>;
189 compatible = "ti,divider-clock";
190 clocks = <&dpll_mpu_ck>;
191 ti,max-div = <31>;
192 ti,autoidle-shift = <8>;
193 reg = <0x2d70>;
194 ti,index-starts-at-one;
195 ti,invert-autoidle-bit;
196 };
197
198 dpll_ddr_ck: dpll_ddr_ck {
199 #clock-cells = <0>;
200 compatible = "ti,am3-dpll-clock";
201 clocks = <&sys_clkin_ck>, <&sys_clkin_ck>;
202 reg = <0x2da0>, <0x2da4>, <0x2dac>;
203 };
204
205 dpll_ddr_m2_ck: dpll_ddr_m2_ck {
206 #clock-cells = <0>;
207 compatible = "ti,divider-clock";
208 clocks = <&dpll_ddr_ck>;
209 ti,max-div = <31>;
210 ti,autoidle-shift = <8>;
211 reg = <0x2db0>;
212 ti,index-starts-at-one;
213 ti,invert-autoidle-bit;
214 };
215
216 dpll_disp_ck: dpll_disp_ck {
217 #clock-cells = <0>;
218 compatible = "ti,am3-dpll-clock";
219 clocks = <&sys_clkin_ck>, <&sys_clkin_ck>;
220 reg = <0x2e20>, <0x2e24>, <0x2e2c>;
221 };
222
223 dpll_disp_m2_ck: dpll_disp_m2_ck {
224 #clock-cells = <0>;
225 compatible = "ti,divider-clock";
226 clocks = <&dpll_disp_ck>;
227 ti,max-div = <31>;
228 ti,autoidle-shift = <8>;
229 reg = <0x2e30>;
230 ti,index-starts-at-one;
231 ti,invert-autoidle-bit;
232 };
233
234 dpll_per_ck: dpll_per_ck {
235 #clock-cells = <0>;
236 compatible = "ti,am3-dpll-j-type-clock";
237 clocks = <&sys_clkin_ck>, <&sys_clkin_ck>;
238 reg = <0x2de0>, <0x2de4>, <0x2dec>;
239 };
240
241 dpll_per_m2_ck: dpll_per_m2_ck {
242 #clock-cells = <0>;
243 compatible = "ti,divider-clock";
244 clocks = <&dpll_per_ck>;
245 ti,max-div = <127>;
246 ti,autoidle-shift = <8>;
247 reg = <0x2df0>;
248 ti,index-starts-at-one;
249 ti,invert-autoidle-bit;
250 };
251
252 dpll_per_m2_div4_wkupdm_ck: dpll_per_m2_div4_wkupdm_ck {
253 #clock-cells = <0>;
254 compatible = "fixed-factor-clock";
255 clocks = <&dpll_per_m2_ck>;
256 clock-mult = <1>;
257 clock-div = <4>;
258 };
259
260 dpll_per_m2_div4_ck: dpll_per_m2_div4_ck {
261 #clock-cells = <0>;
262 compatible = "fixed-factor-clock";
263 clocks = <&dpll_per_m2_ck>;
264 clock-mult = <1>;
265 clock-div = <4>;
266 };
267
268 clk_24mhz: clk_24mhz {
269 #clock-cells = <0>;
270 compatible = "fixed-factor-clock";
271 clocks = <&dpll_per_m2_ck>;
272 clock-mult = <1>;
273 clock-div = <8>;
274 };
275
276 clkdiv32k_ck: clkdiv32k_ck {
277 #clock-cells = <0>;
278 compatible = "fixed-factor-clock";
279 clocks = <&clk_24mhz>;
280 clock-mult = <1>;
281 clock-div = <732>;
282 };
283
284 clkdiv32k_ick: clkdiv32k_ick {
285 #clock-cells = <0>;
286 compatible = "ti,gate-clock";
287 clocks = <&clkdiv32k_ck>;
288 ti,bit-shift = <8>;
289 reg = <0x2a38>;
290 };
291
292 sysclk_div: sysclk_div {
293 #clock-cells = <0>;
294 compatible = "fixed-factor-clock";
295 clocks = <&dpll_core_m4_ck>;
296 clock-mult = <1>;
297 clock-div = <1>;
298 };
299
300 pruss_ocp_gclk: pruss_ocp_gclk {
301 #clock-cells = <0>;
302 compatible = "ti,mux-clock";
303 clocks = <&sysclk_div>, <&dpll_disp_m2_ck>;
304 reg = <0x4248>;
305 };
306
307 clk_32k_tpm_ck: clk_32k_tpm_ck {
308 #clock-cells = <0>;
309 compatible = "fixed-clock";
310 clock-frequency = <32768>;
311 };
312
313 timer1_fck: timer1_fck {
314 #clock-cells = <0>;
315 compatible = "ti,mux-clock";
316 clocks = <&sys_clkin_ck>, <&clkdiv32k_ick>, <&tclkin_ck>, <&clk_rc32k_ck>, <&clk_32768_ck>, <&clk_32k_tpm_ck>;
317 reg = <0x4200>;
318 };
319
320 timer2_fck: timer2_fck {
321 #clock-cells = <0>;
322 compatible = "ti,mux-clock";
323 clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>;
324 reg = <0x4204>;
325 };
326
327 timer3_fck: timer3_fck {
328 #clock-cells = <0>;
329 compatible = "ti,mux-clock";
330 clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>;
331 reg = <0x4208>;
332 };
333
334 timer4_fck: timer4_fck {
335 #clock-cells = <0>;
336 compatible = "ti,mux-clock";
337 clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>;
338 reg = <0x420c>;
339 };
340
341 timer5_fck: timer5_fck {
342 #clock-cells = <0>;
343 compatible = "ti,mux-clock";
344 clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>;
345 reg = <0x4210>;
346 };
347
348 timer6_fck: timer6_fck {
349 #clock-cells = <0>;
350 compatible = "ti,mux-clock";
351 clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>;
352 reg = <0x4214>;
353 };
354
355 timer7_fck: timer7_fck {
356 #clock-cells = <0>;
357 compatible = "ti,mux-clock";
358 clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>;
359 reg = <0x4218>;
360 };
361
362 wdt1_fck: wdt1_fck {
363 #clock-cells = <0>;
364 compatible = "ti,mux-clock";
365 clocks = <&clk_rc32k_ck>, <&clkdiv32k_ick>;
366 reg = <0x422c>;
367 };
368
369 l3_gclk: l3_gclk {
370 #clock-cells = <0>;
371 compatible = "fixed-factor-clock";
372 clocks = <&dpll_core_m4_ck>;
373 clock-mult = <1>;
374 clock-div = <1>;
375 };
376
377 dpll_core_m4_div2_ck: dpll_core_m4_div2_ck {
378 #clock-cells = <0>;
379 compatible = "fixed-factor-clock";
380 clocks = <&sysclk_div>;
381 clock-mult = <1>;
382 clock-div = <2>;
383 };
384
385 l4hs_gclk: l4hs_gclk {
386 #clock-cells = <0>;
387 compatible = "fixed-factor-clock";
388 clocks = <&dpll_core_m4_ck>;
389 clock-mult = <1>;
390 clock-div = <1>;
391 };
392
393 l3s_gclk: l3s_gclk {
394 #clock-cells = <0>;
395 compatible = "fixed-factor-clock";
396 clocks = <&dpll_core_m4_div2_ck>;
397 clock-mult = <1>;
398 clock-div = <1>;
399 };
400
401 l4ls_gclk: l4ls_gclk {
402 #clock-cells = <0>;
403 compatible = "fixed-factor-clock";
404 clocks = <&dpll_core_m4_div2_ck>;
405 clock-mult = <1>;
406 clock-div = <1>;
407 };
408
409 cpsw_125mhz_gclk: cpsw_125mhz_gclk {
410 #clock-cells = <0>;
411 compatible = "fixed-factor-clock";
412 clocks = <&dpll_core_m5_ck>;
413 clock-mult = <1>;
414 clock-div = <2>;
415 };
416
417 cpsw_cpts_rft_clk: cpsw_cpts_rft_clk {
418 #clock-cells = <0>;
419 compatible = "ti,mux-clock";
420 clocks = <&sysclk_div>, <&dpll_core_m5_ck>, <&dpll_disp_m2_ck>;
421 reg = <0x4238>;
422 };
423
424 clk_32k_mosc_ck: clk_32k_mosc_ck {
425 #clock-cells = <0>;
426 compatible = "fixed-clock";
427 clock-frequency = <32768>;
428 };
429
430 gpio0_dbclk_mux_ck: gpio0_dbclk_mux_ck {
431 #clock-cells = <0>;
432 compatible = "ti,mux-clock";
433 clocks = <&clk_rc32k_ck>, <&clk_32768_ck>, <&clkdiv32k_ick>, <&clk_32k_mosc_ck>, <&clk_32k_tpm_ck>;
434 reg = <0x4240>;
435 };
436
437 gpio0_dbclk: gpio0_dbclk {
438 #clock-cells = <0>;
439 compatible = "ti,gate-clock";
440 clocks = <&gpio0_dbclk_mux_ck>;
441 ti,bit-shift = <8>;
442 reg = <0x2b68>;
443 };
444
445 gpio1_dbclk: gpio1_dbclk {
446 #clock-cells = <0>;
447 compatible = "ti,gate-clock";
448 clocks = <&clkdiv32k_ick>;
449 ti,bit-shift = <8>;
450 reg = <0x8c78>;
451 };
452
453 gpio2_dbclk: gpio2_dbclk {
454 #clock-cells = <0>;
455 compatible = "ti,gate-clock";
456 clocks = <&clkdiv32k_ick>;
457 ti,bit-shift = <8>;
458 reg = <0x8c80>;
459 };
460
461 gpio3_dbclk: gpio3_dbclk {
462 #clock-cells = <0>;
463 compatible = "ti,gate-clock";
464 clocks = <&clkdiv32k_ick>;
465 ti,bit-shift = <8>;
466 reg = <0x8c88>;
467 };
468
469 gpio4_dbclk: gpio4_dbclk {
470 #clock-cells = <0>;
471 compatible = "ti,gate-clock";
472 clocks = <&clkdiv32k_ick>;
473 ti,bit-shift = <8>;
474 reg = <0x8c90>;
475 };
476
477 gpio5_dbclk: gpio5_dbclk {
478 #clock-cells = <0>;
479 compatible = "ti,gate-clock";
480 clocks = <&clkdiv32k_ick>;
481 ti,bit-shift = <8>;
482 reg = <0x8c98>;
483 };
484
485 mmc_clk: mmc_clk {
486 #clock-cells = <0>;
487 compatible = "fixed-factor-clock";
488 clocks = <&dpll_per_m2_ck>;
489 clock-mult = <1>;
490 clock-div = <2>;
491 };
492
493 gfx_fclk_clksel_ck: gfx_fclk_clksel_ck {
494 #clock-cells = <0>;
495 compatible = "ti,mux-clock";
496 clocks = <&sysclk_div>, <&dpll_per_m2_ck>;
497 ti,bit-shift = <1>;
498 reg = <0x423c>;
499 };
500
501 gfx_fck_div_ck: gfx_fck_div_ck {
502 #clock-cells = <0>;
503 compatible = "ti,divider-clock";
504 clocks = <&gfx_fclk_clksel_ck>;
505 reg = <0x423c>;
506 ti,max-div = <2>;
507 };
508
509 disp_clk: disp_clk {
510 #clock-cells = <0>;
511 compatible = "ti,mux-clock";
512 clocks = <&dpll_disp_m2_ck>, <&dpll_core_m5_ck>, <&dpll_per_m2_ck>;
513 reg = <0x4244>;
514 };
515
516 dpll_extdev_ck: dpll_extdev_ck {
517 #clock-cells = <0>;
518 compatible = "ti,am3-dpll-clock";
519 clocks = <&sys_clkin_ck>, <&sys_clkin_ck>;
520 reg = <0x2e60>, <0x2e64>, <0x2e6c>;
521 };
522
523 dpll_extdev_m2_ck: dpll_extdev_m2_ck {
524 #clock-cells = <0>;
525 compatible = "ti,divider-clock";
526 clocks = <&dpll_extdev_ck>;
527 ti,max-div = <127>;
528 ti,autoidle-shift = <8>;
529 reg = <0x2e70>;
530 ti,index-starts-at-one;
531 ti,invert-autoidle-bit;
532 };
533
534 mux_synctimer32k_ck: mux_synctimer32k_ck {
535 #clock-cells = <0>;
536 compatible = "ti,mux-clock";
537 clocks = <&clk_32768_ck>, <&clk_32k_tpm_ck>, <&clkdiv32k_ick>;
538 reg = <0x4230>;
539 };
540
541 synctimer_32kclk: synctimer_32kclk {
542 #clock-cells = <0>;
543 compatible = "ti,gate-clock";
544 clocks = <&mux_synctimer32k_ck>;
545 ti,bit-shift = <8>;
546 reg = <0x2a30>;
547 };
548
549 timer8_fck: timer8_fck {
550 #clock-cells = <0>;
551 compatible = "ti,mux-clock";
552 clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>, <&clk_32k_tpm_ck>;
553 reg = <0x421c>;
554 };
555
556 timer9_fck: timer9_fck {
557 #clock-cells = <0>;
558 compatible = "ti,mux-clock";
559 clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>, <&clk_32k_tpm_ck>;
560 reg = <0x4220>;
561 };
562
563 timer10_fck: timer10_fck {
564 #clock-cells = <0>;
565 compatible = "ti,mux-clock";
566 clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>, <&clk_32k_tpm_ck>;
567 reg = <0x4224>;
568 };
569
570 timer11_fck: timer11_fck {
571 #clock-cells = <0>;
572 compatible = "ti,mux-clock";
573 clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>, <&clk_32k_tpm_ck>;
574 reg = <0x4228>;
575 };
576
577 cpsw_50m_clkdiv: cpsw_50m_clkdiv {
578 #clock-cells = <0>;
579 compatible = "fixed-factor-clock";
580 clocks = <&dpll_core_m5_ck>;
581 clock-mult = <1>;
582 clock-div = <1>;
583 };
584
585 cpsw_5m_clkdiv: cpsw_5m_clkdiv {
586 #clock-cells = <0>;
587 compatible = "fixed-factor-clock";
588 clocks = <&cpsw_50m_clkdiv>;
589 clock-mult = <1>;
590 clock-div = <10>;
591 };
592
593 dpll_ddr_x2_ck: dpll_ddr_x2_ck {
594 #clock-cells = <0>;
595 compatible = "ti,am3-dpll-x2-clock";
596 clocks = <&dpll_ddr_ck>;
597 };
598
599 dpll_ddr_m4_ck: dpll_ddr_m4_ck {
600 #clock-cells = <0>;
601 compatible = "ti,divider-clock";
602 clocks = <&dpll_ddr_x2_ck>;
603 ti,max-div = <31>;
604 ti,autoidle-shift = <8>;
605 reg = <0x2db8>;
606 ti,index-starts-at-one;
607 ti,invert-autoidle-bit;
608 };
609
610 dpll_per_clkdcoldo: dpll_per_clkdcoldo {
611 #clock-cells = <0>;
612 compatible = "fixed-factor-clock";
613 clocks = <&dpll_per_ck>;
614 clock-mult = <1>;
615 clock-div = <1>;
616 };
617
618 dll_aging_clk_div: dll_aging_clk_div {
619 #clock-cells = <0>;
620 compatible = "ti,divider-clock";
621 clocks = <&sys_clkin_ck>;
622 reg = <0x4250>;
623 ti,dividers = <8>, <16>, <32>;
624 };
625
626 div_core_25m_ck: div_core_25m_ck {
627 #clock-cells = <0>;
628 compatible = "fixed-factor-clock";
629 clocks = <&sysclk_div>;
630 clock-mult = <1>;
631 clock-div = <8>;
632 };
633
634 func_12m_clk: func_12m_clk {
635 #clock-cells = <0>;
636 compatible = "fixed-factor-clock";
637 clocks = <&dpll_per_m2_ck>;
638 clock-mult = <1>;
639 clock-div = <16>;
640 };
641
642 vtp_clk_div: vtp_clk_div {
643 #clock-cells = <0>;
644 compatible = "fixed-factor-clock";
645 clocks = <&sys_clkin_ck>;
646 clock-mult = <1>;
647 clock-div = <2>;
648 };
649
650 usbphy_32khz_clkmux: usbphy_32khz_clkmux {
651 #clock-cells = <0>;
652 compatible = "ti,mux-clock";
653 clocks = <&clk_32768_ck>, <&clk_32k_tpm_ck>;
654 reg = <0x4260>;
655 };
656};
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index d0df4c4e8b0a..1fd75aa4639d 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -104,6 +104,45 @@
104 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>, 104 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
105 <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; 105 <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
106 106
107 prm: prm@4ae06000 {
108 compatible = "ti,dra7-prm";
109 reg = <0x4ae06000 0x3000>;
110
111 prm_clocks: clocks {
112 #address-cells = <1>;
113 #size-cells = <0>;
114 };
115
116 prm_clockdomains: clockdomains {
117 };
118 };
119
120 cm_core_aon: cm_core_aon@4a005000 {
121 compatible = "ti,dra7-cm-core-aon";
122 reg = <0x4a005000 0x2000>;
123
124 cm_core_aon_clocks: clocks {
125 #address-cells = <1>;
126 #size-cells = <0>;
127 };
128
129 cm_core_aon_clockdomains: clockdomains {
130 };
131 };
132
133 cm_core: cm_core@4a008000 {
134 compatible = "ti,dra7-cm-core";
135 reg = <0x4a008000 0x3000>;
136
137 cm_core_clocks: clocks {
138 #address-cells = <1>;
139 #size-cells = <0>;
140 };
141
142 cm_core_clockdomains: clockdomains {
143 };
144 };
145
107 counter32k: counter@4ae04000 { 146 counter32k: counter@4ae04000 {
108 compatible = "ti,omap-counter32k"; 147 compatible = "ti,omap-counter32k";
109 reg = <0x4ae04000 0x40>; 148 reg = <0x4ae04000 0x40>;
@@ -584,3 +623,5 @@
584 }; 623 };
585 }; 624 };
586}; 625};
626
627/include/ "dra7xx-clocks.dtsi"
diff --git a/arch/arm/boot/dts/dra7xx-clocks.dtsi b/arch/arm/boot/dts/dra7xx-clocks.dtsi
new file mode 100644
index 000000000000..e96da9a898ad
--- /dev/null
+++ b/arch/arm/boot/dts/dra7xx-clocks.dtsi
@@ -0,0 +1,2015 @@
1/*
2 * Device Tree Source for DRA7xx clock data
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10&cm_core_aon_clocks {
11 atl_clkin0_ck: atl_clkin0_ck {
12 #clock-cells = <0>;
13 compatible = "fixed-clock";
14 clock-frequency = <0>;
15 };
16
17 atl_clkin1_ck: atl_clkin1_ck {
18 #clock-cells = <0>;
19 compatible = "fixed-clock";
20 clock-frequency = <0>;
21 };
22
23 atl_clkin2_ck: atl_clkin2_ck {
24 #clock-cells = <0>;
25 compatible = "fixed-clock";
26 clock-frequency = <0>;
27 };
28
29 atlclkin3_ck: atlclkin3_ck {
30 #clock-cells = <0>;
31 compatible = "fixed-clock";
32 clock-frequency = <0>;
33 };
34
35 hdmi_clkin_ck: hdmi_clkin_ck {
36 #clock-cells = <0>;
37 compatible = "fixed-clock";
38 clock-frequency = <0>;
39 };
40
41 mlb_clkin_ck: mlb_clkin_ck {
42 #clock-cells = <0>;
43 compatible = "fixed-clock";
44 clock-frequency = <0>;
45 };
46
47 mlbp_clkin_ck: mlbp_clkin_ck {
48 #clock-cells = <0>;
49 compatible = "fixed-clock";
50 clock-frequency = <0>;
51 };
52
53 pciesref_acs_clk_ck: pciesref_acs_clk_ck {
54 #clock-cells = <0>;
55 compatible = "fixed-clock";
56 clock-frequency = <100000000>;
57 };
58
59 ref_clkin0_ck: ref_clkin0_ck {
60 #clock-cells = <0>;
61 compatible = "fixed-clock";
62 clock-frequency = <0>;
63 };
64
65 ref_clkin1_ck: ref_clkin1_ck {
66 #clock-cells = <0>;
67 compatible = "fixed-clock";
68 clock-frequency = <0>;
69 };
70
71 ref_clkin2_ck: ref_clkin2_ck {
72 #clock-cells = <0>;
73 compatible = "fixed-clock";
74 clock-frequency = <0>;
75 };
76
77 ref_clkin3_ck: ref_clkin3_ck {
78 #clock-cells = <0>;
79 compatible = "fixed-clock";
80 clock-frequency = <0>;
81 };
82
83 rmii_clk_ck: rmii_clk_ck {
84 #clock-cells = <0>;
85 compatible = "fixed-clock";
86 clock-frequency = <0>;
87 };
88
89 sdvenc_clkin_ck: sdvenc_clkin_ck {
90 #clock-cells = <0>;
91 compatible = "fixed-clock";
92 clock-frequency = <0>;
93 };
94
95 secure_32k_clk_src_ck: secure_32k_clk_src_ck {
96 #clock-cells = <0>;
97 compatible = "fixed-clock";
98 clock-frequency = <32768>;
99 };
100
101 sys_32k_ck: sys_32k_ck {
102 #clock-cells = <0>;
103 compatible = "fixed-clock";
104 clock-frequency = <32768>;
105 };
106
107 virt_12000000_ck: virt_12000000_ck {
108 #clock-cells = <0>;
109 compatible = "fixed-clock";
110 clock-frequency = <12000000>;
111 };
112
113 virt_13000000_ck: virt_13000000_ck {
114 #clock-cells = <0>;
115 compatible = "fixed-clock";
116 clock-frequency = <13000000>;
117 };
118
119 virt_16800000_ck: virt_16800000_ck {
120 #clock-cells = <0>;
121 compatible = "fixed-clock";
122 clock-frequency = <16800000>;
123 };
124
125 virt_19200000_ck: virt_19200000_ck {
126 #clock-cells = <0>;
127 compatible = "fixed-clock";
128 clock-frequency = <19200000>;
129 };
130
131 virt_20000000_ck: virt_20000000_ck {
132 #clock-cells = <0>;
133 compatible = "fixed-clock";
134 clock-frequency = <20000000>;
135 };
136
137 virt_26000000_ck: virt_26000000_ck {
138 #clock-cells = <0>;
139 compatible = "fixed-clock";
140 clock-frequency = <26000000>;
141 };
142
143 virt_27000000_ck: virt_27000000_ck {
144 #clock-cells = <0>;
145 compatible = "fixed-clock";
146 clock-frequency = <27000000>;
147 };
148
149 virt_38400000_ck: virt_38400000_ck {
150 #clock-cells = <0>;
151 compatible = "fixed-clock";
152 clock-frequency = <38400000>;
153 };
154
155 sys_clkin2: sys_clkin2 {
156 #clock-cells = <0>;
157 compatible = "fixed-clock";
158 clock-frequency = <22579200>;
159 };
160
161 usb_otg_clkin_ck: usb_otg_clkin_ck {
162 #clock-cells = <0>;
163 compatible = "fixed-clock";
164 clock-frequency = <0>;
165 };
166
167 video1_clkin_ck: video1_clkin_ck {
168 #clock-cells = <0>;
169 compatible = "fixed-clock";
170 clock-frequency = <0>;
171 };
172
173 video1_m2_clkin_ck: video1_m2_clkin_ck {
174 #clock-cells = <0>;
175 compatible = "fixed-clock";
176 clock-frequency = <0>;
177 };
178
179 video2_clkin_ck: video2_clkin_ck {
180 #clock-cells = <0>;
181 compatible = "fixed-clock";
182 clock-frequency = <0>;
183 };
184
185 video2_m2_clkin_ck: video2_m2_clkin_ck {
186 #clock-cells = <0>;
187 compatible = "fixed-clock";
188 clock-frequency = <0>;
189 };
190
191 dpll_abe_ck: dpll_abe_ck {
192 #clock-cells = <0>;
193 compatible = "ti,omap4-dpll-m4xen-clock";
194 clocks = <&abe_dpll_clk_mux>, <&abe_dpll_bypass_clk_mux>;
195 reg = <0x01e0>, <0x01e4>, <0x01ec>, <0x01e8>;
196 };
197
198 dpll_abe_x2_ck: dpll_abe_x2_ck {
199 #clock-cells = <0>;
200 compatible = "ti,omap4-dpll-x2-clock";
201 clocks = <&dpll_abe_ck>;
202 };
203
204 dpll_abe_m2x2_ck: dpll_abe_m2x2_ck {
205 #clock-cells = <0>;
206 compatible = "ti,divider-clock";
207 clocks = <&dpll_abe_x2_ck>;
208 ti,max-div = <31>;
209 ti,autoidle-shift = <8>;
210 reg = <0x01f0>;
211 ti,index-starts-at-one;
212 ti,invert-autoidle-bit;
213 };
214
215 abe_clk: abe_clk {
216 #clock-cells = <0>;
217 compatible = "ti,divider-clock";
218 clocks = <&dpll_abe_m2x2_ck>;
219 ti,max-div = <4>;
220 reg = <0x0108>;
221 ti,index-power-of-two;
222 };
223
224 dpll_abe_m2_ck: dpll_abe_m2_ck {
225 #clock-cells = <0>;
226 compatible = "ti,divider-clock";
227 clocks = <&dpll_abe_ck>;
228 ti,max-div = <31>;
229 ti,autoidle-shift = <8>;
230 reg = <0x01f0>;
231 ti,index-starts-at-one;
232 ti,invert-autoidle-bit;
233 };
234
235 dpll_abe_m3x2_ck: dpll_abe_m3x2_ck {
236 #clock-cells = <0>;
237 compatible = "ti,divider-clock";
238 clocks = <&dpll_abe_x2_ck>;
239 ti,max-div = <31>;
240 ti,autoidle-shift = <8>;
241 reg = <0x01f4>;
242 ti,index-starts-at-one;
243 ti,invert-autoidle-bit;
244 };
245
246 dpll_core_ck: dpll_core_ck {
247 #clock-cells = <0>;
248 compatible = "ti,omap4-dpll-core-clock";
249 clocks = <&sys_clkin1>, <&dpll_abe_m3x2_ck>;
250 reg = <0x0120>, <0x0124>, <0x012c>, <0x0128>;
251 };
252
253 dpll_core_x2_ck: dpll_core_x2_ck {
254 #clock-cells = <0>;
255 compatible = "ti,omap4-dpll-x2-clock";
256 clocks = <&dpll_core_ck>;
257 };
258
259 dpll_core_h12x2_ck: dpll_core_h12x2_ck {
260 #clock-cells = <0>;
261 compatible = "ti,divider-clock";
262 clocks = <&dpll_core_x2_ck>;
263 ti,max-div = <63>;
264 ti,autoidle-shift = <8>;
265 reg = <0x013c>;
266 ti,index-starts-at-one;
267 ti,invert-autoidle-bit;
268 };
269
270 mpu_dpll_hs_clk_div: mpu_dpll_hs_clk_div {
271 #clock-cells = <0>;
272 compatible = "fixed-factor-clock";
273 clocks = <&dpll_core_h12x2_ck>;
274 clock-mult = <1>;
275 clock-div = <1>;
276 };
277
278 dpll_mpu_ck: dpll_mpu_ck {
279 #clock-cells = <0>;
280 compatible = "ti,omap4-dpll-clock";
281 clocks = <&sys_clkin1>, <&mpu_dpll_hs_clk_div>;
282 reg = <0x0160>, <0x0164>, <0x016c>, <0x0168>;
283 };
284
285 dpll_mpu_m2_ck: dpll_mpu_m2_ck {
286 #clock-cells = <0>;
287 compatible = "ti,divider-clock";
288 clocks = <&dpll_mpu_ck>;
289 ti,max-div = <31>;
290 ti,autoidle-shift = <8>;
291 reg = <0x0170>;
292 ti,index-starts-at-one;
293 ti,invert-autoidle-bit;
294 };
295
296 mpu_dclk_div: mpu_dclk_div {
297 #clock-cells = <0>;
298 compatible = "fixed-factor-clock";
299 clocks = <&dpll_mpu_m2_ck>;
300 clock-mult = <1>;
301 clock-div = <1>;
302 };
303
304 dsp_dpll_hs_clk_div: dsp_dpll_hs_clk_div {
305 #clock-cells = <0>;
306 compatible = "fixed-factor-clock";
307 clocks = <&dpll_core_h12x2_ck>;
308 clock-mult = <1>;
309 clock-div = <1>;
310 };
311
312 dpll_dsp_ck: dpll_dsp_ck {
313 #clock-cells = <0>;
314 compatible = "ti,omap4-dpll-clock";
315 clocks = <&sys_clkin1>, <&dsp_dpll_hs_clk_div>;
316 reg = <0x0234>, <0x0238>, <0x0240>, <0x023c>;
317 };
318
319 dpll_dsp_m2_ck: dpll_dsp_m2_ck {
320 #clock-cells = <0>;
321 compatible = "ti,divider-clock";
322 clocks = <&dpll_dsp_ck>;
323 ti,max-div = <31>;
324 ti,autoidle-shift = <8>;
325 reg = <0x0244>;
326 ti,index-starts-at-one;
327 ti,invert-autoidle-bit;
328 };
329
330 iva_dpll_hs_clk_div: iva_dpll_hs_clk_div {
331 #clock-cells = <0>;
332 compatible = "fixed-factor-clock";
333 clocks = <&dpll_core_h12x2_ck>;
334 clock-mult = <1>;
335 clock-div = <1>;
336 };
337
338 dpll_iva_ck: dpll_iva_ck {
339 #clock-cells = <0>;
340 compatible = "ti,omap4-dpll-clock";
341 clocks = <&sys_clkin1>, <&iva_dpll_hs_clk_div>;
342 reg = <0x01a0>, <0x01a4>, <0x01ac>, <0x01a8>;
343 };
344
345 dpll_iva_m2_ck: dpll_iva_m2_ck {
346 #clock-cells = <0>;
347 compatible = "ti,divider-clock";
348 clocks = <&dpll_iva_ck>;
349 ti,max-div = <31>;
350 ti,autoidle-shift = <8>;
351 reg = <0x01b0>;
352 ti,index-starts-at-one;
353 ti,invert-autoidle-bit;
354 };
355
356 iva_dclk: iva_dclk {
357 #clock-cells = <0>;
358 compatible = "fixed-factor-clock";
359 clocks = <&dpll_iva_m2_ck>;
360 clock-mult = <1>;
361 clock-div = <1>;
362 };
363
364 dpll_gpu_ck: dpll_gpu_ck {
365 #clock-cells = <0>;
366 compatible = "ti,omap4-dpll-clock";
367 clocks = <&sys_clkin1>, <&dpll_abe_m3x2_ck>;
368 reg = <0x02d8>, <0x02dc>, <0x02e4>, <0x02e0>;
369 };
370
371 dpll_gpu_m2_ck: dpll_gpu_m2_ck {
372 #clock-cells = <0>;
373 compatible = "ti,divider-clock";
374 clocks = <&dpll_gpu_ck>;
375 ti,max-div = <31>;
376 ti,autoidle-shift = <8>;
377 reg = <0x02e8>;
378 ti,index-starts-at-one;
379 ti,invert-autoidle-bit;
380 };
381
382 dpll_core_m2_ck: dpll_core_m2_ck {
383 #clock-cells = <0>;
384 compatible = "ti,divider-clock";
385 clocks = <&dpll_core_ck>;
386 ti,max-div = <31>;
387 ti,autoidle-shift = <8>;
388 reg = <0x0130>;
389 ti,index-starts-at-one;
390 ti,invert-autoidle-bit;
391 };
392
393 core_dpll_out_dclk_div: core_dpll_out_dclk_div {
394 #clock-cells = <0>;
395 compatible = "fixed-factor-clock";
396 clocks = <&dpll_core_m2_ck>;
397 clock-mult = <1>;
398 clock-div = <1>;
399 };
400
401 dpll_ddr_ck: dpll_ddr_ck {
402 #clock-cells = <0>;
403 compatible = "ti,omap4-dpll-clock";
404 clocks = <&sys_clkin1>, <&dpll_abe_m3x2_ck>;
405 reg = <0x0210>, <0x0214>, <0x021c>, <0x0218>;
406 };
407
408 dpll_ddr_m2_ck: dpll_ddr_m2_ck {
409 #clock-cells = <0>;
410 compatible = "ti,divider-clock";
411 clocks = <&dpll_ddr_ck>;
412 ti,max-div = <31>;
413 ti,autoidle-shift = <8>;
414 reg = <0x0220>;
415 ti,index-starts-at-one;
416 ti,invert-autoidle-bit;
417 };
418
419 dpll_gmac_ck: dpll_gmac_ck {
420 #clock-cells = <0>;
421 compatible = "ti,omap4-dpll-clock";
422 clocks = <&sys_clkin1>, <&dpll_abe_m3x2_ck>;
423 reg = <0x02a8>, <0x02ac>, <0x02b4>, <0x02b0>;
424 };
425
426 dpll_gmac_m2_ck: dpll_gmac_m2_ck {
427 #clock-cells = <0>;
428 compatible = "ti,divider-clock";
429 clocks = <&dpll_gmac_ck>;
430 ti,max-div = <31>;
431 ti,autoidle-shift = <8>;
432 reg = <0x02b8>;
433 ti,index-starts-at-one;
434 ti,invert-autoidle-bit;
435 };
436
437 video2_dclk_div: video2_dclk_div {
438 #clock-cells = <0>;
439 compatible = "fixed-factor-clock";
440 clocks = <&video2_m2_clkin_ck>;
441 clock-mult = <1>;
442 clock-div = <1>;
443 };
444
445 video1_dclk_div: video1_dclk_div {
446 #clock-cells = <0>;
447 compatible = "fixed-factor-clock";
448 clocks = <&video1_m2_clkin_ck>;
449 clock-mult = <1>;
450 clock-div = <1>;
451 };
452
453 hdmi_dclk_div: hdmi_dclk_div {
454 #clock-cells = <0>;
455 compatible = "fixed-factor-clock";
456 clocks = <&hdmi_clkin_ck>;
457 clock-mult = <1>;
458 clock-div = <1>;
459 };
460
461 per_dpll_hs_clk_div: per_dpll_hs_clk_div {
462 #clock-cells = <0>;
463 compatible = "fixed-factor-clock";
464 clocks = <&dpll_abe_m3x2_ck>;
465 clock-mult = <1>;
466 clock-div = <2>;
467 };
468
469 usb_dpll_hs_clk_div: usb_dpll_hs_clk_div {
470 #clock-cells = <0>;
471 compatible = "fixed-factor-clock";
472 clocks = <&dpll_abe_m3x2_ck>;
473 clock-mult = <1>;
474 clock-div = <3>;
475 };
476
477 eve_dpll_hs_clk_div: eve_dpll_hs_clk_div {
478 #clock-cells = <0>;
479 compatible = "fixed-factor-clock";
480 clocks = <&dpll_core_h12x2_ck>;
481 clock-mult = <1>;
482 clock-div = <1>;
483 };
484
485 dpll_eve_ck: dpll_eve_ck {
486 #clock-cells = <0>;
487 compatible = "ti,omap4-dpll-clock";
488 clocks = <&sys_clkin1>, <&eve_dpll_hs_clk_div>;
489 reg = <0x0284>, <0x0288>, <0x0290>, <0x028c>;
490 };
491
492 dpll_eve_m2_ck: dpll_eve_m2_ck {
493 #clock-cells = <0>;
494 compatible = "ti,divider-clock";
495 clocks = <&dpll_eve_ck>;
496 ti,max-div = <31>;
497 ti,autoidle-shift = <8>;
498 reg = <0x0294>;
499 ti,index-starts-at-one;
500 ti,invert-autoidle-bit;
501 };
502
503 eve_dclk_div: eve_dclk_div {
504 #clock-cells = <0>;
505 compatible = "fixed-factor-clock";
506 clocks = <&dpll_eve_m2_ck>;
507 clock-mult = <1>;
508 clock-div = <1>;
509 };
510
511 dpll_core_h13x2_ck: dpll_core_h13x2_ck {
512 #clock-cells = <0>;
513 compatible = "ti,divider-clock";
514 clocks = <&dpll_core_x2_ck>;
515 ti,max-div = <63>;
516 ti,autoidle-shift = <8>;
517 reg = <0x0140>;
518 ti,index-starts-at-one;
519 ti,invert-autoidle-bit;
520 };
521
522 dpll_core_h14x2_ck: dpll_core_h14x2_ck {
523 #clock-cells = <0>;
524 compatible = "ti,divider-clock";
525 clocks = <&dpll_core_x2_ck>;
526 ti,max-div = <63>;
527 ti,autoidle-shift = <8>;
528 reg = <0x0144>;
529 ti,index-starts-at-one;
530 ti,invert-autoidle-bit;
531 };
532
533 dpll_core_h22x2_ck: dpll_core_h22x2_ck {
534 #clock-cells = <0>;
535 compatible = "ti,divider-clock";
536 clocks = <&dpll_core_x2_ck>;
537 ti,max-div = <63>;
538 ti,autoidle-shift = <8>;
539 reg = <0x0154>;
540 ti,index-starts-at-one;
541 ti,invert-autoidle-bit;
542 };
543
544 dpll_core_h23x2_ck: dpll_core_h23x2_ck {
545 #clock-cells = <0>;
546 compatible = "ti,divider-clock";
547 clocks = <&dpll_core_x2_ck>;
548 ti,max-div = <63>;
549 ti,autoidle-shift = <8>;
550 reg = <0x0158>;
551 ti,index-starts-at-one;
552 ti,invert-autoidle-bit;
553 };
554
555 dpll_core_h24x2_ck: dpll_core_h24x2_ck {
556 #clock-cells = <0>;
557 compatible = "ti,divider-clock";
558 clocks = <&dpll_core_x2_ck>;
559 ti,max-div = <63>;
560 ti,autoidle-shift = <8>;
561 reg = <0x015c>;
562 ti,index-starts-at-one;
563 ti,invert-autoidle-bit;
564 };
565
566 dpll_ddr_x2_ck: dpll_ddr_x2_ck {
567 #clock-cells = <0>;
568 compatible = "ti,omap4-dpll-x2-clock";
569 clocks = <&dpll_ddr_ck>;
570 };
571
572 dpll_ddr_h11x2_ck: dpll_ddr_h11x2_ck {
573 #clock-cells = <0>;
574 compatible = "ti,divider-clock";
575 clocks = <&dpll_ddr_x2_ck>;
576 ti,max-div = <63>;
577 ti,autoidle-shift = <8>;
578 reg = <0x0228>;
579 ti,index-starts-at-one;
580 ti,invert-autoidle-bit;
581 };
582
583 dpll_dsp_x2_ck: dpll_dsp_x2_ck {
584 #clock-cells = <0>;
585 compatible = "ti,omap4-dpll-x2-clock";
586 clocks = <&dpll_dsp_ck>;
587 };
588
589 dpll_dsp_m3x2_ck: dpll_dsp_m3x2_ck {
590 #clock-cells = <0>;
591 compatible = "ti,divider-clock";
592 clocks = <&dpll_dsp_x2_ck>;
593 ti,max-div = <31>;
594 ti,autoidle-shift = <8>;
595 reg = <0x0248>;
596 ti,index-starts-at-one;
597 ti,invert-autoidle-bit;
598 };
599
600 dpll_gmac_x2_ck: dpll_gmac_x2_ck {
601 #clock-cells = <0>;
602 compatible = "ti,omap4-dpll-x2-clock";
603 clocks = <&dpll_gmac_ck>;
604 };
605
606 dpll_gmac_h11x2_ck: dpll_gmac_h11x2_ck {
607 #clock-cells = <0>;
608 compatible = "ti,divider-clock";
609 clocks = <&dpll_gmac_x2_ck>;
610 ti,max-div = <63>;
611 ti,autoidle-shift = <8>;
612 reg = <0x02c0>;
613 ti,index-starts-at-one;
614 ti,invert-autoidle-bit;
615 };
616
617 dpll_gmac_h12x2_ck: dpll_gmac_h12x2_ck {
618 #clock-cells = <0>;
619 compatible = "ti,divider-clock";
620 clocks = <&dpll_gmac_x2_ck>;
621 ti,max-div = <63>;
622 ti,autoidle-shift = <8>;
623 reg = <0x02c4>;
624 ti,index-starts-at-one;
625 ti,invert-autoidle-bit;
626 };
627
628 dpll_gmac_h13x2_ck: dpll_gmac_h13x2_ck {
629 #clock-cells = <0>;
630 compatible = "ti,divider-clock";
631 clocks = <&dpll_gmac_x2_ck>;
632 ti,max-div = <63>;
633 ti,autoidle-shift = <8>;
634 reg = <0x02c8>;
635 ti,index-starts-at-one;
636 ti,invert-autoidle-bit;
637 };
638
639 dpll_gmac_m3x2_ck: dpll_gmac_m3x2_ck {
640 #clock-cells = <0>;
641 compatible = "ti,divider-clock";
642 clocks = <&dpll_gmac_x2_ck>;
643 ti,max-div = <31>;
644 ti,autoidle-shift = <8>;
645 reg = <0x02bc>;
646 ti,index-starts-at-one;
647 ti,invert-autoidle-bit;
648 };
649
650 gmii_m_clk_div: gmii_m_clk_div {
651 #clock-cells = <0>;
652 compatible = "fixed-factor-clock";
653 clocks = <&dpll_gmac_h11x2_ck>;
654 clock-mult = <1>;
655 clock-div = <2>;
656 };
657
658 hdmi_clk2_div: hdmi_clk2_div {
659 #clock-cells = <0>;
660 compatible = "fixed-factor-clock";
661 clocks = <&hdmi_clkin_ck>;
662 clock-mult = <1>;
663 clock-div = <1>;
664 };
665
666 hdmi_div_clk: hdmi_div_clk {
667 #clock-cells = <0>;
668 compatible = "fixed-factor-clock";
669 clocks = <&hdmi_clkin_ck>;
670 clock-mult = <1>;
671 clock-div = <1>;
672 };
673
674 l3_iclk_div: l3_iclk_div {
675 #clock-cells = <0>;
676 compatible = "fixed-factor-clock";
677 clocks = <&dpll_core_h12x2_ck>;
678 clock-mult = <1>;
679 clock-div = <1>;
680 };
681
682 l4_root_clk_div: l4_root_clk_div {
683 #clock-cells = <0>;
684 compatible = "fixed-factor-clock";
685 clocks = <&l3_iclk_div>;
686 clock-mult = <1>;
687 clock-div = <1>;
688 };
689
690 video1_clk2_div: video1_clk2_div {
691 #clock-cells = <0>;
692 compatible = "fixed-factor-clock";
693 clocks = <&video1_clkin_ck>;
694 clock-mult = <1>;
695 clock-div = <1>;
696 };
697
698 video1_div_clk: video1_div_clk {
699 #clock-cells = <0>;
700 compatible = "fixed-factor-clock";
701 clocks = <&video1_clkin_ck>;
702 clock-mult = <1>;
703 clock-div = <1>;
704 };
705
706 video2_clk2_div: video2_clk2_div {
707 #clock-cells = <0>;
708 compatible = "fixed-factor-clock";
709 clocks = <&video2_clkin_ck>;
710 clock-mult = <1>;
711 clock-div = <1>;
712 };
713
714 video2_div_clk: video2_div_clk {
715 #clock-cells = <0>;
716 compatible = "fixed-factor-clock";
717 clocks = <&video2_clkin_ck>;
718 clock-mult = <1>;
719 clock-div = <1>;
720 };
721
722 ipu1_gfclk_mux: ipu1_gfclk_mux {
723 #clock-cells = <0>;
724 compatible = "ti,mux-clock";
725 clocks = <&dpll_abe_m2x2_ck>, <&dpll_core_h22x2_ck>;
726 ti,bit-shift = <24>;
727 reg = <0x0520>;
728 };
729
730 mcasp1_ahclkr_mux: mcasp1_ahclkr_mux {
731 #clock-cells = <0>;
732 compatible = "ti,mux-clock";
733 clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>;
734 ti,bit-shift = <28>;
735 reg = <0x0550>;
736 };
737
738 mcasp1_ahclkx_mux: mcasp1_ahclkx_mux {
739 #clock-cells = <0>;
740 compatible = "ti,mux-clock";
741 clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>;
742 ti,bit-shift = <24>;
743 reg = <0x0550>;
744 };
745
746 mcasp1_aux_gfclk_mux: mcasp1_aux_gfclk_mux {
747 #clock-cells = <0>;
748 compatible = "ti,mux-clock";
749 clocks = <&per_abe_x1_gfclk2_div>, <&video1_clk2_div>, <&video2_clk2_div>, <&hdmi_clk2_div>;
750 ti,bit-shift = <22>;
751 reg = <0x0550>;
752 };
753
754 timer5_gfclk_mux: timer5_gfclk_mux {
755 #clock-cells = <0>;
756 compatible = "ti,mux-clock";
757 clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>, <&clkoutmux0_clk_mux>;
758 ti,bit-shift = <24>;
759 reg = <0x0558>;
760 };
761
762 timer6_gfclk_mux: timer6_gfclk_mux {
763 #clock-cells = <0>;
764 compatible = "ti,mux-clock";
765 clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>, <&clkoutmux0_clk_mux>;
766 ti,bit-shift = <24>;
767 reg = <0x0560>;
768 };
769
770 timer7_gfclk_mux: timer7_gfclk_mux {
771 #clock-cells = <0>;
772 compatible = "ti,mux-clock";
773 clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>, <&clkoutmux0_clk_mux>;
774 ti,bit-shift = <24>;
775 reg = <0x0568>;
776 };
777
778 timer8_gfclk_mux: timer8_gfclk_mux {
779 #clock-cells = <0>;
780 compatible = "ti,mux-clock";
781 clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>, <&clkoutmux0_clk_mux>;
782 ti,bit-shift = <24>;
783 reg = <0x0570>;
784 };
785
786 uart6_gfclk_mux: uart6_gfclk_mux {
787 #clock-cells = <0>;
788 compatible = "ti,mux-clock";
789 clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>;
790 ti,bit-shift = <24>;
791 reg = <0x0580>;
792 };
793
794 dummy_ck: dummy_ck {
795 #clock-cells = <0>;
796 compatible = "fixed-clock";
797 clock-frequency = <0>;
798 };
799};
800&prm_clocks {
801 sys_clkin1: sys_clkin1 {
802 #clock-cells = <0>;
803 compatible = "ti,mux-clock";
804 clocks = <&virt_12000000_ck>, <&virt_20000000_ck>, <&virt_16800000_ck>, <&virt_19200000_ck>, <&virt_26000000_ck>, <&virt_27000000_ck>, <&virt_38400000_ck>;
805 reg = <0x0110>;
806 ti,index-starts-at-one;
807 };
808
809 abe_dpll_sys_clk_mux: abe_dpll_sys_clk_mux {
810 #clock-cells = <0>;
811 compatible = "ti,mux-clock";
812 clocks = <&sys_clkin1>, <&sys_clkin2>;
813 reg = <0x0118>;
814 };
815
816 abe_dpll_bypass_clk_mux: abe_dpll_bypass_clk_mux {
817 #clock-cells = <0>;
818 compatible = "ti,mux-clock";
819 clocks = <&abe_dpll_sys_clk_mux>, <&sys_32k_ck>;
820 reg = <0x0114>;
821 };
822
823 abe_dpll_clk_mux: abe_dpll_clk_mux {
824 #clock-cells = <0>;
825 compatible = "ti,mux-clock";
826 clocks = <&abe_dpll_sys_clk_mux>, <&sys_32k_ck>;
827 reg = <0x010c>;
828 };
829
830 abe_24m_fclk: abe_24m_fclk {
831 #clock-cells = <0>;
832 compatible = "ti,divider-clock";
833 clocks = <&dpll_abe_m2x2_ck>;
834 reg = <0x011c>;
835 ti,dividers = <8>, <16>;
836 };
837
838 aess_fclk: aess_fclk {
839 #clock-cells = <0>;
840 compatible = "ti,divider-clock";
841 clocks = <&abe_clk>;
842 reg = <0x0178>;
843 ti,max-div = <2>;
844 };
845
846 abe_giclk_div: abe_giclk_div {
847 #clock-cells = <0>;
848 compatible = "ti,divider-clock";
849 clocks = <&aess_fclk>;
850 reg = <0x0174>;
851 ti,max-div = <2>;
852 };
853
854 abe_lp_clk_div: abe_lp_clk_div {
855 #clock-cells = <0>;
856 compatible = "ti,divider-clock";
857 clocks = <&dpll_abe_m2x2_ck>;
858 reg = <0x01d8>;
859 ti,dividers = <16>, <32>;
860 };
861
862 abe_sys_clk_div: abe_sys_clk_div {
863 #clock-cells = <0>;
864 compatible = "ti,divider-clock";
865 clocks = <&sys_clkin1>;
866 reg = <0x0120>;
867 ti,max-div = <2>;
868 };
869
870 adc_gfclk_mux: adc_gfclk_mux {
871 #clock-cells = <0>;
872 compatible = "ti,mux-clock";
873 clocks = <&sys_clkin1>, <&sys_clkin2>, <&sys_32k_ck>;
874 reg = <0x01dc>;
875 };
876
877 sys_clk1_dclk_div: sys_clk1_dclk_div {
878 #clock-cells = <0>;
879 compatible = "ti,divider-clock";
880 clocks = <&sys_clkin1>;
881 ti,max-div = <64>;
882 reg = <0x01c8>;
883 ti,index-power-of-two;
884 };
885
886 sys_clk2_dclk_div: sys_clk2_dclk_div {
887 #clock-cells = <0>;
888 compatible = "ti,divider-clock";
889 clocks = <&sys_clkin2>;
890 ti,max-div = <64>;
891 reg = <0x01cc>;
892 ti,index-power-of-two;
893 };
894
895 per_abe_x1_dclk_div: per_abe_x1_dclk_div {
896 #clock-cells = <0>;
897 compatible = "ti,divider-clock";
898 clocks = <&dpll_abe_m2_ck>;
899 ti,max-div = <64>;
900 reg = <0x01bc>;
901 ti,index-power-of-two;
902 };
903
904 dsp_gclk_div: dsp_gclk_div {
905 #clock-cells = <0>;
906 compatible = "ti,divider-clock";
907 clocks = <&dpll_dsp_m2_ck>;
908 ti,max-div = <64>;
909 reg = <0x018c>;
910 ti,index-power-of-two;
911 };
912
913 gpu_dclk: gpu_dclk {
914 #clock-cells = <0>;
915 compatible = "ti,divider-clock";
916 clocks = <&dpll_gpu_m2_ck>;
917 ti,max-div = <64>;
918 reg = <0x01a0>;
919 ti,index-power-of-two;
920 };
921
922 emif_phy_dclk_div: emif_phy_dclk_div {
923 #clock-cells = <0>;
924 compatible = "ti,divider-clock";
925 clocks = <&dpll_ddr_m2_ck>;
926 ti,max-div = <64>;
927 reg = <0x0190>;
928 ti,index-power-of-two;
929 };
930
931 gmac_250m_dclk_div: gmac_250m_dclk_div {
932 #clock-cells = <0>;
933 compatible = "ti,divider-clock";
934 clocks = <&dpll_gmac_m2_ck>;
935 ti,max-div = <64>;
936 reg = <0x019c>;
937 ti,index-power-of-two;
938 };
939
940 l3init_480m_dclk_div: l3init_480m_dclk_div {
941 #clock-cells = <0>;
942 compatible = "ti,divider-clock";
943 clocks = <&dpll_usb_m2_ck>;
944 ti,max-div = <64>;
945 reg = <0x01ac>;
946 ti,index-power-of-two;
947 };
948
949 usb_otg_dclk_div: usb_otg_dclk_div {
950 #clock-cells = <0>;
951 compatible = "ti,divider-clock";
952 clocks = <&usb_otg_clkin_ck>;
953 ti,max-div = <64>;
954 reg = <0x0184>;
955 ti,index-power-of-two;
956 };
957
958 sata_dclk_div: sata_dclk_div {
959 #clock-cells = <0>;
960 compatible = "ti,divider-clock";
961 clocks = <&sys_clkin1>;
962 ti,max-div = <64>;
963 reg = <0x01c0>;
964 ti,index-power-of-two;
965 };
966
967 pcie2_dclk_div: pcie2_dclk_div {
968 #clock-cells = <0>;
969 compatible = "ti,divider-clock";
970 clocks = <&dpll_pcie_ref_m2_ck>;
971 ti,max-div = <64>;
972 reg = <0x01b8>;
973 ti,index-power-of-two;
974 };
975
976 pcie_dclk_div: pcie_dclk_div {
977 #clock-cells = <0>;
978 compatible = "ti,divider-clock";
979 clocks = <&apll_pcie_m2_ck>;
980 ti,max-div = <64>;
981 reg = <0x01b4>;
982 ti,index-power-of-two;
983 };
984
985 emu_dclk_div: emu_dclk_div {
986 #clock-cells = <0>;
987 compatible = "ti,divider-clock";
988 clocks = <&sys_clkin1>;
989 ti,max-div = <64>;
990 reg = <0x0194>;
991 ti,index-power-of-two;
992 };
993
994 secure_32k_dclk_div: secure_32k_dclk_div {
995 #clock-cells = <0>;
996 compatible = "ti,divider-clock";
997 clocks = <&secure_32k_clk_src_ck>;
998 ti,max-div = <64>;
999 reg = <0x01c4>;
1000 ti,index-power-of-two;
1001 };
1002
1003 clkoutmux0_clk_mux: clkoutmux0_clk_mux {
1004 #clock-cells = <0>;
1005 compatible = "ti,mux-clock";
1006 clocks = <&sys_clk1_dclk_div>, <&sys_clk2_dclk_div>, <&per_abe_x1_dclk_div>, <&mpu_dclk_div>, <&dsp_gclk_div>, <&iva_dclk>, <&gpu_dclk>, <&core_dpll_out_dclk_div>, <&emif_phy_dclk_div>, <&gmac_250m_dclk_div>, <&video2_dclk_div>, <&video1_dclk_div>, <&hdmi_dclk_div>, <&func_96m_aon_dclk_div>, <&l3init_480m_dclk_div>, <&usb_otg_dclk_div>, <&sata_dclk_div>, <&pcie2_dclk_div>, <&pcie_dclk_div>, <&emu_dclk_div>, <&secure_32k_dclk_div>, <&eve_dclk_div>;
1007 reg = <0x0158>;
1008 };
1009
1010 clkoutmux1_clk_mux: clkoutmux1_clk_mux {
1011 #clock-cells = <0>;
1012 compatible = "ti,mux-clock";
1013 clocks = <&sys_clk1_dclk_div>, <&sys_clk2_dclk_div>, <&per_abe_x1_dclk_div>, <&mpu_dclk_div>, <&dsp_gclk_div>, <&iva_dclk>, <&gpu_dclk>, <&core_dpll_out_dclk_div>, <&emif_phy_dclk_div>, <&gmac_250m_dclk_div>, <&video2_dclk_div>, <&video1_dclk_div>, <&hdmi_dclk_div>, <&func_96m_aon_dclk_div>, <&l3init_480m_dclk_div>, <&usb_otg_dclk_div>, <&sata_dclk_div>, <&pcie2_dclk_div>, <&pcie_dclk_div>, <&emu_dclk_div>, <&secure_32k_dclk_div>, <&eve_dclk_div>;
1014 reg = <0x015c>;
1015 };
1016
1017 clkoutmux2_clk_mux: clkoutmux2_clk_mux {
1018 #clock-cells = <0>;
1019 compatible = "ti,mux-clock";
1020 clocks = <&sys_clk1_dclk_div>, <&sys_clk2_dclk_div>, <&per_abe_x1_dclk_div>, <&mpu_dclk_div>, <&dsp_gclk_div>, <&iva_dclk>, <&gpu_dclk>, <&core_dpll_out_dclk_div>, <&emif_phy_dclk_div>, <&gmac_250m_dclk_div>, <&video2_dclk_div>, <&video1_dclk_div>, <&hdmi_dclk_div>, <&func_96m_aon_dclk_div>, <&l3init_480m_dclk_div>, <&usb_otg_dclk_div>, <&sata_dclk_div>, <&pcie2_dclk_div>, <&pcie_dclk_div>, <&emu_dclk_div>, <&secure_32k_dclk_div>, <&eve_dclk_div>;
1021 reg = <0x0160>;
1022 };
1023
1024 custefuse_sys_gfclk_div: custefuse_sys_gfclk_div {
1025 #clock-cells = <0>;
1026 compatible = "fixed-factor-clock";
1027 clocks = <&sys_clkin1>;
1028 clock-mult = <1>;
1029 clock-div = <2>;
1030 };
1031
1032 eve_clk: eve_clk {
1033 #clock-cells = <0>;
1034 compatible = "ti,mux-clock";
1035 clocks = <&dpll_eve_m2_ck>, <&dpll_dsp_m3x2_ck>;
1036 reg = <0x0180>;
1037 };
1038
1039 hdmi_dpll_clk_mux: hdmi_dpll_clk_mux {
1040 #clock-cells = <0>;
1041 compatible = "ti,mux-clock";
1042 clocks = <&sys_clkin1>, <&sys_clkin2>;
1043 reg = <0x01a4>;
1044 };
1045
1046 mlb_clk: mlb_clk {
1047 #clock-cells = <0>;
1048 compatible = "ti,divider-clock";
1049 clocks = <&mlb_clkin_ck>;
1050 ti,max-div = <64>;
1051 reg = <0x0134>;
1052 ti,index-power-of-two;
1053 };
1054
1055 mlbp_clk: mlbp_clk {
1056 #clock-cells = <0>;
1057 compatible = "ti,divider-clock";
1058 clocks = <&mlbp_clkin_ck>;
1059 ti,max-div = <64>;
1060 reg = <0x0130>;
1061 ti,index-power-of-two;
1062 };
1063
1064 per_abe_x1_gfclk2_div: per_abe_x1_gfclk2_div {
1065 #clock-cells = <0>;
1066 compatible = "ti,divider-clock";
1067 clocks = <&dpll_abe_m2_ck>;
1068 ti,max-div = <64>;
1069 reg = <0x0138>;
1070 ti,index-power-of-two;
1071 };
1072
1073 timer_sys_clk_div: timer_sys_clk_div {
1074 #clock-cells = <0>;
1075 compatible = "ti,divider-clock";
1076 clocks = <&sys_clkin1>;
1077 reg = <0x0144>;
1078 ti,max-div = <2>;
1079 };
1080
1081 video1_dpll_clk_mux: video1_dpll_clk_mux {
1082 #clock-cells = <0>;
1083 compatible = "ti,mux-clock";
1084 clocks = <&sys_clkin1>, <&sys_clkin2>;
1085 reg = <0x01d0>;
1086 };
1087
1088 video2_dpll_clk_mux: video2_dpll_clk_mux {
1089 #clock-cells = <0>;
1090 compatible = "ti,mux-clock";
1091 clocks = <&sys_clkin1>, <&sys_clkin2>;
1092 reg = <0x01d4>;
1093 };
1094
1095 wkupaon_iclk_mux: wkupaon_iclk_mux {
1096 #clock-cells = <0>;
1097 compatible = "ti,mux-clock";
1098 clocks = <&sys_clkin1>, <&abe_lp_clk_div>;
1099 reg = <0x0108>;
1100 };
1101
1102 gpio1_dbclk: gpio1_dbclk {
1103 #clock-cells = <0>;
1104 compatible = "ti,gate-clock";
1105 clocks = <&sys_32k_ck>;
1106 ti,bit-shift = <8>;
1107 reg = <0x1838>;
1108 };
1109
1110 dcan1_sys_clk_mux: dcan1_sys_clk_mux {
1111 #clock-cells = <0>;
1112 compatible = "ti,mux-clock";
1113 clocks = <&sys_clkin1>, <&sys_clkin2>;
1114 ti,bit-shift = <24>;
1115 reg = <0x1888>;
1116 };
1117
1118 timer1_gfclk_mux: timer1_gfclk_mux {
1119 #clock-cells = <0>;
1120 compatible = "ti,mux-clock";
1121 clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>;
1122 ti,bit-shift = <24>;
1123 reg = <0x1840>;
1124 };
1125
1126 uart10_gfclk_mux: uart10_gfclk_mux {
1127 #clock-cells = <0>;
1128 compatible = "ti,mux-clock";
1129 clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>;
1130 ti,bit-shift = <24>;
1131 reg = <0x1880>;
1132 };
1133};
1134&cm_core_clocks {
1135 dpll_pcie_ref_ck: dpll_pcie_ref_ck {
1136 #clock-cells = <0>;
1137 compatible = "ti,omap4-dpll-clock";
1138 clocks = <&sys_clkin1>, <&sys_clkin1>;
1139 reg = <0x0200>, <0x0204>, <0x020c>, <0x0208>;
1140 };
1141
1142 dpll_pcie_ref_m2ldo_ck: dpll_pcie_ref_m2ldo_ck {
1143 #clock-cells = <0>;
1144 compatible = "ti,divider-clock";
1145 clocks = <&dpll_pcie_ref_ck>;
1146 ti,max-div = <31>;
1147 ti,autoidle-shift = <8>;
1148 reg = <0x0210>;
1149 ti,index-starts-at-one;
1150 ti,invert-autoidle-bit;
1151 };
1152
1153 apll_pcie_in_clk_mux: apll_pcie_in_clk_mux@4ae06118 {
1154 compatible = "ti,mux-clock";
1155 clocks = <&dpll_pcie_ref_ck>, <&pciesref_acs_clk_ck>;
1156 #clock-cells = <0>;
1157 reg = <0x021c 0x4>;
1158 ti,bit-shift = <7>;
1159 };
1160
1161 apll_pcie_ck: apll_pcie_ck {
1162 #clock-cells = <0>;
1163 compatible = "ti,dra7-apll-clock";
1164 clocks = <&apll_pcie_in_clk_mux>, <&dpll_pcie_ref_ck>;
1165 reg = <0x021c>, <0x0220>;
1166 };
1167
1168 optfclk_pciephy_div: optfclk_pciephy_div@4a00821c {
1169 compatible = "ti,divider-clock";
1170 clocks = <&apll_pcie_ck>;
1171 #clock-cells = <0>;
1172 reg = <0x021c>;
1173 ti,bit-shift = <8>;
1174 ti,max-div = <2>;
1175 };
1176
1177 optfclk_pciephy_clk: optfclk_pciephy_clk@4a0093b0 {
1178 compatible = "ti,gate-clock";
1179 clocks = <&apll_pcie_ck>;
1180 #clock-cells = <0>;
1181 reg = <0x13b0>;
1182 ti,bit-shift = <9>;
1183 };
1184
1185 optfclk_pciephy_div_clk: optfclk_pciephy_div_clk@4a0093b0 {
1186 compatible = "ti,gate-clock";
1187 clocks = <&optfclk_pciephy_div>;
1188 #clock-cells = <0>;
1189 reg = <0x13b0>;
1190 ti,bit-shift = <10>;
1191 };
1192
1193 apll_pcie_clkvcoldo: apll_pcie_clkvcoldo {
1194 #clock-cells = <0>;
1195 compatible = "fixed-factor-clock";
1196 clocks = <&apll_pcie_ck>;
1197 clock-mult = <1>;
1198 clock-div = <1>;
1199 };
1200
1201 apll_pcie_clkvcoldo_div: apll_pcie_clkvcoldo_div {
1202 #clock-cells = <0>;
1203 compatible = "fixed-factor-clock";
1204 clocks = <&apll_pcie_ck>;
1205 clock-mult = <1>;
1206 clock-div = <1>;
1207 };
1208
1209 apll_pcie_m2_ck: apll_pcie_m2_ck {
1210 #clock-cells = <0>;
1211 compatible = "fixed-factor-clock";
1212 clocks = <&apll_pcie_ck>;
1213 clock-mult = <1>;
1214 clock-div = <1>;
1215 };
1216
1217 dpll_per_ck: dpll_per_ck {
1218 #clock-cells = <0>;
1219 compatible = "ti,omap4-dpll-clock";
1220 clocks = <&sys_clkin1>, <&per_dpll_hs_clk_div>;
1221 reg = <0x0140>, <0x0144>, <0x014c>, <0x0148>;
1222 };
1223
1224 dpll_per_m2_ck: dpll_per_m2_ck {
1225 #clock-cells = <0>;
1226 compatible = "ti,divider-clock";
1227 clocks = <&dpll_per_ck>;
1228 ti,max-div = <31>;
1229 ti,autoidle-shift = <8>;
1230 reg = <0x0150>;
1231 ti,index-starts-at-one;
1232 ti,invert-autoidle-bit;
1233 };
1234
1235 func_96m_aon_dclk_div: func_96m_aon_dclk_div {
1236 #clock-cells = <0>;
1237 compatible = "fixed-factor-clock";
1238 clocks = <&dpll_per_m2_ck>;
1239 clock-mult = <1>;
1240 clock-div = <1>;
1241 };
1242
1243 dpll_usb_ck: dpll_usb_ck {
1244 #clock-cells = <0>;
1245 compatible = "ti,omap4-dpll-j-type-clock";
1246 clocks = <&sys_clkin1>, <&usb_dpll_hs_clk_div>;
1247 reg = <0x0180>, <0x0184>, <0x018c>, <0x0188>;
1248 };
1249
1250 dpll_usb_m2_ck: dpll_usb_m2_ck {
1251 #clock-cells = <0>;
1252 compatible = "ti,divider-clock";
1253 clocks = <&dpll_usb_ck>;
1254 ti,max-div = <127>;
1255 ti,autoidle-shift = <8>;
1256 reg = <0x0190>;
1257 ti,index-starts-at-one;
1258 ti,invert-autoidle-bit;
1259 };
1260
1261 dpll_pcie_ref_m2_ck: dpll_pcie_ref_m2_ck {
1262 #clock-cells = <0>;
1263 compatible = "ti,divider-clock";
1264 clocks = <&dpll_pcie_ref_ck>;
1265 ti,max-div = <127>;
1266 ti,autoidle-shift = <8>;
1267 reg = <0x0210>;
1268 ti,index-starts-at-one;
1269 ti,invert-autoidle-bit;
1270 };
1271
1272 dpll_per_x2_ck: dpll_per_x2_ck {
1273 #clock-cells = <0>;
1274 compatible = "ti,omap4-dpll-x2-clock";
1275 clocks = <&dpll_per_ck>;
1276 };
1277
1278 dpll_per_h11x2_ck: dpll_per_h11x2_ck {
1279 #clock-cells = <0>;
1280 compatible = "ti,divider-clock";
1281 clocks = <&dpll_per_x2_ck>;
1282 ti,max-div = <63>;
1283 ti,autoidle-shift = <8>;
1284 reg = <0x0158>;
1285 ti,index-starts-at-one;
1286 ti,invert-autoidle-bit;
1287 };
1288
1289 dpll_per_h12x2_ck: dpll_per_h12x2_ck {
1290 #clock-cells = <0>;
1291 compatible = "ti,divider-clock";
1292 clocks = <&dpll_per_x2_ck>;
1293 ti,max-div = <63>;
1294 ti,autoidle-shift = <8>;
1295 reg = <0x015c>;
1296 ti,index-starts-at-one;
1297 ti,invert-autoidle-bit;
1298 };
1299
1300 dpll_per_h13x2_ck: dpll_per_h13x2_ck {
1301 #clock-cells = <0>;
1302 compatible = "ti,divider-clock";
1303 clocks = <&dpll_per_x2_ck>;
1304 ti,max-div = <63>;
1305 ti,autoidle-shift = <8>;
1306 reg = <0x0160>;
1307 ti,index-starts-at-one;
1308 ti,invert-autoidle-bit;
1309 };
1310
1311 dpll_per_h14x2_ck: dpll_per_h14x2_ck {
1312 #clock-cells = <0>;
1313 compatible = "ti,divider-clock";
1314 clocks = <&dpll_per_x2_ck>;
1315 ti,max-div = <63>;
1316 ti,autoidle-shift = <8>;
1317 reg = <0x0164>;
1318 ti,index-starts-at-one;
1319 ti,invert-autoidle-bit;
1320 };
1321
1322 dpll_per_m2x2_ck: dpll_per_m2x2_ck {
1323 #clock-cells = <0>;
1324 compatible = "ti,divider-clock";
1325 clocks = <&dpll_per_x2_ck>;
1326 ti,max-div = <31>;
1327 ti,autoidle-shift = <8>;
1328 reg = <0x0150>;
1329 ti,index-starts-at-one;
1330 ti,invert-autoidle-bit;
1331 };
1332
1333 dpll_usb_clkdcoldo: dpll_usb_clkdcoldo {
1334 #clock-cells = <0>;
1335 compatible = "fixed-factor-clock";
1336 clocks = <&dpll_usb_ck>;
1337 clock-mult = <1>;
1338 clock-div = <1>;
1339 };
1340
1341 func_128m_clk: func_128m_clk {
1342 #clock-cells = <0>;
1343 compatible = "fixed-factor-clock";
1344 clocks = <&dpll_per_h11x2_ck>;
1345 clock-mult = <1>;
1346 clock-div = <2>;
1347 };
1348
1349 func_12m_fclk: func_12m_fclk {
1350 #clock-cells = <0>;
1351 compatible = "fixed-factor-clock";
1352 clocks = <&dpll_per_m2x2_ck>;
1353 clock-mult = <1>;
1354 clock-div = <16>;
1355 };
1356
1357 func_24m_clk: func_24m_clk {
1358 #clock-cells = <0>;
1359 compatible = "fixed-factor-clock";
1360 clocks = <&dpll_per_m2_ck>;
1361 clock-mult = <1>;
1362 clock-div = <4>;
1363 };
1364
1365 func_48m_fclk: func_48m_fclk {
1366 #clock-cells = <0>;
1367 compatible = "fixed-factor-clock";
1368 clocks = <&dpll_per_m2x2_ck>;
1369 clock-mult = <1>;
1370 clock-div = <4>;
1371 };
1372
1373 func_96m_fclk: func_96m_fclk {
1374 #clock-cells = <0>;
1375 compatible = "fixed-factor-clock";
1376 clocks = <&dpll_per_m2x2_ck>;
1377 clock-mult = <1>;
1378 clock-div = <2>;
1379 };
1380
1381 l3init_60m_fclk: l3init_60m_fclk {
1382 #clock-cells = <0>;
1383 compatible = "ti,divider-clock";
1384 clocks = <&dpll_usb_m2_ck>;
1385 reg = <0x0104>;
1386 ti,dividers = <1>, <8>;
1387 };
1388
1389 dss_32khz_clk: dss_32khz_clk {
1390 #clock-cells = <0>;
1391 compatible = "ti,gate-clock";
1392 clocks = <&sys_32k_ck>;
1393 ti,bit-shift = <11>;
1394 reg = <0x1120>;
1395 };
1396
1397 dss_48mhz_clk: dss_48mhz_clk {
1398 #clock-cells = <0>;
1399 compatible = "ti,gate-clock";
1400 clocks = <&func_48m_fclk>;
1401 ti,bit-shift = <9>;
1402 reg = <0x1120>;
1403 };
1404
1405 dss_dss_clk: dss_dss_clk {
1406 #clock-cells = <0>;
1407 compatible = "ti,gate-clock";
1408 clocks = <&dpll_per_h12x2_ck>;
1409 ti,bit-shift = <8>;
1410 reg = <0x1120>;
1411 };
1412
1413 dss_hdmi_clk: dss_hdmi_clk {
1414 #clock-cells = <0>;
1415 compatible = "ti,gate-clock";
1416 clocks = <&hdmi_dpll_clk_mux>;
1417 ti,bit-shift = <10>;
1418 reg = <0x1120>;
1419 };
1420
1421 dss_video1_clk: dss_video1_clk {
1422 #clock-cells = <0>;
1423 compatible = "ti,gate-clock";
1424 clocks = <&video1_dpll_clk_mux>;
1425 ti,bit-shift = <12>;
1426 reg = <0x1120>;
1427 };
1428
1429 dss_video2_clk: dss_video2_clk {
1430 #clock-cells = <0>;
1431 compatible = "ti,gate-clock";
1432 clocks = <&video2_dpll_clk_mux>;
1433 ti,bit-shift = <13>;
1434 reg = <0x1120>;
1435 };
1436
1437 gpio2_dbclk: gpio2_dbclk {
1438 #clock-cells = <0>;
1439 compatible = "ti,gate-clock";
1440 clocks = <&sys_32k_ck>;
1441 ti,bit-shift = <8>;
1442 reg = <0x1760>;
1443 };
1444
1445 gpio3_dbclk: gpio3_dbclk {
1446 #clock-cells = <0>;
1447 compatible = "ti,gate-clock";
1448 clocks = <&sys_32k_ck>;
1449 ti,bit-shift = <8>;
1450 reg = <0x1768>;
1451 };
1452
1453 gpio4_dbclk: gpio4_dbclk {
1454 #clock-cells = <0>;
1455 compatible = "ti,gate-clock";
1456 clocks = <&sys_32k_ck>;
1457 ti,bit-shift = <8>;
1458 reg = <0x1770>;
1459 };
1460
1461 gpio5_dbclk: gpio5_dbclk {
1462 #clock-cells = <0>;
1463 compatible = "ti,gate-clock";
1464 clocks = <&sys_32k_ck>;
1465 ti,bit-shift = <8>;
1466 reg = <0x1778>;
1467 };
1468
1469 gpio6_dbclk: gpio6_dbclk {
1470 #clock-cells = <0>;
1471 compatible = "ti,gate-clock";
1472 clocks = <&sys_32k_ck>;
1473 ti,bit-shift = <8>;
1474 reg = <0x1780>;
1475 };
1476
1477 gpio7_dbclk: gpio7_dbclk {
1478 #clock-cells = <0>;
1479 compatible = "ti,gate-clock";
1480 clocks = <&sys_32k_ck>;
1481 ti,bit-shift = <8>;
1482 reg = <0x1810>;
1483 };
1484
1485 gpio8_dbclk: gpio8_dbclk {
1486 #clock-cells = <0>;
1487 compatible = "ti,gate-clock";
1488 clocks = <&sys_32k_ck>;
1489 ti,bit-shift = <8>;
1490 reg = <0x1818>;
1491 };
1492
1493 mmc1_clk32k: mmc1_clk32k {
1494 #clock-cells = <0>;
1495 compatible = "ti,gate-clock";
1496 clocks = <&sys_32k_ck>;
1497 ti,bit-shift = <8>;
1498 reg = <0x1328>;
1499 };
1500
1501 mmc2_clk32k: mmc2_clk32k {
1502 #clock-cells = <0>;
1503 compatible = "ti,gate-clock";
1504 clocks = <&sys_32k_ck>;
1505 ti,bit-shift = <8>;
1506 reg = <0x1330>;
1507 };
1508
1509 mmc3_clk32k: mmc3_clk32k {
1510 #clock-cells = <0>;
1511 compatible = "ti,gate-clock";
1512 clocks = <&sys_32k_ck>;
1513 ti,bit-shift = <8>;
1514 reg = <0x1820>;
1515 };
1516
1517 mmc4_clk32k: mmc4_clk32k {
1518 #clock-cells = <0>;
1519 compatible = "ti,gate-clock";
1520 clocks = <&sys_32k_ck>;
1521 ti,bit-shift = <8>;
1522 reg = <0x1828>;
1523 };
1524
1525 sata_ref_clk: sata_ref_clk {
1526 #clock-cells = <0>;
1527 compatible = "ti,gate-clock";
1528 clocks = <&sys_clkin1>;
1529 ti,bit-shift = <8>;
1530 reg = <0x1388>;
1531 };
1532
1533 usb_otg_ss1_refclk960m: usb_otg_ss1_refclk960m {
1534 #clock-cells = <0>;
1535 compatible = "ti,gate-clock";
1536 clocks = <&dpll_usb_clkdcoldo>;
1537 ti,bit-shift = <8>;
1538 reg = <0x13f0>;
1539 };
1540
1541 usb_otg_ss2_refclk960m: usb_otg_ss2_refclk960m {
1542 #clock-cells = <0>;
1543 compatible = "ti,gate-clock";
1544 clocks = <&dpll_usb_clkdcoldo>;
1545 ti,bit-shift = <8>;
1546 reg = <0x1340>;
1547 };
1548
1549 usb_phy1_always_on_clk32k: usb_phy1_always_on_clk32k {
1550 #clock-cells = <0>;
1551 compatible = "ti,gate-clock";
1552 clocks = <&sys_32k_ck>;
1553 ti,bit-shift = <8>;
1554 reg = <0x0640>;
1555 };
1556
1557 usb_phy2_always_on_clk32k: usb_phy2_always_on_clk32k {
1558 #clock-cells = <0>;
1559 compatible = "ti,gate-clock";
1560 clocks = <&sys_32k_ck>;
1561 ti,bit-shift = <8>;
1562 reg = <0x0688>;
1563 };
1564
1565 usb_phy3_always_on_clk32k: usb_phy3_always_on_clk32k {
1566 #clock-cells = <0>;
1567 compatible = "ti,gate-clock";
1568 clocks = <&sys_32k_ck>;
1569 ti,bit-shift = <8>;
1570 reg = <0x0698>;
1571 };
1572
1573 atl_dpll_clk_mux: atl_dpll_clk_mux {
1574 #clock-cells = <0>;
1575 compatible = "ti,mux-clock";
1576 clocks = <&sys_32k_ck>, <&video1_clkin_ck>, <&video2_clkin_ck>, <&hdmi_clkin_ck>;
1577 ti,bit-shift = <24>;
1578 reg = <0x0c00>;
1579 };
1580
1581 atl_gfclk_mux: atl_gfclk_mux {
1582 #clock-cells = <0>;
1583 compatible = "ti,mux-clock";
1584 clocks = <&l3_iclk_div>, <&dpll_abe_m2_ck>, <&atl_dpll_clk_mux>;
1585 ti,bit-shift = <26>;
1586 reg = <0x0c00>;
1587 };
1588
1589 gmac_gmii_ref_clk_div: gmac_gmii_ref_clk_div {
1590 #clock-cells = <0>;
1591 compatible = "ti,divider-clock";
1592 clocks = <&dpll_gmac_m2_ck>;
1593 ti,bit-shift = <24>;
1594 reg = <0x13d0>;
1595 ti,dividers = <2>;
1596 };
1597
1598 gmac_rft_clk_mux: gmac_rft_clk_mux {
1599 #clock-cells = <0>;
1600 compatible = "ti,mux-clock";
1601 clocks = <&video1_clkin_ck>, <&video2_clkin_ck>, <&dpll_abe_m2_ck>, <&hdmi_clkin_ck>, <&l3_iclk_div>;
1602 ti,bit-shift = <25>;
1603 reg = <0x13d0>;
1604 };
1605
1606 gpu_core_gclk_mux: gpu_core_gclk_mux {
1607 #clock-cells = <0>;
1608 compatible = "ti,mux-clock";
1609 clocks = <&dpll_core_h14x2_ck>, <&dpll_per_h14x2_ck>, <&dpll_gpu_m2_ck>;
1610 ti,bit-shift = <24>;
1611 reg = <0x1220>;
1612 };
1613
1614 gpu_hyd_gclk_mux: gpu_hyd_gclk_mux {
1615 #clock-cells = <0>;
1616 compatible = "ti,mux-clock";
1617 clocks = <&dpll_core_h14x2_ck>, <&dpll_per_h14x2_ck>, <&dpll_gpu_m2_ck>;
1618 ti,bit-shift = <26>;
1619 reg = <0x1220>;
1620 };
1621
1622 l3instr_ts_gclk_div: l3instr_ts_gclk_div {
1623 #clock-cells = <0>;
1624 compatible = "ti,divider-clock";
1625 clocks = <&wkupaon_iclk_mux>;
1626 ti,bit-shift = <24>;
1627 reg = <0x0e50>;
1628 ti,dividers = <8>, <16>, <32>;
1629 };
1630
1631 mcasp2_ahclkr_mux: mcasp2_ahclkr_mux {
1632 #clock-cells = <0>;
1633 compatible = "ti,mux-clock";
1634 clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>;
1635 ti,bit-shift = <28>;
1636 reg = <0x1860>;
1637 };
1638
1639 mcasp2_ahclkx_mux: mcasp2_ahclkx_mux {
1640 #clock-cells = <0>;
1641 compatible = "ti,mux-clock";
1642 clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>;
1643 ti,bit-shift = <28>;
1644 reg = <0x1860>;
1645 };
1646
1647 mcasp2_aux_gfclk_mux: mcasp2_aux_gfclk_mux {
1648 #clock-cells = <0>;
1649 compatible = "ti,mux-clock";
1650 clocks = <&per_abe_x1_gfclk2_div>, <&video1_clk2_div>, <&video2_clk2_div>, <&hdmi_clk2_div>;
1651 ti,bit-shift = <22>;
1652 reg = <0x1860>;
1653 };
1654
1655 mcasp3_ahclkx_mux: mcasp3_ahclkx_mux {
1656 #clock-cells = <0>;
1657 compatible = "ti,mux-clock";
1658 clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>;
1659 ti,bit-shift = <24>;
1660 reg = <0x1868>;
1661 };
1662
1663 mcasp3_aux_gfclk_mux: mcasp3_aux_gfclk_mux {
1664 #clock-cells = <0>;
1665 compatible = "ti,mux-clock";
1666 clocks = <&per_abe_x1_gfclk2_div>, <&video1_clk2_div>, <&video2_clk2_div>, <&hdmi_clk2_div>;
1667 ti,bit-shift = <22>;
1668 reg = <0x1868>;
1669 };
1670
1671 mcasp4_ahclkx_mux: mcasp4_ahclkx_mux {
1672 #clock-cells = <0>;
1673 compatible = "ti,mux-clock";
1674 clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>;
1675 ti,bit-shift = <24>;
1676 reg = <0x1898>;
1677 };
1678
1679 mcasp4_aux_gfclk_mux: mcasp4_aux_gfclk_mux {
1680 #clock-cells = <0>;
1681 compatible = "ti,mux-clock";
1682 clocks = <&per_abe_x1_gfclk2_div>, <&video1_clk2_div>, <&video2_clk2_div>, <&hdmi_clk2_div>;
1683 ti,bit-shift = <22>;
1684 reg = <0x1898>;
1685 };
1686
1687 mcasp5_ahclkx_mux: mcasp5_ahclkx_mux {
1688 #clock-cells = <0>;
1689 compatible = "ti,mux-clock";
1690 clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>;
1691 ti,bit-shift = <24>;
1692 reg = <0x1878>;
1693 };
1694
1695 mcasp5_aux_gfclk_mux: mcasp5_aux_gfclk_mux {
1696 #clock-cells = <0>;
1697 compatible = "ti,mux-clock";
1698 clocks = <&per_abe_x1_gfclk2_div>, <&video1_clk2_div>, <&video2_clk2_div>, <&hdmi_clk2_div>;
1699 ti,bit-shift = <22>;
1700 reg = <0x1878>;
1701 };
1702
1703 mcasp6_ahclkx_mux: mcasp6_ahclkx_mux {
1704 #clock-cells = <0>;
1705 compatible = "ti,mux-clock";
1706 clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>;
1707 ti,bit-shift = <24>;
1708 reg = <0x1904>;
1709 };
1710
1711 mcasp6_aux_gfclk_mux: mcasp6_aux_gfclk_mux {
1712 #clock-cells = <0>;
1713 compatible = "ti,mux-clock";
1714 clocks = <&per_abe_x1_gfclk2_div>, <&video1_clk2_div>, <&video2_clk2_div>, <&hdmi_clk2_div>;
1715 ti,bit-shift = <22>;
1716 reg = <0x1904>;
1717 };
1718
1719 mcasp7_ahclkx_mux: mcasp7_ahclkx_mux {
1720 #clock-cells = <0>;
1721 compatible = "ti,mux-clock";
1722 clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>;
1723 ti,bit-shift = <24>;
1724 reg = <0x1908>;
1725 };
1726
1727 mcasp7_aux_gfclk_mux: mcasp7_aux_gfclk_mux {
1728 #clock-cells = <0>;
1729 compatible = "ti,mux-clock";
1730 clocks = <&per_abe_x1_gfclk2_div>, <&video1_clk2_div>, <&video2_clk2_div>, <&hdmi_clk2_div>;
1731 ti,bit-shift = <22>;
1732 reg = <0x1908>;
1733 };
1734
1735 mcasp8_ahclk_mux: mcasp8_ahclk_mux {
1736 #clock-cells = <0>;
1737 compatible = "ti,mux-clock";
1738 clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>;
1739 ti,bit-shift = <22>;
1740 reg = <0x1890>;
1741 };
1742
1743 mcasp8_aux_gfclk_mux: mcasp8_aux_gfclk_mux {
1744 #clock-cells = <0>;
1745 compatible = "ti,mux-clock";
1746 clocks = <&per_abe_x1_gfclk2_div>, <&video1_clk2_div>, <&video2_clk2_div>, <&hdmi_clk2_div>;
1747 ti,bit-shift = <24>;
1748 reg = <0x1890>;
1749 };
1750
1751 mmc1_fclk_mux: mmc1_fclk_mux {
1752 #clock-cells = <0>;
1753 compatible = "ti,mux-clock";
1754 clocks = <&func_128m_clk>, <&dpll_per_m2x2_ck>;
1755 ti,bit-shift = <24>;
1756 reg = <0x1328>;
1757 };
1758
1759 mmc1_fclk_div: mmc1_fclk_div {
1760 #clock-cells = <0>;
1761 compatible = "ti,divider-clock";
1762 clocks = <&mmc1_fclk_mux>;
1763 ti,bit-shift = <25>;
1764 ti,max-div = <4>;
1765 reg = <0x1328>;
1766 ti,index-power-of-two;
1767 };
1768
1769 mmc2_fclk_mux: mmc2_fclk_mux {
1770 #clock-cells = <0>;
1771 compatible = "ti,mux-clock";
1772 clocks = <&func_128m_clk>, <&dpll_per_m2x2_ck>;
1773 ti,bit-shift = <24>;
1774 reg = <0x1330>;
1775 };
1776
1777 mmc2_fclk_div: mmc2_fclk_div {
1778 #clock-cells = <0>;
1779 compatible = "ti,divider-clock";
1780 clocks = <&mmc2_fclk_mux>;
1781 ti,bit-shift = <25>;
1782 ti,max-div = <4>;
1783 reg = <0x1330>;
1784 ti,index-power-of-two;
1785 };
1786
1787 mmc3_gfclk_mux: mmc3_gfclk_mux {
1788 #clock-cells = <0>;
1789 compatible = "ti,mux-clock";
1790 clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>;
1791 ti,bit-shift = <24>;
1792 reg = <0x1820>;
1793 };
1794
1795 mmc3_gfclk_div: mmc3_gfclk_div {
1796 #clock-cells = <0>;
1797 compatible = "ti,divider-clock";
1798 clocks = <&mmc3_gfclk_mux>;
1799 ti,bit-shift = <25>;
1800 ti,max-div = <4>;
1801 reg = <0x1820>;
1802 ti,index-power-of-two;
1803 };
1804
1805 mmc4_gfclk_mux: mmc4_gfclk_mux {
1806 #clock-cells = <0>;
1807 compatible = "ti,mux-clock";
1808 clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>;
1809 ti,bit-shift = <24>;
1810 reg = <0x1828>;
1811 };
1812
1813 mmc4_gfclk_div: mmc4_gfclk_div {
1814 #clock-cells = <0>;
1815 compatible = "ti,divider-clock";
1816 clocks = <&mmc4_gfclk_mux>;
1817 ti,bit-shift = <25>;
1818 ti,max-div = <4>;
1819 reg = <0x1828>;
1820 ti,index-power-of-two;
1821 };
1822
1823 qspi_gfclk_mux: qspi_gfclk_mux {
1824 #clock-cells = <0>;
1825 compatible = "ti,mux-clock";
1826 clocks = <&func_128m_clk>, <&dpll_per_h13x2_ck>;
1827 ti,bit-shift = <24>;
1828 reg = <0x1838>;
1829 };
1830
1831 qspi_gfclk_div: qspi_gfclk_div {
1832 #clock-cells = <0>;
1833 compatible = "ti,divider-clock";
1834 clocks = <&qspi_gfclk_mux>;
1835 ti,bit-shift = <25>;
1836 ti,max-div = <4>;
1837 reg = <0x1838>;
1838 ti,index-power-of-two;
1839 };
1840
1841 timer10_gfclk_mux: timer10_gfclk_mux {
1842 #clock-cells = <0>;
1843 compatible = "ti,mux-clock";
1844 clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>;
1845 ti,bit-shift = <24>;
1846 reg = <0x1728>;
1847 };
1848
1849 timer11_gfclk_mux: timer11_gfclk_mux {
1850 #clock-cells = <0>;
1851 compatible = "ti,mux-clock";
1852 clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>;
1853 ti,bit-shift = <24>;
1854 reg = <0x1730>;
1855 };
1856
1857 timer13_gfclk_mux: timer13_gfclk_mux {
1858 #clock-cells = <0>;
1859 compatible = "ti,mux-clock";
1860 clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>;
1861 ti,bit-shift = <24>;
1862 reg = <0x17c8>;
1863 };
1864
1865 timer14_gfclk_mux: timer14_gfclk_mux {
1866 #clock-cells = <0>;
1867 compatible = "ti,mux-clock";
1868 clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>;
1869 ti,bit-shift = <24>;
1870 reg = <0x17d0>;
1871 };
1872
1873 timer15_gfclk_mux: timer15_gfclk_mux {
1874 #clock-cells = <0>;
1875 compatible = "ti,mux-clock";
1876 clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>;
1877 ti,bit-shift = <24>;
1878 reg = <0x17d8>;
1879 };
1880
1881 timer16_gfclk_mux: timer16_gfclk_mux {
1882 #clock-cells = <0>;
1883 compatible = "ti,mux-clock";
1884 clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>;
1885 ti,bit-shift = <24>;
1886 reg = <0x1830>;
1887 };
1888
1889 timer2_gfclk_mux: timer2_gfclk_mux {
1890 #clock-cells = <0>;
1891 compatible = "ti,mux-clock";
1892 clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>;
1893 ti,bit-shift = <24>;
1894 reg = <0x1738>;
1895 };
1896
1897 timer3_gfclk_mux: timer3_gfclk_mux {
1898 #clock-cells = <0>;
1899 compatible = "ti,mux-clock";
1900 clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>;
1901 ti,bit-shift = <24>;
1902 reg = <0x1740>;
1903 };
1904
1905 timer4_gfclk_mux: timer4_gfclk_mux {
1906 #clock-cells = <0>;
1907 compatible = "ti,mux-clock";
1908 clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>;
1909 ti,bit-shift = <24>;
1910 reg = <0x1748>;
1911 };
1912
1913 timer9_gfclk_mux: timer9_gfclk_mux {
1914 #clock-cells = <0>;
1915 compatible = "ti,mux-clock";
1916 clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>;
1917 ti,bit-shift = <24>;
1918 reg = <0x1750>;
1919 };
1920
1921 uart1_gfclk_mux: uart1_gfclk_mux {
1922 #clock-cells = <0>;
1923 compatible = "ti,mux-clock";
1924 clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>;
1925 ti,bit-shift = <24>;
1926 reg = <0x1840>;
1927 };
1928
1929 uart2_gfclk_mux: uart2_gfclk_mux {
1930 #clock-cells = <0>;
1931 compatible = "ti,mux-clock";
1932 clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>;
1933 ti,bit-shift = <24>;
1934 reg = <0x1848>;
1935 };
1936
1937 uart3_gfclk_mux: uart3_gfclk_mux {
1938 #clock-cells = <0>;
1939 compatible = "ti,mux-clock";
1940 clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>;
1941 ti,bit-shift = <24>;
1942 reg = <0x1850>;
1943 };
1944
1945 uart4_gfclk_mux: uart4_gfclk_mux {
1946 #clock-cells = <0>;
1947 compatible = "ti,mux-clock";
1948 clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>;
1949 ti,bit-shift = <24>;
1950 reg = <0x1858>;
1951 };
1952
1953 uart5_gfclk_mux: uart5_gfclk_mux {
1954 #clock-cells = <0>;
1955 compatible = "ti,mux-clock";
1956 clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>;
1957 ti,bit-shift = <24>;
1958 reg = <0x1870>;
1959 };
1960
1961 uart7_gfclk_mux: uart7_gfclk_mux {
1962 #clock-cells = <0>;
1963 compatible = "ti,mux-clock";
1964 clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>;
1965 ti,bit-shift = <24>;
1966 reg = <0x18d0>;
1967 };
1968
1969 uart8_gfclk_mux: uart8_gfclk_mux {
1970 #clock-cells = <0>;
1971 compatible = "ti,mux-clock";
1972 clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>;
1973 ti,bit-shift = <24>;
1974 reg = <0x18e0>;
1975 };
1976
1977 uart9_gfclk_mux: uart9_gfclk_mux {
1978 #clock-cells = <0>;
1979 compatible = "ti,mux-clock";
1980 clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>;
1981 ti,bit-shift = <24>;
1982 reg = <0x18e8>;
1983 };
1984
1985 vip1_gclk_mux: vip1_gclk_mux {
1986 #clock-cells = <0>;
1987 compatible = "ti,mux-clock";
1988 clocks = <&l3_iclk_div>, <&dpll_core_h23x2_ck>;
1989 ti,bit-shift = <24>;
1990 reg = <0x1020>;
1991 };
1992
1993 vip2_gclk_mux: vip2_gclk_mux {
1994 #clock-cells = <0>;
1995 compatible = "ti,mux-clock";
1996 clocks = <&l3_iclk_div>, <&dpll_core_h23x2_ck>;
1997 ti,bit-shift = <24>;
1998 reg = <0x1028>;
1999 };
2000
2001 vip3_gclk_mux: vip3_gclk_mux {
2002 #clock-cells = <0>;
2003 compatible = "ti,mux-clock";
2004 clocks = <&l3_iclk_div>, <&dpll_core_h23x2_ck>;
2005 ti,bit-shift = <24>;
2006 reg = <0x1030>;
2007 };
2008};
2009
2010&cm_core_clockdomains {
2011 coreaon_clkdm: coreaon_clkdm {
2012 compatible = "ti,clockdomain";
2013 clocks = <&dpll_usb_ck>;
2014 };
2015};
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 427395c083f5..a5fc83b9c835 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -89,6 +89,45 @@
89 interrupts = <0>; 89 interrupts = <0>;
90 }; 90 };
91 91
92 prm: prm@48306000 {
93 compatible = "ti,omap3-prm";
94 reg = <0x48306000 0x4000>;
95
96 prm_clocks: clocks {
97 #address-cells = <1>;
98 #size-cells = <0>;
99 };
100
101 prm_clockdomains: clockdomains {
102 };
103 };
104
105 cm: cm@48004000 {
106 compatible = "ti,omap3-cm";
107 reg = <0x48004000 0x4000>;
108
109 cm_clocks: clocks {
110 #address-cells = <1>;
111 #size-cells = <0>;
112 };
113
114 cm_clockdomains: clockdomains {
115 };
116 };
117
118 scrm: scrm@48002000 {
119 compatible = "ti,omap3-scrm";
120 reg = <0x48002000 0x2000>;
121
122 scrm_clocks: clocks {
123 #address-cells = <1>;
124 #size-cells = <0>;
125 };
126
127 scrm_clockdomains: clockdomains {
128 };
129 };
130
92 counter32k: counter@48320000 { 131 counter32k: counter@48320000 {
93 compatible = "ti,omap-counter32k"; 132 compatible = "ti,omap-counter32k";
94 reg = <0x48320000 0x20>; 133 reg = <0x48320000 0x20>;
@@ -632,3 +671,5 @@
632 }; 671 };
633 }; 672 };
634}; 673};
674
675/include/ "omap3xxx-clocks.dtsi"
diff --git a/arch/arm/boot/dts/omap3430es1-clocks.dtsi b/arch/arm/boot/dts/omap3430es1-clocks.dtsi
new file mode 100644
index 000000000000..02f6c7fabbec
--- /dev/null
+++ b/arch/arm/boot/dts/omap3430es1-clocks.dtsi
@@ -0,0 +1,208 @@
1/*
2 * Device Tree Source for OMAP3430 ES1 clock data
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10&cm_clocks {
11 gfx_l3_ck: gfx_l3_ck {
12 #clock-cells = <0>;
13 compatible = "ti,wait-gate-clock";
14 clocks = <&l3_ick>;
15 reg = <0x0b10>;
16 ti,bit-shift = <0>;
17 };
18
19 gfx_l3_fck: gfx_l3_fck {
20 #clock-cells = <0>;
21 compatible = "ti,divider-clock";
22 clocks = <&l3_ick>;
23 ti,max-div = <7>;
24 reg = <0x0b40>;
25 ti,index-starts-at-one;
26 };
27
28 gfx_l3_ick: gfx_l3_ick {
29 #clock-cells = <0>;
30 compatible = "fixed-factor-clock";
31 clocks = <&gfx_l3_ck>;
32 clock-mult = <1>;
33 clock-div = <1>;
34 };
35
36 gfx_cg1_ck: gfx_cg1_ck {
37 #clock-cells = <0>;
38 compatible = "ti,wait-gate-clock";
39 clocks = <&gfx_l3_fck>;
40 reg = <0x0b00>;
41 ti,bit-shift = <1>;
42 };
43
44 gfx_cg2_ck: gfx_cg2_ck {
45 #clock-cells = <0>;
46 compatible = "ti,wait-gate-clock";
47 clocks = <&gfx_l3_fck>;
48 reg = <0x0b00>;
49 ti,bit-shift = <2>;
50 };
51
52 d2d_26m_fck: d2d_26m_fck {
53 #clock-cells = <0>;
54 compatible = "ti,wait-gate-clock";
55 clocks = <&sys_ck>;
56 reg = <0x0a00>;
57 ti,bit-shift = <3>;
58 };
59
60 fshostusb_fck: fshostusb_fck {
61 #clock-cells = <0>;
62 compatible = "ti,wait-gate-clock";
63 clocks = <&core_48m_fck>;
64 reg = <0x0a00>;
65 ti,bit-shift = <5>;
66 };
67
68 ssi_ssr_gate_fck_3430es1: ssi_ssr_gate_fck_3430es1 {
69 #clock-cells = <0>;
70 compatible = "ti,composite-no-wait-gate-clock";
71 clocks = <&corex2_fck>;
72 ti,bit-shift = <0>;
73 reg = <0x0a00>;
74 };
75
76 ssi_ssr_div_fck_3430es1: ssi_ssr_div_fck_3430es1 {
77 #clock-cells = <0>;
78 compatible = "ti,composite-divider-clock";
79 clocks = <&corex2_fck>;
80 ti,bit-shift = <8>;
81 reg = <0x0a40>;
82 ti,dividers = <0>, <1>, <2>, <3>, <4>, <0>, <6>, <0>, <8>;
83 };
84
85 ssi_ssr_fck_3430es1: ssi_ssr_fck_3430es1 {
86 #clock-cells = <0>;
87 compatible = "ti,composite-clock";
88 clocks = <&ssi_ssr_gate_fck_3430es1>, <&ssi_ssr_div_fck_3430es1>;
89 };
90
91 ssi_sst_fck_3430es1: ssi_sst_fck_3430es1 {
92 #clock-cells = <0>;
93 compatible = "fixed-factor-clock";
94 clocks = <&ssi_ssr_fck_3430es1>;
95 clock-mult = <1>;
96 clock-div = <2>;
97 };
98
99 hsotgusb_ick_3430es1: hsotgusb_ick_3430es1 {
100 #clock-cells = <0>;
101 compatible = "ti,omap3-no-wait-interface-clock";
102 clocks = <&core_l3_ick>;
103 reg = <0x0a10>;
104 ti,bit-shift = <4>;
105 };
106
107 fac_ick: fac_ick {
108 #clock-cells = <0>;
109 compatible = "ti,omap3-interface-clock";
110 clocks = <&core_l4_ick>;
111 reg = <0x0a10>;
112 ti,bit-shift = <8>;
113 };
114
115 ssi_l4_ick: ssi_l4_ick {
116 #clock-cells = <0>;
117 compatible = "fixed-factor-clock";
118 clocks = <&l4_ick>;
119 clock-mult = <1>;
120 clock-div = <1>;
121 };
122
123 ssi_ick_3430es1: ssi_ick_3430es1 {
124 #clock-cells = <0>;
125 compatible = "ti,omap3-no-wait-interface-clock";
126 clocks = <&ssi_l4_ick>;
127 reg = <0x0a10>;
128 ti,bit-shift = <0>;
129 };
130
131 usb_l4_gate_ick: usb_l4_gate_ick {
132 #clock-cells = <0>;
133 compatible = "ti,composite-interface-clock";
134 clocks = <&l4_ick>;
135 ti,bit-shift = <5>;
136 reg = <0x0a10>;
137 };
138
139 usb_l4_div_ick: usb_l4_div_ick {
140 #clock-cells = <0>;
141 compatible = "ti,composite-divider-clock";
142 clocks = <&l4_ick>;
143 ti,bit-shift = <4>;
144 ti,max-div = <1>;
145 reg = <0x0a40>;
146 ti,index-starts-at-one;
147 };
148
149 usb_l4_ick: usb_l4_ick {
150 #clock-cells = <0>;
151 compatible = "ti,composite-clock";
152 clocks = <&usb_l4_gate_ick>, <&usb_l4_div_ick>;
153 };
154
155 dss1_alwon_fck_3430es1: dss1_alwon_fck_3430es1 {
156 #clock-cells = <0>;
157 compatible = "ti,gate-clock";
158 clocks = <&dpll4_m4x2_ck>;
159 ti,bit-shift = <0>;
160 reg = <0x0e00>;
161 ti,set-rate-parent;
162 };
163
164 dss_ick_3430es1: dss_ick_3430es1 {
165 #clock-cells = <0>;
166 compatible = "ti,omap3-no-wait-interface-clock";
167 clocks = <&l4_ick>;
168 reg = <0x0e10>;
169 ti,bit-shift = <0>;
170 };
171};
172
173&cm_clockdomains {
174 core_l3_clkdm: core_l3_clkdm {
175 compatible = "ti,clockdomain";
176 clocks = <&sdrc_ick>, <&hsotgusb_ick_3430es1>;
177 };
178
179 gfx_3430es1_clkdm: gfx_3430es1_clkdm {
180 compatible = "ti,clockdomain";
181 clocks = <&gfx_l3_ck>, <&gfx_cg1_ck>, <&gfx_cg2_ck>;
182 };
183
184 dss_clkdm: dss_clkdm {
185 compatible = "ti,clockdomain";
186 clocks = <&dss_tv_fck>, <&dss_96m_fck>, <&dss2_alwon_fck>,
187 <&dss1_alwon_fck_3430es1>, <&dss_ick_3430es1>;
188 };
189
190 d2d_clkdm: d2d_clkdm {
191 compatible = "ti,clockdomain";
192 clocks = <&d2d_26m_fck>;
193 };
194
195 core_l4_clkdm: core_l4_clkdm {
196 compatible = "ti,clockdomain";
197 clocks = <&mmchs2_fck>, <&mmchs1_fck>, <&i2c3_fck>, <&i2c2_fck>,
198 <&i2c1_fck>, <&mcspi4_fck>, <&mcspi3_fck>,
199 <&mcspi2_fck>, <&mcspi1_fck>, <&uart2_fck>,
200 <&uart1_fck>, <&hdq_fck>, <&mmchs2_ick>, <&mmchs1_ick>,
201 <&hdq_ick>, <&mcspi4_ick>, <&mcspi3_ick>,
202 <&mcspi2_ick>, <&mcspi1_ick>, <&i2c3_ick>, <&i2c2_ick>,
203 <&i2c1_ick>, <&uart2_ick>, <&uart1_ick>, <&gpt11_ick>,
204 <&gpt10_ick>, <&mcbsp5_ick>, <&mcbsp1_ick>,
205 <&omapctrl_ick>, <&aes2_ick>, <&sha12_ick>,
206 <&fshostusb_fck>, <&fac_ick>, <&ssi_ick_3430es1>;
207 };
208};
diff --git a/arch/arm/boot/dts/omap34xx-omap36xx-clocks.dtsi b/arch/arm/boot/dts/omap34xx-omap36xx-clocks.dtsi
new file mode 100644
index 000000000000..b02017b7630e
--- /dev/null
+++ b/arch/arm/boot/dts/omap34xx-omap36xx-clocks.dtsi
@@ -0,0 +1,268 @@
1/*
2 * Device Tree Source for OMAP34XX/OMAP36XX clock data
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10&cm_clocks {
11 security_l4_ick2: security_l4_ick2 {
12 #clock-cells = <0>;
13 compatible = "fixed-factor-clock";
14 clocks = <&l4_ick>;
15 clock-mult = <1>;
16 clock-div = <1>;
17 };
18
19 aes1_ick: aes1_ick {
20 #clock-cells = <0>;
21 compatible = "ti,omap3-interface-clock";
22 clocks = <&security_l4_ick2>;
23 ti,bit-shift = <3>;
24 reg = <0x0a14>;
25 };
26
27 rng_ick: rng_ick {
28 #clock-cells = <0>;
29 compatible = "ti,omap3-interface-clock";
30 clocks = <&security_l4_ick2>;
31 reg = <0x0a14>;
32 ti,bit-shift = <2>;
33 };
34
35 sha11_ick: sha11_ick {
36 #clock-cells = <0>;
37 compatible = "ti,omap3-interface-clock";
38 clocks = <&security_l4_ick2>;
39 reg = <0x0a14>;
40 ti,bit-shift = <1>;
41 };
42
43 des1_ick: des1_ick {
44 #clock-cells = <0>;
45 compatible = "ti,omap3-interface-clock";
46 clocks = <&security_l4_ick2>;
47 reg = <0x0a14>;
48 ti,bit-shift = <0>;
49 };
50
51 cam_mclk: cam_mclk {
52 #clock-cells = <0>;
53 compatible = "ti,gate-clock";
54 clocks = <&dpll4_m5x2_ck>;
55 ti,bit-shift = <0>;
56 reg = <0x0f00>;
57 ti,set-rate-parent;
58 };
59
60 cam_ick: cam_ick {
61 #clock-cells = <0>;
62 compatible = "ti,omap3-no-wait-interface-clock";
63 clocks = <&l4_ick>;
64 reg = <0x0f10>;
65 ti,bit-shift = <0>;
66 };
67
68 csi2_96m_fck: csi2_96m_fck {
69 #clock-cells = <0>;
70 compatible = "ti,gate-clock";
71 clocks = <&core_96m_fck>;
72 reg = <0x0f00>;
73 ti,bit-shift = <1>;
74 };
75
76 security_l3_ick: security_l3_ick {
77 #clock-cells = <0>;
78 compatible = "fixed-factor-clock";
79 clocks = <&l3_ick>;
80 clock-mult = <1>;
81 clock-div = <1>;
82 };
83
84 pka_ick: pka_ick {
85 #clock-cells = <0>;
86 compatible = "ti,omap3-interface-clock";
87 clocks = <&security_l3_ick>;
88 reg = <0x0a14>;
89 ti,bit-shift = <4>;
90 };
91
92 icr_ick: icr_ick {
93 #clock-cells = <0>;
94 compatible = "ti,omap3-interface-clock";
95 clocks = <&core_l4_ick>;
96 reg = <0x0a10>;
97 ti,bit-shift = <29>;
98 };
99
100 des2_ick: des2_ick {
101 #clock-cells = <0>;
102 compatible = "ti,omap3-interface-clock";
103 clocks = <&core_l4_ick>;
104 reg = <0x0a10>;
105 ti,bit-shift = <26>;
106 };
107
108 mspro_ick: mspro_ick {
109 #clock-cells = <0>;
110 compatible = "ti,omap3-interface-clock";
111 clocks = <&core_l4_ick>;
112 reg = <0x0a10>;
113 ti,bit-shift = <23>;
114 };
115
116 mailboxes_ick: mailboxes_ick {
117 #clock-cells = <0>;
118 compatible = "ti,omap3-interface-clock";
119 clocks = <&core_l4_ick>;
120 reg = <0x0a10>;
121 ti,bit-shift = <7>;
122 };
123
124 ssi_l4_ick: ssi_l4_ick {
125 #clock-cells = <0>;
126 compatible = "fixed-factor-clock";
127 clocks = <&l4_ick>;
128 clock-mult = <1>;
129 clock-div = <1>;
130 };
131
132 sr1_fck: sr1_fck {
133 #clock-cells = <0>;
134 compatible = "ti,wait-gate-clock";
135 clocks = <&sys_ck>;
136 reg = <0x0c00>;
137 ti,bit-shift = <6>;
138 };
139
140 sr2_fck: sr2_fck {
141 #clock-cells = <0>;
142 compatible = "ti,wait-gate-clock";
143 clocks = <&sys_ck>;
144 reg = <0x0c00>;
145 ti,bit-shift = <7>;
146 };
147
148 sr_l4_ick: sr_l4_ick {
149 #clock-cells = <0>;
150 compatible = "fixed-factor-clock";
151 clocks = <&l4_ick>;
152 clock-mult = <1>;
153 clock-div = <1>;
154 };
155
156 dpll2_fck: dpll2_fck {
157 #clock-cells = <0>;
158 compatible = "ti,divider-clock";
159 clocks = <&core_ck>;
160 ti,bit-shift = <19>;
161 ti,max-div = <7>;
162 reg = <0x0040>;
163 ti,index-starts-at-one;
164 };
165
166 dpll2_ck: dpll2_ck {
167 #clock-cells = <0>;
168 compatible = "ti,omap3-dpll-clock";
169 clocks = <&sys_ck>, <&dpll2_fck>;
170 reg = <0x0004>, <0x0024>, <0x0040>, <0x0034>;
171 ti,low-power-stop;
172 ti,lock;
173 ti,low-power-bypass;
174 };
175
176 dpll2_m2_ck: dpll2_m2_ck {
177 #clock-cells = <0>;
178 compatible = "ti,divider-clock";
179 clocks = <&dpll2_ck>;
180 ti,max-div = <31>;
181 reg = <0x0044>;
182 ti,index-starts-at-one;
183 };
184
185 iva2_ck: iva2_ck {
186 #clock-cells = <0>;
187 compatible = "ti,wait-gate-clock";
188 clocks = <&dpll2_m2_ck>;
189 reg = <0x0000>;
190 ti,bit-shift = <0>;
191 };
192
193 modem_fck: modem_fck {
194 #clock-cells = <0>;
195 compatible = "ti,omap3-interface-clock";
196 clocks = <&sys_ck>;
197 reg = <0x0a00>;
198 ti,bit-shift = <31>;
199 };
200
201 sad2d_ick: sad2d_ick {
202 #clock-cells = <0>;
203 compatible = "ti,omap3-interface-clock";
204 clocks = <&l3_ick>;
205 reg = <0x0a10>;
206 ti,bit-shift = <3>;
207 };
208
209 mad2d_ick: mad2d_ick {
210 #clock-cells = <0>;
211 compatible = "ti,omap3-interface-clock";
212 clocks = <&l3_ick>;
213 reg = <0x0a18>;
214 ti,bit-shift = <3>;
215 };
216
217 mspro_fck: mspro_fck {
218 #clock-cells = <0>;
219 compatible = "ti,wait-gate-clock";
220 clocks = <&core_96m_fck>;
221 reg = <0x0a00>;
222 ti,bit-shift = <23>;
223 };
224};
225
226&cm_clockdomains {
227 cam_clkdm: cam_clkdm {
228 compatible = "ti,clockdomain";
229 clocks = <&cam_ick>, <&csi2_96m_fck>;
230 };
231
232 iva2_clkdm: iva2_clkdm {
233 compatible = "ti,clockdomain";
234 clocks = <&iva2_ck>;
235 };
236
237 dpll2_clkdm: dpll2_clkdm {
238 compatible = "ti,clockdomain";
239 clocks = <&dpll2_ck>;
240 };
241
242 wkup_clkdm: wkup_clkdm {
243 compatible = "ti,clockdomain";
244 clocks = <&gpio1_dbck>, <&wdt2_fck>, <&wdt2_ick>, <&wdt1_ick>,
245 <&gpio1_ick>, <&omap_32ksync_ick>, <&gpt12_ick>,
246 <&gpt1_ick>, <&sr1_fck>, <&sr2_fck>;
247 };
248
249 d2d_clkdm: d2d_clkdm {
250 compatible = "ti,clockdomain";
251 clocks = <&modem_fck>, <&sad2d_ick>, <&mad2d_ick>;
252 };
253
254 core_l4_clkdm: core_l4_clkdm {
255 compatible = "ti,clockdomain";
256 clocks = <&mmchs2_fck>, <&mmchs1_fck>, <&i2c3_fck>, <&i2c2_fck>,
257 <&i2c1_fck>, <&mcspi4_fck>, <&mcspi3_fck>,
258 <&mcspi2_fck>, <&mcspi1_fck>, <&uart2_fck>,
259 <&uart1_fck>, <&hdq_fck>, <&mmchs2_ick>, <&mmchs1_ick>,
260 <&hdq_ick>, <&mcspi4_ick>, <&mcspi3_ick>,
261 <&mcspi2_ick>, <&mcspi1_ick>, <&i2c3_ick>, <&i2c2_ick>,
262 <&i2c1_ick>, <&uart2_ick>, <&uart1_ick>, <&gpt11_ick>,
263 <&gpt10_ick>, <&mcbsp5_ick>, <&mcbsp1_ick>,
264 <&omapctrl_ick>, <&aes2_ick>, <&sha12_ick>, <&icr_ick>,
265 <&des2_ick>, <&mspro_ick>, <&mailboxes_ick>,
266 <&mspro_fck>;
267 };
268};
diff --git a/arch/arm/boot/dts/omap34xx.dtsi b/arch/arm/boot/dts/omap34xx.dtsi
index 77d124678c95..2e92360da1f3 100644
--- a/arch/arm/boot/dts/omap34xx.dtsi
+++ b/arch/arm/boot/dts/omap34xx.dtsi
@@ -39,3 +39,7 @@
39 }; 39 };
40 }; 40 };
41}; 41};
42
43/include/ "omap34xx-omap36xx-clocks.dtsi"
44/include/ "omap36xx-omap3430es2plus-clocks.dtsi"
45/include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi"
diff --git a/arch/arm/boot/dts/omap36xx-am35xx-omap3430es2plus-clocks.dtsi b/arch/arm/boot/dts/omap36xx-am35xx-omap3430es2plus-clocks.dtsi
new file mode 100644
index 000000000000..af9ae5346bf2
--- /dev/null
+++ b/arch/arm/boot/dts/omap36xx-am35xx-omap3430es2plus-clocks.dtsi
@@ -0,0 +1,242 @@
1/*
2 * Device Tree Source for OMAP36xx/AM35xx/OMAP34xx clock data
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10&prm_clocks {
11 corex2_d3_fck: corex2_d3_fck {
12 #clock-cells = <0>;
13 compatible = "fixed-factor-clock";
14 clocks = <&corex2_fck>;
15 clock-mult = <1>;
16 clock-div = <3>;
17 };
18
19 corex2_d5_fck: corex2_d5_fck {
20 #clock-cells = <0>;
21 compatible = "fixed-factor-clock";
22 clocks = <&corex2_fck>;
23 clock-mult = <1>;
24 clock-div = <5>;
25 };
26};
27&cm_clocks {
28 dpll5_ck: dpll5_ck {
29 #clock-cells = <0>;
30 compatible = "ti,omap3-dpll-clock";
31 clocks = <&sys_ck>, <&sys_ck>;
32 reg = <0x0d04>, <0x0d24>, <0x0d4c>, <0x0d34>;
33 ti,low-power-stop;
34 ti,lock;
35 };
36
37 dpll5_m2_ck: dpll5_m2_ck {
38 #clock-cells = <0>;
39 compatible = "ti,divider-clock";
40 clocks = <&dpll5_ck>;
41 ti,max-div = <31>;
42 reg = <0x0d50>;
43 ti,index-starts-at-one;
44 };
45
46 sgx_gate_fck: sgx_gate_fck {
47 #clock-cells = <0>;
48 compatible = "ti,composite-gate-clock";
49 clocks = <&core_ck>;
50 ti,bit-shift = <1>;
51 reg = <0x0b00>;
52 };
53
54 core_d3_ck: core_d3_ck {
55 #clock-cells = <0>;
56 compatible = "fixed-factor-clock";
57 clocks = <&core_ck>;
58 clock-mult = <1>;
59 clock-div = <3>;
60 };
61
62 core_d4_ck: core_d4_ck {
63 #clock-cells = <0>;
64 compatible = "fixed-factor-clock";
65 clocks = <&core_ck>;
66 clock-mult = <1>;
67 clock-div = <4>;
68 };
69
70 core_d6_ck: core_d6_ck {
71 #clock-cells = <0>;
72 compatible = "fixed-factor-clock";
73 clocks = <&core_ck>;
74 clock-mult = <1>;
75 clock-div = <6>;
76 };
77
78 omap_192m_alwon_fck: omap_192m_alwon_fck {
79 #clock-cells = <0>;
80 compatible = "fixed-factor-clock";
81 clocks = <&dpll4_m2x2_ck>;
82 clock-mult = <1>;
83 clock-div = <1>;
84 };
85
86 core_d2_ck: core_d2_ck {
87 #clock-cells = <0>;
88 compatible = "fixed-factor-clock";
89 clocks = <&core_ck>;
90 clock-mult = <1>;
91 clock-div = <2>;
92 };
93
94 sgx_mux_fck: sgx_mux_fck {
95 #clock-cells = <0>;
96 compatible = "ti,composite-mux-clock";
97 clocks = <&core_d3_ck>, <&core_d4_ck>, <&core_d6_ck>, <&cm_96m_fck>, <&omap_192m_alwon_fck>, <&core_d2_ck>, <&corex2_d3_fck>, <&corex2_d5_fck>;
98 reg = <0x0b40>;
99 };
100
101 sgx_fck: sgx_fck {
102 #clock-cells = <0>;
103 compatible = "ti,composite-clock";
104 clocks = <&sgx_gate_fck>, <&sgx_mux_fck>;
105 };
106
107 sgx_ick: sgx_ick {
108 #clock-cells = <0>;
109 compatible = "ti,wait-gate-clock";
110 clocks = <&l3_ick>;
111 reg = <0x0b10>;
112 ti,bit-shift = <0>;
113 };
114
115 cpefuse_fck: cpefuse_fck {
116 #clock-cells = <0>;
117 compatible = "ti,gate-clock";
118 clocks = <&sys_ck>;
119 reg = <0x0a08>;
120 ti,bit-shift = <0>;
121 };
122
123 ts_fck: ts_fck {
124 #clock-cells = <0>;
125 compatible = "ti,gate-clock";
126 clocks = <&omap_32k_fck>;
127 reg = <0x0a08>;
128 ti,bit-shift = <1>;
129 };
130
131 usbtll_fck: usbtll_fck {
132 #clock-cells = <0>;
133 compatible = "ti,wait-gate-clock";
134 clocks = <&dpll5_m2_ck>;
135 reg = <0x0a08>;
136 ti,bit-shift = <2>;
137 };
138
139 usbtll_ick: usbtll_ick {
140 #clock-cells = <0>;
141 compatible = "ti,omap3-interface-clock";
142 clocks = <&core_l4_ick>;
143 reg = <0x0a18>;
144 ti,bit-shift = <2>;
145 };
146
147 mmchs3_ick: mmchs3_ick {
148 #clock-cells = <0>;
149 compatible = "ti,omap3-interface-clock";
150 clocks = <&core_l4_ick>;
151 reg = <0x0a10>;
152 ti,bit-shift = <30>;
153 };
154
155 mmchs3_fck: mmchs3_fck {
156 #clock-cells = <0>;
157 compatible = "ti,wait-gate-clock";
158 clocks = <&core_96m_fck>;
159 reg = <0x0a00>;
160 ti,bit-shift = <30>;
161 };
162
163 dss1_alwon_fck_3430es2: dss1_alwon_fck_3430es2 {
164 #clock-cells = <0>;
165 compatible = "ti,dss-gate-clock";
166 clocks = <&dpll4_m4x2_ck>;
167 ti,bit-shift = <0>;
168 reg = <0x0e00>;
169 ti,set-rate-parent;
170 };
171
172 dss_ick_3430es2: dss_ick_3430es2 {
173 #clock-cells = <0>;
174 compatible = "ti,omap3-dss-interface-clock";
175 clocks = <&l4_ick>;
176 reg = <0x0e10>;
177 ti,bit-shift = <0>;
178 };
179
180 usbhost_120m_fck: usbhost_120m_fck {
181 #clock-cells = <0>;
182 compatible = "ti,gate-clock";
183 clocks = <&dpll5_m2_ck>;
184 reg = <0x1400>;
185 ti,bit-shift = <1>;
186 };
187
188 usbhost_48m_fck: usbhost_48m_fck {
189 #clock-cells = <0>;
190 compatible = "ti,dss-gate-clock";
191 clocks = <&omap_48m_fck>;
192 reg = <0x1400>;
193 ti,bit-shift = <0>;
194 };
195
196 usbhost_ick: usbhost_ick {
197 #clock-cells = <0>;
198 compatible = "ti,omap3-dss-interface-clock";
199 clocks = <&l4_ick>;
200 reg = <0x1410>;
201 ti,bit-shift = <0>;
202 };
203};
204
205&cm_clockdomains {
206 dpll5_clkdm: dpll5_clkdm {
207 compatible = "ti,clockdomain";
208 clocks = <&dpll5_ck>;
209 };
210
211 sgx_clkdm: sgx_clkdm {
212 compatible = "ti,clockdomain";
213 clocks = <&sgx_ick>;
214 };
215
216 dss_clkdm: dss_clkdm {
217 compatible = "ti,clockdomain";
218 clocks = <&dss_tv_fck>, <&dss_96m_fck>, <&dss2_alwon_fck>,
219 <&dss1_alwon_fck_3430es2>, <&dss_ick_3430es2>;
220 };
221
222 core_l4_clkdm: core_l4_clkdm {
223 compatible = "ti,clockdomain";
224 clocks = <&mmchs2_fck>, <&mmchs1_fck>, <&i2c3_fck>, <&i2c2_fck>,
225 <&i2c1_fck>, <&mcspi4_fck>, <&mcspi3_fck>,
226 <&mcspi2_fck>, <&mcspi1_fck>, <&uart2_fck>,
227 <&uart1_fck>, <&hdq_fck>, <&mmchs2_ick>, <&mmchs1_ick>,
228 <&hdq_ick>, <&mcspi4_ick>, <&mcspi3_ick>,
229 <&mcspi2_ick>, <&mcspi1_ick>, <&i2c3_ick>, <&i2c2_ick>,
230 <&i2c1_ick>, <&uart2_ick>, <&uart1_ick>, <&gpt11_ick>,
231 <&gpt10_ick>, <&mcbsp5_ick>, <&mcbsp1_ick>,
232 <&omapctrl_ick>, <&aes2_ick>, <&sha12_ick>,
233 <&cpefuse_fck>, <&ts_fck>, <&usbtll_fck>,
234 <&usbtll_ick>, <&mmchs3_ick>, <&mmchs3_fck>;
235 };
236
237 usbhost_clkdm: usbhost_clkdm {
238 compatible = "ti,clockdomain";
239 clocks = <&usbhost_120m_fck>, <&usbhost_48m_fck>,
240 <&usbhost_ick>;
241 };
242};
diff --git a/arch/arm/boot/dts/omap36xx-clocks.dtsi b/arch/arm/boot/dts/omap36xx-clocks.dtsi
new file mode 100644
index 000000000000..2fcf253b677c
--- /dev/null
+++ b/arch/arm/boot/dts/omap36xx-clocks.dtsi
@@ -0,0 +1,90 @@
1/*
2 * Device Tree Source for OMAP36xx clock data
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10&cm_clocks {
11 dpll4_ck: dpll4_ck {
12 #clock-cells = <0>;
13 compatible = "ti,omap3-dpll-per-j-type-clock";
14 clocks = <&sys_ck>, <&sys_ck>;
15 reg = <0x0d00>, <0x0d20>, <0x0d44>, <0x0d30>;
16 };
17
18 dpll4_m5x2_ck: dpll4_m5x2_ck {
19 #clock-cells = <0>;
20 compatible = "ti,hsdiv-gate-clock";
21 clocks = <&dpll4_m5x2_mul_ck>;
22 ti,bit-shift = <0x1e>;
23 reg = <0x0d00>;
24 ti,set-rate-parent;
25 ti,set-bit-to-disable;
26 };
27
28 dpll4_m2x2_ck: dpll4_m2x2_ck {
29 #clock-cells = <0>;
30 compatible = "ti,hsdiv-gate-clock";
31 clocks = <&dpll4_m2x2_mul_ck>;
32 ti,bit-shift = <0x1b>;
33 reg = <0x0d00>;
34 ti,set-bit-to-disable;
35 };
36
37 dpll3_m3x2_ck: dpll3_m3x2_ck {
38 #clock-cells = <0>;
39 compatible = "ti,hsdiv-gate-clock";
40 clocks = <&dpll3_m3x2_mul_ck>;
41 ti,bit-shift = <0xc>;
42 reg = <0x0d00>;
43 ti,set-bit-to-disable;
44 };
45
46 dpll4_m3x2_ck: dpll4_m3x2_ck {
47 #clock-cells = <0>;
48 compatible = "ti,hsdiv-gate-clock";
49 clocks = <&dpll4_m3x2_mul_ck>;
50 ti,bit-shift = <0x1c>;
51 reg = <0x0d00>;
52 ti,set-bit-to-disable;
53 };
54
55 dpll4_m6x2_ck: dpll4_m6x2_ck {
56 #clock-cells = <0>;
57 compatible = "ti,hsdiv-gate-clock";
58 clocks = <&dpll4_m6x2_mul_ck>;
59 ti,bit-shift = <0x1f>;
60 reg = <0x0d00>;
61 ti,set-bit-to-disable;
62 };
63
64 uart4_fck: uart4_fck {
65 #clock-cells = <0>;
66 compatible = "ti,wait-gate-clock";
67 clocks = <&per_48m_fck>;
68 reg = <0x1000>;
69 ti,bit-shift = <18>;
70 };
71};
72
73&cm_clockdomains {
74 dpll4_clkdm: dpll4_clkdm {
75 compatible = "ti,clockdomain";
76 clocks = <&dpll4_ck>;
77 };
78
79 per_clkdm: per_clkdm {
80 compatible = "ti,clockdomain";
81 clocks = <&uart3_fck>, <&gpio6_dbck>, <&gpio5_dbck>,
82 <&gpio4_dbck>, <&gpio3_dbck>, <&gpio2_dbck>,
83 <&wdt3_fck>, <&gpio6_ick>, <&gpio5_ick>, <&gpio4_ick>,
84 <&gpio3_ick>, <&gpio2_ick>, <&wdt3_ick>, <&uart3_ick>,
85 <&uart4_ick>, <&gpt9_ick>, <&gpt8_ick>, <&gpt7_ick>,
86 <&gpt6_ick>, <&gpt5_ick>, <&gpt4_ick>, <&gpt3_ick>,
87 <&gpt2_ick>, <&mcbsp2_ick>, <&mcbsp3_ick>,
88 <&mcbsp4_ick>, <&uart4_fck>;
89 };
90};
diff --git a/arch/arm/boot/dts/omap36xx-omap3430es2plus-clocks.dtsi b/arch/arm/boot/dts/omap36xx-omap3430es2plus-clocks.dtsi
new file mode 100644
index 000000000000..8ed475dd63c9
--- /dev/null
+++ b/arch/arm/boot/dts/omap36xx-omap3430es2plus-clocks.dtsi
@@ -0,0 +1,198 @@
1/*
2 * Device Tree Source for OMAP34xx/OMAP36xx clock data
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10&cm_clocks {
11 ssi_ssr_gate_fck_3430es2: ssi_ssr_gate_fck_3430es2 {
12 #clock-cells = <0>;
13 compatible = "ti,composite-no-wait-gate-clock";
14 clocks = <&corex2_fck>;
15 ti,bit-shift = <0>;
16 reg = <0x0a00>;
17 };
18
19 ssi_ssr_div_fck_3430es2: ssi_ssr_div_fck_3430es2 {
20 #clock-cells = <0>;
21 compatible = "ti,composite-divider-clock";
22 clocks = <&corex2_fck>;
23 ti,bit-shift = <8>;
24 reg = <0x0a40>;
25 ti,dividers = <0>, <1>, <2>, <3>, <4>, <0>, <6>, <0>, <8>;
26 };
27
28 ssi_ssr_fck_3430es2: ssi_ssr_fck_3430es2 {
29 #clock-cells = <0>;
30 compatible = "ti,composite-clock";
31 clocks = <&ssi_ssr_gate_fck_3430es2>, <&ssi_ssr_div_fck_3430es2>;
32 };
33
34 ssi_sst_fck_3430es2: ssi_sst_fck_3430es2 {
35 #clock-cells = <0>;
36 compatible = "fixed-factor-clock";
37 clocks = <&ssi_ssr_fck_3430es2>;
38 clock-mult = <1>;
39 clock-div = <2>;
40 };
41
42 hsotgusb_ick_3430es2: hsotgusb_ick_3430es2 {
43 #clock-cells = <0>;
44 compatible = "ti,omap3-hsotgusb-interface-clock";
45 clocks = <&core_l3_ick>;
46 reg = <0x0a10>;
47 ti,bit-shift = <4>;
48 };
49
50 ssi_l4_ick: ssi_l4_ick {
51 #clock-cells = <0>;
52 compatible = "fixed-factor-clock";
53 clocks = <&l4_ick>;
54 clock-mult = <1>;
55 clock-div = <1>;
56 };
57
58 ssi_ick_3430es2: ssi_ick_3430es2 {
59 #clock-cells = <0>;
60 compatible = "ti,omap3-ssi-interface-clock";
61 clocks = <&ssi_l4_ick>;
62 reg = <0x0a10>;
63 ti,bit-shift = <0>;
64 };
65
66 usim_gate_fck: usim_gate_fck {
67 #clock-cells = <0>;
68 compatible = "ti,composite-gate-clock";
69 clocks = <&omap_96m_fck>;
70 ti,bit-shift = <9>;
71 reg = <0x0c00>;
72 };
73
74 sys_d2_ck: sys_d2_ck {
75 #clock-cells = <0>;
76 compatible = "fixed-factor-clock";
77 clocks = <&sys_ck>;
78 clock-mult = <1>;
79 clock-div = <2>;
80 };
81
82 omap_96m_d2_fck: omap_96m_d2_fck {
83 #clock-cells = <0>;
84 compatible = "fixed-factor-clock";
85 clocks = <&omap_96m_fck>;
86 clock-mult = <1>;
87 clock-div = <2>;
88 };
89
90 omap_96m_d4_fck: omap_96m_d4_fck {
91 #clock-cells = <0>;
92 compatible = "fixed-factor-clock";
93 clocks = <&omap_96m_fck>;
94 clock-mult = <1>;
95 clock-div = <4>;
96 };
97
98 omap_96m_d8_fck: omap_96m_d8_fck {
99 #clock-cells = <0>;
100 compatible = "fixed-factor-clock";
101 clocks = <&omap_96m_fck>;
102 clock-mult = <1>;
103 clock-div = <8>;
104 };
105
106 omap_96m_d10_fck: omap_96m_d10_fck {
107 #clock-cells = <0>;
108 compatible = "fixed-factor-clock";
109 clocks = <&omap_96m_fck>;
110 clock-mult = <1>;
111 clock-div = <10>;
112 };
113
114 dpll5_m2_d4_ck: dpll5_m2_d4_ck {
115 #clock-cells = <0>;
116 compatible = "fixed-factor-clock";
117 clocks = <&dpll5_m2_ck>;
118 clock-mult = <1>;
119 clock-div = <4>;
120 };
121
122 dpll5_m2_d8_ck: dpll5_m2_d8_ck {
123 #clock-cells = <0>;
124 compatible = "fixed-factor-clock";
125 clocks = <&dpll5_m2_ck>;
126 clock-mult = <1>;
127 clock-div = <8>;
128 };
129
130 dpll5_m2_d16_ck: dpll5_m2_d16_ck {
131 #clock-cells = <0>;
132 compatible = "fixed-factor-clock";
133 clocks = <&dpll5_m2_ck>;
134 clock-mult = <1>;
135 clock-div = <16>;
136 };
137
138 dpll5_m2_d20_ck: dpll5_m2_d20_ck {
139 #clock-cells = <0>;
140 compatible = "fixed-factor-clock";
141 clocks = <&dpll5_m2_ck>;
142 clock-mult = <1>;
143 clock-div = <20>;
144 };
145
146 usim_mux_fck: usim_mux_fck {
147 #clock-cells = <0>;
148 compatible = "ti,composite-mux-clock";
149 clocks = <&sys_ck>, <&sys_d2_ck>, <&omap_96m_d2_fck>, <&omap_96m_d4_fck>, <&omap_96m_d8_fck>, <&omap_96m_d10_fck>, <&dpll5_m2_d4_ck>, <&dpll5_m2_d8_ck>, <&dpll5_m2_d16_ck>, <&dpll5_m2_d20_ck>;
150 ti,bit-shift = <3>;
151 reg = <0x0c40>;
152 ti,index-starts-at-one;
153 };
154
155 usim_fck: usim_fck {
156 #clock-cells = <0>;
157 compatible = "ti,composite-clock";
158 clocks = <&usim_gate_fck>, <&usim_mux_fck>;
159 };
160
161 usim_ick: usim_ick {
162 #clock-cells = <0>;
163 compatible = "ti,omap3-interface-clock";
164 clocks = <&wkup_l4_ick>;
165 reg = <0x0c10>;
166 ti,bit-shift = <9>;
167 };
168};
169
170&cm_clockdomains {
171 core_l3_clkdm: core_l3_clkdm {
172 compatible = "ti,clockdomain";
173 clocks = <&sdrc_ick>, <&hsotgusb_ick_3430es2>;
174 };
175
176 wkup_clkdm: wkup_clkdm {
177 compatible = "ti,clockdomain";
178 clocks = <&gpio1_dbck>, <&wdt2_fck>, <&wdt2_ick>, <&wdt1_ick>,
179 <&gpio1_ick>, <&omap_32ksync_ick>, <&gpt12_ick>,
180 <&gpt1_ick>, <&usim_ick>;
181 };
182
183 core_l4_clkdm: core_l4_clkdm {
184 compatible = "ti,clockdomain";
185 clocks = <&cpefuse_fck>, <&ts_fck>, <&usbtll_fck>,
186 <&usbtll_ick>, <&mmchs3_ick>, <&mmchs3_fck>,
187 <&mmchs2_fck>, <&mmchs1_fck>, <&i2c3_fck>, <&i2c2_fck>,
188 <&i2c1_fck>, <&mcspi4_fck>, <&mcspi3_fck>,
189 <&mcspi2_fck>, <&mcspi1_fck>, <&uart2_fck>,
190 <&uart1_fck>, <&hdq_fck>, <&mmchs2_ick>, <&mmchs1_ick>,
191 <&hdq_ick>, <&mcspi4_ick>, <&mcspi3_ick>,
192 <&mcspi2_ick>, <&mcspi1_ick>, <&i2c3_ick>, <&i2c2_ick>,
193 <&i2c1_ick>, <&uart2_ick>, <&uart1_ick>, <&gpt11_ick>,
194 <&gpt10_ick>, <&mcbsp5_ick>, <&mcbsp1_ick>,
195 <&omapctrl_ick>, <&aes2_ick>, <&sha12_ick>,
196 <&ssi_ick_3430es2>;
197 };
198};
diff --git a/arch/arm/boot/dts/omap36xx.dtsi b/arch/arm/boot/dts/omap36xx.dtsi
index b7c7bd96c404..7e8dee9175d6 100644
--- a/arch/arm/boot/dts/omap36xx.dtsi
+++ b/arch/arm/boot/dts/omap36xx.dtsi
@@ -51,3 +51,8 @@
51 }; 51 };
52 }; 52 };
53}; 53};
54
55/include/ "omap36xx-clocks.dtsi"
56/include/ "omap34xx-omap36xx-clocks.dtsi"
57/include/ "omap36xx-omap3430es2plus-clocks.dtsi"
58/include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi"
diff --git a/arch/arm/boot/dts/omap3xxx-clocks.dtsi b/arch/arm/boot/dts/omap3xxx-clocks.dtsi
new file mode 100644
index 000000000000..cb04d4b37e7f
--- /dev/null
+++ b/arch/arm/boot/dts/omap3xxx-clocks.dtsi
@@ -0,0 +1,1660 @@
1/*
2 * Device Tree Source for OMAP3 clock data
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10&prm_clocks {
11 virt_16_8m_ck: virt_16_8m_ck {
12 #clock-cells = <0>;
13 compatible = "fixed-clock";
14 clock-frequency = <16800000>;
15 };
16
17 osc_sys_ck: osc_sys_ck {
18 #clock-cells = <0>;
19 compatible = "ti,mux-clock";
20 clocks = <&virt_12m_ck>, <&virt_13m_ck>, <&virt_19200000_ck>, <&virt_26000000_ck>, <&virt_38_4m_ck>, <&virt_16_8m_ck>;
21 reg = <0x0d40>;
22 };
23
24 sys_ck: sys_ck {
25 #clock-cells = <0>;
26 compatible = "ti,divider-clock";
27 clocks = <&osc_sys_ck>;
28 ti,bit-shift = <6>;
29 ti,max-div = <3>;
30 reg = <0x1270>;
31 ti,index-starts-at-one;
32 };
33
34 sys_clkout1: sys_clkout1 {
35 #clock-cells = <0>;
36 compatible = "ti,gate-clock";
37 clocks = <&osc_sys_ck>;
38 reg = <0x0d70>;
39 ti,bit-shift = <7>;
40 };
41
42 dpll3_x2_ck: dpll3_x2_ck {
43 #clock-cells = <0>;
44 compatible = "fixed-factor-clock";
45 clocks = <&dpll3_ck>;
46 clock-mult = <2>;
47 clock-div = <1>;
48 };
49
50 dpll3_m2x2_ck: dpll3_m2x2_ck {
51 #clock-cells = <0>;
52 compatible = "fixed-factor-clock";
53 clocks = <&dpll3_m2_ck>;
54 clock-mult = <2>;
55 clock-div = <1>;
56 };
57
58 dpll4_x2_ck: dpll4_x2_ck {
59 #clock-cells = <0>;
60 compatible = "fixed-factor-clock";
61 clocks = <&dpll4_ck>;
62 clock-mult = <2>;
63 clock-div = <1>;
64 };
65
66 corex2_fck: corex2_fck {
67 #clock-cells = <0>;
68 compatible = "fixed-factor-clock";
69 clocks = <&dpll3_m2x2_ck>;
70 clock-mult = <1>;
71 clock-div = <1>;
72 };
73
74 wkup_l4_ick: wkup_l4_ick {
75 #clock-cells = <0>;
76 compatible = "fixed-factor-clock";
77 clocks = <&sys_ck>;
78 clock-mult = <1>;
79 clock-div = <1>;
80 };
81};
82&scrm_clocks {
83 mcbsp5_mux_fck: mcbsp5_mux_fck {
84 #clock-cells = <0>;
85 compatible = "ti,composite-mux-clock";
86 clocks = <&core_96m_fck>, <&mcbsp_clks>;
87 ti,bit-shift = <4>;
88 reg = <0x02d8>;
89 };
90
91 mcbsp5_fck: mcbsp5_fck {
92 #clock-cells = <0>;
93 compatible = "ti,composite-clock";
94 clocks = <&mcbsp5_gate_fck>, <&mcbsp5_mux_fck>;
95 };
96
97 mcbsp1_mux_fck: mcbsp1_mux_fck {
98 #clock-cells = <0>;
99 compatible = "ti,composite-mux-clock";
100 clocks = <&core_96m_fck>, <&mcbsp_clks>;
101 ti,bit-shift = <2>;
102 reg = <0x0274>;
103 };
104
105 mcbsp1_fck: mcbsp1_fck {
106 #clock-cells = <0>;
107 compatible = "ti,composite-clock";
108 clocks = <&mcbsp1_gate_fck>, <&mcbsp1_mux_fck>;
109 };
110
111 mcbsp2_mux_fck: mcbsp2_mux_fck {
112 #clock-cells = <0>;
113 compatible = "ti,composite-mux-clock";
114 clocks = <&per_96m_fck>, <&mcbsp_clks>;
115 ti,bit-shift = <6>;
116 reg = <0x0274>;
117 };
118
119 mcbsp2_fck: mcbsp2_fck {
120 #clock-cells = <0>;
121 compatible = "ti,composite-clock";
122 clocks = <&mcbsp2_gate_fck>, <&mcbsp2_mux_fck>;
123 };
124
125 mcbsp3_mux_fck: mcbsp3_mux_fck {
126 #clock-cells = <0>;
127 compatible = "ti,composite-mux-clock";
128 clocks = <&per_96m_fck>, <&mcbsp_clks>;
129 reg = <0x02d8>;
130 };
131
132 mcbsp3_fck: mcbsp3_fck {
133 #clock-cells = <0>;
134 compatible = "ti,composite-clock";
135 clocks = <&mcbsp3_gate_fck>, <&mcbsp3_mux_fck>;
136 };
137
138 mcbsp4_mux_fck: mcbsp4_mux_fck {
139 #clock-cells = <0>;
140 compatible = "ti,composite-mux-clock";
141 clocks = <&per_96m_fck>, <&mcbsp_clks>;
142 ti,bit-shift = <2>;
143 reg = <0x02d8>;
144 };
145
146 mcbsp4_fck: mcbsp4_fck {
147 #clock-cells = <0>;
148 compatible = "ti,composite-clock";
149 clocks = <&mcbsp4_gate_fck>, <&mcbsp4_mux_fck>;
150 };
151};
152&cm_clocks {
153 dummy_apb_pclk: dummy_apb_pclk {
154 #clock-cells = <0>;
155 compatible = "fixed-clock";
156 clock-frequency = <0x0>;
157 };
158
159 omap_32k_fck: omap_32k_fck {
160 #clock-cells = <0>;
161 compatible = "fixed-clock";
162 clock-frequency = <32768>;
163 };
164
165 virt_12m_ck: virt_12m_ck {
166 #clock-cells = <0>;
167 compatible = "fixed-clock";
168 clock-frequency = <12000000>;
169 };
170
171 virt_13m_ck: virt_13m_ck {
172 #clock-cells = <0>;
173 compatible = "fixed-clock";
174 clock-frequency = <13000000>;
175 };
176
177 virt_19200000_ck: virt_19200000_ck {
178 #clock-cells = <0>;
179 compatible = "fixed-clock";
180 clock-frequency = <19200000>;
181 };
182
183 virt_26000000_ck: virt_26000000_ck {
184 #clock-cells = <0>;
185 compatible = "fixed-clock";
186 clock-frequency = <26000000>;
187 };
188
189 virt_38_4m_ck: virt_38_4m_ck {
190 #clock-cells = <0>;
191 compatible = "fixed-clock";
192 clock-frequency = <38400000>;
193 };
194
195 dpll4_ck: dpll4_ck {
196 #clock-cells = <0>;
197 compatible = "ti,omap3-dpll-per-clock";
198 clocks = <&sys_ck>, <&sys_ck>;
199 reg = <0x0d00>, <0x0d20>, <0x0d44>, <0x0d30>;
200 };
201
202 dpll4_m2_ck: dpll4_m2_ck {
203 #clock-cells = <0>;
204 compatible = "ti,divider-clock";
205 clocks = <&dpll4_ck>;
206 ti,max-div = <63>;
207 reg = <0x0d48>;
208 ti,index-starts-at-one;
209 };
210
211 dpll4_m2x2_mul_ck: dpll4_m2x2_mul_ck {
212 #clock-cells = <0>;
213 compatible = "fixed-factor-clock";
214 clocks = <&dpll4_m2_ck>;
215 clock-mult = <2>;
216 clock-div = <1>;
217 };
218
219 dpll4_m2x2_ck: dpll4_m2x2_ck {
220 #clock-cells = <0>;
221 compatible = "ti,gate-clock";
222 clocks = <&dpll4_m2x2_mul_ck>;
223 ti,bit-shift = <0x1b>;
224 reg = <0x0d00>;
225 ti,set-bit-to-disable;
226 };
227
228 omap_96m_alwon_fck: omap_96m_alwon_fck {
229 #clock-cells = <0>;
230 compatible = "fixed-factor-clock";
231 clocks = <&dpll4_m2x2_ck>;
232 clock-mult = <1>;
233 clock-div = <1>;
234 };
235
236 dpll3_ck: dpll3_ck {
237 #clock-cells = <0>;
238 compatible = "ti,omap3-dpll-core-clock";
239 clocks = <&sys_ck>, <&sys_ck>;
240 reg = <0x0d00>, <0x0d20>, <0x0d40>, <0x0d30>;
241 };
242
243 dpll3_m3_ck: dpll3_m3_ck {
244 #clock-cells = <0>;
245 compatible = "ti,divider-clock";
246 clocks = <&dpll3_ck>;
247 ti,bit-shift = <16>;
248 ti,max-div = <31>;
249 reg = <0x1140>;
250 ti,index-starts-at-one;
251 };
252
253 dpll3_m3x2_mul_ck: dpll3_m3x2_mul_ck {
254 #clock-cells = <0>;
255 compatible = "fixed-factor-clock";
256 clocks = <&dpll3_m3_ck>;
257 clock-mult = <2>;
258 clock-div = <1>;
259 };
260
261 dpll3_m3x2_ck: dpll3_m3x2_ck {
262 #clock-cells = <0>;
263 compatible = "ti,gate-clock";
264 clocks = <&dpll3_m3x2_mul_ck>;
265 ti,bit-shift = <0xc>;
266 reg = <0x0d00>;
267 ti,set-bit-to-disable;
268 };
269
270 emu_core_alwon_ck: emu_core_alwon_ck {
271 #clock-cells = <0>;
272 compatible = "fixed-factor-clock";
273 clocks = <&dpll3_m3x2_ck>;
274 clock-mult = <1>;
275 clock-div = <1>;
276 };
277
278 sys_altclk: sys_altclk {
279 #clock-cells = <0>;
280 compatible = "fixed-clock";
281 clock-frequency = <0x0>;
282 };
283
284 mcbsp_clks: mcbsp_clks {
285 #clock-cells = <0>;
286 compatible = "fixed-clock";
287 clock-frequency = <0x0>;
288 };
289
290 dpll3_m2_ck: dpll3_m2_ck {
291 #clock-cells = <0>;
292 compatible = "ti,divider-clock";
293 clocks = <&dpll3_ck>;
294 ti,bit-shift = <27>;
295 ti,max-div = <31>;
296 reg = <0x0d40>;
297 ti,index-starts-at-one;
298 };
299
300 core_ck: core_ck {
301 #clock-cells = <0>;
302 compatible = "fixed-factor-clock";
303 clocks = <&dpll3_m2_ck>;
304 clock-mult = <1>;
305 clock-div = <1>;
306 };
307
308 dpll1_fck: dpll1_fck {
309 #clock-cells = <0>;
310 compatible = "ti,divider-clock";
311 clocks = <&core_ck>;
312 ti,bit-shift = <19>;
313 ti,max-div = <7>;
314 reg = <0x0940>;
315 ti,index-starts-at-one;
316 };
317
318 dpll1_ck: dpll1_ck {
319 #clock-cells = <0>;
320 compatible = "ti,omap3-dpll-clock";
321 clocks = <&sys_ck>, <&dpll1_fck>;
322 reg = <0x0904>, <0x0924>, <0x0940>, <0x0934>;
323 };
324
325 dpll1_x2_ck: dpll1_x2_ck {
326 #clock-cells = <0>;
327 compatible = "fixed-factor-clock";
328 clocks = <&dpll1_ck>;
329 clock-mult = <2>;
330 clock-div = <1>;
331 };
332
333 dpll1_x2m2_ck: dpll1_x2m2_ck {
334 #clock-cells = <0>;
335 compatible = "ti,divider-clock";
336 clocks = <&dpll1_x2_ck>;
337 ti,max-div = <31>;
338 reg = <0x0944>;
339 ti,index-starts-at-one;
340 };
341
342 cm_96m_fck: cm_96m_fck {
343 #clock-cells = <0>;
344 compatible = "fixed-factor-clock";
345 clocks = <&omap_96m_alwon_fck>;
346 clock-mult = <1>;
347 clock-div = <1>;
348 };
349
350 omap_96m_fck: omap_96m_fck {
351 #clock-cells = <0>;
352 compatible = "ti,mux-clock";
353 clocks = <&cm_96m_fck>, <&sys_ck>;
354 ti,bit-shift = <6>;
355 reg = <0x0d40>;
356 };
357
358 dpll4_m3_ck: dpll4_m3_ck {
359 #clock-cells = <0>;
360 compatible = "ti,divider-clock";
361 clocks = <&dpll4_ck>;
362 ti,bit-shift = <8>;
363 ti,max-div = <32>;
364 reg = <0x0e40>;
365 ti,index-starts-at-one;
366 };
367
368 dpll4_m3x2_mul_ck: dpll4_m3x2_mul_ck {
369 #clock-cells = <0>;
370 compatible = "fixed-factor-clock";
371 clocks = <&dpll4_m3_ck>;
372 clock-mult = <2>;
373 clock-div = <1>;
374 };
375
376 dpll4_m3x2_ck: dpll4_m3x2_ck {
377 #clock-cells = <0>;
378 compatible = "ti,gate-clock";
379 clocks = <&dpll4_m3x2_mul_ck>;
380 ti,bit-shift = <0x1c>;
381 reg = <0x0d00>;
382 ti,set-bit-to-disable;
383 };
384
385 omap_54m_fck: omap_54m_fck {
386 #clock-cells = <0>;
387 compatible = "ti,mux-clock";
388 clocks = <&dpll4_m3x2_ck>, <&sys_altclk>;
389 ti,bit-shift = <5>;
390 reg = <0x0d40>;
391 };
392
393 cm_96m_d2_fck: cm_96m_d2_fck {
394 #clock-cells = <0>;
395 compatible = "fixed-factor-clock";
396 clocks = <&cm_96m_fck>;
397 clock-mult = <1>;
398 clock-div = <2>;
399 };
400
401 omap_48m_fck: omap_48m_fck {
402 #clock-cells = <0>;
403 compatible = "ti,mux-clock";
404 clocks = <&cm_96m_d2_fck>, <&sys_altclk>;
405 ti,bit-shift = <3>;
406 reg = <0x0d40>;
407 };
408
409 omap_12m_fck: omap_12m_fck {
410 #clock-cells = <0>;
411 compatible = "fixed-factor-clock";
412 clocks = <&omap_48m_fck>;
413 clock-mult = <1>;
414 clock-div = <4>;
415 };
416
417 dpll4_m4_ck: dpll4_m4_ck {
418 #clock-cells = <0>;
419 compatible = "ti,divider-clock";
420 clocks = <&dpll4_ck>;
421 ti,max-div = <32>;
422 reg = <0x0e40>;
423 ti,index-starts-at-one;
424 };
425
426 dpll4_m4x2_mul_ck: dpll4_m4x2_mul_ck {
427 #clock-cells = <0>;
428 compatible = "fixed-factor-clock";
429 clocks = <&dpll4_m4_ck>;
430 clock-mult = <2>;
431 clock-div = <1>;
432 };
433
434 dpll4_m4x2_ck: dpll4_m4x2_ck {
435 #clock-cells = <0>;
436 compatible = "ti,gate-clock";
437 clocks = <&dpll4_m4x2_mul_ck>;
438 ti,bit-shift = <0x1d>;
439 reg = <0x0d00>;
440 ti,set-bit-to-disable;
441 };
442
443 dpll4_m5_ck: dpll4_m5_ck {
444 #clock-cells = <0>;
445 compatible = "ti,divider-clock";
446 clocks = <&dpll4_ck>;
447 ti,max-div = <63>;
448 reg = <0x0f40>;
449 ti,index-starts-at-one;
450 };
451
452 dpll4_m5x2_mul_ck: dpll4_m5x2_mul_ck {
453 #clock-cells = <0>;
454 compatible = "fixed-factor-clock";
455 clocks = <&dpll4_m5_ck>;
456 clock-mult = <2>;
457 clock-div = <1>;
458 };
459
460 dpll4_m5x2_ck: dpll4_m5x2_ck {
461 #clock-cells = <0>;
462 compatible = "ti,gate-clock";
463 clocks = <&dpll4_m5x2_mul_ck>;
464 ti,bit-shift = <0x1e>;
465 reg = <0x0d00>;
466 ti,set-bit-to-disable;
467 };
468
469 dpll4_m6_ck: dpll4_m6_ck {
470 #clock-cells = <0>;
471 compatible = "ti,divider-clock";
472 clocks = <&dpll4_ck>;
473 ti,bit-shift = <24>;
474 ti,max-div = <63>;
475 reg = <0x1140>;
476 ti,index-starts-at-one;
477 };
478
479 dpll4_m6x2_mul_ck: dpll4_m6x2_mul_ck {
480 #clock-cells = <0>;
481 compatible = "fixed-factor-clock";
482 clocks = <&dpll4_m6_ck>;
483 clock-mult = <2>;
484 clock-div = <1>;
485 };
486
487 dpll4_m6x2_ck: dpll4_m6x2_ck {
488 #clock-cells = <0>;
489 compatible = "ti,gate-clock";
490 clocks = <&dpll4_m6x2_mul_ck>;
491 ti,bit-shift = <0x1f>;
492 reg = <0x0d00>;
493 ti,set-bit-to-disable;
494 };
495
496 emu_per_alwon_ck: emu_per_alwon_ck {
497 #clock-cells = <0>;
498 compatible = "fixed-factor-clock";
499 clocks = <&dpll4_m6x2_ck>;
500 clock-mult = <1>;
501 clock-div = <1>;
502 };
503
504 clkout2_src_gate_ck: clkout2_src_gate_ck {
505 #clock-cells = <0>;
506 compatible = "ti,composite-no-wait-gate-clock";
507 clocks = <&core_ck>;
508 ti,bit-shift = <7>;
509 reg = <0x0d70>;
510 };
511
512 clkout2_src_mux_ck: clkout2_src_mux_ck {
513 #clock-cells = <0>;
514 compatible = "ti,composite-mux-clock";
515 clocks = <&core_ck>, <&sys_ck>, <&cm_96m_fck>, <&omap_54m_fck>;
516 reg = <0x0d70>;
517 };
518
519 clkout2_src_ck: clkout2_src_ck {
520 #clock-cells = <0>;
521 compatible = "ti,composite-clock";
522 clocks = <&clkout2_src_gate_ck>, <&clkout2_src_mux_ck>;
523 };
524
525 sys_clkout2: sys_clkout2 {
526 #clock-cells = <0>;
527 compatible = "ti,divider-clock";
528 clocks = <&clkout2_src_ck>;
529 ti,bit-shift = <3>;
530 ti,max-div = <64>;
531 reg = <0x0d70>;
532 ti,index-power-of-two;
533 };
534
535 mpu_ck: mpu_ck {
536 #clock-cells = <0>;
537 compatible = "fixed-factor-clock";
538 clocks = <&dpll1_x2m2_ck>;
539 clock-mult = <1>;
540 clock-div = <1>;
541 };
542
543 arm_fck: arm_fck {
544 #clock-cells = <0>;
545 compatible = "ti,divider-clock";
546 clocks = <&mpu_ck>;
547 reg = <0x0924>;
548 ti,max-div = <2>;
549 };
550
551 emu_mpu_alwon_ck: emu_mpu_alwon_ck {
552 #clock-cells = <0>;
553 compatible = "fixed-factor-clock";
554 clocks = <&mpu_ck>;
555 clock-mult = <1>;
556 clock-div = <1>;
557 };
558
559 l3_ick: l3_ick {
560 #clock-cells = <0>;
561 compatible = "ti,divider-clock";
562 clocks = <&core_ck>;
563 ti,max-div = <3>;
564 reg = <0x0a40>;
565 ti,index-starts-at-one;
566 };
567
568 l4_ick: l4_ick {
569 #clock-cells = <0>;
570 compatible = "ti,divider-clock";
571 clocks = <&l3_ick>;
572 ti,bit-shift = <2>;
573 ti,max-div = <3>;
574 reg = <0x0a40>;
575 ti,index-starts-at-one;
576 };
577
578 rm_ick: rm_ick {
579 #clock-cells = <0>;
580 compatible = "ti,divider-clock";
581 clocks = <&l4_ick>;
582 ti,bit-shift = <1>;
583 ti,max-div = <3>;
584 reg = <0x0c40>;
585 ti,index-starts-at-one;
586 };
587
588 gpt10_gate_fck: gpt10_gate_fck {
589 #clock-cells = <0>;
590 compatible = "ti,composite-gate-clock";
591 clocks = <&sys_ck>;
592 ti,bit-shift = <11>;
593 reg = <0x0a00>;
594 };
595
596 gpt10_mux_fck: gpt10_mux_fck {
597 #clock-cells = <0>;
598 compatible = "ti,composite-mux-clock";
599 clocks = <&omap_32k_fck>, <&sys_ck>;
600 ti,bit-shift = <6>;
601 reg = <0x0a40>;
602 };
603
604 gpt10_fck: gpt10_fck {
605 #clock-cells = <0>;
606 compatible = "ti,composite-clock";
607 clocks = <&gpt10_gate_fck>, <&gpt10_mux_fck>;
608 };
609
610 gpt11_gate_fck: gpt11_gate_fck {
611 #clock-cells = <0>;
612 compatible = "ti,composite-gate-clock";
613 clocks = <&sys_ck>;
614 ti,bit-shift = <12>;
615 reg = <0x0a00>;
616 };
617
618 gpt11_mux_fck: gpt11_mux_fck {
619 #clock-cells = <0>;
620 compatible = "ti,composite-mux-clock";
621 clocks = <&omap_32k_fck>, <&sys_ck>;
622 ti,bit-shift = <7>;
623 reg = <0x0a40>;
624 };
625
626 gpt11_fck: gpt11_fck {
627 #clock-cells = <0>;
628 compatible = "ti,composite-clock";
629 clocks = <&gpt11_gate_fck>, <&gpt11_mux_fck>;
630 };
631
632 core_96m_fck: core_96m_fck {
633 #clock-cells = <0>;
634 compatible = "fixed-factor-clock";
635 clocks = <&omap_96m_fck>;
636 clock-mult = <1>;
637 clock-div = <1>;
638 };
639
640 mmchs2_fck: mmchs2_fck {
641 #clock-cells = <0>;
642 compatible = "ti,wait-gate-clock";
643 clocks = <&core_96m_fck>;
644 reg = <0x0a00>;
645 ti,bit-shift = <25>;
646 };
647
648 mmchs1_fck: mmchs1_fck {
649 #clock-cells = <0>;
650 compatible = "ti,wait-gate-clock";
651 clocks = <&core_96m_fck>;
652 reg = <0x0a00>;
653 ti,bit-shift = <24>;
654 };
655
656 i2c3_fck: i2c3_fck {
657 #clock-cells = <0>;
658 compatible = "ti,wait-gate-clock";
659 clocks = <&core_96m_fck>;
660 reg = <0x0a00>;
661 ti,bit-shift = <17>;
662 };
663
664 i2c2_fck: i2c2_fck {
665 #clock-cells = <0>;
666 compatible = "ti,wait-gate-clock";
667 clocks = <&core_96m_fck>;
668 reg = <0x0a00>;
669 ti,bit-shift = <16>;
670 };
671
672 i2c1_fck: i2c1_fck {
673 #clock-cells = <0>;
674 compatible = "ti,wait-gate-clock";
675 clocks = <&core_96m_fck>;
676 reg = <0x0a00>;
677 ti,bit-shift = <15>;
678 };
679
680 mcbsp5_gate_fck: mcbsp5_gate_fck {
681 #clock-cells = <0>;
682 compatible = "ti,composite-gate-clock";
683 clocks = <&mcbsp_clks>;
684 ti,bit-shift = <10>;
685 reg = <0x0a00>;
686 };
687
688 mcbsp1_gate_fck: mcbsp1_gate_fck {
689 #clock-cells = <0>;
690 compatible = "ti,composite-gate-clock";
691 clocks = <&mcbsp_clks>;
692 ti,bit-shift = <9>;
693 reg = <0x0a00>;
694 };
695
696 core_48m_fck: core_48m_fck {
697 #clock-cells = <0>;
698 compatible = "fixed-factor-clock";
699 clocks = <&omap_48m_fck>;
700 clock-mult = <1>;
701 clock-div = <1>;
702 };
703
704 mcspi4_fck: mcspi4_fck {
705 #clock-cells = <0>;
706 compatible = "ti,wait-gate-clock";
707 clocks = <&core_48m_fck>;
708 reg = <0x0a00>;
709 ti,bit-shift = <21>;
710 };
711
712 mcspi3_fck: mcspi3_fck {
713 #clock-cells = <0>;
714 compatible = "ti,wait-gate-clock";
715 clocks = <&core_48m_fck>;
716 reg = <0x0a00>;
717 ti,bit-shift = <20>;
718 };
719
720 mcspi2_fck: mcspi2_fck {
721 #clock-cells = <0>;
722 compatible = "ti,wait-gate-clock";
723 clocks = <&core_48m_fck>;
724 reg = <0x0a00>;
725 ti,bit-shift = <19>;
726 };
727
728 mcspi1_fck: mcspi1_fck {
729 #clock-cells = <0>;
730 compatible = "ti,wait-gate-clock";
731 clocks = <&core_48m_fck>;
732 reg = <0x0a00>;
733 ti,bit-shift = <18>;
734 };
735
736 uart2_fck: uart2_fck {
737 #clock-cells = <0>;
738 compatible = "ti,wait-gate-clock";
739 clocks = <&core_48m_fck>;
740 reg = <0x0a00>;
741 ti,bit-shift = <14>;
742 };
743
744 uart1_fck: uart1_fck {
745 #clock-cells = <0>;
746 compatible = "ti,wait-gate-clock";
747 clocks = <&core_48m_fck>;
748 reg = <0x0a00>;
749 ti,bit-shift = <13>;
750 };
751
752 core_12m_fck: core_12m_fck {
753 #clock-cells = <0>;
754 compatible = "fixed-factor-clock";
755 clocks = <&omap_12m_fck>;
756 clock-mult = <1>;
757 clock-div = <1>;
758 };
759
760 hdq_fck: hdq_fck {
761 #clock-cells = <0>;
762 compatible = "ti,wait-gate-clock";
763 clocks = <&core_12m_fck>;
764 reg = <0x0a00>;
765 ti,bit-shift = <22>;
766 };
767
768 core_l3_ick: core_l3_ick {
769 #clock-cells = <0>;
770 compatible = "fixed-factor-clock";
771 clocks = <&l3_ick>;
772 clock-mult = <1>;
773 clock-div = <1>;
774 };
775
776 sdrc_ick: sdrc_ick {
777 #clock-cells = <0>;
778 compatible = "ti,wait-gate-clock";
779 clocks = <&core_l3_ick>;
780 reg = <0x0a10>;
781 ti,bit-shift = <1>;
782 };
783
784 gpmc_fck: gpmc_fck {
785 #clock-cells = <0>;
786 compatible = "fixed-factor-clock";
787 clocks = <&core_l3_ick>;
788 clock-mult = <1>;
789 clock-div = <1>;
790 };
791
792 core_l4_ick: core_l4_ick {
793 #clock-cells = <0>;
794 compatible = "fixed-factor-clock";
795 clocks = <&l4_ick>;
796 clock-mult = <1>;
797 clock-div = <1>;
798 };
799
800 mmchs2_ick: mmchs2_ick {
801 #clock-cells = <0>;
802 compatible = "ti,omap3-interface-clock";
803 clocks = <&core_l4_ick>;
804 reg = <0x0a10>;
805 ti,bit-shift = <25>;
806 };
807
808 mmchs1_ick: mmchs1_ick {
809 #clock-cells = <0>;
810 compatible = "ti,omap3-interface-clock";
811 clocks = <&core_l4_ick>;
812 reg = <0x0a10>;
813 ti,bit-shift = <24>;
814 };
815
816 hdq_ick: hdq_ick {
817 #clock-cells = <0>;
818 compatible = "ti,omap3-interface-clock";
819 clocks = <&core_l4_ick>;
820 reg = <0x0a10>;
821 ti,bit-shift = <22>;
822 };
823
824 mcspi4_ick: mcspi4_ick {
825 #clock-cells = <0>;
826 compatible = "ti,omap3-interface-clock";
827 clocks = <&core_l4_ick>;
828 reg = <0x0a10>;
829 ti,bit-shift = <21>;
830 };
831
832 mcspi3_ick: mcspi3_ick {
833 #clock-cells = <0>;
834 compatible = "ti,omap3-interface-clock";
835 clocks = <&core_l4_ick>;
836 reg = <0x0a10>;
837 ti,bit-shift = <20>;
838 };
839
840 mcspi2_ick: mcspi2_ick {
841 #clock-cells = <0>;
842 compatible = "ti,omap3-interface-clock";
843 clocks = <&core_l4_ick>;
844 reg = <0x0a10>;
845 ti,bit-shift = <19>;
846 };
847
848 mcspi1_ick: mcspi1_ick {
849 #clock-cells = <0>;
850 compatible = "ti,omap3-interface-clock";
851 clocks = <&core_l4_ick>;
852 reg = <0x0a10>;
853 ti,bit-shift = <18>;
854 };
855
856 i2c3_ick: i2c3_ick {
857 #clock-cells = <0>;
858 compatible = "ti,omap3-interface-clock";
859 clocks = <&core_l4_ick>;
860 reg = <0x0a10>;
861 ti,bit-shift = <17>;
862 };
863
864 i2c2_ick: i2c2_ick {
865 #clock-cells = <0>;
866 compatible = "ti,omap3-interface-clock";
867 clocks = <&core_l4_ick>;
868 reg = <0x0a10>;
869 ti,bit-shift = <16>;
870 };
871
872 i2c1_ick: i2c1_ick {
873 #clock-cells = <0>;
874 compatible = "ti,omap3-interface-clock";
875 clocks = <&core_l4_ick>;
876 reg = <0x0a10>;
877 ti,bit-shift = <15>;
878 };
879
880 uart2_ick: uart2_ick {
881 #clock-cells = <0>;
882 compatible = "ti,omap3-interface-clock";
883 clocks = <&core_l4_ick>;
884 reg = <0x0a10>;
885 ti,bit-shift = <14>;
886 };
887
888 uart1_ick: uart1_ick {
889 #clock-cells = <0>;
890 compatible = "ti,omap3-interface-clock";
891 clocks = <&core_l4_ick>;
892 reg = <0x0a10>;
893 ti,bit-shift = <13>;
894 };
895
896 gpt11_ick: gpt11_ick {
897 #clock-cells = <0>;
898 compatible = "ti,omap3-interface-clock";
899 clocks = <&core_l4_ick>;
900 reg = <0x0a10>;
901 ti,bit-shift = <12>;
902 };
903
904 gpt10_ick: gpt10_ick {
905 #clock-cells = <0>;
906 compatible = "ti,omap3-interface-clock";
907 clocks = <&core_l4_ick>;
908 reg = <0x0a10>;
909 ti,bit-shift = <11>;
910 };
911
912 mcbsp5_ick: mcbsp5_ick {
913 #clock-cells = <0>;
914 compatible = "ti,omap3-interface-clock";
915 clocks = <&core_l4_ick>;
916 reg = <0x0a10>;
917 ti,bit-shift = <10>;
918 };
919
920 mcbsp1_ick: mcbsp1_ick {
921 #clock-cells = <0>;
922 compatible = "ti,omap3-interface-clock";
923 clocks = <&core_l4_ick>;
924 reg = <0x0a10>;
925 ti,bit-shift = <9>;
926 };
927
928 omapctrl_ick: omapctrl_ick {
929 #clock-cells = <0>;
930 compatible = "ti,omap3-interface-clock";
931 clocks = <&core_l4_ick>;
932 reg = <0x0a10>;
933 ti,bit-shift = <6>;
934 };
935
936 dss_tv_fck: dss_tv_fck {
937 #clock-cells = <0>;
938 compatible = "ti,gate-clock";
939 clocks = <&omap_54m_fck>;
940 reg = <0x0e00>;
941 ti,bit-shift = <2>;
942 };
943
944 dss_96m_fck: dss_96m_fck {
945 #clock-cells = <0>;
946 compatible = "ti,gate-clock";
947 clocks = <&omap_96m_fck>;
948 reg = <0x0e00>;
949 ti,bit-shift = <2>;
950 };
951
952 dss2_alwon_fck: dss2_alwon_fck {
953 #clock-cells = <0>;
954 compatible = "ti,gate-clock";
955 clocks = <&sys_ck>;
956 reg = <0x0e00>;
957 ti,bit-shift = <1>;
958 };
959
960 dummy_ck: dummy_ck {
961 #clock-cells = <0>;
962 compatible = "fixed-clock";
963 clock-frequency = <0>;
964 };
965
966 gpt1_gate_fck: gpt1_gate_fck {
967 #clock-cells = <0>;
968 compatible = "ti,composite-gate-clock";
969 clocks = <&sys_ck>;
970 ti,bit-shift = <0>;
971 reg = <0x0c00>;
972 };
973
974 gpt1_mux_fck: gpt1_mux_fck {
975 #clock-cells = <0>;
976 compatible = "ti,composite-mux-clock";
977 clocks = <&omap_32k_fck>, <&sys_ck>;
978 reg = <0x0c40>;
979 };
980
981 gpt1_fck: gpt1_fck {
982 #clock-cells = <0>;
983 compatible = "ti,composite-clock";
984 clocks = <&gpt1_gate_fck>, <&gpt1_mux_fck>;
985 };
986
987 aes2_ick: aes2_ick {
988 #clock-cells = <0>;
989 compatible = "ti,omap3-interface-clock";
990 clocks = <&core_l4_ick>;
991 ti,bit-shift = <28>;
992 reg = <0x0a10>;
993 };
994
995 wkup_32k_fck: wkup_32k_fck {
996 #clock-cells = <0>;
997 compatible = "fixed-factor-clock";
998 clocks = <&omap_32k_fck>;
999 clock-mult = <1>;
1000 clock-div = <1>;
1001 };
1002
1003 gpio1_dbck: gpio1_dbck {
1004 #clock-cells = <0>;
1005 compatible = "ti,gate-clock";
1006 clocks = <&wkup_32k_fck>;
1007 reg = <0x0c00>;
1008 ti,bit-shift = <3>;
1009 };
1010
1011 sha12_ick: sha12_ick {
1012 #clock-cells = <0>;
1013 compatible = "ti,omap3-interface-clock";
1014 clocks = <&core_l4_ick>;
1015 reg = <0x0a10>;
1016 ti,bit-shift = <27>;
1017 };
1018
1019 wdt2_fck: wdt2_fck {
1020 #clock-cells = <0>;
1021 compatible = "ti,wait-gate-clock";
1022 clocks = <&wkup_32k_fck>;
1023 reg = <0x0c00>;
1024 ti,bit-shift = <5>;
1025 };
1026
1027 wdt2_ick: wdt2_ick {
1028 #clock-cells = <0>;
1029 compatible = "ti,omap3-interface-clock";
1030 clocks = <&wkup_l4_ick>;
1031 reg = <0x0c10>;
1032 ti,bit-shift = <5>;
1033 };
1034
1035 wdt1_ick: wdt1_ick {
1036 #clock-cells = <0>;
1037 compatible = "ti,omap3-interface-clock";
1038 clocks = <&wkup_l4_ick>;
1039 reg = <0x0c10>;
1040 ti,bit-shift = <4>;
1041 };
1042
1043 gpio1_ick: gpio1_ick {
1044 #clock-cells = <0>;
1045 compatible = "ti,omap3-interface-clock";
1046 clocks = <&wkup_l4_ick>;
1047 reg = <0x0c10>;
1048 ti,bit-shift = <3>;
1049 };
1050
1051 omap_32ksync_ick: omap_32ksync_ick {
1052 #clock-cells = <0>;
1053 compatible = "ti,omap3-interface-clock";
1054 clocks = <&wkup_l4_ick>;
1055 reg = <0x0c10>;
1056 ti,bit-shift = <2>;
1057 };
1058
1059 gpt12_ick: gpt12_ick {
1060 #clock-cells = <0>;
1061 compatible = "ti,omap3-interface-clock";
1062 clocks = <&wkup_l4_ick>;
1063 reg = <0x0c10>;
1064 ti,bit-shift = <1>;
1065 };
1066
1067 gpt1_ick: gpt1_ick {
1068 #clock-cells = <0>;
1069 compatible = "ti,omap3-interface-clock";
1070 clocks = <&wkup_l4_ick>;
1071 reg = <0x0c10>;
1072 ti,bit-shift = <0>;
1073 };
1074
1075 per_96m_fck: per_96m_fck {
1076 #clock-cells = <0>;
1077 compatible = "fixed-factor-clock";
1078 clocks = <&omap_96m_alwon_fck>;
1079 clock-mult = <1>;
1080 clock-div = <1>;
1081 };
1082
1083 per_48m_fck: per_48m_fck {
1084 #clock-cells = <0>;
1085 compatible = "fixed-factor-clock";
1086 clocks = <&omap_48m_fck>;
1087 clock-mult = <1>;
1088 clock-div = <1>;
1089 };
1090
1091 uart3_fck: uart3_fck {
1092 #clock-cells = <0>;
1093 compatible = "ti,wait-gate-clock";
1094 clocks = <&per_48m_fck>;
1095 reg = <0x1000>;
1096 ti,bit-shift = <11>;
1097 };
1098
1099 gpt2_gate_fck: gpt2_gate_fck {
1100 #clock-cells = <0>;
1101 compatible = "ti,composite-gate-clock";
1102 clocks = <&sys_ck>;
1103 ti,bit-shift = <3>;
1104 reg = <0x1000>;
1105 };
1106
1107 gpt2_mux_fck: gpt2_mux_fck {
1108 #clock-cells = <0>;
1109 compatible = "ti,composite-mux-clock";
1110 clocks = <&omap_32k_fck>, <&sys_ck>;
1111 reg = <0x1040>;
1112 };
1113
1114 gpt2_fck: gpt2_fck {
1115 #clock-cells = <0>;
1116 compatible = "ti,composite-clock";
1117 clocks = <&gpt2_gate_fck>, <&gpt2_mux_fck>;
1118 };
1119
1120 gpt3_gate_fck: gpt3_gate_fck {
1121 #clock-cells = <0>;
1122 compatible = "ti,composite-gate-clock";
1123 clocks = <&sys_ck>;
1124 ti,bit-shift = <4>;
1125 reg = <0x1000>;
1126 };
1127
1128 gpt3_mux_fck: gpt3_mux_fck {
1129 #clock-cells = <0>;
1130 compatible = "ti,composite-mux-clock";
1131 clocks = <&omap_32k_fck>, <&sys_ck>;
1132 ti,bit-shift = <1>;
1133 reg = <0x1040>;
1134 };
1135
1136 gpt3_fck: gpt3_fck {
1137 #clock-cells = <0>;
1138 compatible = "ti,composite-clock";
1139 clocks = <&gpt3_gate_fck>, <&gpt3_mux_fck>;
1140 };
1141
1142 gpt4_gate_fck: gpt4_gate_fck {
1143 #clock-cells = <0>;
1144 compatible = "ti,composite-gate-clock";
1145 clocks = <&sys_ck>;
1146 ti,bit-shift = <5>;
1147 reg = <0x1000>;
1148 };
1149
1150 gpt4_mux_fck: gpt4_mux_fck {
1151 #clock-cells = <0>;
1152 compatible = "ti,composite-mux-clock";
1153 clocks = <&omap_32k_fck>, <&sys_ck>;
1154 ti,bit-shift = <2>;
1155 reg = <0x1040>;
1156 };
1157
1158 gpt4_fck: gpt4_fck {
1159 #clock-cells = <0>;
1160 compatible = "ti,composite-clock";
1161 clocks = <&gpt4_gate_fck>, <&gpt4_mux_fck>;
1162 };
1163
1164 gpt5_gate_fck: gpt5_gate_fck {
1165 #clock-cells = <0>;
1166 compatible = "ti,composite-gate-clock";
1167 clocks = <&sys_ck>;
1168 ti,bit-shift = <6>;
1169 reg = <0x1000>;
1170 };
1171
1172 gpt5_mux_fck: gpt5_mux_fck {
1173 #clock-cells = <0>;
1174 compatible = "ti,composite-mux-clock";
1175 clocks = <&omap_32k_fck>, <&sys_ck>;
1176 ti,bit-shift = <3>;
1177 reg = <0x1040>;
1178 };
1179
1180 gpt5_fck: gpt5_fck {
1181 #clock-cells = <0>;
1182 compatible = "ti,composite-clock";
1183 clocks = <&gpt5_gate_fck>, <&gpt5_mux_fck>;
1184 };
1185
1186 gpt6_gate_fck: gpt6_gate_fck {
1187 #clock-cells = <0>;
1188 compatible = "ti,composite-gate-clock";
1189 clocks = <&sys_ck>;
1190 ti,bit-shift = <7>;
1191 reg = <0x1000>;
1192 };
1193
1194 gpt6_mux_fck: gpt6_mux_fck {
1195 #clock-cells = <0>;
1196 compatible = "ti,composite-mux-clock";
1197 clocks = <&omap_32k_fck>, <&sys_ck>;
1198 ti,bit-shift = <4>;
1199 reg = <0x1040>;
1200 };
1201
1202 gpt6_fck: gpt6_fck {
1203 #clock-cells = <0>;
1204 compatible = "ti,composite-clock";
1205 clocks = <&gpt6_gate_fck>, <&gpt6_mux_fck>;
1206 };
1207
1208 gpt7_gate_fck: gpt7_gate_fck {
1209 #clock-cells = <0>;
1210 compatible = "ti,composite-gate-clock";
1211 clocks = <&sys_ck>;
1212 ti,bit-shift = <8>;
1213 reg = <0x1000>;
1214 };
1215
1216 gpt7_mux_fck: gpt7_mux_fck {
1217 #clock-cells = <0>;
1218 compatible = "ti,composite-mux-clock";
1219 clocks = <&omap_32k_fck>, <&sys_ck>;
1220 ti,bit-shift = <5>;
1221 reg = <0x1040>;
1222 };
1223
1224 gpt7_fck: gpt7_fck {
1225 #clock-cells = <0>;
1226 compatible = "ti,composite-clock";
1227 clocks = <&gpt7_gate_fck>, <&gpt7_mux_fck>;
1228 };
1229
1230 gpt8_gate_fck: gpt8_gate_fck {
1231 #clock-cells = <0>;
1232 compatible = "ti,composite-gate-clock";
1233 clocks = <&sys_ck>;
1234 ti,bit-shift = <9>;
1235 reg = <0x1000>;
1236 };
1237
1238 gpt8_mux_fck: gpt8_mux_fck {
1239 #clock-cells = <0>;
1240 compatible = "ti,composite-mux-clock";
1241 clocks = <&omap_32k_fck>, <&sys_ck>;
1242 ti,bit-shift = <6>;
1243 reg = <0x1040>;
1244 };
1245
1246 gpt8_fck: gpt8_fck {
1247 #clock-cells = <0>;
1248 compatible = "ti,composite-clock";
1249 clocks = <&gpt8_gate_fck>, <&gpt8_mux_fck>;
1250 };
1251
1252 gpt9_gate_fck: gpt9_gate_fck {
1253 #clock-cells = <0>;
1254 compatible = "ti,composite-gate-clock";
1255 clocks = <&sys_ck>;
1256 ti,bit-shift = <10>;
1257 reg = <0x1000>;
1258 };
1259
1260 gpt9_mux_fck: gpt9_mux_fck {
1261 #clock-cells = <0>;
1262 compatible = "ti,composite-mux-clock";
1263 clocks = <&omap_32k_fck>, <&sys_ck>;
1264 ti,bit-shift = <7>;
1265 reg = <0x1040>;
1266 };
1267
1268 gpt9_fck: gpt9_fck {
1269 #clock-cells = <0>;
1270 compatible = "ti,composite-clock";
1271 clocks = <&gpt9_gate_fck>, <&gpt9_mux_fck>;
1272 };
1273
1274 per_32k_alwon_fck: per_32k_alwon_fck {
1275 #clock-cells = <0>;
1276 compatible = "fixed-factor-clock";
1277 clocks = <&omap_32k_fck>;
1278 clock-mult = <1>;
1279 clock-div = <1>;
1280 };
1281
1282 gpio6_dbck: gpio6_dbck {
1283 #clock-cells = <0>;
1284 compatible = "ti,gate-clock";
1285 clocks = <&per_32k_alwon_fck>;
1286 reg = <0x1000>;
1287 ti,bit-shift = <17>;
1288 };
1289
1290 gpio5_dbck: gpio5_dbck {
1291 #clock-cells = <0>;
1292 compatible = "ti,gate-clock";
1293 clocks = <&per_32k_alwon_fck>;
1294 reg = <0x1000>;
1295 ti,bit-shift = <16>;
1296 };
1297
1298 gpio4_dbck: gpio4_dbck {
1299 #clock-cells = <0>;
1300 compatible = "ti,gate-clock";
1301 clocks = <&per_32k_alwon_fck>;
1302 reg = <0x1000>;
1303 ti,bit-shift = <15>;
1304 };
1305
1306 gpio3_dbck: gpio3_dbck {
1307 #clock-cells = <0>;
1308 compatible = "ti,gate-clock";
1309 clocks = <&per_32k_alwon_fck>;
1310 reg = <0x1000>;
1311 ti,bit-shift = <14>;
1312 };
1313
1314 gpio2_dbck: gpio2_dbck {
1315 #clock-cells = <0>;
1316 compatible = "ti,gate-clock";
1317 clocks = <&per_32k_alwon_fck>;
1318 reg = <0x1000>;
1319 ti,bit-shift = <13>;
1320 };
1321
1322 wdt3_fck: wdt3_fck {
1323 #clock-cells = <0>;
1324 compatible = "ti,wait-gate-clock";
1325 clocks = <&per_32k_alwon_fck>;
1326 reg = <0x1000>;
1327 ti,bit-shift = <12>;
1328 };
1329
1330 per_l4_ick: per_l4_ick {
1331 #clock-cells = <0>;
1332 compatible = "fixed-factor-clock";
1333 clocks = <&l4_ick>;
1334 clock-mult = <1>;
1335 clock-div = <1>;
1336 };
1337
1338 gpio6_ick: gpio6_ick {
1339 #clock-cells = <0>;
1340 compatible = "ti,omap3-interface-clock";
1341 clocks = <&per_l4_ick>;
1342 reg = <0x1010>;
1343 ti,bit-shift = <17>;
1344 };
1345
1346 gpio5_ick: gpio5_ick {
1347 #clock-cells = <0>;
1348 compatible = "ti,omap3-interface-clock";
1349 clocks = <&per_l4_ick>;
1350 reg = <0x1010>;
1351 ti,bit-shift = <16>;
1352 };
1353
1354 gpio4_ick: gpio4_ick {
1355 #clock-cells = <0>;
1356 compatible = "ti,omap3-interface-clock";
1357 clocks = <&per_l4_ick>;
1358 reg = <0x1010>;
1359 ti,bit-shift = <15>;
1360 };
1361
1362 gpio3_ick: gpio3_ick {
1363 #clock-cells = <0>;
1364 compatible = "ti,omap3-interface-clock";
1365 clocks = <&per_l4_ick>;
1366 reg = <0x1010>;
1367 ti,bit-shift = <14>;
1368 };
1369
1370 gpio2_ick: gpio2_ick {
1371 #clock-cells = <0>;
1372 compatible = "ti,omap3-interface-clock";
1373 clocks = <&per_l4_ick>;
1374 reg = <0x1010>;
1375 ti,bit-shift = <13>;
1376 };
1377
1378 wdt3_ick: wdt3_ick {
1379 #clock-cells = <0>;
1380 compatible = "ti,omap3-interface-clock";
1381 clocks = <&per_l4_ick>;
1382 reg = <0x1010>;
1383 ti,bit-shift = <12>;
1384 };
1385
1386 uart3_ick: uart3_ick {
1387 #clock-cells = <0>;
1388 compatible = "ti,omap3-interface-clock";
1389 clocks = <&per_l4_ick>;
1390 reg = <0x1010>;
1391 ti,bit-shift = <11>;
1392 };
1393
1394 uart4_ick: uart4_ick {
1395 #clock-cells = <0>;
1396 compatible = "ti,omap3-interface-clock";
1397 clocks = <&per_l4_ick>;
1398 reg = <0x1010>;
1399 ti,bit-shift = <18>;
1400 };
1401
1402 gpt9_ick: gpt9_ick {
1403 #clock-cells = <0>;
1404 compatible = "ti,omap3-interface-clock";
1405 clocks = <&per_l4_ick>;
1406 reg = <0x1010>;
1407 ti,bit-shift = <10>;
1408 };
1409
1410 gpt8_ick: gpt8_ick {
1411 #clock-cells = <0>;
1412 compatible = "ti,omap3-interface-clock";
1413 clocks = <&per_l4_ick>;
1414 reg = <0x1010>;
1415 ti,bit-shift = <9>;
1416 };
1417
1418 gpt7_ick: gpt7_ick {
1419 #clock-cells = <0>;
1420 compatible = "ti,omap3-interface-clock";
1421 clocks = <&per_l4_ick>;
1422 reg = <0x1010>;
1423 ti,bit-shift = <8>;
1424 };
1425
1426 gpt6_ick: gpt6_ick {
1427 #clock-cells = <0>;
1428 compatible = "ti,omap3-interface-clock";
1429 clocks = <&per_l4_ick>;
1430 reg = <0x1010>;
1431 ti,bit-shift = <7>;
1432 };
1433
1434 gpt5_ick: gpt5_ick {
1435 #clock-cells = <0>;
1436 compatible = "ti,omap3-interface-clock";
1437 clocks = <&per_l4_ick>;
1438 reg = <0x1010>;
1439 ti,bit-shift = <6>;
1440 };
1441
1442 gpt4_ick: gpt4_ick {
1443 #clock-cells = <0>;
1444 compatible = "ti,omap3-interface-clock";
1445 clocks = <&per_l4_ick>;
1446 reg = <0x1010>;
1447 ti,bit-shift = <5>;
1448 };
1449
1450 gpt3_ick: gpt3_ick {
1451 #clock-cells = <0>;
1452 compatible = "ti,omap3-interface-clock";
1453 clocks = <&per_l4_ick>;
1454 reg = <0x1010>;
1455 ti,bit-shift = <4>;
1456 };
1457
1458 gpt2_ick: gpt2_ick {
1459 #clock-cells = <0>;
1460 compatible = "ti,omap3-interface-clock";
1461 clocks = <&per_l4_ick>;
1462 reg = <0x1010>;
1463 ti,bit-shift = <3>;
1464 };
1465
1466 mcbsp2_ick: mcbsp2_ick {
1467 #clock-cells = <0>;
1468 compatible = "ti,omap3-interface-clock";
1469 clocks = <&per_l4_ick>;
1470 reg = <0x1010>;
1471 ti,bit-shift = <0>;
1472 };
1473
1474 mcbsp3_ick: mcbsp3_ick {
1475 #clock-cells = <0>;
1476 compatible = "ti,omap3-interface-clock";
1477 clocks = <&per_l4_ick>;
1478 reg = <0x1010>;
1479 ti,bit-shift = <1>;
1480 };
1481
1482 mcbsp4_ick: mcbsp4_ick {
1483 #clock-cells = <0>;
1484 compatible = "ti,omap3-interface-clock";
1485 clocks = <&per_l4_ick>;
1486 reg = <0x1010>;
1487 ti,bit-shift = <2>;
1488 };
1489
1490 mcbsp2_gate_fck: mcbsp2_gate_fck {
1491 #clock-cells = <0>;
1492 compatible = "ti,composite-gate-clock";
1493 clocks = <&mcbsp_clks>;
1494 ti,bit-shift = <0>;
1495 reg = <0x1000>;
1496 };
1497
1498 mcbsp3_gate_fck: mcbsp3_gate_fck {
1499 #clock-cells = <0>;
1500 compatible = "ti,composite-gate-clock";
1501 clocks = <&mcbsp_clks>;
1502 ti,bit-shift = <1>;
1503 reg = <0x1000>;
1504 };
1505
1506 mcbsp4_gate_fck: mcbsp4_gate_fck {
1507 #clock-cells = <0>;
1508 compatible = "ti,composite-gate-clock";
1509 clocks = <&mcbsp_clks>;
1510 ti,bit-shift = <2>;
1511 reg = <0x1000>;
1512 };
1513
1514 emu_src_mux_ck: emu_src_mux_ck {
1515 #clock-cells = <0>;
1516 compatible = "ti,mux-clock";
1517 clocks = <&sys_ck>, <&emu_core_alwon_ck>, <&emu_per_alwon_ck>, <&emu_mpu_alwon_ck>;
1518 reg = <0x1140>;
1519 };
1520
1521 emu_src_ck: emu_src_ck {
1522 #clock-cells = <0>;
1523 compatible = "ti,clkdm-gate-clock";
1524 clocks = <&emu_src_mux_ck>;
1525 };
1526
1527 pclk_fck: pclk_fck {
1528 #clock-cells = <0>;
1529 compatible = "ti,divider-clock";
1530 clocks = <&emu_src_ck>;
1531 ti,bit-shift = <8>;
1532 ti,max-div = <7>;
1533 reg = <0x1140>;
1534 ti,index-starts-at-one;
1535 };
1536
1537 pclkx2_fck: pclkx2_fck {
1538 #clock-cells = <0>;
1539 compatible = "ti,divider-clock";
1540 clocks = <&emu_src_ck>;
1541 ti,bit-shift = <6>;
1542 ti,max-div = <3>;
1543 reg = <0x1140>;
1544 ti,index-starts-at-one;
1545 };
1546
1547 atclk_fck: atclk_fck {
1548 #clock-cells = <0>;
1549 compatible = "ti,divider-clock";
1550 clocks = <&emu_src_ck>;
1551 ti,bit-shift = <4>;
1552 ti,max-div = <3>;
1553 reg = <0x1140>;
1554 ti,index-starts-at-one;
1555 };
1556
1557 traceclk_src_fck: traceclk_src_fck {
1558 #clock-cells = <0>;
1559 compatible = "ti,mux-clock";
1560 clocks = <&sys_ck>, <&emu_core_alwon_ck>, <&emu_per_alwon_ck>, <&emu_mpu_alwon_ck>;
1561 ti,bit-shift = <2>;
1562 reg = <0x1140>;
1563 };
1564
1565 traceclk_fck: traceclk_fck {
1566 #clock-cells = <0>;
1567 compatible = "ti,divider-clock";
1568 clocks = <&traceclk_src_fck>;
1569 ti,bit-shift = <11>;
1570 ti,max-div = <7>;
1571 reg = <0x1140>;
1572 ti,index-starts-at-one;
1573 };
1574
1575 secure_32k_fck: secure_32k_fck {
1576 #clock-cells = <0>;
1577 compatible = "fixed-clock";
1578 clock-frequency = <32768>;
1579 };
1580
1581 gpt12_fck: gpt12_fck {
1582 #clock-cells = <0>;
1583 compatible = "fixed-factor-clock";
1584 clocks = <&secure_32k_fck>;
1585 clock-mult = <1>;
1586 clock-div = <1>;
1587 };
1588
1589 wdt1_fck: wdt1_fck {
1590 #clock-cells = <0>;
1591 compatible = "fixed-factor-clock";
1592 clocks = <&secure_32k_fck>;
1593 clock-mult = <1>;
1594 clock-div = <1>;
1595 };
1596};
1597
1598&cm_clockdomains {
1599 core_l3_clkdm: core_l3_clkdm {
1600 compatible = "ti,clockdomain";
1601 clocks = <&sdrc_ick>;
1602 };
1603
1604 dpll3_clkdm: dpll3_clkdm {
1605 compatible = "ti,clockdomain";
1606 clocks = <&dpll3_ck>;
1607 };
1608
1609 dpll1_clkdm: dpll1_clkdm {
1610 compatible = "ti,clockdomain";
1611 clocks = <&dpll1_ck>;
1612 };
1613
1614 per_clkdm: per_clkdm {
1615 compatible = "ti,clockdomain";
1616 clocks = <&uart3_fck>, <&gpio6_dbck>, <&gpio5_dbck>,
1617 <&gpio4_dbck>, <&gpio3_dbck>, <&gpio2_dbck>,
1618 <&wdt3_fck>, <&gpio6_ick>, <&gpio5_ick>, <&gpio4_ick>,
1619 <&gpio3_ick>, <&gpio2_ick>, <&wdt3_ick>, <&uart3_ick>,
1620 <&uart4_ick>, <&gpt9_ick>, <&gpt8_ick>, <&gpt7_ick>,
1621 <&gpt6_ick>, <&gpt5_ick>, <&gpt4_ick>, <&gpt3_ick>,
1622 <&gpt2_ick>, <&mcbsp2_ick>, <&mcbsp3_ick>,
1623 <&mcbsp4_ick>;
1624 };
1625
1626 emu_clkdm: emu_clkdm {
1627 compatible = "ti,clockdomain";
1628 clocks = <&emu_src_ck>;
1629 };
1630
1631 dpll4_clkdm: dpll4_clkdm {
1632 compatible = "ti,clockdomain";
1633 clocks = <&dpll4_ck>;
1634 };
1635
1636 wkup_clkdm: wkup_clkdm {
1637 compatible = "ti,clockdomain";
1638 clocks = <&gpio1_dbck>, <&wdt2_fck>, <&wdt2_ick>, <&wdt1_ick>,
1639 <&gpio1_ick>, <&omap_32ksync_ick>, <&gpt12_ick>,
1640 <&gpt1_ick>;
1641 };
1642
1643 dss_clkdm: dss_clkdm {
1644 compatible = "ti,clockdomain";
1645 clocks = <&dss_tv_fck>, <&dss_96m_fck>, <&dss2_alwon_fck>;
1646 };
1647
1648 core_l4_clkdm: core_l4_clkdm {
1649 compatible = "ti,clockdomain";
1650 clocks = <&mmchs2_fck>, <&mmchs1_fck>, <&i2c3_fck>, <&i2c2_fck>,
1651 <&i2c1_fck>, <&mcspi4_fck>, <&mcspi3_fck>,
1652 <&mcspi2_fck>, <&mcspi1_fck>, <&uart2_fck>,
1653 <&uart1_fck>, <&hdq_fck>, <&mmchs2_ick>, <&mmchs1_ick>,
1654 <&hdq_ick>, <&mcspi4_ick>, <&mcspi3_ick>,
1655 <&mcspi2_ick>, <&mcspi1_ick>, <&i2c3_ick>, <&i2c2_ick>,
1656 <&i2c1_ick>, <&uart2_ick>, <&uart1_ick>, <&gpt11_ick>,
1657 <&gpt10_ick>, <&mcbsp5_ick>, <&mcbsp1_ick>,
1658 <&omapctrl_ick>, <&aes2_ick>, <&sha12_ick>;
1659 };
1660};
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index a1e05853afcd..d3f8a6e8ca20 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -107,6 +107,58 @@
107 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>, 107 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
108 <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; 108 <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
109 109
110 cm1: cm1@4a004000 {
111 compatible = "ti,omap4-cm1";
112 reg = <0x4a004000 0x2000>;
113
114 cm1_clocks: clocks {
115 #address-cells = <1>;
116 #size-cells = <0>;
117 };
118
119 cm1_clockdomains: clockdomains {
120 };
121 };
122
123 prm: prm@4a306000 {
124 compatible = "ti,omap4-prm";
125 reg = <0x4a306000 0x3000>;
126
127 prm_clocks: clocks {
128 #address-cells = <1>;
129 #size-cells = <0>;
130 };
131
132 prm_clockdomains: clockdomains {
133 };
134 };
135
136 cm2: cm2@4a008000 {
137 compatible = "ti,omap4-cm2";
138 reg = <0x4a008000 0x3000>;
139
140 cm2_clocks: clocks {
141 #address-cells = <1>;
142 #size-cells = <0>;
143 };
144
145 cm2_clockdomains: clockdomains {
146 };
147 };
148
149 scrm: scrm@4a30a000 {
150 compatible = "ti,omap4-scrm";
151 reg = <0x4a30a000 0x2000>;
152
153 scrm_clocks: clocks {
154 #address-cells = <1>;
155 #size-cells = <0>;
156 };
157
158 scrm_clockdomains: clockdomains {
159 };
160 };
161
110 counter32k: counter@4a304000 { 162 counter32k: counter@4a304000 {
111 compatible = "ti,omap-counter32k"; 163 compatible = "ti,omap-counter32k";
112 reg = <0x4a304000 0x20>; 164 reg = <0x4a304000 0x20>;
@@ -707,3 +759,5 @@
707 }; 759 };
708 }; 760 };
709}; 761};
762
763/include/ "omap44xx-clocks.dtsi"
diff --git a/arch/arm/boot/dts/omap443x-clocks.dtsi b/arch/arm/boot/dts/omap443x-clocks.dtsi
new file mode 100644
index 000000000000..2bd2166f88d3
--- /dev/null
+++ b/arch/arm/boot/dts/omap443x-clocks.dtsi
@@ -0,0 +1,18 @@
1/*
2 * Device Tree Source for OMAP4 clock data
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10&prm_clocks {
11 bandgap_fclk: bandgap_fclk {
12 #clock-cells = <0>;
13 compatible = "ti,gate-clock";
14 clocks = <&sys_32k_ck>;
15 ti,bit-shift = <8>;
16 reg = <0x1888>;
17 };
18};
diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index ab607a19a613..8c1cfad30d60 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -44,3 +44,5 @@
44 }; 44 };
45 }; 45 };
46}; 46};
47
48/include/ "omap443x-clocks.dtsi"
diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index 11566bed0035..6b32f520741a 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -52,3 +52,5 @@
52 }; 52 };
53 }; 53 };
54}; 54};
55
56/include/ "omap446x-clocks.dtsi"
diff --git a/arch/arm/boot/dts/omap446x-clocks.dtsi b/arch/arm/boot/dts/omap446x-clocks.dtsi
new file mode 100644
index 000000000000..be033e9803e9
--- /dev/null
+++ b/arch/arm/boot/dts/omap446x-clocks.dtsi
@@ -0,0 +1,27 @@
1/*
2 * Device Tree Source for OMAP4 clock data
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10&prm_clocks {
11 div_ts_ck: div_ts_ck {
12 #clock-cells = <0>;
13 compatible = "ti,divider-clock";
14 clocks = <&l4_wkup_clk_mux_ck>;
15 ti,bit-shift = <24>;
16 reg = <0x1888>;
17 ti,dividers = <8>, <16>, <32>;
18 };
19
20 bandgap_ts_fclk: bandgap_ts_fclk {
21 #clock-cells = <0>;
22 compatible = "ti,gate-clock";
23 clocks = <&div_ts_ck>;
24 ti,bit-shift = <8>;
25 reg = <0x1888>;
26 };
27};
diff --git a/arch/arm/boot/dts/omap44xx-clocks.dtsi b/arch/arm/boot/dts/omap44xx-clocks.dtsi
new file mode 100644
index 000000000000..c821ff5e9b8d
--- /dev/null
+++ b/arch/arm/boot/dts/omap44xx-clocks.dtsi
@@ -0,0 +1,1651 @@
1/*
2 * Device Tree Source for OMAP4 clock data
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10&cm1_clocks {
11 extalt_clkin_ck: extalt_clkin_ck {
12 #clock-cells = <0>;
13 compatible = "fixed-clock";
14 clock-frequency = <59000000>;
15 };
16
17 pad_clks_src_ck: pad_clks_src_ck {
18 #clock-cells = <0>;
19 compatible = "fixed-clock";
20 clock-frequency = <12000000>;
21 };
22
23 pad_clks_ck: pad_clks_ck {
24 #clock-cells = <0>;
25 compatible = "ti,gate-clock";
26 clocks = <&pad_clks_src_ck>;
27 ti,bit-shift = <8>;
28 reg = <0x0108>;
29 };
30
31 pad_slimbus_core_clks_ck: pad_slimbus_core_clks_ck {
32 #clock-cells = <0>;
33 compatible = "fixed-clock";
34 clock-frequency = <12000000>;
35 };
36
37 secure_32k_clk_src_ck: secure_32k_clk_src_ck {
38 #clock-cells = <0>;
39 compatible = "fixed-clock";
40 clock-frequency = <32768>;
41 };
42
43 slimbus_src_clk: slimbus_src_clk {
44 #clock-cells = <0>;
45 compatible = "fixed-clock";
46 clock-frequency = <12000000>;
47 };
48
49 slimbus_clk: slimbus_clk {
50 #clock-cells = <0>;
51 compatible = "ti,gate-clock";
52 clocks = <&slimbus_src_clk>;
53 ti,bit-shift = <10>;
54 reg = <0x0108>;
55 };
56
57 sys_32k_ck: sys_32k_ck {
58 #clock-cells = <0>;
59 compatible = "fixed-clock";
60 clock-frequency = <32768>;
61 };
62
63 virt_12000000_ck: virt_12000000_ck {
64 #clock-cells = <0>;
65 compatible = "fixed-clock";
66 clock-frequency = <12000000>;
67 };
68
69 virt_13000000_ck: virt_13000000_ck {
70 #clock-cells = <0>;
71 compatible = "fixed-clock";
72 clock-frequency = <13000000>;
73 };
74
75 virt_16800000_ck: virt_16800000_ck {
76 #clock-cells = <0>;
77 compatible = "fixed-clock";
78 clock-frequency = <16800000>;
79 };
80
81 virt_19200000_ck: virt_19200000_ck {
82 #clock-cells = <0>;
83 compatible = "fixed-clock";
84 clock-frequency = <19200000>;
85 };
86
87 virt_26000000_ck: virt_26000000_ck {
88 #clock-cells = <0>;
89 compatible = "fixed-clock";
90 clock-frequency = <26000000>;
91 };
92
93 virt_27000000_ck: virt_27000000_ck {
94 #clock-cells = <0>;
95 compatible = "fixed-clock";
96 clock-frequency = <27000000>;
97 };
98
99 virt_38400000_ck: virt_38400000_ck {
100 #clock-cells = <0>;
101 compatible = "fixed-clock";
102 clock-frequency = <38400000>;
103 };
104
105 tie_low_clock_ck: tie_low_clock_ck {
106 #clock-cells = <0>;
107 compatible = "fixed-clock";
108 clock-frequency = <0>;
109 };
110
111 utmi_phy_clkout_ck: utmi_phy_clkout_ck {
112 #clock-cells = <0>;
113 compatible = "fixed-clock";
114 clock-frequency = <60000000>;
115 };
116
117 xclk60mhsp1_ck: xclk60mhsp1_ck {
118 #clock-cells = <0>;
119 compatible = "fixed-clock";
120 clock-frequency = <60000000>;
121 };
122
123 xclk60mhsp2_ck: xclk60mhsp2_ck {
124 #clock-cells = <0>;
125 compatible = "fixed-clock";
126 clock-frequency = <60000000>;
127 };
128
129 xclk60motg_ck: xclk60motg_ck {
130 #clock-cells = <0>;
131 compatible = "fixed-clock";
132 clock-frequency = <60000000>;
133 };
134
135 dpll_abe_ck: dpll_abe_ck {
136 #clock-cells = <0>;
137 compatible = "ti,omap4-dpll-m4xen-clock";
138 clocks = <&abe_dpll_refclk_mux_ck>, <&abe_dpll_bypass_clk_mux_ck>;
139 reg = <0x01e0>, <0x01e4>, <0x01ec>, <0x01e8>;
140 };
141
142 dpll_abe_x2_ck: dpll_abe_x2_ck {
143 #clock-cells = <0>;
144 compatible = "ti,omap4-dpll-x2-clock";
145 clocks = <&dpll_abe_ck>;
146 reg = <0x01f0>;
147 };
148
149 dpll_abe_m2x2_ck: dpll_abe_m2x2_ck {
150 #clock-cells = <0>;
151 compatible = "ti,divider-clock";
152 clocks = <&dpll_abe_x2_ck>;
153 ti,max-div = <31>;
154 ti,autoidle-shift = <8>;
155 reg = <0x01f0>;
156 ti,index-starts-at-one;
157 ti,invert-autoidle-bit;
158 };
159
160 abe_24m_fclk: abe_24m_fclk {
161 #clock-cells = <0>;
162 compatible = "fixed-factor-clock";
163 clocks = <&dpll_abe_m2x2_ck>;
164 clock-mult = <1>;
165 clock-div = <8>;
166 };
167
168 abe_clk: abe_clk {
169 #clock-cells = <0>;
170 compatible = "ti,divider-clock";
171 clocks = <&dpll_abe_m2x2_ck>;
172 ti,max-div = <4>;
173 reg = <0x0108>;
174 ti,index-power-of-two;
175 };
176
177 aess_fclk: aess_fclk {
178 #clock-cells = <0>;
179 compatible = "ti,divider-clock";
180 clocks = <&abe_clk>;
181 ti,bit-shift = <24>;
182 ti,max-div = <2>;
183 reg = <0x0528>;
184 };
185
186 dpll_abe_m3x2_ck: dpll_abe_m3x2_ck {
187 #clock-cells = <0>;
188 compatible = "ti,divider-clock";
189 clocks = <&dpll_abe_x2_ck>;
190 ti,max-div = <31>;
191 ti,autoidle-shift = <8>;
192 reg = <0x01f4>;
193 ti,index-starts-at-one;
194 ti,invert-autoidle-bit;
195 };
196
197 core_hsd_byp_clk_mux_ck: core_hsd_byp_clk_mux_ck {
198 #clock-cells = <0>;
199 compatible = "ti,mux-clock";
200 clocks = <&sys_clkin_ck>, <&dpll_abe_m3x2_ck>;
201 ti,bit-shift = <23>;
202 reg = <0x012c>;
203 };
204
205 dpll_core_ck: dpll_core_ck {
206 #clock-cells = <0>;
207 compatible = "ti,omap4-dpll-core-clock";
208 clocks = <&sys_clkin_ck>, <&core_hsd_byp_clk_mux_ck>;
209 reg = <0x0120>, <0x0124>, <0x012c>, <0x0128>;
210 };
211
212 dpll_core_x2_ck: dpll_core_x2_ck {
213 #clock-cells = <0>;
214 compatible = "ti,omap4-dpll-x2-clock";
215 clocks = <&dpll_core_ck>;
216 };
217
218 dpll_core_m6x2_ck: dpll_core_m6x2_ck {
219 #clock-cells = <0>;
220 compatible = "ti,divider-clock";
221 clocks = <&dpll_core_x2_ck>;
222 ti,max-div = <31>;
223 ti,autoidle-shift = <8>;
224 reg = <0x0140>;
225 ti,index-starts-at-one;
226 ti,invert-autoidle-bit;
227 };
228
229 dpll_core_m2_ck: dpll_core_m2_ck {
230 #clock-cells = <0>;
231 compatible = "ti,divider-clock";
232 clocks = <&dpll_core_ck>;
233 ti,max-div = <31>;
234 ti,autoidle-shift = <8>;
235 reg = <0x0130>;
236 ti,index-starts-at-one;
237 ti,invert-autoidle-bit;
238 };
239
240 ddrphy_ck: ddrphy_ck {
241 #clock-cells = <0>;
242 compatible = "fixed-factor-clock";
243 clocks = <&dpll_core_m2_ck>;
244 clock-mult = <1>;
245 clock-div = <2>;
246 };
247
248 dpll_core_m5x2_ck: dpll_core_m5x2_ck {
249 #clock-cells = <0>;
250 compatible = "ti,divider-clock";
251 clocks = <&dpll_core_x2_ck>;
252 ti,max-div = <31>;
253 ti,autoidle-shift = <8>;
254 reg = <0x013c>;
255 ti,index-starts-at-one;
256 ti,invert-autoidle-bit;
257 };
258
259 div_core_ck: div_core_ck {
260 #clock-cells = <0>;
261 compatible = "ti,divider-clock";
262 clocks = <&dpll_core_m5x2_ck>;
263 reg = <0x0100>;
264 ti,max-div = <2>;
265 };
266
267 div_iva_hs_clk: div_iva_hs_clk {
268 #clock-cells = <0>;
269 compatible = "ti,divider-clock";
270 clocks = <&dpll_core_m5x2_ck>;
271 ti,max-div = <4>;
272 reg = <0x01dc>;
273 ti,index-power-of-two;
274 };
275
276 div_mpu_hs_clk: div_mpu_hs_clk {
277 #clock-cells = <0>;
278 compatible = "ti,divider-clock";
279 clocks = <&dpll_core_m5x2_ck>;
280 ti,max-div = <4>;
281 reg = <0x019c>;
282 ti,index-power-of-two;
283 };
284
285 dpll_core_m4x2_ck: dpll_core_m4x2_ck {
286 #clock-cells = <0>;
287 compatible = "ti,divider-clock";
288 clocks = <&dpll_core_x2_ck>;
289 ti,max-div = <31>;
290 ti,autoidle-shift = <8>;
291 reg = <0x0138>;
292 ti,index-starts-at-one;
293 ti,invert-autoidle-bit;
294 };
295
296 dll_clk_div_ck: dll_clk_div_ck {
297 #clock-cells = <0>;
298 compatible = "fixed-factor-clock";
299 clocks = <&dpll_core_m4x2_ck>;
300 clock-mult = <1>;
301 clock-div = <2>;
302 };
303
304 dpll_abe_m2_ck: dpll_abe_m2_ck {
305 #clock-cells = <0>;
306 compatible = "ti,divider-clock";
307 clocks = <&dpll_abe_ck>;
308 ti,max-div = <31>;
309 reg = <0x01f0>;
310 ti,index-starts-at-one;
311 };
312
313 dpll_core_m3x2_gate_ck: dpll_core_m3x2_gate_ck {
314 #clock-cells = <0>;
315 compatible = "ti,composite-no-wait-gate-clock";
316 clocks = <&dpll_core_x2_ck>;
317 ti,bit-shift = <8>;
318 reg = <0x0134>;
319 };
320
321 dpll_core_m3x2_div_ck: dpll_core_m3x2_div_ck {
322 #clock-cells = <0>;
323 compatible = "ti,composite-divider-clock";
324 clocks = <&dpll_core_x2_ck>;
325 ti,max-div = <31>;
326 reg = <0x0134>;
327 ti,index-starts-at-one;
328 };
329
330 dpll_core_m3x2_ck: dpll_core_m3x2_ck {
331 #clock-cells = <0>;
332 compatible = "ti,composite-clock";
333 clocks = <&dpll_core_m3x2_gate_ck>, <&dpll_core_m3x2_div_ck>;
334 };
335
336 dpll_core_m7x2_ck: dpll_core_m7x2_ck {
337 #clock-cells = <0>;
338 compatible = "ti,divider-clock";
339 clocks = <&dpll_core_x2_ck>;
340 ti,max-div = <31>;
341 ti,autoidle-shift = <8>;
342 reg = <0x0144>;
343 ti,index-starts-at-one;
344 ti,invert-autoidle-bit;
345 };
346
347 iva_hsd_byp_clk_mux_ck: iva_hsd_byp_clk_mux_ck {
348 #clock-cells = <0>;
349 compatible = "ti,mux-clock";
350 clocks = <&sys_clkin_ck>, <&div_iva_hs_clk>;
351 ti,bit-shift = <23>;
352 reg = <0x01ac>;
353 };
354
355 dpll_iva_ck: dpll_iva_ck {
356 #clock-cells = <0>;
357 compatible = "ti,omap4-dpll-clock";
358 clocks = <&sys_clkin_ck>, <&iva_hsd_byp_clk_mux_ck>;
359 reg = <0x01a0>, <0x01a4>, <0x01ac>, <0x01a8>;
360 };
361
362 dpll_iva_x2_ck: dpll_iva_x2_ck {
363 #clock-cells = <0>;
364 compatible = "ti,omap4-dpll-x2-clock";
365 clocks = <&dpll_iva_ck>;
366 };
367
368 dpll_iva_m4x2_ck: dpll_iva_m4x2_ck {
369 #clock-cells = <0>;
370 compatible = "ti,divider-clock";
371 clocks = <&dpll_iva_x2_ck>;
372 ti,max-div = <31>;
373 ti,autoidle-shift = <8>;
374 reg = <0x01b8>;
375 ti,index-starts-at-one;
376 ti,invert-autoidle-bit;
377 };
378
379 dpll_iva_m5x2_ck: dpll_iva_m5x2_ck {
380 #clock-cells = <0>;
381 compatible = "ti,divider-clock";
382 clocks = <&dpll_iva_x2_ck>;
383 ti,max-div = <31>;
384 ti,autoidle-shift = <8>;
385 reg = <0x01bc>;
386 ti,index-starts-at-one;
387 ti,invert-autoidle-bit;
388 };
389
390 dpll_mpu_ck: dpll_mpu_ck {
391 #clock-cells = <0>;
392 compatible = "ti,omap4-dpll-clock";
393 clocks = <&sys_clkin_ck>, <&div_mpu_hs_clk>;
394 reg = <0x0160>, <0x0164>, <0x016c>, <0x0168>;
395 };
396
397 dpll_mpu_m2_ck: dpll_mpu_m2_ck {
398 #clock-cells = <0>;
399 compatible = "ti,divider-clock";
400 clocks = <&dpll_mpu_ck>;
401 ti,max-div = <31>;
402 ti,autoidle-shift = <8>;
403 reg = <0x0170>;
404 ti,index-starts-at-one;
405 ti,invert-autoidle-bit;
406 };
407
408 per_hs_clk_div_ck: per_hs_clk_div_ck {
409 #clock-cells = <0>;
410 compatible = "fixed-factor-clock";
411 clocks = <&dpll_abe_m3x2_ck>;
412 clock-mult = <1>;
413 clock-div = <2>;
414 };
415
416 usb_hs_clk_div_ck: usb_hs_clk_div_ck {
417 #clock-cells = <0>;
418 compatible = "fixed-factor-clock";
419 clocks = <&dpll_abe_m3x2_ck>;
420 clock-mult = <1>;
421 clock-div = <3>;
422 };
423
424 l3_div_ck: l3_div_ck {
425 #clock-cells = <0>;
426 compatible = "ti,divider-clock";
427 clocks = <&div_core_ck>;
428 ti,bit-shift = <4>;
429 ti,max-div = <2>;
430 reg = <0x0100>;
431 };
432
433 l4_div_ck: l4_div_ck {
434 #clock-cells = <0>;
435 compatible = "ti,divider-clock";
436 clocks = <&l3_div_ck>;
437 ti,bit-shift = <8>;
438 ti,max-div = <2>;
439 reg = <0x0100>;
440 };
441
442 lp_clk_div_ck: lp_clk_div_ck {
443 #clock-cells = <0>;
444 compatible = "fixed-factor-clock";
445 clocks = <&dpll_abe_m2x2_ck>;
446 clock-mult = <1>;
447 clock-div = <16>;
448 };
449
450 mpu_periphclk: mpu_periphclk {
451 #clock-cells = <0>;
452 compatible = "fixed-factor-clock";
453 clocks = <&dpll_mpu_ck>;
454 clock-mult = <1>;
455 clock-div = <2>;
456 };
457
458 ocp_abe_iclk: ocp_abe_iclk {
459 #clock-cells = <0>;
460 compatible = "ti,divider-clock";
461 clocks = <&aess_fclk>;
462 ti,bit-shift = <24>;
463 reg = <0x0528>;
464 ti,dividers = <2>, <1>;
465 };
466
467 per_abe_24m_fclk: per_abe_24m_fclk {
468 #clock-cells = <0>;
469 compatible = "fixed-factor-clock";
470 clocks = <&dpll_abe_m2_ck>;
471 clock-mult = <1>;
472 clock-div = <4>;
473 };
474
475 dmic_sync_mux_ck: dmic_sync_mux_ck {
476 #clock-cells = <0>;
477 compatible = "ti,mux-clock";
478 clocks = <&abe_24m_fclk>, <&syc_clk_div_ck>, <&func_24m_clk>;
479 ti,bit-shift = <25>;
480 reg = <0x0538>;
481 };
482
483 func_dmic_abe_gfclk: func_dmic_abe_gfclk {
484 #clock-cells = <0>;
485 compatible = "ti,mux-clock";
486 clocks = <&dmic_sync_mux_ck>, <&pad_clks_ck>, <&slimbus_clk>;
487 ti,bit-shift = <24>;
488 reg = <0x0538>;
489 };
490
491 mcasp_sync_mux_ck: mcasp_sync_mux_ck {
492 #clock-cells = <0>;
493 compatible = "ti,mux-clock";
494 clocks = <&abe_24m_fclk>, <&syc_clk_div_ck>, <&func_24m_clk>;
495 ti,bit-shift = <25>;
496 reg = <0x0540>;
497 };
498
499 func_mcasp_abe_gfclk: func_mcasp_abe_gfclk {
500 #clock-cells = <0>;
501 compatible = "ti,mux-clock";
502 clocks = <&mcasp_sync_mux_ck>, <&pad_clks_ck>, <&slimbus_clk>;
503 ti,bit-shift = <24>;
504 reg = <0x0540>;
505 };
506
507 mcbsp1_sync_mux_ck: mcbsp1_sync_mux_ck {
508 #clock-cells = <0>;
509 compatible = "ti,mux-clock";
510 clocks = <&abe_24m_fclk>, <&syc_clk_div_ck>, <&func_24m_clk>;
511 ti,bit-shift = <25>;
512 reg = <0x0548>;
513 };
514
515 func_mcbsp1_gfclk: func_mcbsp1_gfclk {
516 #clock-cells = <0>;
517 compatible = "ti,mux-clock";
518 clocks = <&mcbsp1_sync_mux_ck>, <&pad_clks_ck>, <&slimbus_clk>;
519 ti,bit-shift = <24>;
520 reg = <0x0548>;
521 };
522
523 mcbsp2_sync_mux_ck: mcbsp2_sync_mux_ck {
524 #clock-cells = <0>;
525 compatible = "ti,mux-clock";
526 clocks = <&abe_24m_fclk>, <&syc_clk_div_ck>, <&func_24m_clk>;
527 ti,bit-shift = <25>;
528 reg = <0x0550>;
529 };
530
531 func_mcbsp2_gfclk: func_mcbsp2_gfclk {
532 #clock-cells = <0>;
533 compatible = "ti,mux-clock";
534 clocks = <&mcbsp2_sync_mux_ck>, <&pad_clks_ck>, <&slimbus_clk>;
535 ti,bit-shift = <24>;
536 reg = <0x0550>;
537 };
538
539 mcbsp3_sync_mux_ck: mcbsp3_sync_mux_ck {
540 #clock-cells = <0>;
541 compatible = "ti,mux-clock";
542 clocks = <&abe_24m_fclk>, <&syc_clk_div_ck>, <&func_24m_clk>;
543 ti,bit-shift = <25>;
544 reg = <0x0558>;
545 };
546
547 func_mcbsp3_gfclk: func_mcbsp3_gfclk {
548 #clock-cells = <0>;
549 compatible = "ti,mux-clock";
550 clocks = <&mcbsp3_sync_mux_ck>, <&pad_clks_ck>, <&slimbus_clk>;
551 ti,bit-shift = <24>;
552 reg = <0x0558>;
553 };
554
555 slimbus1_fclk_1: slimbus1_fclk_1 {
556 #clock-cells = <0>;
557 compatible = "ti,gate-clock";
558 clocks = <&func_24m_clk>;
559 ti,bit-shift = <9>;
560 reg = <0x0560>;
561 };
562
563 slimbus1_fclk_0: slimbus1_fclk_0 {
564 #clock-cells = <0>;
565 compatible = "ti,gate-clock";
566 clocks = <&abe_24m_fclk>;
567 ti,bit-shift = <8>;
568 reg = <0x0560>;
569 };
570
571 slimbus1_fclk_2: slimbus1_fclk_2 {
572 #clock-cells = <0>;
573 compatible = "ti,gate-clock";
574 clocks = <&pad_clks_ck>;
575 ti,bit-shift = <10>;
576 reg = <0x0560>;
577 };
578
579 slimbus1_slimbus_clk: slimbus1_slimbus_clk {
580 #clock-cells = <0>;
581 compatible = "ti,gate-clock";
582 clocks = <&slimbus_clk>;
583 ti,bit-shift = <11>;
584 reg = <0x0560>;
585 };
586
587 timer5_sync_mux: timer5_sync_mux {
588 #clock-cells = <0>;
589 compatible = "ti,mux-clock";
590 clocks = <&syc_clk_div_ck>, <&sys_32k_ck>;
591 ti,bit-shift = <24>;
592 reg = <0x0568>;
593 };
594
595 timer6_sync_mux: timer6_sync_mux {
596 #clock-cells = <0>;
597 compatible = "ti,mux-clock";
598 clocks = <&syc_clk_div_ck>, <&sys_32k_ck>;
599 ti,bit-shift = <24>;
600 reg = <0x0570>;
601 };
602
603 timer7_sync_mux: timer7_sync_mux {
604 #clock-cells = <0>;
605 compatible = "ti,mux-clock";
606 clocks = <&syc_clk_div_ck>, <&sys_32k_ck>;
607 ti,bit-shift = <24>;
608 reg = <0x0578>;
609 };
610
611 timer8_sync_mux: timer8_sync_mux {
612 #clock-cells = <0>;
613 compatible = "ti,mux-clock";
614 clocks = <&syc_clk_div_ck>, <&sys_32k_ck>;
615 ti,bit-shift = <24>;
616 reg = <0x0580>;
617 };
618
619 dummy_ck: dummy_ck {
620 #clock-cells = <0>;
621 compatible = "fixed-clock";
622 clock-frequency = <0>;
623 };
624};
625&prm_clocks {
626 sys_clkin_ck: sys_clkin_ck {
627 #clock-cells = <0>;
628 compatible = "ti,mux-clock";
629 clocks = <&virt_12000000_ck>, <&virt_13000000_ck>, <&virt_16800000_ck>, <&virt_19200000_ck>, <&virt_26000000_ck>, <&virt_27000000_ck>, <&virt_38400000_ck>;
630 reg = <0x0110>;
631 ti,index-starts-at-one;
632 };
633
634 abe_dpll_bypass_clk_mux_ck: abe_dpll_bypass_clk_mux_ck {
635 #clock-cells = <0>;
636 compatible = "ti,mux-clock";
637 clocks = <&sys_clkin_ck>, <&sys_32k_ck>;
638 ti,bit-shift = <24>;
639 reg = <0x0108>;
640 };
641
642 abe_dpll_refclk_mux_ck: abe_dpll_refclk_mux_ck {
643 #clock-cells = <0>;
644 compatible = "ti,mux-clock";
645 clocks = <&sys_clkin_ck>, <&sys_32k_ck>;
646 reg = <0x010c>;
647 };
648
649 dbgclk_mux_ck: dbgclk_mux_ck {
650 #clock-cells = <0>;
651 compatible = "fixed-factor-clock";
652 clocks = <&sys_clkin_ck>;
653 clock-mult = <1>;
654 clock-div = <1>;
655 };
656
657 l4_wkup_clk_mux_ck: l4_wkup_clk_mux_ck {
658 #clock-cells = <0>;
659 compatible = "ti,mux-clock";
660 clocks = <&sys_clkin_ck>, <&lp_clk_div_ck>;
661 reg = <0x0108>;
662 };
663
664 syc_clk_div_ck: syc_clk_div_ck {
665 #clock-cells = <0>;
666 compatible = "ti,divider-clock";
667 clocks = <&sys_clkin_ck>;
668 reg = <0x0100>;
669 ti,max-div = <2>;
670 };
671
672 gpio1_dbclk: gpio1_dbclk {
673 #clock-cells = <0>;
674 compatible = "ti,gate-clock";
675 clocks = <&sys_32k_ck>;
676 ti,bit-shift = <8>;
677 reg = <0x1838>;
678 };
679
680 dmt1_clk_mux: dmt1_clk_mux {
681 #clock-cells = <0>;
682 compatible = "ti,mux-clock";
683 clocks = <&sys_clkin_ck>, <&sys_32k_ck>;
684 ti,bit-shift = <24>;
685 reg = <0x1840>;
686 };
687
688 usim_ck: usim_ck {
689 #clock-cells = <0>;
690 compatible = "ti,divider-clock";
691 clocks = <&dpll_per_m4x2_ck>;
692 ti,bit-shift = <24>;
693 reg = <0x1858>;
694 ti,dividers = <14>, <18>;
695 };
696
697 usim_fclk: usim_fclk {
698 #clock-cells = <0>;
699 compatible = "ti,gate-clock";
700 clocks = <&usim_ck>;
701 ti,bit-shift = <8>;
702 reg = <0x1858>;
703 };
704
705 pmd_stm_clock_mux_ck: pmd_stm_clock_mux_ck {
706 #clock-cells = <0>;
707 compatible = "ti,mux-clock";
708 clocks = <&sys_clkin_ck>, <&dpll_core_m6x2_ck>, <&tie_low_clock_ck>;
709 ti,bit-shift = <20>;
710 reg = <0x1a20>;
711 };
712
713 pmd_trace_clk_mux_ck: pmd_trace_clk_mux_ck {
714 #clock-cells = <0>;
715 compatible = "ti,mux-clock";
716 clocks = <&sys_clkin_ck>, <&dpll_core_m6x2_ck>, <&tie_low_clock_ck>;
717 ti,bit-shift = <22>;
718 reg = <0x1a20>;
719 };
720
721 stm_clk_div_ck: stm_clk_div_ck {
722 #clock-cells = <0>;
723 compatible = "ti,divider-clock";
724 clocks = <&pmd_stm_clock_mux_ck>;
725 ti,bit-shift = <27>;
726 ti,max-div = <64>;
727 reg = <0x1a20>;
728 ti,index-power-of-two;
729 };
730
731 trace_clk_div_div_ck: trace_clk_div_div_ck {
732 #clock-cells = <0>;
733 compatible = "ti,divider-clock";
734 clocks = <&pmd_trace_clk_mux_ck>;
735 ti,bit-shift = <24>;
736 reg = <0x1a20>;
737 ti,dividers = <0>, <1>, <2>, <0>, <4>;
738 };
739
740 trace_clk_div_ck: trace_clk_div_ck {
741 #clock-cells = <0>;
742 compatible = "ti,clkdm-gate-clock";
743 clocks = <&trace_clk_div_div_ck>;
744 };
745};
746
747&prm_clockdomains {
748 emu_sys_clkdm: emu_sys_clkdm {
749 compatible = "ti,clockdomain";
750 clocks = <&trace_clk_div_ck>;
751 };
752};
753
754&cm2_clocks {
755 per_hsd_byp_clk_mux_ck: per_hsd_byp_clk_mux_ck {
756 #clock-cells = <0>;
757 compatible = "ti,mux-clock";
758 clocks = <&sys_clkin_ck>, <&per_hs_clk_div_ck>;
759 ti,bit-shift = <23>;
760 reg = <0x014c>;
761 };
762
763 dpll_per_ck: dpll_per_ck {
764 #clock-cells = <0>;
765 compatible = "ti,omap4-dpll-clock";
766 clocks = <&sys_clkin_ck>, <&per_hsd_byp_clk_mux_ck>;
767 reg = <0x0140>, <0x0144>, <0x014c>, <0x0148>;
768 };
769
770 dpll_per_m2_ck: dpll_per_m2_ck {
771 #clock-cells = <0>;
772 compatible = "ti,divider-clock";
773 clocks = <&dpll_per_ck>;
774 ti,max-div = <31>;
775 reg = <0x0150>;
776 ti,index-starts-at-one;
777 };
778
779 dpll_per_x2_ck: dpll_per_x2_ck {
780 #clock-cells = <0>;
781 compatible = "ti,omap4-dpll-x2-clock";
782 clocks = <&dpll_per_ck>;
783 reg = <0x0150>;
784 };
785
786 dpll_per_m2x2_ck: dpll_per_m2x2_ck {
787 #clock-cells = <0>;
788 compatible = "ti,divider-clock";
789 clocks = <&dpll_per_x2_ck>;
790 ti,max-div = <31>;
791 ti,autoidle-shift = <8>;
792 reg = <0x0150>;
793 ti,index-starts-at-one;
794 ti,invert-autoidle-bit;
795 };
796
797 dpll_per_m3x2_gate_ck: dpll_per_m3x2_gate_ck {
798 #clock-cells = <0>;
799 compatible = "ti,composite-no-wait-gate-clock";
800 clocks = <&dpll_per_x2_ck>;
801 ti,bit-shift = <8>;
802 reg = <0x0154>;
803 };
804
805 dpll_per_m3x2_div_ck: dpll_per_m3x2_div_ck {
806 #clock-cells = <0>;
807 compatible = "ti,composite-divider-clock";
808 clocks = <&dpll_per_x2_ck>;
809 ti,max-div = <31>;
810 reg = <0x0154>;
811 ti,index-starts-at-one;
812 };
813
814 dpll_per_m3x2_ck: dpll_per_m3x2_ck {
815 #clock-cells = <0>;
816 compatible = "ti,composite-clock";
817 clocks = <&dpll_per_m3x2_gate_ck>, <&dpll_per_m3x2_div_ck>;
818 };
819
820 dpll_per_m4x2_ck: dpll_per_m4x2_ck {
821 #clock-cells = <0>;
822 compatible = "ti,divider-clock";
823 clocks = <&dpll_per_x2_ck>;
824 ti,max-div = <31>;
825 ti,autoidle-shift = <8>;
826 reg = <0x0158>;
827 ti,index-starts-at-one;
828 ti,invert-autoidle-bit;
829 };
830
831 dpll_per_m5x2_ck: dpll_per_m5x2_ck {
832 #clock-cells = <0>;
833 compatible = "ti,divider-clock";
834 clocks = <&dpll_per_x2_ck>;
835 ti,max-div = <31>;
836 ti,autoidle-shift = <8>;
837 reg = <0x015c>;
838 ti,index-starts-at-one;
839 ti,invert-autoidle-bit;
840 };
841
842 dpll_per_m6x2_ck: dpll_per_m6x2_ck {
843 #clock-cells = <0>;
844 compatible = "ti,divider-clock";
845 clocks = <&dpll_per_x2_ck>;
846 ti,max-div = <31>;
847 ti,autoidle-shift = <8>;
848 reg = <0x0160>;
849 ti,index-starts-at-one;
850 ti,invert-autoidle-bit;
851 };
852
853 dpll_per_m7x2_ck: dpll_per_m7x2_ck {
854 #clock-cells = <0>;
855 compatible = "ti,divider-clock";
856 clocks = <&dpll_per_x2_ck>;
857 ti,max-div = <31>;
858 ti,autoidle-shift = <8>;
859 reg = <0x0164>;
860 ti,index-starts-at-one;
861 ti,invert-autoidle-bit;
862 };
863
864 dpll_usb_ck: dpll_usb_ck {
865 #clock-cells = <0>;
866 compatible = "ti,omap4-dpll-j-type-clock";
867 clocks = <&sys_clkin_ck>, <&usb_hs_clk_div_ck>;
868 reg = <0x0180>, <0x0184>, <0x018c>, <0x0188>;
869 };
870
871 dpll_usb_clkdcoldo_ck: dpll_usb_clkdcoldo_ck {
872 #clock-cells = <0>;
873 compatible = "ti,fixed-factor-clock";
874 clocks = <&dpll_usb_ck>;
875 ti,clock-div = <1>;
876 ti,autoidle-shift = <8>;
877 reg = <0x01b4>;
878 ti,clock-mult = <1>;
879 ti,invert-autoidle-bit;
880 };
881
882 dpll_usb_m2_ck: dpll_usb_m2_ck {
883 #clock-cells = <0>;
884 compatible = "ti,divider-clock";
885 clocks = <&dpll_usb_ck>;
886 ti,max-div = <127>;
887 ti,autoidle-shift = <8>;
888 reg = <0x0190>;
889 ti,index-starts-at-one;
890 ti,invert-autoidle-bit;
891 };
892
893 ducati_clk_mux_ck: ducati_clk_mux_ck {
894 #clock-cells = <0>;
895 compatible = "ti,mux-clock";
896 clocks = <&div_core_ck>, <&dpll_per_m6x2_ck>;
897 reg = <0x0100>;
898 };
899
900 func_12m_fclk: func_12m_fclk {
901 #clock-cells = <0>;
902 compatible = "fixed-factor-clock";
903 clocks = <&dpll_per_m2x2_ck>;
904 clock-mult = <1>;
905 clock-div = <16>;
906 };
907
908 func_24m_clk: func_24m_clk {
909 #clock-cells = <0>;
910 compatible = "fixed-factor-clock";
911 clocks = <&dpll_per_m2_ck>;
912 clock-mult = <1>;
913 clock-div = <4>;
914 };
915
916 func_24mc_fclk: func_24mc_fclk {
917 #clock-cells = <0>;
918 compatible = "fixed-factor-clock";
919 clocks = <&dpll_per_m2x2_ck>;
920 clock-mult = <1>;
921 clock-div = <8>;
922 };
923
924 func_48m_fclk: func_48m_fclk {
925 #clock-cells = <0>;
926 compatible = "ti,divider-clock";
927 clocks = <&dpll_per_m2x2_ck>;
928 reg = <0x0108>;
929 ti,dividers = <4>, <8>;
930 };
931
932 func_48mc_fclk: func_48mc_fclk {
933 #clock-cells = <0>;
934 compatible = "fixed-factor-clock";
935 clocks = <&dpll_per_m2x2_ck>;
936 clock-mult = <1>;
937 clock-div = <4>;
938 };
939
940 func_64m_fclk: func_64m_fclk {
941 #clock-cells = <0>;
942 compatible = "ti,divider-clock";
943 clocks = <&dpll_per_m4x2_ck>;
944 reg = <0x0108>;
945 ti,dividers = <2>, <4>;
946 };
947
948 func_96m_fclk: func_96m_fclk {
949 #clock-cells = <0>;
950 compatible = "ti,divider-clock";
951 clocks = <&dpll_per_m2x2_ck>;
952 reg = <0x0108>;
953 ti,dividers = <2>, <4>;
954 };
955
956 init_60m_fclk: init_60m_fclk {
957 #clock-cells = <0>;
958 compatible = "ti,divider-clock";
959 clocks = <&dpll_usb_m2_ck>;
960 reg = <0x0104>;
961 ti,dividers = <1>, <8>;
962 };
963
964 per_abe_nc_fclk: per_abe_nc_fclk {
965 #clock-cells = <0>;
966 compatible = "ti,divider-clock";
967 clocks = <&dpll_abe_m2_ck>;
968 reg = <0x0108>;
969 ti,max-div = <2>;
970 };
971
972 aes1_fck: aes1_fck {
973 #clock-cells = <0>;
974 compatible = "ti,gate-clock";
975 clocks = <&l3_div_ck>;
976 ti,bit-shift = <1>;
977 reg = <0x15a0>;
978 };
979
980 aes2_fck: aes2_fck {
981 #clock-cells = <0>;
982 compatible = "ti,gate-clock";
983 clocks = <&l3_div_ck>;
984 ti,bit-shift = <1>;
985 reg = <0x15a8>;
986 };
987
988 dss_sys_clk: dss_sys_clk {
989 #clock-cells = <0>;
990 compatible = "ti,gate-clock";
991 clocks = <&syc_clk_div_ck>;
992 ti,bit-shift = <10>;
993 reg = <0x1120>;
994 };
995
996 dss_tv_clk: dss_tv_clk {
997 #clock-cells = <0>;
998 compatible = "ti,gate-clock";
999 clocks = <&extalt_clkin_ck>;
1000 ti,bit-shift = <11>;
1001 reg = <0x1120>;
1002 };
1003
1004 dss_dss_clk: dss_dss_clk {
1005 #clock-cells = <0>;
1006 compatible = "ti,gate-clock";
1007 clocks = <&dpll_per_m5x2_ck>;
1008 ti,bit-shift = <8>;
1009 reg = <0x1120>;
1010 ti,set-rate-parent;
1011 };
1012
1013 dss_48mhz_clk: dss_48mhz_clk {
1014 #clock-cells = <0>;
1015 compatible = "ti,gate-clock";
1016 clocks = <&func_48mc_fclk>;
1017 ti,bit-shift = <9>;
1018 reg = <0x1120>;
1019 };
1020
1021 dss_fck: dss_fck {
1022 #clock-cells = <0>;
1023 compatible = "ti,gate-clock";
1024 clocks = <&l3_div_ck>;
1025 ti,bit-shift = <1>;
1026 reg = <0x1120>;
1027 };
1028
1029 fdif_fck: fdif_fck {
1030 #clock-cells = <0>;
1031 compatible = "ti,divider-clock";
1032 clocks = <&dpll_per_m4x2_ck>;
1033 ti,bit-shift = <24>;
1034 ti,max-div = <4>;
1035 reg = <0x1028>;
1036 ti,index-power-of-two;
1037 };
1038
1039 gpio2_dbclk: gpio2_dbclk {
1040 #clock-cells = <0>;
1041 compatible = "ti,gate-clock";
1042 clocks = <&sys_32k_ck>;
1043 ti,bit-shift = <8>;
1044 reg = <0x1460>;
1045 };
1046
1047 gpio3_dbclk: gpio3_dbclk {
1048 #clock-cells = <0>;
1049 compatible = "ti,gate-clock";
1050 clocks = <&sys_32k_ck>;
1051 ti,bit-shift = <8>;
1052 reg = <0x1468>;
1053 };
1054
1055 gpio4_dbclk: gpio4_dbclk {
1056 #clock-cells = <0>;
1057 compatible = "ti,gate-clock";
1058 clocks = <&sys_32k_ck>;
1059 ti,bit-shift = <8>;
1060 reg = <0x1470>;
1061 };
1062
1063 gpio5_dbclk: gpio5_dbclk {
1064 #clock-cells = <0>;
1065 compatible = "ti,gate-clock";
1066 clocks = <&sys_32k_ck>;
1067 ti,bit-shift = <8>;
1068 reg = <0x1478>;
1069 };
1070
1071 gpio6_dbclk: gpio6_dbclk {
1072 #clock-cells = <0>;
1073 compatible = "ti,gate-clock";
1074 clocks = <&sys_32k_ck>;
1075 ti,bit-shift = <8>;
1076 reg = <0x1480>;
1077 };
1078
1079 sgx_clk_mux: sgx_clk_mux {
1080 #clock-cells = <0>;
1081 compatible = "ti,mux-clock";
1082 clocks = <&dpll_core_m7x2_ck>, <&dpll_per_m7x2_ck>;
1083 ti,bit-shift = <24>;
1084 reg = <0x1220>;
1085 };
1086
1087 hsi_fck: hsi_fck {
1088 #clock-cells = <0>;
1089 compatible = "ti,divider-clock";
1090 clocks = <&dpll_per_m2x2_ck>;
1091 ti,bit-shift = <24>;
1092 ti,max-div = <4>;
1093 reg = <0x1338>;
1094 ti,index-power-of-two;
1095 };
1096
1097 iss_ctrlclk: iss_ctrlclk {
1098 #clock-cells = <0>;
1099 compatible = "ti,gate-clock";
1100 clocks = <&func_96m_fclk>;
1101 ti,bit-shift = <8>;
1102 reg = <0x1020>;
1103 };
1104
1105 mcbsp4_sync_mux_ck: mcbsp4_sync_mux_ck {
1106 #clock-cells = <0>;
1107 compatible = "ti,mux-clock";
1108 clocks = <&func_96m_fclk>, <&per_abe_nc_fclk>;
1109 ti,bit-shift = <25>;
1110 reg = <0x14e0>;
1111 };
1112
1113 per_mcbsp4_gfclk: per_mcbsp4_gfclk {
1114 #clock-cells = <0>;
1115 compatible = "ti,mux-clock";
1116 clocks = <&mcbsp4_sync_mux_ck>, <&pad_clks_ck>;
1117 ti,bit-shift = <24>;
1118 reg = <0x14e0>;
1119 };
1120
1121 hsmmc1_fclk: hsmmc1_fclk {
1122 #clock-cells = <0>;
1123 compatible = "ti,mux-clock";
1124 clocks = <&func_64m_fclk>, <&func_96m_fclk>;
1125 ti,bit-shift = <24>;
1126 reg = <0x1328>;
1127 };
1128
1129 hsmmc2_fclk: hsmmc2_fclk {
1130 #clock-cells = <0>;
1131 compatible = "ti,mux-clock";
1132 clocks = <&func_64m_fclk>, <&func_96m_fclk>;
1133 ti,bit-shift = <24>;
1134 reg = <0x1330>;
1135 };
1136
1137 ocp2scp_usb_phy_phy_48m: ocp2scp_usb_phy_phy_48m {
1138 #clock-cells = <0>;
1139 compatible = "ti,gate-clock";
1140 clocks = <&func_48m_fclk>;
1141 ti,bit-shift = <8>;
1142 reg = <0x13e0>;
1143 };
1144
1145 sha2md5_fck: sha2md5_fck {
1146 #clock-cells = <0>;
1147 compatible = "ti,gate-clock";
1148 clocks = <&l3_div_ck>;
1149 ti,bit-shift = <1>;
1150 reg = <0x15c8>;
1151 };
1152
1153 slimbus2_fclk_1: slimbus2_fclk_1 {
1154 #clock-cells = <0>;
1155 compatible = "ti,gate-clock";
1156 clocks = <&per_abe_24m_fclk>;
1157 ti,bit-shift = <9>;
1158 reg = <0x1538>;
1159 };
1160
1161 slimbus2_fclk_0: slimbus2_fclk_0 {
1162 #clock-cells = <0>;
1163 compatible = "ti,gate-clock";
1164 clocks = <&func_24mc_fclk>;
1165 ti,bit-shift = <8>;
1166 reg = <0x1538>;
1167 };
1168
1169 slimbus2_slimbus_clk: slimbus2_slimbus_clk {
1170 #clock-cells = <0>;
1171 compatible = "ti,gate-clock";
1172 clocks = <&pad_slimbus_core_clks_ck>;
1173 ti,bit-shift = <10>;
1174 reg = <0x1538>;
1175 };
1176
1177 smartreflex_core_fck: smartreflex_core_fck {
1178 #clock-cells = <0>;
1179 compatible = "ti,gate-clock";
1180 clocks = <&l4_wkup_clk_mux_ck>;
1181 ti,bit-shift = <1>;
1182 reg = <0x0638>;
1183 };
1184
1185 smartreflex_iva_fck: smartreflex_iva_fck {
1186 #clock-cells = <0>;
1187 compatible = "ti,gate-clock";
1188 clocks = <&l4_wkup_clk_mux_ck>;
1189 ti,bit-shift = <1>;
1190 reg = <0x0630>;
1191 };
1192
1193 smartreflex_mpu_fck: smartreflex_mpu_fck {
1194 #clock-cells = <0>;
1195 compatible = "ti,gate-clock";
1196 clocks = <&l4_wkup_clk_mux_ck>;
1197 ti,bit-shift = <1>;
1198 reg = <0x0628>;
1199 };
1200
1201 cm2_dm10_mux: cm2_dm10_mux {
1202 #clock-cells = <0>;
1203 compatible = "ti,mux-clock";
1204 clocks = <&sys_clkin_ck>, <&sys_32k_ck>;
1205 ti,bit-shift = <24>;
1206 reg = <0x1428>;
1207 };
1208
1209 cm2_dm11_mux: cm2_dm11_mux {
1210 #clock-cells = <0>;
1211 compatible = "ti,mux-clock";
1212 clocks = <&sys_clkin_ck>, <&sys_32k_ck>;
1213 ti,bit-shift = <24>;
1214 reg = <0x1430>;
1215 };
1216
1217 cm2_dm2_mux: cm2_dm2_mux {
1218 #clock-cells = <0>;
1219 compatible = "ti,mux-clock";
1220 clocks = <&sys_clkin_ck>, <&sys_32k_ck>;
1221 ti,bit-shift = <24>;
1222 reg = <0x1438>;
1223 };
1224
1225 cm2_dm3_mux: cm2_dm3_mux {
1226 #clock-cells = <0>;
1227 compatible = "ti,mux-clock";
1228 clocks = <&sys_clkin_ck>, <&sys_32k_ck>;
1229 ti,bit-shift = <24>;
1230 reg = <0x1440>;
1231 };
1232
1233 cm2_dm4_mux: cm2_dm4_mux {
1234 #clock-cells = <0>;
1235 compatible = "ti,mux-clock";
1236 clocks = <&sys_clkin_ck>, <&sys_32k_ck>;
1237 ti,bit-shift = <24>;
1238 reg = <0x1448>;
1239 };
1240
1241 cm2_dm9_mux: cm2_dm9_mux {
1242 #clock-cells = <0>;
1243 compatible = "ti,mux-clock";
1244 clocks = <&sys_clkin_ck>, <&sys_32k_ck>;
1245 ti,bit-shift = <24>;
1246 reg = <0x1450>;
1247 };
1248
1249 usb_host_fs_fck: usb_host_fs_fck {
1250 #clock-cells = <0>;
1251 compatible = "ti,gate-clock";
1252 clocks = <&func_48mc_fclk>;
1253 ti,bit-shift = <1>;
1254 reg = <0x13d0>;
1255 };
1256
1257 utmi_p1_gfclk: utmi_p1_gfclk {
1258 #clock-cells = <0>;
1259 compatible = "ti,mux-clock";
1260 clocks = <&init_60m_fclk>, <&xclk60mhsp1_ck>;
1261 ti,bit-shift = <24>;
1262 reg = <0x1358>;
1263 };
1264
1265 usb_host_hs_utmi_p1_clk: usb_host_hs_utmi_p1_clk {
1266 #clock-cells = <0>;
1267 compatible = "ti,gate-clock";
1268 clocks = <&utmi_p1_gfclk>;
1269 ti,bit-shift = <8>;
1270 reg = <0x1358>;
1271 };
1272
1273 utmi_p2_gfclk: utmi_p2_gfclk {
1274 #clock-cells = <0>;
1275 compatible = "ti,mux-clock";
1276 clocks = <&init_60m_fclk>, <&xclk60mhsp2_ck>;
1277 ti,bit-shift = <25>;
1278 reg = <0x1358>;
1279 };
1280
1281 usb_host_hs_utmi_p2_clk: usb_host_hs_utmi_p2_clk {
1282 #clock-cells = <0>;
1283 compatible = "ti,gate-clock";
1284 clocks = <&utmi_p2_gfclk>;
1285 ti,bit-shift = <9>;
1286 reg = <0x1358>;
1287 };
1288
1289 usb_host_hs_utmi_p3_clk: usb_host_hs_utmi_p3_clk {
1290 #clock-cells = <0>;
1291 compatible = "ti,gate-clock";
1292 clocks = <&init_60m_fclk>;
1293 ti,bit-shift = <10>;
1294 reg = <0x1358>;
1295 };
1296
1297 usb_host_hs_hsic480m_p1_clk: usb_host_hs_hsic480m_p1_clk {
1298 #clock-cells = <0>;
1299 compatible = "ti,gate-clock";
1300 clocks = <&dpll_usb_m2_ck>;
1301 ti,bit-shift = <13>;
1302 reg = <0x1358>;
1303 };
1304
1305 usb_host_hs_hsic60m_p1_clk: usb_host_hs_hsic60m_p1_clk {
1306 #clock-cells = <0>;
1307 compatible = "ti,gate-clock";
1308 clocks = <&init_60m_fclk>;
1309 ti,bit-shift = <11>;
1310 reg = <0x1358>;
1311 };
1312
1313 usb_host_hs_hsic60m_p2_clk: usb_host_hs_hsic60m_p2_clk {
1314 #clock-cells = <0>;
1315 compatible = "ti,gate-clock";
1316 clocks = <&init_60m_fclk>;
1317 ti,bit-shift = <12>;
1318 reg = <0x1358>;
1319 };
1320
1321 usb_host_hs_hsic480m_p2_clk: usb_host_hs_hsic480m_p2_clk {
1322 #clock-cells = <0>;
1323 compatible = "ti,gate-clock";
1324 clocks = <&dpll_usb_m2_ck>;
1325 ti,bit-shift = <14>;
1326 reg = <0x1358>;
1327 };
1328
1329 usb_host_hs_func48mclk: usb_host_hs_func48mclk {
1330 #clock-cells = <0>;
1331 compatible = "ti,gate-clock";
1332 clocks = <&func_48mc_fclk>;
1333 ti,bit-shift = <15>;
1334 reg = <0x1358>;
1335 };
1336
1337 usb_host_hs_fck: usb_host_hs_fck {
1338 #clock-cells = <0>;
1339 compatible = "ti,gate-clock";
1340 clocks = <&init_60m_fclk>;
1341 ti,bit-shift = <1>;
1342 reg = <0x1358>;
1343 };
1344
1345 otg_60m_gfclk: otg_60m_gfclk {
1346 #clock-cells = <0>;
1347 compatible = "ti,mux-clock";
1348 clocks = <&utmi_phy_clkout_ck>, <&xclk60motg_ck>;
1349 ti,bit-shift = <24>;
1350 reg = <0x1360>;
1351 };
1352
1353 usb_otg_hs_xclk: usb_otg_hs_xclk {
1354 #clock-cells = <0>;
1355 compatible = "ti,gate-clock";
1356 clocks = <&otg_60m_gfclk>;
1357 ti,bit-shift = <8>;
1358 reg = <0x1360>;
1359 };
1360
1361 usb_otg_hs_ick: usb_otg_hs_ick {
1362 #clock-cells = <0>;
1363 compatible = "ti,gate-clock";
1364 clocks = <&l3_div_ck>;
1365 ti,bit-shift = <0>;
1366 reg = <0x1360>;
1367 };
1368
1369 usb_phy_cm_clk32k: usb_phy_cm_clk32k {
1370 #clock-cells = <0>;
1371 compatible = "ti,gate-clock";
1372 clocks = <&sys_32k_ck>;
1373 ti,bit-shift = <8>;
1374 reg = <0x0640>;
1375 };
1376
1377 usb_tll_hs_usb_ch2_clk: usb_tll_hs_usb_ch2_clk {
1378 #clock-cells = <0>;
1379 compatible = "ti,gate-clock";
1380 clocks = <&init_60m_fclk>;
1381 ti,bit-shift = <10>;
1382 reg = <0x1368>;
1383 };
1384
1385 usb_tll_hs_usb_ch0_clk: usb_tll_hs_usb_ch0_clk {
1386 #clock-cells = <0>;
1387 compatible = "ti,gate-clock";
1388 clocks = <&init_60m_fclk>;
1389 ti,bit-shift = <8>;
1390 reg = <0x1368>;
1391 };
1392
1393 usb_tll_hs_usb_ch1_clk: usb_tll_hs_usb_ch1_clk {
1394 #clock-cells = <0>;
1395 compatible = "ti,gate-clock";
1396 clocks = <&init_60m_fclk>;
1397 ti,bit-shift = <9>;
1398 reg = <0x1368>;
1399 };
1400
1401 usb_tll_hs_ick: usb_tll_hs_ick {
1402 #clock-cells = <0>;
1403 compatible = "ti,gate-clock";
1404 clocks = <&l4_div_ck>;
1405 ti,bit-shift = <0>;
1406 reg = <0x1368>;
1407 };
1408};
1409
1410&cm2_clockdomains {
1411 l3_init_clkdm: l3_init_clkdm {
1412 compatible = "ti,clockdomain";
1413 clocks = <&dpll_usb_ck>, <&usb_host_fs_fck>;
1414 };
1415};
1416
1417&scrm_clocks {
1418 auxclk0_src_gate_ck: auxclk0_src_gate_ck {
1419 #clock-cells = <0>;
1420 compatible = "ti,composite-no-wait-gate-clock";
1421 clocks = <&dpll_core_m3x2_ck>;
1422 ti,bit-shift = <8>;
1423 reg = <0x0310>;
1424 };
1425
1426 auxclk0_src_mux_ck: auxclk0_src_mux_ck {
1427 #clock-cells = <0>;
1428 compatible = "ti,composite-mux-clock";
1429 clocks = <&sys_clkin_ck>, <&dpll_core_m3x2_ck>, <&dpll_per_m3x2_ck>;
1430 ti,bit-shift = <1>;
1431 reg = <0x0310>;
1432 };
1433
1434 auxclk0_src_ck: auxclk0_src_ck {
1435 #clock-cells = <0>;
1436 compatible = "ti,composite-clock";
1437 clocks = <&auxclk0_src_gate_ck>, <&auxclk0_src_mux_ck>;
1438 };
1439
1440 auxclk0_ck: auxclk0_ck {
1441 #clock-cells = <0>;
1442 compatible = "ti,divider-clock";
1443 clocks = <&auxclk0_src_ck>;
1444 ti,bit-shift = <16>;
1445 ti,max-div = <16>;
1446 reg = <0x0310>;
1447 };
1448
1449 auxclk1_src_gate_ck: auxclk1_src_gate_ck {
1450 #clock-cells = <0>;
1451 compatible = "ti,composite-no-wait-gate-clock";
1452 clocks = <&dpll_core_m3x2_ck>;
1453 ti,bit-shift = <8>;
1454 reg = <0x0314>;
1455 };
1456
1457 auxclk1_src_mux_ck: auxclk1_src_mux_ck {
1458 #clock-cells = <0>;
1459 compatible = "ti,composite-mux-clock";
1460 clocks = <&sys_clkin_ck>, <&dpll_core_m3x2_ck>, <&dpll_per_m3x2_ck>;
1461 ti,bit-shift = <1>;
1462 reg = <0x0314>;
1463 };
1464
1465 auxclk1_src_ck: auxclk1_src_ck {
1466 #clock-cells = <0>;
1467 compatible = "ti,composite-clock";
1468 clocks = <&auxclk1_src_gate_ck>, <&auxclk1_src_mux_ck>;
1469 };
1470
1471 auxclk1_ck: auxclk1_ck {
1472 #clock-cells = <0>;
1473 compatible = "ti,divider-clock";
1474 clocks = <&auxclk1_src_ck>;
1475 ti,bit-shift = <16>;
1476 ti,max-div = <16>;
1477 reg = <0x0314>;
1478 };
1479
1480 auxclk2_src_gate_ck: auxclk2_src_gate_ck {
1481 #clock-cells = <0>;
1482 compatible = "ti,composite-no-wait-gate-clock";
1483 clocks = <&dpll_core_m3x2_ck>;
1484 ti,bit-shift = <8>;
1485 reg = <0x0318>;
1486 };
1487
1488 auxclk2_src_mux_ck: auxclk2_src_mux_ck {
1489 #clock-cells = <0>;
1490 compatible = "ti,composite-mux-clock";
1491 clocks = <&sys_clkin_ck>, <&dpll_core_m3x2_ck>, <&dpll_per_m3x2_ck>;
1492 ti,bit-shift = <1>;
1493 reg = <0x0318>;
1494 };
1495
1496 auxclk2_src_ck: auxclk2_src_ck {
1497 #clock-cells = <0>;
1498 compatible = "ti,composite-clock";
1499 clocks = <&auxclk2_src_gate_ck>, <&auxclk2_src_mux_ck>;
1500 };
1501
1502 auxclk2_ck: auxclk2_ck {
1503 #clock-cells = <0>;
1504 compatible = "ti,divider-clock";
1505 clocks = <&auxclk2_src_ck>;
1506 ti,bit-shift = <16>;
1507 ti,max-div = <16>;
1508 reg = <0x0318>;
1509 };
1510
1511 auxclk3_src_gate_ck: auxclk3_src_gate_ck {
1512 #clock-cells = <0>;
1513 compatible = "ti,composite-no-wait-gate-clock";
1514 clocks = <&dpll_core_m3x2_ck>;
1515 ti,bit-shift = <8>;
1516 reg = <0x031c>;
1517 };
1518
1519 auxclk3_src_mux_ck: auxclk3_src_mux_ck {
1520 #clock-cells = <0>;
1521 compatible = "ti,composite-mux-clock";
1522 clocks = <&sys_clkin_ck>, <&dpll_core_m3x2_ck>, <&dpll_per_m3x2_ck>;
1523 ti,bit-shift = <1>;
1524 reg = <0x031c>;
1525 };
1526
1527 auxclk3_src_ck: auxclk3_src_ck {
1528 #clock-cells = <0>;
1529 compatible = "ti,composite-clock";
1530 clocks = <&auxclk3_src_gate_ck>, <&auxclk3_src_mux_ck>;
1531 };
1532
1533 auxclk3_ck: auxclk3_ck {
1534 #clock-cells = <0>;
1535 compatible = "ti,divider-clock";
1536 clocks = <&auxclk3_src_ck>;
1537 ti,bit-shift = <16>;
1538 ti,max-div = <16>;
1539 reg = <0x031c>;
1540 };
1541
1542 auxclk4_src_gate_ck: auxclk4_src_gate_ck {
1543 #clock-cells = <0>;
1544 compatible = "ti,composite-no-wait-gate-clock";
1545 clocks = <&dpll_core_m3x2_ck>;
1546 ti,bit-shift = <8>;
1547 reg = <0x0320>;
1548 };
1549
1550 auxclk4_src_mux_ck: auxclk4_src_mux_ck {
1551 #clock-cells = <0>;
1552 compatible = "ti,composite-mux-clock";
1553 clocks = <&sys_clkin_ck>, <&dpll_core_m3x2_ck>, <&dpll_per_m3x2_ck>;
1554 ti,bit-shift = <1>;
1555 reg = <0x0320>;
1556 };
1557
1558 auxclk4_src_ck: auxclk4_src_ck {
1559 #clock-cells = <0>;
1560 compatible = "ti,composite-clock";
1561 clocks = <&auxclk4_src_gate_ck>, <&auxclk4_src_mux_ck>;
1562 };
1563
1564 auxclk4_ck: auxclk4_ck {
1565 #clock-cells = <0>;
1566 compatible = "ti,divider-clock";
1567 clocks = <&auxclk4_src_ck>;
1568 ti,bit-shift = <16>;
1569 ti,max-div = <16>;
1570 reg = <0x0320>;
1571 };
1572
1573 auxclk5_src_gate_ck: auxclk5_src_gate_ck {
1574 #clock-cells = <0>;
1575 compatible = "ti,composite-no-wait-gate-clock";
1576 clocks = <&dpll_core_m3x2_ck>;
1577 ti,bit-shift = <8>;
1578 reg = <0x0324>;
1579 };
1580
1581 auxclk5_src_mux_ck: auxclk5_src_mux_ck {
1582 #clock-cells = <0>;
1583 compatible = "ti,composite-mux-clock";
1584 clocks = <&sys_clkin_ck>, <&dpll_core_m3x2_ck>, <&dpll_per_m3x2_ck>;
1585 ti,bit-shift = <1>;
1586 reg = <0x0324>;
1587 };
1588
1589 auxclk5_src_ck: auxclk5_src_ck {
1590 #clock-cells = <0>;
1591 compatible = "ti,composite-clock";
1592 clocks = <&auxclk5_src_gate_ck>, <&auxclk5_src_mux_ck>;
1593 };
1594
1595 auxclk5_ck: auxclk5_ck {
1596 #clock-cells = <0>;
1597 compatible = "ti,divider-clock";
1598 clocks = <&auxclk5_src_ck>;
1599 ti,bit-shift = <16>;
1600 ti,max-div = <16>;
1601 reg = <0x0324>;
1602 };
1603
1604 auxclkreq0_ck: auxclkreq0_ck {
1605 #clock-cells = <0>;
1606 compatible = "ti,mux-clock";
1607 clocks = <&auxclk0_ck>, <&auxclk1_ck>, <&auxclk2_ck>, <&auxclk3_ck>, <&auxclk4_ck>, <&auxclk5_ck>;
1608 ti,bit-shift = <2>;
1609 reg = <0x0210>;
1610 };
1611
1612 auxclkreq1_ck: auxclkreq1_ck {
1613 #clock-cells = <0>;
1614 compatible = "ti,mux-clock";
1615 clocks = <&auxclk0_ck>, <&auxclk1_ck>, <&auxclk2_ck>, <&auxclk3_ck>, <&auxclk4_ck>, <&auxclk5_ck>;
1616 ti,bit-shift = <2>;
1617 reg = <0x0214>;
1618 };
1619
1620 auxclkreq2_ck: auxclkreq2_ck {
1621 #clock-cells = <0>;
1622 compatible = "ti,mux-clock";
1623 clocks = <&auxclk0_ck>, <&auxclk1_ck>, <&auxclk2_ck>, <&auxclk3_ck>, <&auxclk4_ck>, <&auxclk5_ck>;
1624 ti,bit-shift = <2>;
1625 reg = <0x0218>;
1626 };
1627
1628 auxclkreq3_ck: auxclkreq3_ck {
1629 #clock-cells = <0>;
1630 compatible = "ti,mux-clock";
1631 clocks = <&auxclk0_ck>, <&auxclk1_ck>, <&auxclk2_ck>, <&auxclk3_ck>, <&auxclk4_ck>, <&auxclk5_ck>;
1632 ti,bit-shift = <2>;
1633 reg = <0x021c>;
1634 };
1635
1636 auxclkreq4_ck: auxclkreq4_ck {
1637 #clock-cells = <0>;
1638 compatible = "ti,mux-clock";
1639 clocks = <&auxclk0_ck>, <&auxclk1_ck>, <&auxclk2_ck>, <&auxclk3_ck>, <&auxclk4_ck>, <&auxclk5_ck>;
1640 ti,bit-shift = <2>;
1641 reg = <0x0220>;
1642 };
1643
1644 auxclkreq5_ck: auxclkreq5_ck {
1645 #clock-cells = <0>;
1646 compatible = "ti,mux-clock";
1647 clocks = <&auxclk0_ck>, <&auxclk1_ck>, <&auxclk2_ck>, <&auxclk3_ck>, <&auxclk4_ck>, <&auxclk5_ck>;
1648 ti,bit-shift = <2>;
1649 reg = <0x0224>;
1650 };
1651};
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index ab9a21ae82f3..a72813a9663e 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -117,6 +117,58 @@
117 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>, 117 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
118 <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; 118 <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
119 119
120 prm: prm@4ae06000 {
121 compatible = "ti,omap5-prm";
122 reg = <0x4ae06000 0x3000>;
123
124 prm_clocks: clocks {
125 #address-cells = <1>;
126 #size-cells = <0>;
127 };
128
129 prm_clockdomains: clockdomains {
130 };
131 };
132
133 cm_core_aon: cm_core_aon@4a004000 {
134 compatible = "ti,omap5-cm-core-aon";
135 reg = <0x4a004000 0x2000>;
136
137 cm_core_aon_clocks: clocks {
138 #address-cells = <1>;
139 #size-cells = <0>;
140 };
141
142 cm_core_aon_clockdomains: clockdomains {
143 };
144 };
145
146 scrm: scrm@4ae0a000 {
147 compatible = "ti,omap5-scrm";
148 reg = <0x4ae0a000 0x2000>;
149
150 scrm_clocks: clocks {
151 #address-cells = <1>;
152 #size-cells = <0>;
153 };
154
155 scrm_clockdomains: clockdomains {
156 };
157 };
158
159 cm_core: cm_core@4a008000 {
160 compatible = "ti,omap5-cm-core";
161 reg = <0x4a008000 0x3000>;
162
163 cm_core_clocks: clocks {
164 #address-cells = <1>;
165 #size-cells = <0>;
166 };
167
168 cm_core_clockdomains: clockdomains {
169 };
170 };
171
120 counter32k: counter@4ae04000 { 172 counter32k: counter@4ae04000 {
121 compatible = "ti,omap-counter32k"; 173 compatible = "ti,omap-counter32k";
122 reg = <0x4ae04000 0x40>; 174 reg = <0x4ae04000 0x40>;
@@ -751,3 +803,5 @@
751 }; 803 };
752 }; 804 };
753}; 805};
806
807/include/ "omap54xx-clocks.dtsi"
diff --git a/arch/arm/boot/dts/omap54xx-clocks.dtsi b/arch/arm/boot/dts/omap54xx-clocks.dtsi
new file mode 100644
index 000000000000..d487fdab3921
--- /dev/null
+++ b/arch/arm/boot/dts/omap54xx-clocks.dtsi
@@ -0,0 +1,1399 @@
1/*
2 * Device Tree Source for OMAP5 clock data
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10&cm_core_aon_clocks {
11 pad_clks_src_ck: pad_clks_src_ck {
12 #clock-cells = <0>;
13 compatible = "fixed-clock";
14 clock-frequency = <12000000>;
15 };
16
17 pad_clks_ck: pad_clks_ck {
18 #clock-cells = <0>;
19 compatible = "ti,gate-clock";
20 clocks = <&pad_clks_src_ck>;
21 ti,bit-shift = <8>;
22 reg = <0x0108>;
23 };
24
25 secure_32k_clk_src_ck: secure_32k_clk_src_ck {
26 #clock-cells = <0>;
27 compatible = "fixed-clock";
28 clock-frequency = <32768>;
29 };
30
31 slimbus_src_clk: slimbus_src_clk {
32 #clock-cells = <0>;
33 compatible = "fixed-clock";
34 clock-frequency = <12000000>;
35 };
36
37 slimbus_clk: slimbus_clk {
38 #clock-cells = <0>;
39 compatible = "ti,gate-clock";
40 clocks = <&slimbus_src_clk>;
41 ti,bit-shift = <10>;
42 reg = <0x0108>;
43 };
44
45 sys_32k_ck: sys_32k_ck {
46 #clock-cells = <0>;
47 compatible = "fixed-clock";
48 clock-frequency = <32768>;
49 };
50
51 virt_12000000_ck: virt_12000000_ck {
52 #clock-cells = <0>;
53 compatible = "fixed-clock";
54 clock-frequency = <12000000>;
55 };
56
57 virt_13000000_ck: virt_13000000_ck {
58 #clock-cells = <0>;
59 compatible = "fixed-clock";
60 clock-frequency = <13000000>;
61 };
62
63 virt_16800000_ck: virt_16800000_ck {
64 #clock-cells = <0>;
65 compatible = "fixed-clock";
66 clock-frequency = <16800000>;
67 };
68
69 virt_19200000_ck: virt_19200000_ck {
70 #clock-cells = <0>;
71 compatible = "fixed-clock";
72 clock-frequency = <19200000>;
73 };
74
75 virt_26000000_ck: virt_26000000_ck {
76 #clock-cells = <0>;
77 compatible = "fixed-clock";
78 clock-frequency = <26000000>;
79 };
80
81 virt_27000000_ck: virt_27000000_ck {
82 #clock-cells = <0>;
83 compatible = "fixed-clock";
84 clock-frequency = <27000000>;
85 };
86
87 virt_38400000_ck: virt_38400000_ck {
88 #clock-cells = <0>;
89 compatible = "fixed-clock";
90 clock-frequency = <38400000>;
91 };
92
93 xclk60mhsp1_ck: xclk60mhsp1_ck {
94 #clock-cells = <0>;
95 compatible = "fixed-clock";
96 clock-frequency = <60000000>;
97 };
98
99 xclk60mhsp2_ck: xclk60mhsp2_ck {
100 #clock-cells = <0>;
101 compatible = "fixed-clock";
102 clock-frequency = <60000000>;
103 };
104
105 dpll_abe_ck: dpll_abe_ck {
106 #clock-cells = <0>;
107 compatible = "ti,omap4-dpll-m4xen-clock";
108 clocks = <&abe_dpll_clk_mux>, <&abe_dpll_bypass_clk_mux>;
109 reg = <0x01e0>, <0x01e4>, <0x01ec>, <0x01e8>;
110 };
111
112 dpll_abe_x2_ck: dpll_abe_x2_ck {
113 #clock-cells = <0>;
114 compatible = "ti,omap4-dpll-x2-clock";
115 clocks = <&dpll_abe_ck>;
116 };
117
118 dpll_abe_m2x2_ck: dpll_abe_m2x2_ck {
119 #clock-cells = <0>;
120 compatible = "ti,divider-clock";
121 clocks = <&dpll_abe_x2_ck>;
122 ti,max-div = <31>;
123 ti,autoidle-shift = <8>;
124 reg = <0x01f0>;
125 ti,index-starts-at-one;
126 ti,invert-autoidle-bit;
127 };
128
129 abe_24m_fclk: abe_24m_fclk {
130 #clock-cells = <0>;
131 compatible = "fixed-factor-clock";
132 clocks = <&dpll_abe_m2x2_ck>;
133 clock-mult = <1>;
134 clock-div = <8>;
135 };
136
137 abe_clk: abe_clk {
138 #clock-cells = <0>;
139 compatible = "ti,divider-clock";
140 clocks = <&dpll_abe_m2x2_ck>;
141 ti,max-div = <4>;
142 reg = <0x0108>;
143 ti,index-power-of-two;
144 };
145
146 abe_iclk: abe_iclk {
147 #clock-cells = <0>;
148 compatible = "fixed-factor-clock";
149 clocks = <&abe_clk>;
150 clock-mult = <1>;
151 clock-div = <2>;
152 };
153
154 abe_lp_clk_div: abe_lp_clk_div {
155 #clock-cells = <0>;
156 compatible = "fixed-factor-clock";
157 clocks = <&dpll_abe_m2x2_ck>;
158 clock-mult = <1>;
159 clock-div = <16>;
160 };
161
162 dpll_abe_m3x2_ck: dpll_abe_m3x2_ck {
163 #clock-cells = <0>;
164 compatible = "ti,divider-clock";
165 clocks = <&dpll_abe_x2_ck>;
166 ti,max-div = <31>;
167 ti,autoidle-shift = <8>;
168 reg = <0x01f4>;
169 ti,index-starts-at-one;
170 ti,invert-autoidle-bit;
171 };
172
173 dpll_core_ck: dpll_core_ck {
174 #clock-cells = <0>;
175 compatible = "ti,omap4-dpll-core-clock";
176 clocks = <&sys_clkin>, <&dpll_abe_m3x2_ck>;
177 reg = <0x0120>, <0x0124>, <0x012c>, <0x0128>;
178 };
179
180 dpll_core_x2_ck: dpll_core_x2_ck {
181 #clock-cells = <0>;
182 compatible = "ti,omap4-dpll-x2-clock";
183 clocks = <&dpll_core_ck>;
184 };
185
186 dpll_core_h21x2_ck: dpll_core_h21x2_ck {
187 #clock-cells = <0>;
188 compatible = "ti,divider-clock";
189 clocks = <&dpll_core_x2_ck>;
190 ti,max-div = <63>;
191 ti,autoidle-shift = <8>;
192 reg = <0x0150>;
193 ti,index-starts-at-one;
194 ti,invert-autoidle-bit;
195 };
196
197 c2c_fclk: c2c_fclk {
198 #clock-cells = <0>;
199 compatible = "fixed-factor-clock";
200 clocks = <&dpll_core_h21x2_ck>;
201 clock-mult = <1>;
202 clock-div = <1>;
203 };
204
205 c2c_iclk: c2c_iclk {
206 #clock-cells = <0>;
207 compatible = "fixed-factor-clock";
208 clocks = <&c2c_fclk>;
209 clock-mult = <1>;
210 clock-div = <2>;
211 };
212
213 dpll_core_h11x2_ck: dpll_core_h11x2_ck {
214 #clock-cells = <0>;
215 compatible = "ti,divider-clock";
216 clocks = <&dpll_core_x2_ck>;
217 ti,max-div = <63>;
218 ti,autoidle-shift = <8>;
219 reg = <0x0138>;
220 ti,index-starts-at-one;
221 ti,invert-autoidle-bit;
222 };
223
224 dpll_core_h12x2_ck: dpll_core_h12x2_ck {
225 #clock-cells = <0>;
226 compatible = "ti,divider-clock";
227 clocks = <&dpll_core_x2_ck>;
228 ti,max-div = <63>;
229 ti,autoidle-shift = <8>;
230 reg = <0x013c>;
231 ti,index-starts-at-one;
232 ti,invert-autoidle-bit;
233 };
234
235 dpll_core_h13x2_ck: dpll_core_h13x2_ck {
236 #clock-cells = <0>;
237 compatible = "ti,divider-clock";
238 clocks = <&dpll_core_x2_ck>;
239 ti,max-div = <63>;
240 ti,autoidle-shift = <8>;
241 reg = <0x0140>;
242 ti,index-starts-at-one;
243 ti,invert-autoidle-bit;
244 };
245
246 dpll_core_h14x2_ck: dpll_core_h14x2_ck {
247 #clock-cells = <0>;
248 compatible = "ti,divider-clock";
249 clocks = <&dpll_core_x2_ck>;
250 ti,max-div = <63>;
251 ti,autoidle-shift = <8>;
252 reg = <0x0144>;
253 ti,index-starts-at-one;
254 ti,invert-autoidle-bit;
255 };
256
257 dpll_core_h22x2_ck: dpll_core_h22x2_ck {
258 #clock-cells = <0>;
259 compatible = "ti,divider-clock";
260 clocks = <&dpll_core_x2_ck>;
261 ti,max-div = <63>;
262 ti,autoidle-shift = <8>;
263 reg = <0x0154>;
264 ti,index-starts-at-one;
265 ti,invert-autoidle-bit;
266 };
267
268 dpll_core_h23x2_ck: dpll_core_h23x2_ck {
269 #clock-cells = <0>;
270 compatible = "ti,divider-clock";
271 clocks = <&dpll_core_x2_ck>;
272 ti,max-div = <63>;
273 ti,autoidle-shift = <8>;
274 reg = <0x0158>;
275 ti,index-starts-at-one;
276 ti,invert-autoidle-bit;
277 };
278
279 dpll_core_h24x2_ck: dpll_core_h24x2_ck {
280 #clock-cells = <0>;
281 compatible = "ti,divider-clock";
282 clocks = <&dpll_core_x2_ck>;
283 ti,max-div = <63>;
284 ti,autoidle-shift = <8>;
285 reg = <0x015c>;
286 ti,index-starts-at-one;
287 ti,invert-autoidle-bit;
288 };
289
290 dpll_core_m2_ck: dpll_core_m2_ck {
291 #clock-cells = <0>;
292 compatible = "ti,divider-clock";
293 clocks = <&dpll_core_ck>;
294 ti,max-div = <31>;
295 ti,autoidle-shift = <8>;
296 reg = <0x0130>;
297 ti,index-starts-at-one;
298 ti,invert-autoidle-bit;
299 };
300
301 dpll_core_m3x2_ck: dpll_core_m3x2_ck {
302 #clock-cells = <0>;
303 compatible = "ti,divider-clock";
304 clocks = <&dpll_core_x2_ck>;
305 ti,max-div = <31>;
306 ti,autoidle-shift = <8>;
307 reg = <0x0134>;
308 ti,index-starts-at-one;
309 ti,invert-autoidle-bit;
310 };
311
312 iva_dpll_hs_clk_div: iva_dpll_hs_clk_div {
313 #clock-cells = <0>;
314 compatible = "fixed-factor-clock";
315 clocks = <&dpll_core_h12x2_ck>;
316 clock-mult = <1>;
317 clock-div = <1>;
318 };
319
320 dpll_iva_ck: dpll_iva_ck {
321 #clock-cells = <0>;
322 compatible = "ti,omap4-dpll-clock";
323 clocks = <&sys_clkin>, <&iva_dpll_hs_clk_div>;
324 reg = <0x01a0>, <0x01a4>, <0x01ac>, <0x01a8>;
325 };
326
327 dpll_iva_x2_ck: dpll_iva_x2_ck {
328 #clock-cells = <0>;
329 compatible = "ti,omap4-dpll-x2-clock";
330 clocks = <&dpll_iva_ck>;
331 };
332
333 dpll_iva_h11x2_ck: dpll_iva_h11x2_ck {
334 #clock-cells = <0>;
335 compatible = "ti,divider-clock";
336 clocks = <&dpll_iva_x2_ck>;
337 ti,max-div = <63>;
338 ti,autoidle-shift = <8>;
339 reg = <0x01b8>;
340 ti,index-starts-at-one;
341 ti,invert-autoidle-bit;
342 };
343
344 dpll_iva_h12x2_ck: dpll_iva_h12x2_ck {
345 #clock-cells = <0>;
346 compatible = "ti,divider-clock";
347 clocks = <&dpll_iva_x2_ck>;
348 ti,max-div = <63>;
349 ti,autoidle-shift = <8>;
350 reg = <0x01bc>;
351 ti,index-starts-at-one;
352 ti,invert-autoidle-bit;
353 };
354
355 mpu_dpll_hs_clk_div: mpu_dpll_hs_clk_div {
356 #clock-cells = <0>;
357 compatible = "fixed-factor-clock";
358 clocks = <&dpll_core_h12x2_ck>;
359 clock-mult = <1>;
360 clock-div = <1>;
361 };
362
363 dpll_mpu_ck: dpll_mpu_ck {
364 #clock-cells = <0>;
365 compatible = "ti,omap4-dpll-clock";
366 clocks = <&sys_clkin>, <&mpu_dpll_hs_clk_div>;
367 reg = <0x0160>, <0x0164>, <0x016c>, <0x0168>;
368 };
369
370 dpll_mpu_m2_ck: dpll_mpu_m2_ck {
371 #clock-cells = <0>;
372 compatible = "ti,divider-clock";
373 clocks = <&dpll_mpu_ck>;
374 ti,max-div = <31>;
375 ti,autoidle-shift = <8>;
376 reg = <0x0170>;
377 ti,index-starts-at-one;
378 ti,invert-autoidle-bit;
379 };
380
381 per_dpll_hs_clk_div: per_dpll_hs_clk_div {
382 #clock-cells = <0>;
383 compatible = "fixed-factor-clock";
384 clocks = <&dpll_abe_m3x2_ck>;
385 clock-mult = <1>;
386 clock-div = <2>;
387 };
388
389 usb_dpll_hs_clk_div: usb_dpll_hs_clk_div {
390 #clock-cells = <0>;
391 compatible = "fixed-factor-clock";
392 clocks = <&dpll_abe_m3x2_ck>;
393 clock-mult = <1>;
394 clock-div = <3>;
395 };
396
397 l3_iclk_div: l3_iclk_div {
398 #clock-cells = <0>;
399 compatible = "fixed-factor-clock";
400 clocks = <&dpll_core_h12x2_ck>;
401 clock-mult = <1>;
402 clock-div = <1>;
403 };
404
405 gpu_l3_iclk: gpu_l3_iclk {
406 #clock-cells = <0>;
407 compatible = "fixed-factor-clock";
408 clocks = <&l3_iclk_div>;
409 clock-mult = <1>;
410 clock-div = <1>;
411 };
412
413 l4_root_clk_div: l4_root_clk_div {
414 #clock-cells = <0>;
415 compatible = "fixed-factor-clock";
416 clocks = <&l3_iclk_div>;
417 clock-mult = <1>;
418 clock-div = <1>;
419 };
420
421 slimbus1_slimbus_clk: slimbus1_slimbus_clk {
422 #clock-cells = <0>;
423 compatible = "ti,gate-clock";
424 clocks = <&slimbus_clk>;
425 ti,bit-shift = <11>;
426 reg = <0x0560>;
427 };
428
429 aess_fclk: aess_fclk {
430 #clock-cells = <0>;
431 compatible = "ti,divider-clock";
432 clocks = <&abe_clk>;
433 ti,bit-shift = <24>;
434 ti,max-div = <2>;
435 reg = <0x0528>;
436 };
437
438 dmic_sync_mux_ck: dmic_sync_mux_ck {
439 #clock-cells = <0>;
440 compatible = "ti,mux-clock";
441 clocks = <&abe_24m_fclk>, <&dss_syc_gfclk_div>, <&func_24m_clk>;
442 ti,bit-shift = <26>;
443 reg = <0x0538>;
444 };
445
446 dmic_gfclk: dmic_gfclk {
447 #clock-cells = <0>;
448 compatible = "ti,mux-clock";
449 clocks = <&dmic_sync_mux_ck>, <&pad_clks_ck>, <&slimbus_clk>;
450 ti,bit-shift = <24>;
451 reg = <0x0538>;
452 };
453
454 mcasp_sync_mux_ck: mcasp_sync_mux_ck {
455 #clock-cells = <0>;
456 compatible = "ti,mux-clock";
457 clocks = <&abe_24m_fclk>, <&dss_syc_gfclk_div>, <&func_24m_clk>;
458 ti,bit-shift = <26>;
459 reg = <0x0540>;
460 };
461
462 mcasp_gfclk: mcasp_gfclk {
463 #clock-cells = <0>;
464 compatible = "ti,mux-clock";
465 clocks = <&mcasp_sync_mux_ck>, <&pad_clks_ck>, <&slimbus_clk>;
466 ti,bit-shift = <24>;
467 reg = <0x0540>;
468 };
469
470 mcbsp1_sync_mux_ck: mcbsp1_sync_mux_ck {
471 #clock-cells = <0>;
472 compatible = "ti,mux-clock";
473 clocks = <&abe_24m_fclk>, <&dss_syc_gfclk_div>, <&func_24m_clk>;
474 ti,bit-shift = <26>;
475 reg = <0x0548>;
476 };
477
478 mcbsp1_gfclk: mcbsp1_gfclk {
479 #clock-cells = <0>;
480 compatible = "ti,mux-clock";
481 clocks = <&mcbsp1_sync_mux_ck>, <&pad_clks_ck>, <&slimbus_clk>;
482 ti,bit-shift = <24>;
483 reg = <0x0548>;
484 };
485
486 mcbsp2_sync_mux_ck: mcbsp2_sync_mux_ck {
487 #clock-cells = <0>;
488 compatible = "ti,mux-clock";
489 clocks = <&abe_24m_fclk>, <&dss_syc_gfclk_div>, <&func_24m_clk>;
490 ti,bit-shift = <26>;
491 reg = <0x0550>;
492 };
493
494 mcbsp2_gfclk: mcbsp2_gfclk {
495 #clock-cells = <0>;
496 compatible = "ti,mux-clock";
497 clocks = <&mcbsp2_sync_mux_ck>, <&pad_clks_ck>, <&slimbus_clk>;
498 ti,bit-shift = <24>;
499 reg = <0x0550>;
500 };
501
502 mcbsp3_sync_mux_ck: mcbsp3_sync_mux_ck {
503 #clock-cells = <0>;
504 compatible = "ti,mux-clock";
505 clocks = <&abe_24m_fclk>, <&dss_syc_gfclk_div>, <&func_24m_clk>;
506 ti,bit-shift = <26>;
507 reg = <0x0558>;
508 };
509
510 mcbsp3_gfclk: mcbsp3_gfclk {
511 #clock-cells = <0>;
512 compatible = "ti,mux-clock";
513 clocks = <&mcbsp3_sync_mux_ck>, <&pad_clks_ck>, <&slimbus_clk>;
514 ti,bit-shift = <24>;
515 reg = <0x0558>;
516 };
517
518 timer5_gfclk_mux: timer5_gfclk_mux {
519 #clock-cells = <0>;
520 compatible = "ti,mux-clock";
521 clocks = <&dss_syc_gfclk_div>, <&sys_32k_ck>;
522 ti,bit-shift = <24>;
523 reg = <0x0568>;
524 };
525
526 timer6_gfclk_mux: timer6_gfclk_mux {
527 #clock-cells = <0>;
528 compatible = "ti,mux-clock";
529 clocks = <&dss_syc_gfclk_div>, <&sys_32k_ck>;
530 ti,bit-shift = <24>;
531 reg = <0x0570>;
532 };
533
534 timer7_gfclk_mux: timer7_gfclk_mux {
535 #clock-cells = <0>;
536 compatible = "ti,mux-clock";
537 clocks = <&dss_syc_gfclk_div>, <&sys_32k_ck>;
538 ti,bit-shift = <24>;
539 reg = <0x0578>;
540 };
541
542 timer8_gfclk_mux: timer8_gfclk_mux {
543 #clock-cells = <0>;
544 compatible = "ti,mux-clock";
545 clocks = <&dss_syc_gfclk_div>, <&sys_32k_ck>;
546 ti,bit-shift = <24>;
547 reg = <0x0580>;
548 };
549
550 dummy_ck: dummy_ck {
551 #clock-cells = <0>;
552 compatible = "fixed-clock";
553 clock-frequency = <0>;
554 };
555};
556&prm_clocks {
557 sys_clkin: sys_clkin {
558 #clock-cells = <0>;
559 compatible = "ti,mux-clock";
560 clocks = <&virt_12000000_ck>, <&virt_13000000_ck>, <&virt_16800000_ck>, <&virt_19200000_ck>, <&virt_26000000_ck>, <&virt_27000000_ck>, <&virt_38400000_ck>;
561 reg = <0x0110>;
562 ti,index-starts-at-one;
563 };
564
565 abe_dpll_bypass_clk_mux: abe_dpll_bypass_clk_mux {
566 #clock-cells = <0>;
567 compatible = "ti,mux-clock";
568 clocks = <&sys_clkin>, <&sys_32k_ck>;
569 reg = <0x0108>;
570 };
571
572 abe_dpll_clk_mux: abe_dpll_clk_mux {
573 #clock-cells = <0>;
574 compatible = "ti,mux-clock";
575 clocks = <&sys_clkin>, <&sys_32k_ck>;
576 reg = <0x010c>;
577 };
578
579 custefuse_sys_gfclk_div: custefuse_sys_gfclk_div {
580 #clock-cells = <0>;
581 compatible = "fixed-factor-clock";
582 clocks = <&sys_clkin>;
583 clock-mult = <1>;
584 clock-div = <2>;
585 };
586
587 dss_syc_gfclk_div: dss_syc_gfclk_div {
588 #clock-cells = <0>;
589 compatible = "fixed-factor-clock";
590 clocks = <&sys_clkin>;
591 clock-mult = <1>;
592 clock-div = <1>;
593 };
594
595 wkupaon_iclk_mux: wkupaon_iclk_mux {
596 #clock-cells = <0>;
597 compatible = "ti,mux-clock";
598 clocks = <&sys_clkin>, <&abe_lp_clk_div>;
599 reg = <0x0108>;
600 };
601
602 l3instr_ts_gclk_div: l3instr_ts_gclk_div {
603 #clock-cells = <0>;
604 compatible = "fixed-factor-clock";
605 clocks = <&wkupaon_iclk_mux>;
606 clock-mult = <1>;
607 clock-div = <1>;
608 };
609
610 gpio1_dbclk: gpio1_dbclk {
611 #clock-cells = <0>;
612 compatible = "ti,gate-clock";
613 clocks = <&sys_32k_ck>;
614 ti,bit-shift = <8>;
615 reg = <0x1938>;
616 };
617
618 timer1_gfclk_mux: timer1_gfclk_mux {
619 #clock-cells = <0>;
620 compatible = "ti,mux-clock";
621 clocks = <&sys_clkin>, <&sys_32k_ck>;
622 ti,bit-shift = <24>;
623 reg = <0x1940>;
624 };
625};
626&cm_core_clocks {
627 dpll_per_ck: dpll_per_ck {
628 #clock-cells = <0>;
629 compatible = "ti,omap4-dpll-clock";
630 clocks = <&sys_clkin>, <&per_dpll_hs_clk_div>;
631 reg = <0x0140>, <0x0144>, <0x014c>, <0x0148>;
632 };
633
634 dpll_per_x2_ck: dpll_per_x2_ck {
635 #clock-cells = <0>;
636 compatible = "ti,omap4-dpll-x2-clock";
637 clocks = <&dpll_per_ck>;
638 };
639
640 dpll_per_h11x2_ck: dpll_per_h11x2_ck {
641 #clock-cells = <0>;
642 compatible = "ti,divider-clock";
643 clocks = <&dpll_per_x2_ck>;
644 ti,max-div = <63>;
645 ti,autoidle-shift = <8>;
646 reg = <0x0158>;
647 ti,index-starts-at-one;
648 ti,invert-autoidle-bit;
649 };
650
651 dpll_per_h12x2_ck: dpll_per_h12x2_ck {
652 #clock-cells = <0>;
653 compatible = "ti,divider-clock";
654 clocks = <&dpll_per_x2_ck>;
655 ti,max-div = <63>;
656 ti,autoidle-shift = <8>;
657 reg = <0x015c>;
658 ti,index-starts-at-one;
659 ti,invert-autoidle-bit;
660 };
661
662 dpll_per_h14x2_ck: dpll_per_h14x2_ck {
663 #clock-cells = <0>;
664 compatible = "ti,divider-clock";
665 clocks = <&dpll_per_x2_ck>;
666 ti,max-div = <63>;
667 ti,autoidle-shift = <8>;
668 reg = <0x0164>;
669 ti,index-starts-at-one;
670 ti,invert-autoidle-bit;
671 };
672
673 dpll_per_m2_ck: dpll_per_m2_ck {
674 #clock-cells = <0>;
675 compatible = "ti,divider-clock";
676 clocks = <&dpll_per_ck>;
677 ti,max-div = <31>;
678 ti,autoidle-shift = <8>;
679 reg = <0x0150>;
680 ti,index-starts-at-one;
681 ti,invert-autoidle-bit;
682 };
683
684 dpll_per_m2x2_ck: dpll_per_m2x2_ck {
685 #clock-cells = <0>;
686 compatible = "ti,divider-clock";
687 clocks = <&dpll_per_x2_ck>;
688 ti,max-div = <31>;
689 ti,autoidle-shift = <8>;
690 reg = <0x0150>;
691 ti,index-starts-at-one;
692 ti,invert-autoidle-bit;
693 };
694
695 dpll_per_m3x2_ck: dpll_per_m3x2_ck {
696 #clock-cells = <0>;
697 compatible = "ti,divider-clock";
698 clocks = <&dpll_per_x2_ck>;
699 ti,max-div = <31>;
700 ti,autoidle-shift = <8>;
701 reg = <0x0154>;
702 ti,index-starts-at-one;
703 ti,invert-autoidle-bit;
704 };
705
706 dpll_unipro1_ck: dpll_unipro1_ck {
707 #clock-cells = <0>;
708 compatible = "ti,omap4-dpll-clock";
709 clocks = <&sys_clkin>, <&sys_clkin>;
710 reg = <0x0200>, <0x0204>, <0x020c>, <0x0208>;
711 };
712
713 dpll_unipro1_clkdcoldo: dpll_unipro1_clkdcoldo {
714 #clock-cells = <0>;
715 compatible = "fixed-factor-clock";
716 clocks = <&dpll_unipro1_ck>;
717 clock-mult = <1>;
718 clock-div = <1>;
719 };
720
721 dpll_unipro1_m2_ck: dpll_unipro1_m2_ck {
722 #clock-cells = <0>;
723 compatible = "ti,divider-clock";
724 clocks = <&dpll_unipro1_ck>;
725 ti,max-div = <127>;
726 ti,autoidle-shift = <8>;
727 reg = <0x0210>;
728 ti,index-starts-at-one;
729 ti,invert-autoidle-bit;
730 };
731
732 dpll_unipro2_ck: dpll_unipro2_ck {
733 #clock-cells = <0>;
734 compatible = "ti,omap4-dpll-clock";
735 clocks = <&sys_clkin>, <&sys_clkin>;
736 reg = <0x01c0>, <0x01c4>, <0x01cc>, <0x01c8>;
737 };
738
739 dpll_unipro2_clkdcoldo: dpll_unipro2_clkdcoldo {
740 #clock-cells = <0>;
741 compatible = "fixed-factor-clock";
742 clocks = <&dpll_unipro2_ck>;
743 clock-mult = <1>;
744 clock-div = <1>;
745 };
746
747 dpll_unipro2_m2_ck: dpll_unipro2_m2_ck {
748 #clock-cells = <0>;
749 compatible = "ti,divider-clock";
750 clocks = <&dpll_unipro2_ck>;
751 ti,max-div = <127>;
752 ti,autoidle-shift = <8>;
753 reg = <0x01d0>;
754 ti,index-starts-at-one;
755 ti,invert-autoidle-bit;
756 };
757
758 dpll_usb_ck: dpll_usb_ck {
759 #clock-cells = <0>;
760 compatible = "ti,omap4-dpll-j-type-clock";
761 clocks = <&sys_clkin>, <&usb_dpll_hs_clk_div>;
762 reg = <0x0180>, <0x0184>, <0x018c>, <0x0188>;
763 };
764
765 dpll_usb_clkdcoldo: dpll_usb_clkdcoldo {
766 #clock-cells = <0>;
767 compatible = "fixed-factor-clock";
768 clocks = <&dpll_usb_ck>;
769 clock-mult = <1>;
770 clock-div = <1>;
771 };
772
773 dpll_usb_m2_ck: dpll_usb_m2_ck {
774 #clock-cells = <0>;
775 compatible = "ti,divider-clock";
776 clocks = <&dpll_usb_ck>;
777 ti,max-div = <127>;
778 ti,autoidle-shift = <8>;
779 reg = <0x0190>;
780 ti,index-starts-at-one;
781 ti,invert-autoidle-bit;
782 };
783
784 func_128m_clk: func_128m_clk {
785 #clock-cells = <0>;
786 compatible = "fixed-factor-clock";
787 clocks = <&dpll_per_h11x2_ck>;
788 clock-mult = <1>;
789 clock-div = <2>;
790 };
791
792 func_12m_fclk: func_12m_fclk {
793 #clock-cells = <0>;
794 compatible = "fixed-factor-clock";
795 clocks = <&dpll_per_m2x2_ck>;
796 clock-mult = <1>;
797 clock-div = <16>;
798 };
799
800 func_24m_clk: func_24m_clk {
801 #clock-cells = <0>;
802 compatible = "fixed-factor-clock";
803 clocks = <&dpll_per_m2_ck>;
804 clock-mult = <1>;
805 clock-div = <4>;
806 };
807
808 func_48m_fclk: func_48m_fclk {
809 #clock-cells = <0>;
810 compatible = "fixed-factor-clock";
811 clocks = <&dpll_per_m2x2_ck>;
812 clock-mult = <1>;
813 clock-div = <4>;
814 };
815
816 func_96m_fclk: func_96m_fclk {
817 #clock-cells = <0>;
818 compatible = "fixed-factor-clock";
819 clocks = <&dpll_per_m2x2_ck>;
820 clock-mult = <1>;
821 clock-div = <2>;
822 };
823
824 l3init_60m_fclk: l3init_60m_fclk {
825 #clock-cells = <0>;
826 compatible = "ti,divider-clock";
827 clocks = <&dpll_usb_m2_ck>;
828 reg = <0x0104>;
829 ti,dividers = <1>, <8>;
830 };
831
832 dss_32khz_clk: dss_32khz_clk {
833 #clock-cells = <0>;
834 compatible = "ti,gate-clock";
835 clocks = <&sys_32k_ck>;
836 ti,bit-shift = <11>;
837 reg = <0x1420>;
838 };
839
840 dss_48mhz_clk: dss_48mhz_clk {
841 #clock-cells = <0>;
842 compatible = "ti,gate-clock";
843 clocks = <&func_48m_fclk>;
844 ti,bit-shift = <9>;
845 reg = <0x1420>;
846 };
847
848 dss_dss_clk: dss_dss_clk {
849 #clock-cells = <0>;
850 compatible = "ti,gate-clock";
851 clocks = <&dpll_per_h12x2_ck>;
852 ti,bit-shift = <8>;
853 reg = <0x1420>;
854 };
855
856 dss_sys_clk: dss_sys_clk {
857 #clock-cells = <0>;
858 compatible = "ti,gate-clock";
859 clocks = <&dss_syc_gfclk_div>;
860 ti,bit-shift = <10>;
861 reg = <0x1420>;
862 };
863
864 gpio2_dbclk: gpio2_dbclk {
865 #clock-cells = <0>;
866 compatible = "ti,gate-clock";
867 clocks = <&sys_32k_ck>;
868 ti,bit-shift = <8>;
869 reg = <0x1060>;
870 };
871
872 gpio3_dbclk: gpio3_dbclk {
873 #clock-cells = <0>;
874 compatible = "ti,gate-clock";
875 clocks = <&sys_32k_ck>;
876 ti,bit-shift = <8>;
877 reg = <0x1068>;
878 };
879
880 gpio4_dbclk: gpio4_dbclk {
881 #clock-cells = <0>;
882 compatible = "ti,gate-clock";
883 clocks = <&sys_32k_ck>;
884 ti,bit-shift = <8>;
885 reg = <0x1070>;
886 };
887
888 gpio5_dbclk: gpio5_dbclk {
889 #clock-cells = <0>;
890 compatible = "ti,gate-clock";
891 clocks = <&sys_32k_ck>;
892 ti,bit-shift = <8>;
893 reg = <0x1078>;
894 };
895
896 gpio6_dbclk: gpio6_dbclk {
897 #clock-cells = <0>;
898 compatible = "ti,gate-clock";
899 clocks = <&sys_32k_ck>;
900 ti,bit-shift = <8>;
901 reg = <0x1080>;
902 };
903
904 gpio7_dbclk: gpio7_dbclk {
905 #clock-cells = <0>;
906 compatible = "ti,gate-clock";
907 clocks = <&sys_32k_ck>;
908 ti,bit-shift = <8>;
909 reg = <0x1110>;
910 };
911
912 gpio8_dbclk: gpio8_dbclk {
913 #clock-cells = <0>;
914 compatible = "ti,gate-clock";
915 clocks = <&sys_32k_ck>;
916 ti,bit-shift = <8>;
917 reg = <0x1118>;
918 };
919
920 iss_ctrlclk: iss_ctrlclk {
921 #clock-cells = <0>;
922 compatible = "ti,gate-clock";
923 clocks = <&func_96m_fclk>;
924 ti,bit-shift = <8>;
925 reg = <0x1320>;
926 };
927
928 lli_txphy_clk: lli_txphy_clk {
929 #clock-cells = <0>;
930 compatible = "ti,gate-clock";
931 clocks = <&dpll_unipro1_clkdcoldo>;
932 ti,bit-shift = <8>;
933 reg = <0x0f20>;
934 };
935
936 lli_txphy_ls_clk: lli_txphy_ls_clk {
937 #clock-cells = <0>;
938 compatible = "ti,gate-clock";
939 clocks = <&dpll_unipro1_m2_ck>;
940 ti,bit-shift = <9>;
941 reg = <0x0f20>;
942 };
943
944 mmc1_32khz_clk: mmc1_32khz_clk {
945 #clock-cells = <0>;
946 compatible = "ti,gate-clock";
947 clocks = <&sys_32k_ck>;
948 ti,bit-shift = <8>;
949 reg = <0x1628>;
950 };
951
952 sata_ref_clk: sata_ref_clk {
953 #clock-cells = <0>;
954 compatible = "ti,gate-clock";
955 clocks = <&sys_clkin>;
956 ti,bit-shift = <8>;
957 reg = <0x1688>;
958 };
959
960 usb_host_hs_hsic480m_p1_clk: usb_host_hs_hsic480m_p1_clk {
961 #clock-cells = <0>;
962 compatible = "ti,gate-clock";
963 clocks = <&dpll_usb_m2_ck>;
964 ti,bit-shift = <13>;
965 reg = <0x1658>;
966 };
967
968 usb_host_hs_hsic480m_p2_clk: usb_host_hs_hsic480m_p2_clk {
969 #clock-cells = <0>;
970 compatible = "ti,gate-clock";
971 clocks = <&dpll_usb_m2_ck>;
972 ti,bit-shift = <14>;
973 reg = <0x1658>;
974 };
975
976 usb_host_hs_hsic480m_p3_clk: usb_host_hs_hsic480m_p3_clk {
977 #clock-cells = <0>;
978 compatible = "ti,gate-clock";
979 clocks = <&dpll_usb_m2_ck>;
980 ti,bit-shift = <7>;
981 reg = <0x1658>;
982 };
983
984 usb_host_hs_hsic60m_p1_clk: usb_host_hs_hsic60m_p1_clk {
985 #clock-cells = <0>;
986 compatible = "ti,gate-clock";
987 clocks = <&l3init_60m_fclk>;
988 ti,bit-shift = <11>;
989 reg = <0x1658>;
990 };
991
992 usb_host_hs_hsic60m_p2_clk: usb_host_hs_hsic60m_p2_clk {
993 #clock-cells = <0>;
994 compatible = "ti,gate-clock";
995 clocks = <&l3init_60m_fclk>;
996 ti,bit-shift = <12>;
997 reg = <0x1658>;
998 };
999
1000 usb_host_hs_hsic60m_p3_clk: usb_host_hs_hsic60m_p3_clk {
1001 #clock-cells = <0>;
1002 compatible = "ti,gate-clock";
1003 clocks = <&l3init_60m_fclk>;
1004 ti,bit-shift = <6>;
1005 reg = <0x1658>;
1006 };
1007
1008 utmi_p1_gfclk: utmi_p1_gfclk {
1009 #clock-cells = <0>;
1010 compatible = "ti,mux-clock";
1011 clocks = <&l3init_60m_fclk>, <&xclk60mhsp1_ck>;
1012 ti,bit-shift = <24>;
1013 reg = <0x1658>;
1014 };
1015
1016 usb_host_hs_utmi_p1_clk: usb_host_hs_utmi_p1_clk {
1017 #clock-cells = <0>;
1018 compatible = "ti,gate-clock";
1019 clocks = <&utmi_p1_gfclk>;
1020 ti,bit-shift = <8>;
1021 reg = <0x1658>;
1022 };
1023
1024 utmi_p2_gfclk: utmi_p2_gfclk {
1025 #clock-cells = <0>;
1026 compatible = "ti,mux-clock";
1027 clocks = <&l3init_60m_fclk>, <&xclk60mhsp2_ck>;
1028 ti,bit-shift = <25>;
1029 reg = <0x1658>;
1030 };
1031
1032 usb_host_hs_utmi_p2_clk: usb_host_hs_utmi_p2_clk {
1033 #clock-cells = <0>;
1034 compatible = "ti,gate-clock";
1035 clocks = <&utmi_p2_gfclk>;
1036 ti,bit-shift = <9>;
1037 reg = <0x1658>;
1038 };
1039
1040 usb_host_hs_utmi_p3_clk: usb_host_hs_utmi_p3_clk {
1041 #clock-cells = <0>;
1042 compatible = "ti,gate-clock";
1043 clocks = <&l3init_60m_fclk>;
1044 ti,bit-shift = <10>;
1045 reg = <0x1658>;
1046 };
1047
1048 usb_otg_ss_refclk960m: usb_otg_ss_refclk960m {
1049 #clock-cells = <0>;
1050 compatible = "ti,gate-clock";
1051 clocks = <&dpll_usb_clkdcoldo>;
1052 ti,bit-shift = <8>;
1053 reg = <0x16f0>;
1054 };
1055
1056 usb_phy_cm_clk32k: usb_phy_cm_clk32k {
1057 #clock-cells = <0>;
1058 compatible = "ti,gate-clock";
1059 clocks = <&sys_32k_ck>;
1060 ti,bit-shift = <8>;
1061 reg = <0x0640>;
1062 };
1063
1064 usb_tll_hs_usb_ch0_clk: usb_tll_hs_usb_ch0_clk {
1065 #clock-cells = <0>;
1066 compatible = "ti,gate-clock";
1067 clocks = <&l3init_60m_fclk>;
1068 ti,bit-shift = <8>;
1069 reg = <0x1668>;
1070 };
1071
1072 usb_tll_hs_usb_ch1_clk: usb_tll_hs_usb_ch1_clk {
1073 #clock-cells = <0>;
1074 compatible = "ti,gate-clock";
1075 clocks = <&l3init_60m_fclk>;
1076 ti,bit-shift = <9>;
1077 reg = <0x1668>;
1078 };
1079
1080 usb_tll_hs_usb_ch2_clk: usb_tll_hs_usb_ch2_clk {
1081 #clock-cells = <0>;
1082 compatible = "ti,gate-clock";
1083 clocks = <&l3init_60m_fclk>;
1084 ti,bit-shift = <10>;
1085 reg = <0x1668>;
1086 };
1087
1088 fdif_fclk: fdif_fclk {
1089 #clock-cells = <0>;
1090 compatible = "ti,divider-clock";
1091 clocks = <&dpll_per_h11x2_ck>;
1092 ti,bit-shift = <24>;
1093 ti,max-div = <2>;
1094 reg = <0x1328>;
1095 };
1096
1097 gpu_core_gclk_mux: gpu_core_gclk_mux {
1098 #clock-cells = <0>;
1099 compatible = "ti,mux-clock";
1100 clocks = <&dpll_core_h14x2_ck>, <&dpll_per_h14x2_ck>;
1101 ti,bit-shift = <24>;
1102 reg = <0x1520>;
1103 };
1104
1105 gpu_hyd_gclk_mux: gpu_hyd_gclk_mux {
1106 #clock-cells = <0>;
1107 compatible = "ti,mux-clock";
1108 clocks = <&dpll_core_h14x2_ck>, <&dpll_per_h14x2_ck>;
1109 ti,bit-shift = <25>;
1110 reg = <0x1520>;
1111 };
1112
1113 hsi_fclk: hsi_fclk {
1114 #clock-cells = <0>;
1115 compatible = "ti,divider-clock";
1116 clocks = <&dpll_per_m2x2_ck>;
1117 ti,bit-shift = <24>;
1118 ti,max-div = <2>;
1119 reg = <0x1638>;
1120 };
1121
1122 mmc1_fclk_mux: mmc1_fclk_mux {
1123 #clock-cells = <0>;
1124 compatible = "ti,mux-clock";
1125 clocks = <&func_128m_clk>, <&dpll_per_m2x2_ck>;
1126 ti,bit-shift = <24>;
1127 reg = <0x1628>;
1128 };
1129
1130 mmc1_fclk: mmc1_fclk {
1131 #clock-cells = <0>;
1132 compatible = "ti,divider-clock";
1133 clocks = <&mmc1_fclk_mux>;
1134 ti,bit-shift = <25>;
1135 ti,max-div = <2>;
1136 reg = <0x1628>;
1137 };
1138
1139 mmc2_fclk_mux: mmc2_fclk_mux {
1140 #clock-cells = <0>;
1141 compatible = "ti,mux-clock";
1142 clocks = <&func_128m_clk>, <&dpll_per_m2x2_ck>;
1143 ti,bit-shift = <24>;
1144 reg = <0x1630>;
1145 };
1146
1147 mmc2_fclk: mmc2_fclk {
1148 #clock-cells = <0>;
1149 compatible = "ti,divider-clock";
1150 clocks = <&mmc2_fclk_mux>;
1151 ti,bit-shift = <25>;
1152 ti,max-div = <2>;
1153 reg = <0x1630>;
1154 };
1155
1156 timer10_gfclk_mux: timer10_gfclk_mux {
1157 #clock-cells = <0>;
1158 compatible = "ti,mux-clock";
1159 clocks = <&sys_clkin>, <&sys_32k_ck>;
1160 ti,bit-shift = <24>;
1161 reg = <0x1028>;
1162 };
1163
1164 timer11_gfclk_mux: timer11_gfclk_mux {
1165 #clock-cells = <0>;
1166 compatible = "ti,mux-clock";
1167 clocks = <&sys_clkin>, <&sys_32k_ck>;
1168 ti,bit-shift = <24>;
1169 reg = <0x1030>;
1170 };
1171
1172 timer2_gfclk_mux: timer2_gfclk_mux {
1173 #clock-cells = <0>;
1174 compatible = "ti,mux-clock";
1175 clocks = <&sys_clkin>, <&sys_32k_ck>;
1176 ti,bit-shift = <24>;
1177 reg = <0x1038>;
1178 };
1179
1180 timer3_gfclk_mux: timer3_gfclk_mux {
1181 #clock-cells = <0>;
1182 compatible = "ti,mux-clock";
1183 clocks = <&sys_clkin>, <&sys_32k_ck>;
1184 ti,bit-shift = <24>;
1185 reg = <0x1040>;
1186 };
1187
1188 timer4_gfclk_mux: timer4_gfclk_mux {
1189 #clock-cells = <0>;
1190 compatible = "ti,mux-clock";
1191 clocks = <&sys_clkin>, <&sys_32k_ck>;
1192 ti,bit-shift = <24>;
1193 reg = <0x1048>;
1194 };
1195
1196 timer9_gfclk_mux: timer9_gfclk_mux {
1197 #clock-cells = <0>;
1198 compatible = "ti,mux-clock";
1199 clocks = <&sys_clkin>, <&sys_32k_ck>;
1200 ti,bit-shift = <24>;
1201 reg = <0x1050>;
1202 };
1203};
1204
1205&cm_core_clockdomains {
1206 l3init_clkdm: l3init_clkdm {
1207 compatible = "ti,clockdomain";
1208 clocks = <&dpll_usb_ck>;
1209 };
1210};
1211
1212&scrm_clocks {
1213 auxclk0_src_gate_ck: auxclk0_src_gate_ck {
1214 #clock-cells = <0>;
1215 compatible = "ti,composite-no-wait-gate-clock";
1216 clocks = <&dpll_core_m3x2_ck>;
1217 ti,bit-shift = <8>;
1218 reg = <0x0310>;
1219 };
1220
1221 auxclk0_src_mux_ck: auxclk0_src_mux_ck {
1222 #clock-cells = <0>;
1223 compatible = "ti,composite-mux-clock";
1224 clocks = <&sys_clkin>, <&dpll_core_m3x2_ck>, <&dpll_per_m3x2_ck>;
1225 ti,bit-shift = <1>;
1226 reg = <0x0310>;
1227 };
1228
1229 auxclk0_src_ck: auxclk0_src_ck {
1230 #clock-cells = <0>;
1231 compatible = "ti,composite-clock";
1232 clocks = <&auxclk0_src_gate_ck>, <&auxclk0_src_mux_ck>;
1233 };
1234
1235 auxclk0_ck: auxclk0_ck {
1236 #clock-cells = <0>;
1237 compatible = "ti,divider-clock";
1238 clocks = <&auxclk0_src_ck>;
1239 ti,bit-shift = <16>;
1240 ti,max-div = <16>;
1241 reg = <0x0310>;
1242 };
1243
1244 auxclk1_src_gate_ck: auxclk1_src_gate_ck {
1245 #clock-cells = <0>;
1246 compatible = "ti,composite-no-wait-gate-clock";
1247 clocks = <&dpll_core_m3x2_ck>;
1248 ti,bit-shift = <8>;
1249 reg = <0x0314>;
1250 };
1251
1252 auxclk1_src_mux_ck: auxclk1_src_mux_ck {
1253 #clock-cells = <0>;
1254 compatible = "ti,composite-mux-clock";
1255 clocks = <&sys_clkin>, <&dpll_core_m3x2_ck>, <&dpll_per_m3x2_ck>;
1256 ti,bit-shift = <1>;
1257 reg = <0x0314>;
1258 };
1259
1260 auxclk1_src_ck: auxclk1_src_ck {
1261 #clock-cells = <0>;
1262 compatible = "ti,composite-clock";
1263 clocks = <&auxclk1_src_gate_ck>, <&auxclk1_src_mux_ck>;
1264 };
1265
1266 auxclk1_ck: auxclk1_ck {
1267 #clock-cells = <0>;
1268 compatible = "ti,divider-clock";
1269 clocks = <&auxclk1_src_ck>;
1270 ti,bit-shift = <16>;
1271 ti,max-div = <16>;
1272 reg = <0x0314>;
1273 };
1274
1275 auxclk2_src_gate_ck: auxclk2_src_gate_ck {
1276 #clock-cells = <0>;
1277 compatible = "ti,composite-no-wait-gate-clock";
1278 clocks = <&dpll_core_m3x2_ck>;
1279 ti,bit-shift = <8>;
1280 reg = <0x0318>;
1281 };
1282
1283 auxclk2_src_mux_ck: auxclk2_src_mux_ck {
1284 #clock-cells = <0>;
1285 compatible = "ti,composite-mux-clock";
1286 clocks = <&sys_clkin>, <&dpll_core_m3x2_ck>, <&dpll_per_m3x2_ck>;
1287 ti,bit-shift = <1>;
1288 reg = <0x0318>;
1289 };
1290
1291 auxclk2_src_ck: auxclk2_src_ck {
1292 #clock-cells = <0>;
1293 compatible = "ti,composite-clock";
1294 clocks = <&auxclk2_src_gate_ck>, <&auxclk2_src_mux_ck>;
1295 };
1296
1297 auxclk2_ck: auxclk2_ck {
1298 #clock-cells = <0>;
1299 compatible = "ti,divider-clock";
1300 clocks = <&auxclk2_src_ck>;
1301 ti,bit-shift = <16>;
1302 ti,max-div = <16>;
1303 reg = <0x0318>;
1304 };
1305
1306 auxclk3_src_gate_ck: auxclk3_src_gate_ck {
1307 #clock-cells = <0>;
1308 compatible = "ti,composite-no-wait-gate-clock";
1309 clocks = <&dpll_core_m3x2_ck>;
1310 ti,bit-shift = <8>;
1311 reg = <0x031c>;
1312 };
1313
1314 auxclk3_src_mux_ck: auxclk3_src_mux_ck {
1315 #clock-cells = <0>;
1316 compatible = "ti,composite-mux-clock";
1317 clocks = <&sys_clkin>, <&dpll_core_m3x2_ck>, <&dpll_per_m3x2_ck>;
1318 ti,bit-shift = <1>;
1319 reg = <0x031c>;
1320 };
1321
1322 auxclk3_src_ck: auxclk3_src_ck {
1323 #clock-cells = <0>;
1324 compatible = "ti,composite-clock";
1325 clocks = <&auxclk3_src_gate_ck>, <&auxclk3_src_mux_ck>;
1326 };
1327
1328 auxclk3_ck: auxclk3_ck {
1329 #clock-cells = <0>;
1330 compatible = "ti,divider-clock";
1331 clocks = <&auxclk3_src_ck>;
1332 ti,bit-shift = <16>;
1333 ti,max-div = <16>;
1334 reg = <0x031c>;
1335 };
1336
1337 auxclk4_src_gate_ck: auxclk4_src_gate_ck {
1338 #clock-cells = <0>;
1339 compatible = "ti,composite-no-wait-gate-clock";
1340 clocks = <&dpll_core_m3x2_ck>;
1341 ti,bit-shift = <8>;
1342 reg = <0x0320>;
1343 };
1344
1345 auxclk4_src_mux_ck: auxclk4_src_mux_ck {
1346 #clock-cells = <0>;
1347 compatible = "ti,composite-mux-clock";
1348 clocks = <&sys_clkin>, <&dpll_core_m3x2_ck>, <&dpll_per_m3x2_ck>;
1349 ti,bit-shift = <1>;
1350 reg = <0x0320>;
1351 };
1352
1353 auxclk4_src_ck: auxclk4_src_ck {
1354 #clock-cells = <0>;
1355 compatible = "ti,composite-clock";
1356 clocks = <&auxclk4_src_gate_ck>, <&auxclk4_src_mux_ck>;
1357 };
1358
1359 auxclk4_ck: auxclk4_ck {
1360 #clock-cells = <0>;
1361 compatible = "ti,divider-clock";
1362 clocks = <&auxclk4_src_ck>;
1363 ti,bit-shift = <16>;
1364 ti,max-div = <16>;
1365 reg = <0x0320>;
1366 };
1367
1368 auxclkreq0_ck: auxclkreq0_ck {
1369 #clock-cells = <0>;
1370 compatible = "ti,mux-clock";
1371 clocks = <&auxclk0_ck>, <&auxclk1_ck>, <&auxclk2_ck>, <&auxclk3_ck>, <&auxclk4_ck>;
1372 ti,bit-shift = <2>;
1373 reg = <0x0210>;
1374 };
1375
1376 auxclkreq1_ck: auxclkreq1_ck {
1377 #clock-cells = <0>;
1378 compatible = "ti,mux-clock";
1379 clocks = <&auxclk0_ck>, <&auxclk1_ck>, <&auxclk2_ck>, <&auxclk3_ck>, <&auxclk4_ck>;
1380 ti,bit-shift = <2>;
1381 reg = <0x0214>;
1382 };
1383
1384 auxclkreq2_ck: auxclkreq2_ck {
1385 #clock-cells = <0>;
1386 compatible = "ti,mux-clock";
1387 clocks = <&auxclk0_ck>, <&auxclk1_ck>, <&auxclk2_ck>, <&auxclk3_ck>, <&auxclk4_ck>;
1388 ti,bit-shift = <2>;
1389 reg = <0x0218>;
1390 };
1391
1392 auxclkreq3_ck: auxclkreq3_ck {
1393 #clock-cells = <0>;
1394 compatible = "ti,mux-clock";
1395 clocks = <&auxclk0_ck>, <&auxclk1_ck>, <&auxclk2_ck>, <&auxclk3_ck>, <&auxclk4_ck>;
1396 ti,bit-shift = <2>;
1397 reg = <0x021c>;
1398 };
1399};
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 4191ae08f4c8..653b489479e0 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -76,6 +76,16 @@ config SOC_AM43XX
76 select ARM_GIC 76 select ARM_GIC
77 select MACH_OMAP_GENERIC 77 select MACH_OMAP_GENERIC
78 78
79config SOC_DRA7XX
80 bool "TI DRA7XX"
81 depends on ARCH_MULTI_V7
82 select ARCH_OMAP2PLUS
83 select ARM_CPU_SUSPEND if PM
84 select ARM_GIC
85 select CPU_V7
86 select HAVE_SMP
87 select HAVE_ARM_ARCH_TIMER
88
79config ARCH_OMAP2PLUS 89config ARCH_OMAP2PLUS
80 bool 90 bool
81 select ARCH_HAS_BANDGAP 91 select ARCH_HAS_BANDGAP
@@ -128,14 +138,6 @@ config SOC_HAS_REALTIME_COUNTER
128 depends on SOC_OMAP5 || SOC_DRA7XX 138 depends on SOC_OMAP5 || SOC_DRA7XX
129 default y 139 default y
130 140
131config SOC_DRA7XX
132 bool "TI DRA7XX"
133 select ARM_ARCH_TIMER
134 select CPU_V7
135 select ARM_GIC
136 select HAVE_SMP
137 select COMMON_CLK
138
139comment "OMAP Core Type" 141comment "OMAP Core Type"
140 depends on ARCH_OMAP2 142 depends on ARCH_OMAP2
141 143
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index f78b177e8f4f..e6eec6f72fd3 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -130,6 +130,7 @@ obj-$(CONFIG_SOC_AM33XX) += $(voltagedomain-common)
130obj-$(CONFIG_SOC_AM43XX) += $(voltagedomain-common) 130obj-$(CONFIG_SOC_AM43XX) += $(voltagedomain-common)
131obj-$(CONFIG_SOC_OMAP5) += $(voltagedomain-common) 131obj-$(CONFIG_SOC_OMAP5) += $(voltagedomain-common)
132obj-$(CONFIG_SOC_OMAP5) += voltagedomains54xx_data.o 132obj-$(CONFIG_SOC_OMAP5) += voltagedomains54xx_data.o
133obj-$(CONFIG_SOC_DRA7XX) += $(voltagedomain-common)
133 134
134# OMAP powerdomain framework 135# OMAP powerdomain framework
135powerdomain-common += powerdomain.o powerdomain-common.o 136powerdomain-common += powerdomain.o powerdomain-common.o
@@ -184,12 +185,14 @@ obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o clkt34xx_dpll3m2.o
184obj-$(CONFIG_ARCH_OMAP3) += clock3517.o clock36xx.o 185obj-$(CONFIG_ARCH_OMAP3) += clock3517.o clock36xx.o
185obj-$(CONFIG_ARCH_OMAP3) += dpll3xxx.o cclock3xxx_data.o 186obj-$(CONFIG_ARCH_OMAP3) += dpll3xxx.o cclock3xxx_data.o
186obj-$(CONFIG_ARCH_OMAP3) += clkt_iclk.o 187obj-$(CONFIG_ARCH_OMAP3) += clkt_iclk.o
187obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) cclock44xx_data.o 188obj-$(CONFIG_ARCH_OMAP4) += $(clock-common)
188obj-$(CONFIG_ARCH_OMAP4) += dpll3xxx.o dpll44xx.o 189obj-$(CONFIG_ARCH_OMAP4) += dpll3xxx.o dpll44xx.o
189obj-$(CONFIG_SOC_AM33XX) += $(clock-common) dpll3xxx.o 190obj-$(CONFIG_SOC_AM33XX) += $(clock-common) dpll3xxx.o
190obj-$(CONFIG_SOC_AM33XX) += cclock33xx_data.o
191obj-$(CONFIG_SOC_OMAP5) += $(clock-common) 191obj-$(CONFIG_SOC_OMAP5) += $(clock-common)
192obj-$(CONFIG_SOC_OMAP5) += dpll3xxx.o dpll44xx.o 192obj-$(CONFIG_SOC_OMAP5) += dpll3xxx.o dpll44xx.o
193obj-$(CONFIG_SOC_DRA7XX) += $(clock-common)
194obj-$(CONFIG_SOC_DRA7XX) += dpll3xxx.o dpll44xx.o
195obj-$(CONFIG_SOC_AM43XX) += $(clock-common) dpll3xxx.o
193 196
194# OMAP2 clock rate set data (old "OPP" data) 197# OMAP2 clock rate set data (old "OPP" data)
195obj-$(CONFIG_SOC_OMAP2420) += opp2420_data.o 198obj-$(CONFIG_SOC_OMAP2420) += opp2420_data.o
diff --git a/arch/arm/mach-omap2/cclock33xx_data.c b/arch/arm/mach-omap2/cclock33xx_data.c
deleted file mode 100644
index 865d30ee812f..000000000000
--- a/arch/arm/mach-omap2/cclock33xx_data.c
+++ /dev/null
@@ -1,1064 +0,0 @@
1/*
2 * AM33XX Clock data
3 *
4 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
5 * Vaibhav Hiremath <hvaibhav@ti.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation version 2.
10 *
11 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12 * kind, whether express or implied; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#include <linux/kernel.h>
18#include <linux/list.h>
19#include <linux/clk-private.h>
20#include <linux/clkdev.h>
21#include <linux/io.h>
22
23#include "am33xx.h"
24#include "soc.h"
25#include "iomap.h"
26#include "clock.h"
27#include "control.h"
28#include "cm.h"
29#include "cm33xx.h"
30#include "cm-regbits-33xx.h"
31#include "prm.h"
32
33/* Modulemode control */
34#define AM33XX_MODULEMODE_HWCTRL_SHIFT 0
35#define AM33XX_MODULEMODE_SWCTRL_SHIFT 1
36
37/*LIST_HEAD(clocks);*/
38
39/* Root clocks */
40
41/* RTC 32k */
42DEFINE_CLK_FIXED_RATE(clk_32768_ck, CLK_IS_ROOT, 32768, 0x0);
43
44/* On-Chip 32KHz RC OSC */
45DEFINE_CLK_FIXED_RATE(clk_rc32k_ck, CLK_IS_ROOT, 32000, 0x0);
46
47/* Crystal input clks */
48DEFINE_CLK_FIXED_RATE(virt_19200000_ck, CLK_IS_ROOT, 19200000, 0x0);
49
50DEFINE_CLK_FIXED_RATE(virt_24000000_ck, CLK_IS_ROOT, 24000000, 0x0);
51
52DEFINE_CLK_FIXED_RATE(virt_25000000_ck, CLK_IS_ROOT, 25000000, 0x0);
53
54DEFINE_CLK_FIXED_RATE(virt_26000000_ck, CLK_IS_ROOT, 26000000, 0x0);
55
56/* Oscillator clock */
57/* 19.2, 24, 25 or 26 MHz */
58static const char *sys_clkin_ck_parents[] = {
59 "virt_19200000_ck", "virt_24000000_ck", "virt_25000000_ck",
60 "virt_26000000_ck",
61};
62
63/*
64 * sys_clk in: input to the dpll and also used as funtional clock for,
65 * adc_tsc, smartreflex0-1, timer1-7, mcasp0-1, dcan0-1, cefuse
66 *
67 */
68DEFINE_CLK_MUX(sys_clkin_ck, sys_clkin_ck_parents, NULL, 0x0,
69 AM33XX_CTRL_REGADDR(AM33XX_CONTROL_STATUS),
70 AM33XX_CONTROL_STATUS_SYSBOOT1_SHIFT,
71 AM33XX_CONTROL_STATUS_SYSBOOT1_WIDTH,
72 0, NULL);
73
74/* External clock - 12 MHz */
75DEFINE_CLK_FIXED_RATE(tclkin_ck, CLK_IS_ROOT, 12000000, 0x0);
76
77/* Module clocks and DPLL outputs */
78
79/* DPLL_CORE */
80static struct dpll_data dpll_core_dd = {
81 .mult_div1_reg = AM33XX_CM_CLKSEL_DPLL_CORE,
82 .clk_bypass = &sys_clkin_ck,
83 .clk_ref = &sys_clkin_ck,
84 .control_reg = AM33XX_CM_CLKMODE_DPLL_CORE,
85 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
86 .idlest_reg = AM33XX_CM_IDLEST_DPLL_CORE,
87 .mult_mask = AM33XX_DPLL_MULT_MASK,
88 .div1_mask = AM33XX_DPLL_DIV_MASK,
89 .enable_mask = AM33XX_DPLL_EN_MASK,
90 .idlest_mask = AM33XX_ST_DPLL_CLK_MASK,
91 .max_multiplier = 2047,
92 .max_divider = 128,
93 .min_divider = 1,
94};
95
96/* CLKDCOLDO output */
97static const char *dpll_core_ck_parents[] = {
98 "sys_clkin_ck",
99};
100
101static struct clk dpll_core_ck;
102
103static const struct clk_ops dpll_core_ck_ops = {
104 .recalc_rate = &omap3_dpll_recalc,
105 .get_parent = &omap2_init_dpll_parent,
106};
107
108static struct clk_hw_omap dpll_core_ck_hw = {
109 .hw = {
110 .clk = &dpll_core_ck,
111 },
112 .dpll_data = &dpll_core_dd,
113 .ops = &clkhwops_omap3_dpll,
114};
115
116DEFINE_STRUCT_CLK(dpll_core_ck, dpll_core_ck_parents, dpll_core_ck_ops);
117
118static const char *dpll_core_x2_ck_parents[] = {
119 "dpll_core_ck",
120};
121
122static struct clk dpll_core_x2_ck;
123
124static const struct clk_ops dpll_x2_ck_ops = {
125 .recalc_rate = &omap3_clkoutx2_recalc,
126};
127
128static struct clk_hw_omap dpll_core_x2_ck_hw = {
129 .hw = {
130 .clk = &dpll_core_x2_ck,
131 },
132 .flags = CLOCK_CLKOUTX2,
133};
134
135DEFINE_STRUCT_CLK(dpll_core_x2_ck, dpll_core_x2_ck_parents, dpll_x2_ck_ops);
136
137DEFINE_CLK_DIVIDER(dpll_core_m4_ck, "dpll_core_x2_ck", &dpll_core_x2_ck,
138 0x0, AM33XX_CM_DIV_M4_DPLL_CORE,
139 AM33XX_HSDIVIDER_CLKOUT1_DIV_SHIFT,
140 AM33XX_HSDIVIDER_CLKOUT1_DIV_WIDTH, CLK_DIVIDER_ONE_BASED,
141 NULL);
142
143DEFINE_CLK_DIVIDER(dpll_core_m5_ck, "dpll_core_x2_ck", &dpll_core_x2_ck,
144 0x0, AM33XX_CM_DIV_M5_DPLL_CORE,
145 AM33XX_HSDIVIDER_CLKOUT2_DIV_SHIFT,
146 AM33XX_HSDIVIDER_CLKOUT2_DIV_WIDTH,
147 CLK_DIVIDER_ONE_BASED, NULL);
148
149DEFINE_CLK_DIVIDER(dpll_core_m6_ck, "dpll_core_x2_ck", &dpll_core_x2_ck,
150 0x0, AM33XX_CM_DIV_M6_DPLL_CORE,
151 AM33XX_HSDIVIDER_CLKOUT3_DIV_SHIFT,
152 AM33XX_HSDIVIDER_CLKOUT3_DIV_WIDTH,
153 CLK_DIVIDER_ONE_BASED, NULL);
154
155
156/* DPLL_MPU */
157static struct dpll_data dpll_mpu_dd = {
158 .mult_div1_reg = AM33XX_CM_CLKSEL_DPLL_MPU,
159 .clk_bypass = &sys_clkin_ck,
160 .clk_ref = &sys_clkin_ck,
161 .control_reg = AM33XX_CM_CLKMODE_DPLL_MPU,
162 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
163 .idlest_reg = AM33XX_CM_IDLEST_DPLL_MPU,
164 .mult_mask = AM33XX_DPLL_MULT_MASK,
165 .div1_mask = AM33XX_DPLL_DIV_MASK,
166 .enable_mask = AM33XX_DPLL_EN_MASK,
167 .idlest_mask = AM33XX_ST_DPLL_CLK_MASK,
168 .max_multiplier = 2047,
169 .max_divider = 128,
170 .min_divider = 1,
171};
172
173/* CLKOUT: fdpll/M2 */
174static struct clk dpll_mpu_ck;
175
176static const struct clk_ops dpll_mpu_ck_ops = {
177 .enable = &omap3_noncore_dpll_enable,
178 .disable = &omap3_noncore_dpll_disable,
179 .recalc_rate = &omap3_dpll_recalc,
180 .round_rate = &omap2_dpll_round_rate,
181 .set_rate = &omap3_noncore_dpll_set_rate,
182 .get_parent = &omap2_init_dpll_parent,
183};
184
185static struct clk_hw_omap dpll_mpu_ck_hw = {
186 .hw = {
187 .clk = &dpll_mpu_ck,
188 },
189 .dpll_data = &dpll_mpu_dd,
190 .ops = &clkhwops_omap3_dpll,
191};
192
193DEFINE_STRUCT_CLK(dpll_mpu_ck, dpll_core_ck_parents, dpll_mpu_ck_ops);
194
195/*
196 * TODO: Add clksel here (sys_clkin, CORE_CLKOUTM6, PER_CLKOUTM2
197 * and ALT_CLK1/2)
198 */
199DEFINE_CLK_DIVIDER(dpll_mpu_m2_ck, "dpll_mpu_ck", &dpll_mpu_ck,
200 0x0, AM33XX_CM_DIV_M2_DPLL_MPU, AM33XX_DPLL_CLKOUT_DIV_SHIFT,
201 AM33XX_DPLL_CLKOUT_DIV_WIDTH, CLK_DIVIDER_ONE_BASED, NULL);
202
203/* DPLL_DDR */
204static struct dpll_data dpll_ddr_dd = {
205 .mult_div1_reg = AM33XX_CM_CLKSEL_DPLL_DDR,
206 .clk_bypass = &sys_clkin_ck,
207 .clk_ref = &sys_clkin_ck,
208 .control_reg = AM33XX_CM_CLKMODE_DPLL_DDR,
209 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
210 .idlest_reg = AM33XX_CM_IDLEST_DPLL_DDR,
211 .mult_mask = AM33XX_DPLL_MULT_MASK,
212 .div1_mask = AM33XX_DPLL_DIV_MASK,
213 .enable_mask = AM33XX_DPLL_EN_MASK,
214 .idlest_mask = AM33XX_ST_DPLL_CLK_MASK,
215 .max_multiplier = 2047,
216 .max_divider = 128,
217 .min_divider = 1,
218};
219
220/* CLKOUT: fdpll/M2 */
221static struct clk dpll_ddr_ck;
222
223static const struct clk_ops dpll_ddr_ck_ops = {
224 .recalc_rate = &omap3_dpll_recalc,
225 .get_parent = &omap2_init_dpll_parent,
226 .round_rate = &omap2_dpll_round_rate,
227 .set_rate = &omap3_noncore_dpll_set_rate,
228};
229
230static struct clk_hw_omap dpll_ddr_ck_hw = {
231 .hw = {
232 .clk = &dpll_ddr_ck,
233 },
234 .dpll_data = &dpll_ddr_dd,
235 .ops = &clkhwops_omap3_dpll,
236};
237
238DEFINE_STRUCT_CLK(dpll_ddr_ck, dpll_core_ck_parents, dpll_ddr_ck_ops);
239
240/*
241 * TODO: Add clksel here (sys_clkin, CORE_CLKOUTM6, PER_CLKOUTM2
242 * and ALT_CLK1/2)
243 */
244DEFINE_CLK_DIVIDER(dpll_ddr_m2_ck, "dpll_ddr_ck", &dpll_ddr_ck,
245 0x0, AM33XX_CM_DIV_M2_DPLL_DDR,
246 AM33XX_DPLL_CLKOUT_DIV_SHIFT, AM33XX_DPLL_CLKOUT_DIV_WIDTH,
247 CLK_DIVIDER_ONE_BASED, NULL);
248
249/* emif_fck functional clock */
250DEFINE_CLK_FIXED_FACTOR(dpll_ddr_m2_div2_ck, "dpll_ddr_m2_ck", &dpll_ddr_m2_ck,
251 0x0, 1, 2);
252
253/* DPLL_DISP */
254static struct dpll_data dpll_disp_dd = {
255 .mult_div1_reg = AM33XX_CM_CLKSEL_DPLL_DISP,
256 .clk_bypass = &sys_clkin_ck,
257 .clk_ref = &sys_clkin_ck,
258 .control_reg = AM33XX_CM_CLKMODE_DPLL_DISP,
259 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
260 .idlest_reg = AM33XX_CM_IDLEST_DPLL_DISP,
261 .mult_mask = AM33XX_DPLL_MULT_MASK,
262 .div1_mask = AM33XX_DPLL_DIV_MASK,
263 .enable_mask = AM33XX_DPLL_EN_MASK,
264 .idlest_mask = AM33XX_ST_DPLL_CLK_MASK,
265 .max_multiplier = 2047,
266 .max_divider = 128,
267 .min_divider = 1,
268};
269
270/* CLKOUT: fdpll/M2 */
271static struct clk dpll_disp_ck;
272
273static struct clk_hw_omap dpll_disp_ck_hw = {
274 .hw = {
275 .clk = &dpll_disp_ck,
276 },
277 .dpll_data = &dpll_disp_dd,
278 .ops = &clkhwops_omap3_dpll,
279};
280
281DEFINE_STRUCT_CLK(dpll_disp_ck, dpll_core_ck_parents, dpll_ddr_ck_ops);
282
283/*
284 * TODO: Add clksel here (sys_clkin, CORE_CLKOUTM6, PER_CLKOUTM2
285 * and ALT_CLK1/2)
286 */
287DEFINE_CLK_DIVIDER(dpll_disp_m2_ck, "dpll_disp_ck", &dpll_disp_ck,
288 CLK_SET_RATE_PARENT, AM33XX_CM_DIV_M2_DPLL_DISP,
289 AM33XX_DPLL_CLKOUT_DIV_SHIFT, AM33XX_DPLL_CLKOUT_DIV_WIDTH,
290 CLK_DIVIDER_ONE_BASED, NULL);
291
292/* DPLL_PER */
293static struct dpll_data dpll_per_dd = {
294 .mult_div1_reg = AM33XX_CM_CLKSEL_DPLL_PERIPH,
295 .clk_bypass = &sys_clkin_ck,
296 .clk_ref = &sys_clkin_ck,
297 .control_reg = AM33XX_CM_CLKMODE_DPLL_PER,
298 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
299 .idlest_reg = AM33XX_CM_IDLEST_DPLL_PER,
300 .mult_mask = AM33XX_DPLL_MULT_PERIPH_MASK,
301 .div1_mask = AM33XX_DPLL_PER_DIV_MASK,
302 .enable_mask = AM33XX_DPLL_EN_MASK,
303 .idlest_mask = AM33XX_ST_DPLL_CLK_MASK,
304 .max_multiplier = 2047,
305 .max_divider = 128,
306 .min_divider = 1,
307 .flags = DPLL_J_TYPE,
308};
309
310/* CLKDCOLDO */
311static struct clk dpll_per_ck;
312
313static struct clk_hw_omap dpll_per_ck_hw = {
314 .hw = {
315 .clk = &dpll_per_ck,
316 },
317 .dpll_data = &dpll_per_dd,
318 .ops = &clkhwops_omap3_dpll,
319};
320
321DEFINE_STRUCT_CLK(dpll_per_ck, dpll_core_ck_parents, dpll_ddr_ck_ops);
322
323/* CLKOUT: fdpll/M2 */
324DEFINE_CLK_DIVIDER(dpll_per_m2_ck, "dpll_per_ck", &dpll_per_ck, 0x0,
325 AM33XX_CM_DIV_M2_DPLL_PER, AM33XX_DPLL_CLKOUT_DIV_SHIFT,
326 AM33XX_DPLL_CLKOUT_DIV_WIDTH, CLK_DIVIDER_ONE_BASED,
327 NULL);
328
329DEFINE_CLK_FIXED_FACTOR(dpll_per_m2_div4_wkupdm_ck, "dpll_per_m2_ck",
330 &dpll_per_m2_ck, 0x0, 1, 4);
331
332DEFINE_CLK_FIXED_FACTOR(dpll_per_m2_div4_ck, "dpll_per_m2_ck",
333 &dpll_per_m2_ck, 0x0, 1, 4);
334
335DEFINE_CLK_FIXED_FACTOR(dpll_core_m4_div2_ck, "dpll_core_m4_ck",
336 &dpll_core_m4_ck, 0x0, 1, 2);
337
338DEFINE_CLK_FIXED_FACTOR(l4_rtc_gclk, "dpll_core_m4_ck", &dpll_core_m4_ck, 0x0,
339 1, 2);
340
341DEFINE_CLK_FIXED_FACTOR(clk_24mhz, "dpll_per_m2_ck", &dpll_per_m2_ck, 0x0, 1,
342 8);
343
344/*
345 * Below clock nodes describes clockdomains derived out
346 * of core clock.
347 */
348static const struct clk_ops clk_ops_null = {
349};
350
351static const char *l3_gclk_parents[] = {
352 "dpll_core_m4_ck"
353};
354
355static struct clk l3_gclk;
356DEFINE_STRUCT_CLK_HW_OMAP(l3_gclk, NULL);
357DEFINE_STRUCT_CLK(l3_gclk, l3_gclk_parents, clk_ops_null);
358
359static struct clk l4hs_gclk;
360DEFINE_STRUCT_CLK_HW_OMAP(l4hs_gclk, NULL);
361DEFINE_STRUCT_CLK(l4hs_gclk, l3_gclk_parents, clk_ops_null);
362
363static const char *l3s_gclk_parents[] = {
364 "dpll_core_m4_div2_ck"
365};
366
367static struct clk l3s_gclk;
368DEFINE_STRUCT_CLK_HW_OMAP(l3s_gclk, NULL);
369DEFINE_STRUCT_CLK(l3s_gclk, l3s_gclk_parents, clk_ops_null);
370
371static struct clk l4fw_gclk;
372DEFINE_STRUCT_CLK_HW_OMAP(l4fw_gclk, NULL);
373DEFINE_STRUCT_CLK(l4fw_gclk, l3s_gclk_parents, clk_ops_null);
374
375static struct clk l4ls_gclk;
376DEFINE_STRUCT_CLK_HW_OMAP(l4ls_gclk, NULL);
377DEFINE_STRUCT_CLK(l4ls_gclk, l3s_gclk_parents, clk_ops_null);
378
379static struct clk sysclk_div_ck;
380DEFINE_STRUCT_CLK_HW_OMAP(sysclk_div_ck, NULL);
381DEFINE_STRUCT_CLK(sysclk_div_ck, l3_gclk_parents, clk_ops_null);
382
383/*
384 * In order to match the clock domain with hwmod clockdomain entry,
385 * separate clock nodes is required for the modules which are
386 * directly getting their funtioncal clock from sys_clkin.
387 */
388static struct clk adc_tsc_fck;
389DEFINE_STRUCT_CLK_HW_OMAP(adc_tsc_fck, NULL);
390DEFINE_STRUCT_CLK(adc_tsc_fck, dpll_core_ck_parents, clk_ops_null);
391
392static struct clk dcan0_fck;
393DEFINE_STRUCT_CLK_HW_OMAP(dcan0_fck, NULL);
394DEFINE_STRUCT_CLK(dcan0_fck, dpll_core_ck_parents, clk_ops_null);
395
396static struct clk dcan1_fck;
397DEFINE_STRUCT_CLK_HW_OMAP(dcan1_fck, NULL);
398DEFINE_STRUCT_CLK(dcan1_fck, dpll_core_ck_parents, clk_ops_null);
399
400static struct clk mcasp0_fck;
401DEFINE_STRUCT_CLK_HW_OMAP(mcasp0_fck, NULL);
402DEFINE_STRUCT_CLK(mcasp0_fck, dpll_core_ck_parents, clk_ops_null);
403
404static struct clk mcasp1_fck;
405DEFINE_STRUCT_CLK_HW_OMAP(mcasp1_fck, NULL);
406DEFINE_STRUCT_CLK(mcasp1_fck, dpll_core_ck_parents, clk_ops_null);
407
408static struct clk smartreflex0_fck;
409DEFINE_STRUCT_CLK_HW_OMAP(smartreflex0_fck, NULL);
410DEFINE_STRUCT_CLK(smartreflex0_fck, dpll_core_ck_parents, clk_ops_null);
411
412static struct clk smartreflex1_fck;
413DEFINE_STRUCT_CLK_HW_OMAP(smartreflex1_fck, NULL);
414DEFINE_STRUCT_CLK(smartreflex1_fck, dpll_core_ck_parents, clk_ops_null);
415
416static struct clk sha0_fck;
417DEFINE_STRUCT_CLK_HW_OMAP(sha0_fck, NULL);
418DEFINE_STRUCT_CLK(sha0_fck, dpll_core_ck_parents, clk_ops_null);
419
420static struct clk aes0_fck;
421DEFINE_STRUCT_CLK_HW_OMAP(aes0_fck, NULL);
422DEFINE_STRUCT_CLK(aes0_fck, dpll_core_ck_parents, clk_ops_null);
423
424static struct clk rng_fck;
425DEFINE_STRUCT_CLK_HW_OMAP(rng_fck, NULL);
426DEFINE_STRUCT_CLK(rng_fck, dpll_core_ck_parents, clk_ops_null);
427
428/*
429 * Modules clock nodes
430 *
431 * The following clock leaf nodes are added for the moment because:
432 *
433 * - hwmod data is not present for these modules, either hwmod
434 * control is not required or its not populated.
435 * - Driver code is not yet migrated to use hwmod/runtime pm
436 * - Modules outside kernel access (to disable them by default)
437 *
438 * - mmu (gfx domain)
439 * - cefuse
440 * - usbotg_fck (its additional clock and not really a modulemode)
441 * - ieee5000
442 */
443
444DEFINE_CLK_GATE(mmu_fck, "dpll_core_m4_ck", &dpll_core_m4_ck, 0x0,
445 AM33XX_CM_GFX_MMUDATA_CLKCTRL, AM33XX_MODULEMODE_SWCTRL_SHIFT,
446 0x0, NULL);
447
448DEFINE_CLK_GATE(cefuse_fck, "sys_clkin_ck", &sys_clkin_ck, 0x0,
449 AM33XX_CM_CEFUSE_CEFUSE_CLKCTRL, AM33XX_MODULEMODE_SWCTRL_SHIFT,
450 0x0, NULL);
451
452/*
453 * clkdiv32 is generated from fixed division of 732.4219
454 */
455DEFINE_CLK_FIXED_FACTOR(clkdiv32k_ck, "clk_24mhz", &clk_24mhz, 0x0, 1, 732);
456
457static struct clk clkdiv32k_ick;
458
459static const char *clkdiv32k_ick_parent_names[] = {
460 "clkdiv32k_ck",
461};
462
463static const struct clk_ops clkdiv32k_ick_ops = {
464 .enable = &omap2_dflt_clk_enable,
465 .disable = &omap2_dflt_clk_disable,
466 .is_enabled = &omap2_dflt_clk_is_enabled,
467 .init = &omap2_init_clk_clkdm,
468};
469
470static struct clk_hw_omap clkdiv32k_ick_hw = {
471 .hw = {
472 .clk = &clkdiv32k_ick,
473 },
474 .enable_reg = AM33XX_CM_PER_CLKDIV32K_CLKCTRL,
475 .enable_bit = AM33XX_MODULEMODE_SWCTRL_SHIFT,
476 .clkdm_name = "clk_24mhz_clkdm",
477};
478
479DEFINE_STRUCT_CLK(clkdiv32k_ick, clkdiv32k_ick_parent_names, clkdiv32k_ick_ops);
480
481/* "usbotg_fck" is an additional clock and not really a modulemode */
482DEFINE_CLK_GATE(usbotg_fck, "dpll_per_ck", &dpll_per_ck, 0x0,
483 AM33XX_CM_CLKDCOLDO_DPLL_PER, AM33XX_ST_DPLL_CLKDCOLDO_SHIFT,
484 0x0, NULL);
485
486DEFINE_CLK_GATE(ieee5000_fck, "dpll_core_m4_div2_ck", &dpll_core_m4_div2_ck,
487 0x0, AM33XX_CM_PER_IEEE5000_CLKCTRL,
488 AM33XX_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
489
490/* Timers */
491static const struct clksel timer1_clkmux_sel[] = {
492 { .parent = &sys_clkin_ck, .rates = div_1_0_rates },
493 { .parent = &clkdiv32k_ick, .rates = div_1_1_rates },
494 { .parent = &tclkin_ck, .rates = div_1_2_rates },
495 { .parent = &clk_rc32k_ck, .rates = div_1_3_rates },
496 { .parent = &clk_32768_ck, .rates = div_1_4_rates },
497 { .parent = NULL },
498};
499
500static const char *timer1_ck_parents[] = {
501 "sys_clkin_ck", "clkdiv32k_ick", "tclkin_ck", "clk_rc32k_ck",
502 "clk_32768_ck",
503};
504
505static struct clk timer1_fck;
506
507static const struct clk_ops timer1_fck_ops = {
508 .recalc_rate = &omap2_clksel_recalc,
509 .get_parent = &omap2_clksel_find_parent_index,
510 .set_parent = &omap2_clksel_set_parent,
511 .init = &omap2_init_clk_clkdm,
512};
513
514static struct clk_hw_omap timer1_fck_hw = {
515 .hw = {
516 .clk = &timer1_fck,
517 },
518 .clkdm_name = "l4ls_clkdm",
519 .clksel = timer1_clkmux_sel,
520 .clksel_reg = AM33XX_CLKSEL_TIMER1MS_CLK,
521 .clksel_mask = AM33XX_CLKSEL_0_2_MASK,
522};
523
524DEFINE_STRUCT_CLK(timer1_fck, timer1_ck_parents, timer1_fck_ops);
525
526static const struct clksel timer2_to_7_clk_sel[] = {
527 { .parent = &tclkin_ck, .rates = div_1_0_rates },
528 { .parent = &sys_clkin_ck, .rates = div_1_1_rates },
529 { .parent = &clkdiv32k_ick, .rates = div_1_2_rates },
530 { .parent = NULL },
531};
532
533static const char *timer2_to_7_ck_parents[] = {
534 "tclkin_ck", "sys_clkin_ck", "clkdiv32k_ick",
535};
536
537static struct clk timer2_fck;
538
539static struct clk_hw_omap timer2_fck_hw = {
540 .hw = {
541 .clk = &timer2_fck,
542 },
543 .clkdm_name = "l4ls_clkdm",
544 .clksel = timer2_to_7_clk_sel,
545 .clksel_reg = AM33XX_CLKSEL_TIMER2_CLK,
546 .clksel_mask = AM33XX_CLKSEL_0_1_MASK,
547};
548
549DEFINE_STRUCT_CLK(timer2_fck, timer2_to_7_ck_parents, timer1_fck_ops);
550
551static struct clk timer3_fck;
552
553static struct clk_hw_omap timer3_fck_hw = {
554 .hw = {
555 .clk = &timer3_fck,
556 },
557 .clkdm_name = "l4ls_clkdm",
558 .clksel = timer2_to_7_clk_sel,
559 .clksel_reg = AM33XX_CLKSEL_TIMER3_CLK,
560 .clksel_mask = AM33XX_CLKSEL_0_1_MASK,
561};
562
563DEFINE_STRUCT_CLK(timer3_fck, timer2_to_7_ck_parents, timer1_fck_ops);
564
565static struct clk timer4_fck;
566
567static struct clk_hw_omap timer4_fck_hw = {
568 .hw = {
569 .clk = &timer4_fck,
570 },
571 .clkdm_name = "l4ls_clkdm",
572 .clksel = timer2_to_7_clk_sel,
573 .clksel_reg = AM33XX_CLKSEL_TIMER4_CLK,
574 .clksel_mask = AM33XX_CLKSEL_0_1_MASK,
575};
576
577DEFINE_STRUCT_CLK(timer4_fck, timer2_to_7_ck_parents, timer1_fck_ops);
578
579static struct clk timer5_fck;
580
581static struct clk_hw_omap timer5_fck_hw = {
582 .hw = {
583 .clk = &timer5_fck,
584 },
585 .clkdm_name = "l4ls_clkdm",
586 .clksel = timer2_to_7_clk_sel,
587 .clksel_reg = AM33XX_CLKSEL_TIMER5_CLK,
588 .clksel_mask = AM33XX_CLKSEL_0_1_MASK,
589};
590
591DEFINE_STRUCT_CLK(timer5_fck, timer2_to_7_ck_parents, timer1_fck_ops);
592
593static struct clk timer6_fck;
594
595static struct clk_hw_omap timer6_fck_hw = {
596 .hw = {
597 .clk = &timer6_fck,
598 },
599 .clkdm_name = "l4ls_clkdm",
600 .clksel = timer2_to_7_clk_sel,
601 .clksel_reg = AM33XX_CLKSEL_TIMER6_CLK,
602 .clksel_mask = AM33XX_CLKSEL_0_1_MASK,
603};
604
605DEFINE_STRUCT_CLK(timer6_fck, timer2_to_7_ck_parents, timer1_fck_ops);
606
607static struct clk timer7_fck;
608
609static struct clk_hw_omap timer7_fck_hw = {
610 .hw = {
611 .clk = &timer7_fck,
612 },
613 .clkdm_name = "l4ls_clkdm",
614 .clksel = timer2_to_7_clk_sel,
615 .clksel_reg = AM33XX_CLKSEL_TIMER7_CLK,
616 .clksel_mask = AM33XX_CLKSEL_0_1_MASK,
617};
618
619DEFINE_STRUCT_CLK(timer7_fck, timer2_to_7_ck_parents, timer1_fck_ops);
620
621DEFINE_CLK_FIXED_FACTOR(cpsw_125mhz_gclk,
622 "dpll_core_m5_ck",
623 &dpll_core_m5_ck,
624 0x0,
625 1, 2);
626
627static const struct clk_ops cpsw_fck_ops = {
628 .recalc_rate = &omap2_clksel_recalc,
629 .get_parent = &omap2_clksel_find_parent_index,
630 .set_parent = &omap2_clksel_set_parent,
631};
632
633static const struct clksel cpsw_cpts_rft_clkmux_sel[] = {
634 { .parent = &dpll_core_m5_ck, .rates = div_1_0_rates },
635 { .parent = &dpll_core_m4_ck, .rates = div_1_1_rates },
636 { .parent = NULL },
637};
638
639static const char *cpsw_cpts_rft_ck_parents[] = {
640 "dpll_core_m5_ck", "dpll_core_m4_ck",
641};
642
643static struct clk cpsw_cpts_rft_clk;
644
645static struct clk_hw_omap cpsw_cpts_rft_clk_hw = {
646 .hw = {
647 .clk = &cpsw_cpts_rft_clk,
648 },
649 .clkdm_name = "cpsw_125mhz_clkdm",
650 .clksel = cpsw_cpts_rft_clkmux_sel,
651 .clksel_reg = AM33XX_CM_CPTS_RFT_CLKSEL,
652 .clksel_mask = AM33XX_CLKSEL_0_0_MASK,
653};
654
655DEFINE_STRUCT_CLK(cpsw_cpts_rft_clk, cpsw_cpts_rft_ck_parents, cpsw_fck_ops);
656
657
658/* gpio */
659static const char *gpio0_ck_parents[] = {
660 "clk_rc32k_ck", "clk_32768_ck", "clkdiv32k_ick",
661};
662
663static const struct clksel gpio0_dbclk_mux_sel[] = {
664 { .parent = &clk_rc32k_ck, .rates = div_1_0_rates },
665 { .parent = &clk_32768_ck, .rates = div_1_1_rates },
666 { .parent = &clkdiv32k_ick, .rates = div_1_2_rates },
667 { .parent = NULL },
668};
669
670static const struct clk_ops gpio_fck_ops = {
671 .recalc_rate = &omap2_clksel_recalc,
672 .get_parent = &omap2_clksel_find_parent_index,
673 .set_parent = &omap2_clksel_set_parent,
674 .init = &omap2_init_clk_clkdm,
675};
676
677static struct clk gpio0_dbclk_mux_ck;
678
679static struct clk_hw_omap gpio0_dbclk_mux_ck_hw = {
680 .hw = {
681 .clk = &gpio0_dbclk_mux_ck,
682 },
683 .clkdm_name = "l4_wkup_clkdm",
684 .clksel = gpio0_dbclk_mux_sel,
685 .clksel_reg = AM33XX_CLKSEL_GPIO0_DBCLK,
686 .clksel_mask = AM33XX_CLKSEL_0_1_MASK,
687};
688
689DEFINE_STRUCT_CLK(gpio0_dbclk_mux_ck, gpio0_ck_parents, gpio_fck_ops);
690
691DEFINE_CLK_GATE(gpio0_dbclk, "gpio0_dbclk_mux_ck", &gpio0_dbclk_mux_ck, 0x0,
692 AM33XX_CM_WKUP_GPIO0_CLKCTRL,
693 AM33XX_OPTFCLKEN_GPIO0_GDBCLK_SHIFT, 0x0, NULL);
694
695DEFINE_CLK_GATE(gpio1_dbclk, "clkdiv32k_ick", &clkdiv32k_ick, 0x0,
696 AM33XX_CM_PER_GPIO1_CLKCTRL,
697 AM33XX_OPTFCLKEN_GPIO_1_GDBCLK_SHIFT, 0x0, NULL);
698
699DEFINE_CLK_GATE(gpio2_dbclk, "clkdiv32k_ick", &clkdiv32k_ick, 0x0,
700 AM33XX_CM_PER_GPIO2_CLKCTRL,
701 AM33XX_OPTFCLKEN_GPIO_2_GDBCLK_SHIFT, 0x0, NULL);
702
703DEFINE_CLK_GATE(gpio3_dbclk, "clkdiv32k_ick", &clkdiv32k_ick, 0x0,
704 AM33XX_CM_PER_GPIO3_CLKCTRL,
705 AM33XX_OPTFCLKEN_GPIO_3_GDBCLK_SHIFT, 0x0, NULL);
706
707
708static const char *pruss_ck_parents[] = {
709 "l3_gclk", "dpll_disp_m2_ck",
710};
711
712static const struct clksel pruss_ocp_clk_mux_sel[] = {
713 { .parent = &l3_gclk, .rates = div_1_0_rates },
714 { .parent = &dpll_disp_m2_ck, .rates = div_1_1_rates },
715 { .parent = NULL },
716};
717
718static struct clk pruss_ocp_gclk;
719
720static struct clk_hw_omap pruss_ocp_gclk_hw = {
721 .hw = {
722 .clk = &pruss_ocp_gclk,
723 },
724 .clkdm_name = "pruss_ocp_clkdm",
725 .clksel = pruss_ocp_clk_mux_sel,
726 .clksel_reg = AM33XX_CLKSEL_PRUSS_OCP_CLK,
727 .clksel_mask = AM33XX_CLKSEL_0_0_MASK,
728};
729
730DEFINE_STRUCT_CLK(pruss_ocp_gclk, pruss_ck_parents, gpio_fck_ops);
731
732static const char *lcd_ck_parents[] = {
733 "dpll_disp_m2_ck", "dpll_core_m5_ck", "dpll_per_m2_ck",
734};
735
736static const struct clksel lcd_clk_mux_sel[] = {
737 { .parent = &dpll_disp_m2_ck, .rates = div_1_0_rates },
738 { .parent = &dpll_core_m5_ck, .rates = div_1_1_rates },
739 { .parent = &dpll_per_m2_ck, .rates = div_1_2_rates },
740 { .parent = NULL },
741};
742
743static struct clk lcd_gclk;
744
745static struct clk_hw_omap lcd_gclk_hw = {
746 .hw = {
747 .clk = &lcd_gclk,
748 },
749 .clkdm_name = "lcdc_clkdm",
750 .clksel = lcd_clk_mux_sel,
751 .clksel_reg = AM33XX_CLKSEL_LCDC_PIXEL_CLK,
752 .clksel_mask = AM33XX_CLKSEL_0_1_MASK,
753};
754
755DEFINE_STRUCT_CLK_FLAGS(lcd_gclk, lcd_ck_parents,
756 gpio_fck_ops, CLK_SET_RATE_PARENT);
757
758DEFINE_CLK_FIXED_FACTOR(mmc_clk, "dpll_per_m2_ck", &dpll_per_m2_ck, 0x0, 1, 2);
759
760static const char *gfx_ck_parents[] = {
761 "dpll_core_m4_ck", "dpll_per_m2_ck",
762};
763
764static const struct clksel gfx_clksel_sel[] = {
765 { .parent = &dpll_core_m4_ck, .rates = div_1_0_rates },
766 { .parent = &dpll_per_m2_ck, .rates = div_1_1_rates },
767 { .parent = NULL },
768};
769
770static struct clk gfx_fclk_clksel_ck;
771
772static struct clk_hw_omap gfx_fclk_clksel_ck_hw = {
773 .hw = {
774 .clk = &gfx_fclk_clksel_ck,
775 },
776 .clksel = gfx_clksel_sel,
777 .clksel_reg = AM33XX_CLKSEL_GFX_FCLK,
778 .clksel_mask = AM33XX_CLKSEL_GFX_FCLK_MASK,
779};
780
781DEFINE_STRUCT_CLK(gfx_fclk_clksel_ck, gfx_ck_parents, gpio_fck_ops);
782
783static const struct clk_div_table div_1_0_2_1_rates[] = {
784 { .div = 1, .val = 0, },
785 { .div = 2, .val = 1, },
786 { .div = 0 },
787};
788
789DEFINE_CLK_DIVIDER_TABLE(gfx_fck_div_ck, "gfx_fclk_clksel_ck",
790 &gfx_fclk_clksel_ck, 0x0, AM33XX_CLKSEL_GFX_FCLK,
791 AM33XX_CLKSEL_0_0_SHIFT, AM33XX_CLKSEL_0_0_WIDTH,
792 0x0, div_1_0_2_1_rates, NULL);
793
794static const char *sysclkout_ck_parents[] = {
795 "clk_32768_ck", "l3_gclk", "dpll_ddr_m2_ck", "dpll_per_m2_ck",
796 "lcd_gclk",
797};
798
799static const struct clksel sysclkout_pre_sel[] = {
800 { .parent = &clk_32768_ck, .rates = div_1_0_rates },
801 { .parent = &l3_gclk, .rates = div_1_1_rates },
802 { .parent = &dpll_ddr_m2_ck, .rates = div_1_2_rates },
803 { .parent = &dpll_per_m2_ck, .rates = div_1_3_rates },
804 { .parent = &lcd_gclk, .rates = div_1_4_rates },
805 { .parent = NULL },
806};
807
808static struct clk sysclkout_pre_ck;
809
810static struct clk_hw_omap sysclkout_pre_ck_hw = {
811 .hw = {
812 .clk = &sysclkout_pre_ck,
813 },
814 .clksel = sysclkout_pre_sel,
815 .clksel_reg = AM33XX_CM_CLKOUT_CTRL,
816 .clksel_mask = AM33XX_CLKOUT2SOURCE_MASK,
817};
818
819DEFINE_STRUCT_CLK(sysclkout_pre_ck, sysclkout_ck_parents, gpio_fck_ops);
820
821/* Divide by 8 clock rates with default clock is 1/1*/
822static const struct clk_div_table div8_rates[] = {
823 { .div = 1, .val = 0, },
824 { .div = 2, .val = 1, },
825 { .div = 3, .val = 2, },
826 { .div = 4, .val = 3, },
827 { .div = 5, .val = 4, },
828 { .div = 6, .val = 5, },
829 { .div = 7, .val = 6, },
830 { .div = 8, .val = 7, },
831 { .div = 0 },
832};
833
834DEFINE_CLK_DIVIDER_TABLE(clkout2_div_ck, "sysclkout_pre_ck", &sysclkout_pre_ck,
835 0x0, AM33XX_CM_CLKOUT_CTRL, AM33XX_CLKOUT2DIV_SHIFT,
836 AM33XX_CLKOUT2DIV_WIDTH, 0x0, div8_rates, NULL);
837
838DEFINE_CLK_GATE(clkout2_ck, "clkout2_div_ck", &clkout2_div_ck, 0x0,
839 AM33XX_CM_CLKOUT_CTRL, AM33XX_CLKOUT2EN_SHIFT, 0x0, NULL);
840
841static const char *wdt_ck_parents[] = {
842 "clk_rc32k_ck", "clkdiv32k_ick",
843};
844
845static const struct clksel wdt_clkmux_sel[] = {
846 { .parent = &clk_rc32k_ck, .rates = div_1_0_rates },
847 { .parent = &clkdiv32k_ick, .rates = div_1_1_rates },
848 { .parent = NULL },
849};
850
851static struct clk wdt1_fck;
852
853static struct clk_hw_omap wdt1_fck_hw = {
854 .hw = {
855 .clk = &wdt1_fck,
856 },
857 .clkdm_name = "l4_wkup_clkdm",
858 .clksel = wdt_clkmux_sel,
859 .clksel_reg = AM33XX_CLKSEL_WDT1_CLK,
860 .clksel_mask = AM33XX_CLKSEL_0_1_MASK,
861};
862
863DEFINE_STRUCT_CLK(wdt1_fck, wdt_ck_parents, gpio_fck_ops);
864
865static const char *pwmss_clk_parents[] = {
866 "dpll_per_m2_ck",
867};
868
869static const struct clk_ops ehrpwm_tbclk_ops = {
870 .enable = &omap2_dflt_clk_enable,
871 .disable = &omap2_dflt_clk_disable,
872};
873
874DEFINE_CLK_OMAP_MUX_GATE(ehrpwm0_tbclk, "l4ls_clkdm",
875 NULL, NULL, 0,
876 AM33XX_CTRL_REGADDR(AM33XX_PWMSS_TBCLK_CLKCTRL),
877 AM33XX_PWMSS0_TBCLKEN_SHIFT,
878 NULL, pwmss_clk_parents, ehrpwm_tbclk_ops);
879
880DEFINE_CLK_OMAP_MUX_GATE(ehrpwm1_tbclk, "l4ls_clkdm",
881 NULL, NULL, 0,
882 AM33XX_CTRL_REGADDR(AM33XX_PWMSS_TBCLK_CLKCTRL),
883 AM33XX_PWMSS1_TBCLKEN_SHIFT,
884 NULL, pwmss_clk_parents, ehrpwm_tbclk_ops);
885
886DEFINE_CLK_OMAP_MUX_GATE(ehrpwm2_tbclk, "l4ls_clkdm",
887 NULL, NULL, 0,
888 AM33XX_CTRL_REGADDR(AM33XX_PWMSS_TBCLK_CLKCTRL),
889 AM33XX_PWMSS2_TBCLKEN_SHIFT,
890 NULL, pwmss_clk_parents, ehrpwm_tbclk_ops);
891
892/*
893 * debugss optional clocks
894 */
895DEFINE_CLK_GATE(dbg_sysclk_ck, "sys_clkin_ck", &sys_clkin_ck,
896 0x0, AM33XX_CM_WKUP_DEBUGSS_CLKCTRL,
897 AM33XX_OPTFCLKEN_DBGSYSCLK_SHIFT, 0x0, NULL);
898
899DEFINE_CLK_GATE(dbg_clka_ck, "dpll_core_m4_ck", &dpll_core_m4_ck,
900 0x0, AM33XX_CM_WKUP_DEBUGSS_CLKCTRL,
901 AM33XX_OPTCLK_DEBUG_CLKA_SHIFT, 0x0, NULL);
902
903static const char *stm_pmd_clock_mux_ck_parents[] = {
904 "dbg_sysclk_ck", "dbg_clka_ck",
905};
906
907DEFINE_CLK_MUX(stm_pmd_clock_mux_ck, stm_pmd_clock_mux_ck_parents, NULL, 0x0,
908 AM33XX_CM_WKUP_DEBUGSS_CLKCTRL, AM33XX_STM_PMD_CLKSEL_SHIFT,
909 AM33XX_STM_PMD_CLKSEL_WIDTH, 0x0, NULL);
910
911DEFINE_CLK_MUX(trace_pmd_clk_mux_ck, stm_pmd_clock_mux_ck_parents, NULL, 0x0,
912 AM33XX_CM_WKUP_DEBUGSS_CLKCTRL,
913 AM33XX_TRC_PMD_CLKSEL_SHIFT,
914 AM33XX_TRC_PMD_CLKSEL_WIDTH, 0x0, NULL);
915
916DEFINE_CLK_DIVIDER(stm_clk_div_ck, "stm_pmd_clock_mux_ck",
917 &stm_pmd_clock_mux_ck, 0x0, AM33XX_CM_WKUP_DEBUGSS_CLKCTRL,
918 AM33XX_STM_PMD_CLKDIVSEL_SHIFT,
919 AM33XX_STM_PMD_CLKDIVSEL_WIDTH, CLK_DIVIDER_POWER_OF_TWO,
920 NULL);
921
922DEFINE_CLK_DIVIDER(trace_clk_div_ck, "trace_pmd_clk_mux_ck",
923 &trace_pmd_clk_mux_ck, 0x0, AM33XX_CM_WKUP_DEBUGSS_CLKCTRL,
924 AM33XX_TRC_PMD_CLKDIVSEL_SHIFT,
925 AM33XX_TRC_PMD_CLKDIVSEL_WIDTH, CLK_DIVIDER_POWER_OF_TWO,
926 NULL);
927
928/*
929 * clkdev
930 */
931static struct omap_clk am33xx_clks[] = {
932 CLK(NULL, "clk_32768_ck", &clk_32768_ck),
933 CLK(NULL, "clk_rc32k_ck", &clk_rc32k_ck),
934 CLK(NULL, "virt_19200000_ck", &virt_19200000_ck),
935 CLK(NULL, "virt_24000000_ck", &virt_24000000_ck),
936 CLK(NULL, "virt_25000000_ck", &virt_25000000_ck),
937 CLK(NULL, "virt_26000000_ck", &virt_26000000_ck),
938 CLK(NULL, "sys_clkin_ck", &sys_clkin_ck),
939 CLK(NULL, "tclkin_ck", &tclkin_ck),
940 CLK(NULL, "dpll_core_ck", &dpll_core_ck),
941 CLK(NULL, "dpll_core_x2_ck", &dpll_core_x2_ck),
942 CLK(NULL, "dpll_core_m4_ck", &dpll_core_m4_ck),
943 CLK(NULL, "dpll_core_m5_ck", &dpll_core_m5_ck),
944 CLK(NULL, "dpll_core_m6_ck", &dpll_core_m6_ck),
945 CLK(NULL, "dpll_mpu_ck", &dpll_mpu_ck),
946 CLK("cpu0", NULL, &dpll_mpu_ck),
947 CLK(NULL, "dpll_mpu_m2_ck", &dpll_mpu_m2_ck),
948 CLK(NULL, "dpll_ddr_ck", &dpll_ddr_ck),
949 CLK(NULL, "dpll_ddr_m2_ck", &dpll_ddr_m2_ck),
950 CLK(NULL, "dpll_ddr_m2_div2_ck", &dpll_ddr_m2_div2_ck),
951 CLK(NULL, "dpll_disp_ck", &dpll_disp_ck),
952 CLK(NULL, "dpll_disp_m2_ck", &dpll_disp_m2_ck),
953 CLK(NULL, "dpll_per_ck", &dpll_per_ck),
954 CLK(NULL, "dpll_per_m2_ck", &dpll_per_m2_ck),
955 CLK(NULL, "dpll_per_m2_div4_wkupdm_ck", &dpll_per_m2_div4_wkupdm_ck),
956 CLK(NULL, "dpll_per_m2_div4_ck", &dpll_per_m2_div4_ck),
957 CLK(NULL, "adc_tsc_fck", &adc_tsc_fck),
958 CLK(NULL, "cefuse_fck", &cefuse_fck),
959 CLK(NULL, "clkdiv32k_ck", &clkdiv32k_ck),
960 CLK(NULL, "clkdiv32k_ick", &clkdiv32k_ick),
961 CLK(NULL, "dcan0_fck", &dcan0_fck),
962 CLK("481cc000.d_can", NULL, &dcan0_fck),
963 CLK(NULL, "dcan1_fck", &dcan1_fck),
964 CLK("481d0000.d_can", NULL, &dcan1_fck),
965 CLK(NULL, "pruss_ocp_gclk", &pruss_ocp_gclk),
966 CLK(NULL, "mcasp0_fck", &mcasp0_fck),
967 CLK(NULL, "mcasp1_fck", &mcasp1_fck),
968 CLK(NULL, "mmu_fck", &mmu_fck),
969 CLK(NULL, "smartreflex0_fck", &smartreflex0_fck),
970 CLK(NULL, "smartreflex1_fck", &smartreflex1_fck),
971 CLK(NULL, "sha0_fck", &sha0_fck),
972 CLK(NULL, "aes0_fck", &aes0_fck),
973 CLK(NULL, "rng_fck", &rng_fck),
974 CLK(NULL, "timer1_fck", &timer1_fck),
975 CLK(NULL, "timer2_fck", &timer2_fck),
976 CLK(NULL, "timer3_fck", &timer3_fck),
977 CLK(NULL, "timer4_fck", &timer4_fck),
978 CLK(NULL, "timer5_fck", &timer5_fck),
979 CLK(NULL, "timer6_fck", &timer6_fck),
980 CLK(NULL, "timer7_fck", &timer7_fck),
981 CLK(NULL, "usbotg_fck", &usbotg_fck),
982 CLK(NULL, "ieee5000_fck", &ieee5000_fck),
983 CLK(NULL, "wdt1_fck", &wdt1_fck),
984 CLK(NULL, "l4_rtc_gclk", &l4_rtc_gclk),
985 CLK(NULL, "l3_gclk", &l3_gclk),
986 CLK(NULL, "dpll_core_m4_div2_ck", &dpll_core_m4_div2_ck),
987 CLK(NULL, "l4hs_gclk", &l4hs_gclk),
988 CLK(NULL, "l3s_gclk", &l3s_gclk),
989 CLK(NULL, "l4fw_gclk", &l4fw_gclk),
990 CLK(NULL, "l4ls_gclk", &l4ls_gclk),
991 CLK(NULL, "clk_24mhz", &clk_24mhz),
992 CLK(NULL, "sysclk_div_ck", &sysclk_div_ck),
993 CLK(NULL, "cpsw_125mhz_gclk", &cpsw_125mhz_gclk),
994 CLK(NULL, "cpsw_cpts_rft_clk", &cpsw_cpts_rft_clk),
995 CLK(NULL, "gpio0_dbclk_mux_ck", &gpio0_dbclk_mux_ck),
996 CLK(NULL, "gpio0_dbclk", &gpio0_dbclk),
997 CLK(NULL, "gpio1_dbclk", &gpio1_dbclk),
998 CLK(NULL, "gpio2_dbclk", &gpio2_dbclk),
999 CLK(NULL, "gpio3_dbclk", &gpio3_dbclk),
1000 CLK(NULL, "lcd_gclk", &lcd_gclk),
1001 CLK(NULL, "mmc_clk", &mmc_clk),
1002 CLK(NULL, "gfx_fclk_clksel_ck", &gfx_fclk_clksel_ck),
1003 CLK(NULL, "gfx_fck_div_ck", &gfx_fck_div_ck),
1004 CLK(NULL, "sysclkout_pre_ck", &sysclkout_pre_ck),
1005 CLK(NULL, "clkout2_div_ck", &clkout2_div_ck),
1006 CLK(NULL, "timer_32k_ck", &clkdiv32k_ick),
1007 CLK(NULL, "timer_sys_ck", &sys_clkin_ck),
1008 CLK(NULL, "dbg_sysclk_ck", &dbg_sysclk_ck),
1009 CLK(NULL, "dbg_clka_ck", &dbg_clka_ck),
1010 CLK(NULL, "stm_pmd_clock_mux_ck", &stm_pmd_clock_mux_ck),
1011 CLK(NULL, "trace_pmd_clk_mux_ck", &trace_pmd_clk_mux_ck),
1012 CLK(NULL, "stm_clk_div_ck", &stm_clk_div_ck),
1013 CLK(NULL, "trace_clk_div_ck", &trace_clk_div_ck),
1014 CLK(NULL, "clkout2_ck", &clkout2_ck),
1015 CLK("48300200.ehrpwm", "tbclk", &ehrpwm0_tbclk),
1016 CLK("48302200.ehrpwm", "tbclk", &ehrpwm1_tbclk),
1017 CLK("48304200.ehrpwm", "tbclk", &ehrpwm2_tbclk),
1018};
1019
1020
1021static const char *enable_init_clks[] = {
1022 "dpll_ddr_m2_ck",
1023 "dpll_mpu_m2_ck",
1024 "l3_gclk",
1025 "l4hs_gclk",
1026 "l4fw_gclk",
1027 "l4ls_gclk",
1028 "clkout2_ck", /* Required for external peripherals like, Audio codecs */
1029};
1030
1031int __init am33xx_clk_init(void)
1032{
1033 if (soc_is_am33xx())
1034 cpu_mask = RATE_IN_AM33XX;
1035
1036 omap_clocks_register(am33xx_clks, ARRAY_SIZE(am33xx_clks));
1037
1038 omap2_clk_disable_autoidle_all();
1039
1040 omap2_clk_enable_init_clocks(enable_init_clks,
1041 ARRAY_SIZE(enable_init_clks));
1042
1043 /* TRM ERRATA: Timer 3 & 6 default parent (TCLKIN) may not be always
1044 * physically present, in such a case HWMOD enabling of
1045 * clock would be failure with default parent. And timer
1046 * probe thinks clock is already enabled, this leads to
1047 * crash upon accessing timer 3 & 6 registers in probe.
1048 * Fix by setting parent of both these timers to master
1049 * oscillator clock.
1050 */
1051
1052 clk_set_parent(&timer3_fck, &sys_clkin_ck);
1053 clk_set_parent(&timer6_fck, &sys_clkin_ck);
1054 /*
1055 * The On-Chip 32K RC Osc clock is not an accurate clock-source as per
1056 * the design/spec, so as a result, for example, timer which supposed
1057 * to get expired @60Sec, but will expire somewhere ~@40Sec, which is
1058 * not expected by any use-case, so change WDT1 clock source to PRCM
1059 * 32KHz clock.
1060 */
1061 clk_set_parent(&wdt1_fck, &clkdiv32k_ick);
1062
1063 return 0;
1064}
diff --git a/arch/arm/mach-omap2/cclock44xx_data.c b/arch/arm/mach-omap2/cclock44xx_data.c
deleted file mode 100644
index ec0dc0b1755e..000000000000
--- a/arch/arm/mach-omap2/cclock44xx_data.c
+++ /dev/null
@@ -1,1735 +0,0 @@
1/*
2 * OMAP4 Clock data
3 *
4 * Copyright (C) 2009-2012 Texas Instruments, Inc.
5 * Copyright (C) 2009-2010 Nokia Corporation
6 *
7 * Paul Walmsley (paul@pwsan.com)
8 * Rajendra Nayak (rnayak@ti.com)
9 * Benoit Cousson (b-cousson@ti.com)
10 * Mike Turquette (mturquette@ti.com)
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 *
16 * XXX Some of the ES1 clocks have been removed/changed; once support
17 * is added for discriminating clocks by ES level, these should be added back
18 * in.
19 *
20 * XXX All of the remaining MODULEMODE clock nodes should be removed
21 * once the drivers are updated to use pm_runtime or to use the appropriate
22 * upstream clock node for rate/parent selection.
23 */
24
25#include <linux/kernel.h>
26#include <linux/list.h>
27#include <linux/clk-private.h>
28#include <linux/clkdev.h>
29#include <linux/io.h>
30
31#include "soc.h"
32#include "iomap.h"
33#include "clock.h"
34#include "clock44xx.h"
35#include "cm1_44xx.h"
36#include "cm2_44xx.h"
37#include "cm-regbits-44xx.h"
38#include "prm44xx.h"
39#include "prm-regbits-44xx.h"
40#include "control.h"
41#include "scrm44xx.h"
42
43/* OMAP4 modulemode control */
44#define OMAP4430_MODULEMODE_HWCTRL_SHIFT 0
45#define OMAP4430_MODULEMODE_SWCTRL_SHIFT 1
46
47/*
48 * OMAP4 ABE DPLL default frequency. In OMAP4460 TRM version V, section
49 * "3.6.3.2.3 CM1_ABE Clock Generator" states that the "DPLL_ABE_X2_CLK
50 * must be set to 196.608 MHz" and hence, the DPLL locked frequency is
51 * half of this value.
52 */
53#define OMAP4_DPLL_ABE_DEFFREQ 98304000
54
55/*
56 * OMAP4 USB DPLL default frequency. In OMAP4430 TRM version V, section
57 * "3.6.3.9.5 DPLL_USB Preferred Settings" shows that the preferred
58 * locked frequency for the USB DPLL is 960MHz.
59 */
60#define OMAP4_DPLL_USB_DEFFREQ 960000000
61
62/* Root clocks */
63
64DEFINE_CLK_FIXED_RATE(extalt_clkin_ck, CLK_IS_ROOT, 59000000, 0x0);
65
66DEFINE_CLK_FIXED_RATE(pad_clks_src_ck, CLK_IS_ROOT, 12000000, 0x0);
67
68DEFINE_CLK_GATE(pad_clks_ck, "pad_clks_src_ck", &pad_clks_src_ck, 0x0,
69 OMAP4430_CM_CLKSEL_ABE, OMAP4430_PAD_CLKS_GATE_SHIFT,
70 0x0, NULL);
71
72DEFINE_CLK_FIXED_RATE(pad_slimbus_core_clks_ck, CLK_IS_ROOT, 12000000, 0x0);
73
74DEFINE_CLK_FIXED_RATE(secure_32k_clk_src_ck, CLK_IS_ROOT, 32768, 0x0);
75
76DEFINE_CLK_FIXED_RATE(slimbus_src_clk, CLK_IS_ROOT, 12000000, 0x0);
77
78DEFINE_CLK_GATE(slimbus_clk, "slimbus_src_clk", &slimbus_src_clk, 0x0,
79 OMAP4430_CM_CLKSEL_ABE, OMAP4430_SLIMBUS_CLK_GATE_SHIFT,
80 0x0, NULL);
81
82DEFINE_CLK_FIXED_RATE(sys_32k_ck, CLK_IS_ROOT, 32768, 0x0);
83
84DEFINE_CLK_FIXED_RATE(virt_12000000_ck, CLK_IS_ROOT, 12000000, 0x0);
85
86DEFINE_CLK_FIXED_RATE(virt_13000000_ck, CLK_IS_ROOT, 13000000, 0x0);
87
88DEFINE_CLK_FIXED_RATE(virt_16800000_ck, CLK_IS_ROOT, 16800000, 0x0);
89
90DEFINE_CLK_FIXED_RATE(virt_19200000_ck, CLK_IS_ROOT, 19200000, 0x0);
91
92DEFINE_CLK_FIXED_RATE(virt_26000000_ck, CLK_IS_ROOT, 26000000, 0x0);
93
94DEFINE_CLK_FIXED_RATE(virt_27000000_ck, CLK_IS_ROOT, 27000000, 0x0);
95
96DEFINE_CLK_FIXED_RATE(virt_38400000_ck, CLK_IS_ROOT, 38400000, 0x0);
97
98static const char *sys_clkin_ck_parents[] = {
99 "virt_12000000_ck", "virt_13000000_ck", "virt_16800000_ck",
100 "virt_19200000_ck", "virt_26000000_ck", "virt_27000000_ck",
101 "virt_38400000_ck",
102};
103
104DEFINE_CLK_MUX(sys_clkin_ck, sys_clkin_ck_parents, NULL, 0x0,
105 OMAP4430_CM_SYS_CLKSEL, OMAP4430_SYS_CLKSEL_SHIFT,
106 OMAP4430_SYS_CLKSEL_WIDTH, CLK_MUX_INDEX_ONE, NULL);
107
108DEFINE_CLK_FIXED_RATE(tie_low_clock_ck, CLK_IS_ROOT, 0, 0x0);
109
110DEFINE_CLK_FIXED_RATE(utmi_phy_clkout_ck, CLK_IS_ROOT, 60000000, 0x0);
111
112DEFINE_CLK_FIXED_RATE(xclk60mhsp1_ck, CLK_IS_ROOT, 60000000, 0x0);
113
114DEFINE_CLK_FIXED_RATE(xclk60mhsp2_ck, CLK_IS_ROOT, 60000000, 0x0);
115
116DEFINE_CLK_FIXED_RATE(xclk60motg_ck, CLK_IS_ROOT, 60000000, 0x0);
117
118/* Module clocks and DPLL outputs */
119
120static const char *abe_dpll_bypass_clk_mux_ck_parents[] = {
121 "sys_clkin_ck", "sys_32k_ck",
122};
123
124DEFINE_CLK_MUX(abe_dpll_bypass_clk_mux_ck, abe_dpll_bypass_clk_mux_ck_parents,
125 NULL, 0x0, OMAP4430_CM_L4_WKUP_CLKSEL, OMAP4430_CLKSEL_SHIFT,
126 OMAP4430_CLKSEL_WIDTH, 0x0, NULL);
127
128DEFINE_CLK_MUX(abe_dpll_refclk_mux_ck, abe_dpll_bypass_clk_mux_ck_parents, NULL,
129 0x0, OMAP4430_CM_ABE_PLL_REF_CLKSEL, OMAP4430_CLKSEL_0_0_SHIFT,
130 OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL);
131
132/* DPLL_ABE */
133static struct dpll_data dpll_abe_dd = {
134 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_ABE,
135 .clk_bypass = &abe_dpll_bypass_clk_mux_ck,
136 .clk_ref = &abe_dpll_refclk_mux_ck,
137 .control_reg = OMAP4430_CM_CLKMODE_DPLL_ABE,
138 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
139 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_ABE,
140 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_ABE,
141 .mult_mask = OMAP4430_DPLL_MULT_MASK,
142 .div1_mask = OMAP4430_DPLL_DIV_MASK,
143 .enable_mask = OMAP4430_DPLL_EN_MASK,
144 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
145 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
146 .m4xen_mask = OMAP4430_DPLL_REGM4XEN_MASK,
147 .lpmode_mask = OMAP4430_DPLL_LPMODE_EN_MASK,
148 .max_multiplier = 2047,
149 .max_divider = 128,
150 .min_divider = 1,
151};
152
153
154static const char *dpll_abe_ck_parents[] = {
155 "abe_dpll_refclk_mux_ck",
156};
157
158static struct clk dpll_abe_ck;
159
160static const struct clk_ops dpll_abe_ck_ops = {
161 .enable = &omap3_noncore_dpll_enable,
162 .disable = &omap3_noncore_dpll_disable,
163 .recalc_rate = &omap4_dpll_regm4xen_recalc,
164 .round_rate = &omap4_dpll_regm4xen_round_rate,
165 .set_rate = &omap3_noncore_dpll_set_rate,
166 .get_parent = &omap2_init_dpll_parent,
167};
168
169static struct clk_hw_omap dpll_abe_ck_hw = {
170 .hw = {
171 .clk = &dpll_abe_ck,
172 },
173 .dpll_data = &dpll_abe_dd,
174 .ops = &clkhwops_omap3_dpll,
175};
176
177DEFINE_STRUCT_CLK(dpll_abe_ck, dpll_abe_ck_parents, dpll_abe_ck_ops);
178
179static const char *dpll_abe_x2_ck_parents[] = {
180 "dpll_abe_ck",
181};
182
183static struct clk dpll_abe_x2_ck;
184
185static const struct clk_ops dpll_abe_x2_ck_ops = {
186 .recalc_rate = &omap3_clkoutx2_recalc,
187};
188
189static struct clk_hw_omap dpll_abe_x2_ck_hw = {
190 .hw = {
191 .clk = &dpll_abe_x2_ck,
192 },
193 .flags = CLOCK_CLKOUTX2,
194 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE,
195 .ops = &clkhwops_omap4_dpllmx,
196};
197
198DEFINE_STRUCT_CLK(dpll_abe_x2_ck, dpll_abe_x2_ck_parents, dpll_abe_x2_ck_ops);
199
200static const struct clk_ops omap_hsdivider_ops = {
201 .set_rate = &omap2_clksel_set_rate,
202 .recalc_rate = &omap2_clksel_recalc,
203 .round_rate = &omap2_clksel_round_rate,
204};
205
206DEFINE_CLK_OMAP_HSDIVIDER(dpll_abe_m2x2_ck, "dpll_abe_x2_ck", &dpll_abe_x2_ck,
207 0x0, OMAP4430_CM_DIV_M2_DPLL_ABE,
208 OMAP4430_DPLL_CLKOUT_DIV_MASK);
209
210DEFINE_CLK_FIXED_FACTOR(abe_24m_fclk, "dpll_abe_m2x2_ck", &dpll_abe_m2x2_ck,
211 0x0, 1, 8);
212
213DEFINE_CLK_DIVIDER(abe_clk, "dpll_abe_m2x2_ck", &dpll_abe_m2x2_ck, 0x0,
214 OMAP4430_CM_CLKSEL_ABE, OMAP4430_CLKSEL_OPP_SHIFT,
215 OMAP4430_CLKSEL_OPP_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
216
217DEFINE_CLK_DIVIDER(aess_fclk, "abe_clk", &abe_clk, 0x0,
218 OMAP4430_CM1_ABE_AESS_CLKCTRL,
219 OMAP4430_CLKSEL_AESS_FCLK_SHIFT,
220 OMAP4430_CLKSEL_AESS_FCLK_WIDTH,
221 0x0, NULL);
222
223DEFINE_CLK_OMAP_HSDIVIDER(dpll_abe_m3x2_ck, "dpll_abe_x2_ck", &dpll_abe_x2_ck,
224 0x0, OMAP4430_CM_DIV_M3_DPLL_ABE,
225 OMAP4430_DPLL_CLKOUTHIF_DIV_MASK);
226
227static const char *core_hsd_byp_clk_mux_ck_parents[] = {
228 "sys_clkin_ck", "dpll_abe_m3x2_ck",
229};
230
231DEFINE_CLK_MUX(core_hsd_byp_clk_mux_ck, core_hsd_byp_clk_mux_ck_parents, NULL,
232 0x0, OMAP4430_CM_CLKSEL_DPLL_CORE,
233 OMAP4430_DPLL_BYP_CLKSEL_SHIFT, OMAP4430_DPLL_BYP_CLKSEL_WIDTH,
234 0x0, NULL);
235
236/* DPLL_CORE */
237static struct dpll_data dpll_core_dd = {
238 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_CORE,
239 .clk_bypass = &core_hsd_byp_clk_mux_ck,
240 .clk_ref = &sys_clkin_ck,
241 .control_reg = OMAP4430_CM_CLKMODE_DPLL_CORE,
242 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
243 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_CORE,
244 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_CORE,
245 .mult_mask = OMAP4430_DPLL_MULT_MASK,
246 .div1_mask = OMAP4430_DPLL_DIV_MASK,
247 .enable_mask = OMAP4430_DPLL_EN_MASK,
248 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
249 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
250 .max_multiplier = 2047,
251 .max_divider = 128,
252 .min_divider = 1,
253};
254
255
256static const char *dpll_core_ck_parents[] = {
257 "sys_clkin_ck", "core_hsd_byp_clk_mux_ck"
258};
259
260static struct clk dpll_core_ck;
261
262static const struct clk_ops dpll_core_ck_ops = {
263 .recalc_rate = &omap3_dpll_recalc,
264 .get_parent = &omap2_init_dpll_parent,
265};
266
267static struct clk_hw_omap dpll_core_ck_hw = {
268 .hw = {
269 .clk = &dpll_core_ck,
270 },
271 .dpll_data = &dpll_core_dd,
272 .ops = &clkhwops_omap3_dpll,
273};
274
275DEFINE_STRUCT_CLK(dpll_core_ck, dpll_core_ck_parents, dpll_core_ck_ops);
276
277static const char *dpll_core_x2_ck_parents[] = {
278 "dpll_core_ck",
279};
280
281static struct clk dpll_core_x2_ck;
282
283static struct clk_hw_omap dpll_core_x2_ck_hw = {
284 .hw = {
285 .clk = &dpll_core_x2_ck,
286 },
287};
288
289DEFINE_STRUCT_CLK(dpll_core_x2_ck, dpll_core_x2_ck_parents, dpll_abe_x2_ck_ops);
290
291DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m6x2_ck, "dpll_core_x2_ck",
292 &dpll_core_x2_ck, 0x0, OMAP4430_CM_DIV_M6_DPLL_CORE,
293 OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK);
294
295DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m2_ck, "dpll_core_ck", &dpll_core_ck, 0x0,
296 OMAP4430_CM_DIV_M2_DPLL_CORE,
297 OMAP4430_DPLL_CLKOUT_DIV_MASK);
298
299DEFINE_CLK_FIXED_FACTOR(ddrphy_ck, "dpll_core_m2_ck", &dpll_core_m2_ck, 0x0, 1,
300 2);
301
302DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m5x2_ck, "dpll_core_x2_ck",
303 &dpll_core_x2_ck, 0x0, OMAP4430_CM_DIV_M5_DPLL_CORE,
304 OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK);
305
306DEFINE_CLK_DIVIDER(div_core_ck, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck, 0x0,
307 OMAP4430_CM_CLKSEL_CORE, OMAP4430_CLKSEL_CORE_SHIFT,
308 OMAP4430_CLKSEL_CORE_WIDTH, 0x0, NULL);
309
310DEFINE_CLK_DIVIDER(div_iva_hs_clk, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck,
311 0x0, OMAP4430_CM_BYPCLK_DPLL_IVA, OMAP4430_CLKSEL_0_1_SHIFT,
312 OMAP4430_CLKSEL_0_1_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
313
314DEFINE_CLK_DIVIDER(div_mpu_hs_clk, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck,
315 0x0, OMAP4430_CM_BYPCLK_DPLL_MPU, OMAP4430_CLKSEL_0_1_SHIFT,
316 OMAP4430_CLKSEL_0_1_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
317
318DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m4x2_ck, "dpll_core_x2_ck",
319 &dpll_core_x2_ck, 0x0, OMAP4430_CM_DIV_M4_DPLL_CORE,
320 OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK);
321
322DEFINE_CLK_FIXED_FACTOR(dll_clk_div_ck, "dpll_core_m4x2_ck", &dpll_core_m4x2_ck,
323 0x0, 1, 2);
324
325DEFINE_CLK_DIVIDER(dpll_abe_m2_ck, "dpll_abe_ck", &dpll_abe_ck, 0x0,
326 OMAP4430_CM_DIV_M2_DPLL_ABE, OMAP4430_DPLL_CLKOUT_DIV_SHIFT,
327 OMAP4430_DPLL_CLKOUT_DIV_WIDTH, CLK_DIVIDER_ONE_BASED, NULL);
328
329static const struct clk_ops dpll_hsd_ops = {
330 .enable = &omap2_dflt_clk_enable,
331 .disable = &omap2_dflt_clk_disable,
332 .is_enabled = &omap2_dflt_clk_is_enabled,
333 .recalc_rate = &omap2_clksel_recalc,
334 .get_parent = &omap2_clksel_find_parent_index,
335 .set_parent = &omap2_clksel_set_parent,
336 .init = &omap2_init_clk_clkdm,
337};
338
339static const struct clk_ops func_dmic_abe_gfclk_ops = {
340 .recalc_rate = &omap2_clksel_recalc,
341 .get_parent = &omap2_clksel_find_parent_index,
342 .set_parent = &omap2_clksel_set_parent,
343};
344
345static const char *dpll_core_m3x2_ck_parents[] = {
346 "dpll_core_x2_ck",
347};
348
349static const struct clksel dpll_core_m3x2_div[] = {
350 { .parent = &dpll_core_x2_ck, .rates = div31_1to31_rates },
351 { .parent = NULL },
352};
353
354/* XXX Missing round_rate, set_rate in ops */
355DEFINE_CLK_OMAP_MUX_GATE(dpll_core_m3x2_ck, NULL, dpll_core_m3x2_div,
356 OMAP4430_CM_DIV_M3_DPLL_CORE,
357 OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
358 OMAP4430_CM_DIV_M3_DPLL_CORE,
359 OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT, NULL,
360 dpll_core_m3x2_ck_parents, dpll_hsd_ops);
361
362DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m7x2_ck, "dpll_core_x2_ck",
363 &dpll_core_x2_ck, 0x0, OMAP4430_CM_DIV_M7_DPLL_CORE,
364 OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK);
365
366static const char *iva_hsd_byp_clk_mux_ck_parents[] = {
367 "sys_clkin_ck", "div_iva_hs_clk",
368};
369
370DEFINE_CLK_MUX(iva_hsd_byp_clk_mux_ck, iva_hsd_byp_clk_mux_ck_parents, NULL,
371 0x0, OMAP4430_CM_CLKSEL_DPLL_IVA, OMAP4430_DPLL_BYP_CLKSEL_SHIFT,
372 OMAP4430_DPLL_BYP_CLKSEL_WIDTH, 0x0, NULL);
373
374/* DPLL_IVA */
375static struct dpll_data dpll_iva_dd = {
376 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_IVA,
377 .clk_bypass = &iva_hsd_byp_clk_mux_ck,
378 .clk_ref = &sys_clkin_ck,
379 .control_reg = OMAP4430_CM_CLKMODE_DPLL_IVA,
380 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
381 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_IVA,
382 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_IVA,
383 .mult_mask = OMAP4430_DPLL_MULT_MASK,
384 .div1_mask = OMAP4430_DPLL_DIV_MASK,
385 .enable_mask = OMAP4430_DPLL_EN_MASK,
386 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
387 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
388 .max_multiplier = 2047,
389 .max_divider = 128,
390 .min_divider = 1,
391};
392
393static const char *dpll_iva_ck_parents[] = {
394 "sys_clkin_ck", "iva_hsd_byp_clk_mux_ck"
395};
396
397static struct clk dpll_iva_ck;
398
399static const struct clk_ops dpll_ck_ops = {
400 .enable = &omap3_noncore_dpll_enable,
401 .disable = &omap3_noncore_dpll_disable,
402 .recalc_rate = &omap3_dpll_recalc,
403 .round_rate = &omap2_dpll_round_rate,
404 .set_rate = &omap3_noncore_dpll_set_rate,
405 .get_parent = &omap2_init_dpll_parent,
406};
407
408static struct clk_hw_omap dpll_iva_ck_hw = {
409 .hw = {
410 .clk = &dpll_iva_ck,
411 },
412 .dpll_data = &dpll_iva_dd,
413 .ops = &clkhwops_omap3_dpll,
414};
415
416DEFINE_STRUCT_CLK(dpll_iva_ck, dpll_iva_ck_parents, dpll_ck_ops);
417
418static const char *dpll_iva_x2_ck_parents[] = {
419 "dpll_iva_ck",
420};
421
422static struct clk dpll_iva_x2_ck;
423
424static struct clk_hw_omap dpll_iva_x2_ck_hw = {
425 .hw = {
426 .clk = &dpll_iva_x2_ck,
427 },
428};
429
430DEFINE_STRUCT_CLK(dpll_iva_x2_ck, dpll_iva_x2_ck_parents, dpll_abe_x2_ck_ops);
431
432DEFINE_CLK_OMAP_HSDIVIDER(dpll_iva_m4x2_ck, "dpll_iva_x2_ck", &dpll_iva_x2_ck,
433 0x0, OMAP4430_CM_DIV_M4_DPLL_IVA,
434 OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK);
435
436DEFINE_CLK_OMAP_HSDIVIDER(dpll_iva_m5x2_ck, "dpll_iva_x2_ck", &dpll_iva_x2_ck,
437 0x0, OMAP4430_CM_DIV_M5_DPLL_IVA,
438 OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK);
439
440/* DPLL_MPU */
441static struct dpll_data dpll_mpu_dd = {
442 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_MPU,
443 .clk_bypass = &div_mpu_hs_clk,
444 .clk_ref = &sys_clkin_ck,
445 .control_reg = OMAP4430_CM_CLKMODE_DPLL_MPU,
446 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
447 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_MPU,
448 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_MPU,
449 .mult_mask = OMAP4430_DPLL_MULT_MASK,
450 .div1_mask = OMAP4430_DPLL_DIV_MASK,
451 .enable_mask = OMAP4430_DPLL_EN_MASK,
452 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
453 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
454 .max_multiplier = 2047,
455 .max_divider = 128,
456 .min_divider = 1,
457};
458
459static const char *dpll_mpu_ck_parents[] = {
460 "sys_clkin_ck", "div_mpu_hs_clk"
461};
462
463static struct clk dpll_mpu_ck;
464
465static struct clk_hw_omap dpll_mpu_ck_hw = {
466 .hw = {
467 .clk = &dpll_mpu_ck,
468 },
469 .dpll_data = &dpll_mpu_dd,
470 .ops = &clkhwops_omap3_dpll,
471};
472
473DEFINE_STRUCT_CLK(dpll_mpu_ck, dpll_mpu_ck_parents, dpll_ck_ops);
474
475DEFINE_CLK_FIXED_FACTOR(mpu_periphclk, "dpll_mpu_ck", &dpll_mpu_ck, 0x0, 1, 2);
476
477DEFINE_CLK_OMAP_HSDIVIDER(dpll_mpu_m2_ck, "dpll_mpu_ck", &dpll_mpu_ck, 0x0,
478 OMAP4430_CM_DIV_M2_DPLL_MPU,
479 OMAP4430_DPLL_CLKOUT_DIV_MASK);
480
481DEFINE_CLK_FIXED_FACTOR(per_hs_clk_div_ck, "dpll_abe_m3x2_ck",
482 &dpll_abe_m3x2_ck, 0x0, 1, 2);
483
484static const char *per_hsd_byp_clk_mux_ck_parents[] = {
485 "sys_clkin_ck", "per_hs_clk_div_ck",
486};
487
488DEFINE_CLK_MUX(per_hsd_byp_clk_mux_ck, per_hsd_byp_clk_mux_ck_parents, NULL,
489 0x0, OMAP4430_CM_CLKSEL_DPLL_PER, OMAP4430_DPLL_BYP_CLKSEL_SHIFT,
490 OMAP4430_DPLL_BYP_CLKSEL_WIDTH, 0x0, NULL);
491
492/* DPLL_PER */
493static struct dpll_data dpll_per_dd = {
494 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_PER,
495 .clk_bypass = &per_hsd_byp_clk_mux_ck,
496 .clk_ref = &sys_clkin_ck,
497 .control_reg = OMAP4430_CM_CLKMODE_DPLL_PER,
498 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
499 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_PER,
500 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_PER,
501 .mult_mask = OMAP4430_DPLL_MULT_MASK,
502 .div1_mask = OMAP4430_DPLL_DIV_MASK,
503 .enable_mask = OMAP4430_DPLL_EN_MASK,
504 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
505 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
506 .max_multiplier = 2047,
507 .max_divider = 128,
508 .min_divider = 1,
509};
510
511static const char *dpll_per_ck_parents[] = {
512 "sys_clkin_ck", "per_hsd_byp_clk_mux_ck"
513};
514
515static struct clk dpll_per_ck;
516
517static struct clk_hw_omap dpll_per_ck_hw = {
518 .hw = {
519 .clk = &dpll_per_ck,
520 },
521 .dpll_data = &dpll_per_dd,
522 .ops = &clkhwops_omap3_dpll,
523};
524
525DEFINE_STRUCT_CLK(dpll_per_ck, dpll_per_ck_parents, dpll_ck_ops);
526
527DEFINE_CLK_DIVIDER(dpll_per_m2_ck, "dpll_per_ck", &dpll_per_ck, 0x0,
528 OMAP4430_CM_DIV_M2_DPLL_PER, OMAP4430_DPLL_CLKOUT_DIV_SHIFT,
529 OMAP4430_DPLL_CLKOUT_DIV_WIDTH, CLK_DIVIDER_ONE_BASED, NULL);
530
531static const char *dpll_per_x2_ck_parents[] = {
532 "dpll_per_ck",
533};
534
535static struct clk dpll_per_x2_ck;
536
537static struct clk_hw_omap dpll_per_x2_ck_hw = {
538 .hw = {
539 .clk = &dpll_per_x2_ck,
540 },
541 .flags = CLOCK_CLKOUTX2,
542 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER,
543 .ops = &clkhwops_omap4_dpllmx,
544};
545
546DEFINE_STRUCT_CLK(dpll_per_x2_ck, dpll_per_x2_ck_parents, dpll_abe_x2_ck_ops);
547
548DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m2x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck,
549 0x0, OMAP4430_CM_DIV_M2_DPLL_PER,
550 OMAP4430_DPLL_CLKOUT_DIV_MASK);
551
552static const char *dpll_per_m3x2_ck_parents[] = {
553 "dpll_per_x2_ck",
554};
555
556static const struct clksel dpll_per_m3x2_div[] = {
557 { .parent = &dpll_per_x2_ck, .rates = div31_1to31_rates },
558 { .parent = NULL },
559};
560
561/* XXX Missing round_rate, set_rate in ops */
562DEFINE_CLK_OMAP_MUX_GATE(dpll_per_m3x2_ck, NULL, dpll_per_m3x2_div,
563 OMAP4430_CM_DIV_M3_DPLL_PER,
564 OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
565 OMAP4430_CM_DIV_M3_DPLL_PER,
566 OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT, NULL,
567 dpll_per_m3x2_ck_parents, dpll_hsd_ops);
568
569DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m4x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck,
570 0x0, OMAP4430_CM_DIV_M4_DPLL_PER,
571 OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK);
572
573DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m5x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck,
574 0x0, OMAP4430_CM_DIV_M5_DPLL_PER,
575 OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK);
576
577DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m6x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck,
578 0x0, OMAP4430_CM_DIV_M6_DPLL_PER,
579 OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK);
580
581DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m7x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck,
582 0x0, OMAP4430_CM_DIV_M7_DPLL_PER,
583 OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK);
584
585DEFINE_CLK_FIXED_FACTOR(usb_hs_clk_div_ck, "dpll_abe_m3x2_ck",
586 &dpll_abe_m3x2_ck, 0x0, 1, 3);
587
588/* DPLL_USB */
589static struct dpll_data dpll_usb_dd = {
590 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_USB,
591 .clk_bypass = &usb_hs_clk_div_ck,
592 .flags = DPLL_J_TYPE,
593 .clk_ref = &sys_clkin_ck,
594 .control_reg = OMAP4430_CM_CLKMODE_DPLL_USB,
595 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
596 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_USB,
597 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_USB,
598 .mult_mask = OMAP4430_DPLL_MULT_USB_MASK,
599 .div1_mask = OMAP4430_DPLL_DIV_0_7_MASK,
600 .enable_mask = OMAP4430_DPLL_EN_MASK,
601 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
602 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
603 .sddiv_mask = OMAP4430_DPLL_SD_DIV_MASK,
604 .max_multiplier = 4095,
605 .max_divider = 256,
606 .min_divider = 1,
607};
608
609static const char *dpll_usb_ck_parents[] = {
610 "sys_clkin_ck", "usb_hs_clk_div_ck"
611};
612
613static struct clk dpll_usb_ck;
614
615static const struct clk_ops dpll_usb_ck_ops = {
616 .enable = &omap3_noncore_dpll_enable,
617 .disable = &omap3_noncore_dpll_disable,
618 .recalc_rate = &omap3_dpll_recalc,
619 .round_rate = &omap2_dpll_round_rate,
620 .set_rate = &omap3_noncore_dpll_set_rate,
621 .get_parent = &omap2_init_dpll_parent,
622 .init = &omap2_init_clk_clkdm,
623};
624
625static struct clk_hw_omap dpll_usb_ck_hw = {
626 .hw = {
627 .clk = &dpll_usb_ck,
628 },
629 .dpll_data = &dpll_usb_dd,
630 .clkdm_name = "l3_init_clkdm",
631 .ops = &clkhwops_omap3_dpll,
632};
633
634DEFINE_STRUCT_CLK(dpll_usb_ck, dpll_usb_ck_parents, dpll_usb_ck_ops);
635
636static const char *dpll_usb_clkdcoldo_ck_parents[] = {
637 "dpll_usb_ck",
638};
639
640static struct clk dpll_usb_clkdcoldo_ck;
641
642static const struct clk_ops dpll_usb_clkdcoldo_ck_ops = {
643};
644
645static struct clk_hw_omap dpll_usb_clkdcoldo_ck_hw = {
646 .hw = {
647 .clk = &dpll_usb_clkdcoldo_ck,
648 },
649 .clksel_reg = OMAP4430_CM_CLKDCOLDO_DPLL_USB,
650 .ops = &clkhwops_omap4_dpllmx,
651};
652
653DEFINE_STRUCT_CLK(dpll_usb_clkdcoldo_ck, dpll_usb_clkdcoldo_ck_parents,
654 dpll_usb_clkdcoldo_ck_ops);
655
656DEFINE_CLK_OMAP_HSDIVIDER(dpll_usb_m2_ck, "dpll_usb_ck", &dpll_usb_ck, 0x0,
657 OMAP4430_CM_DIV_M2_DPLL_USB,
658 OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK);
659
660static const char *ducati_clk_mux_ck_parents[] = {
661 "div_core_ck", "dpll_per_m6x2_ck",
662};
663
664DEFINE_CLK_MUX(ducati_clk_mux_ck, ducati_clk_mux_ck_parents, NULL, 0x0,
665 OMAP4430_CM_CLKSEL_DUCATI_ISS_ROOT, OMAP4430_CLKSEL_0_0_SHIFT,
666 OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL);
667
668DEFINE_CLK_FIXED_FACTOR(func_12m_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck,
669 0x0, 1, 16);
670
671DEFINE_CLK_FIXED_FACTOR(func_24m_clk, "dpll_per_m2_ck", &dpll_per_m2_ck, 0x0,
672 1, 4);
673
674DEFINE_CLK_FIXED_FACTOR(func_24mc_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck,
675 0x0, 1, 8);
676
677static const struct clk_div_table func_48m_fclk_rates[] = {
678 { .div = 4, .val = 0 },
679 { .div = 8, .val = 1 },
680 { .div = 0 },
681};
682DEFINE_CLK_DIVIDER_TABLE(func_48m_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck,
683 0x0, OMAP4430_CM_SCALE_FCLK, OMAP4430_SCALE_FCLK_SHIFT,
684 OMAP4430_SCALE_FCLK_WIDTH, 0x0, func_48m_fclk_rates,
685 NULL);
686
687DEFINE_CLK_FIXED_FACTOR(func_48mc_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck,
688 0x0, 1, 4);
689
690static const struct clk_div_table func_64m_fclk_rates[] = {
691 { .div = 2, .val = 0 },
692 { .div = 4, .val = 1 },
693 { .div = 0 },
694};
695DEFINE_CLK_DIVIDER_TABLE(func_64m_fclk, "dpll_per_m4x2_ck", &dpll_per_m4x2_ck,
696 0x0, OMAP4430_CM_SCALE_FCLK, OMAP4430_SCALE_FCLK_SHIFT,
697 OMAP4430_SCALE_FCLK_WIDTH, 0x0, func_64m_fclk_rates,
698 NULL);
699
700static const struct clk_div_table func_96m_fclk_rates[] = {
701 { .div = 2, .val = 0 },
702 { .div = 4, .val = 1 },
703 { .div = 0 },
704};
705DEFINE_CLK_DIVIDER_TABLE(func_96m_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck,
706 0x0, OMAP4430_CM_SCALE_FCLK, OMAP4430_SCALE_FCLK_SHIFT,
707 OMAP4430_SCALE_FCLK_WIDTH, 0x0, func_96m_fclk_rates,
708 NULL);
709
710static const struct clk_div_table init_60m_fclk_rates[] = {
711 { .div = 1, .val = 0 },
712 { .div = 8, .val = 1 },
713 { .div = 0 },
714};
715DEFINE_CLK_DIVIDER_TABLE(init_60m_fclk, "dpll_usb_m2_ck", &dpll_usb_m2_ck,
716 0x0, OMAP4430_CM_CLKSEL_USB_60MHZ,
717 OMAP4430_CLKSEL_0_0_SHIFT, OMAP4430_CLKSEL_0_0_WIDTH,
718 0x0, init_60m_fclk_rates, NULL);
719
720DEFINE_CLK_DIVIDER(l3_div_ck, "div_core_ck", &div_core_ck, 0x0,
721 OMAP4430_CM_CLKSEL_CORE, OMAP4430_CLKSEL_L3_SHIFT,
722 OMAP4430_CLKSEL_L3_WIDTH, 0x0, NULL);
723
724DEFINE_CLK_DIVIDER(l4_div_ck, "l3_div_ck", &l3_div_ck, 0x0,
725 OMAP4430_CM_CLKSEL_CORE, OMAP4430_CLKSEL_L4_SHIFT,
726 OMAP4430_CLKSEL_L4_WIDTH, 0x0, NULL);
727
728DEFINE_CLK_FIXED_FACTOR(lp_clk_div_ck, "dpll_abe_m2x2_ck", &dpll_abe_m2x2_ck,
729 0x0, 1, 16);
730
731static const char *l4_wkup_clk_mux_ck_parents[] = {
732 "sys_clkin_ck", "lp_clk_div_ck",
733};
734
735DEFINE_CLK_MUX(l4_wkup_clk_mux_ck, l4_wkup_clk_mux_ck_parents, NULL, 0x0,
736 OMAP4430_CM_L4_WKUP_CLKSEL, OMAP4430_CLKSEL_0_0_SHIFT,
737 OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL);
738
739static const struct clk_div_table ocp_abe_iclk_rates[] = {
740 { .div = 2, .val = 0 },
741 { .div = 1, .val = 1 },
742 { .div = 0 },
743};
744DEFINE_CLK_DIVIDER_TABLE(ocp_abe_iclk, "aess_fclk", &aess_fclk, 0x0,
745 OMAP4430_CM1_ABE_AESS_CLKCTRL,
746 OMAP4430_CLKSEL_AESS_FCLK_SHIFT,
747 OMAP4430_CLKSEL_AESS_FCLK_WIDTH,
748 0x0, ocp_abe_iclk_rates, NULL);
749
750DEFINE_CLK_FIXED_FACTOR(per_abe_24m_fclk, "dpll_abe_m2_ck", &dpll_abe_m2_ck,
751 0x0, 1, 4);
752
753DEFINE_CLK_DIVIDER(per_abe_nc_fclk, "dpll_abe_m2_ck", &dpll_abe_m2_ck, 0x0,
754 OMAP4430_CM_SCALE_FCLK, OMAP4430_SCALE_FCLK_SHIFT,
755 OMAP4430_SCALE_FCLK_WIDTH, 0x0, NULL);
756
757DEFINE_CLK_DIVIDER(syc_clk_div_ck, "sys_clkin_ck", &sys_clkin_ck, 0x0,
758 OMAP4430_CM_ABE_DSS_SYS_CLKSEL, OMAP4430_CLKSEL_0_0_SHIFT,
759 OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL);
760
761static const char *dbgclk_mux_ck_parents[] = {
762 "sys_clkin_ck"
763};
764
765static struct clk dbgclk_mux_ck;
766DEFINE_STRUCT_CLK_HW_OMAP(dbgclk_mux_ck, NULL);
767DEFINE_STRUCT_CLK(dbgclk_mux_ck, dbgclk_mux_ck_parents,
768 dpll_usb_clkdcoldo_ck_ops);
769
770/* Leaf clocks controlled by modules */
771
772DEFINE_CLK_GATE(aes1_fck, "l3_div_ck", &l3_div_ck, 0x0,
773 OMAP4430_CM_L4SEC_AES1_CLKCTRL,
774 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
775
776DEFINE_CLK_GATE(aes2_fck, "l3_div_ck", &l3_div_ck, 0x0,
777 OMAP4430_CM_L4SEC_AES2_CLKCTRL,
778 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
779
780DEFINE_CLK_GATE(bandgap_fclk, "sys_32k_ck", &sys_32k_ck, 0x0,
781 OMAP4430_CM_WKUP_BANDGAP_CLKCTRL,
782 OMAP4430_OPTFCLKEN_BGAP_32K_SHIFT, 0x0, NULL);
783
784static const struct clk_div_table div_ts_ck_rates[] = {
785 { .div = 8, .val = 0 },
786 { .div = 16, .val = 1 },
787 { .div = 32, .val = 2 },
788 { .div = 0 },
789};
790DEFINE_CLK_DIVIDER_TABLE(div_ts_ck, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck,
791 0x0, OMAP4430_CM_WKUP_BANDGAP_CLKCTRL,
792 OMAP4430_CLKSEL_24_25_SHIFT,
793 OMAP4430_CLKSEL_24_25_WIDTH, 0x0, div_ts_ck_rates,
794 NULL);
795
796DEFINE_CLK_GATE(bandgap_ts_fclk, "div_ts_ck", &div_ts_ck, 0x0,
797 OMAP4430_CM_WKUP_BANDGAP_CLKCTRL,
798 OMAP4460_OPTFCLKEN_TS_FCLK_SHIFT,
799 0x0, NULL);
800
801static const char *dmic_sync_mux_ck_parents[] = {
802 "abe_24m_fclk", "syc_clk_div_ck", "func_24m_clk",
803};
804
805DEFINE_CLK_MUX(dmic_sync_mux_ck, dmic_sync_mux_ck_parents, NULL,
806 0x0, OMAP4430_CM1_ABE_DMIC_CLKCTRL,
807 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
808 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
809
810static const struct clksel func_dmic_abe_gfclk_sel[] = {
811 { .parent = &dmic_sync_mux_ck, .rates = div_1_0_rates },
812 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
813 { .parent = &slimbus_clk, .rates = div_1_2_rates },
814 { .parent = NULL },
815};
816
817static const char *func_dmic_abe_gfclk_parents[] = {
818 "dmic_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
819};
820
821DEFINE_CLK_OMAP_MUX(func_dmic_abe_gfclk, "abe_clkdm", func_dmic_abe_gfclk_sel,
822 OMAP4430_CM1_ABE_DMIC_CLKCTRL, OMAP4430_CLKSEL_SOURCE_MASK,
823 func_dmic_abe_gfclk_parents, func_dmic_abe_gfclk_ops);
824
825DEFINE_CLK_GATE(dss_sys_clk, "syc_clk_div_ck", &syc_clk_div_ck, 0x0,
826 OMAP4430_CM_DSS_DSS_CLKCTRL,
827 OMAP4430_OPTFCLKEN_SYS_CLK_SHIFT, 0x0, NULL);
828
829DEFINE_CLK_GATE(dss_tv_clk, "extalt_clkin_ck", &extalt_clkin_ck, 0x0,
830 OMAP4430_CM_DSS_DSS_CLKCTRL,
831 OMAP4430_OPTFCLKEN_TV_CLK_SHIFT, 0x0, NULL);
832
833DEFINE_CLK_GATE(dss_dss_clk, "dpll_per_m5x2_ck", &dpll_per_m5x2_ck,
834 CLK_SET_RATE_PARENT,
835 OMAP4430_CM_DSS_DSS_CLKCTRL, OMAP4430_OPTFCLKEN_DSSCLK_SHIFT,
836 0x0, NULL);
837
838DEFINE_CLK_GATE(dss_48mhz_clk, "func_48mc_fclk", &func_48mc_fclk, 0x0,
839 OMAP4430_CM_DSS_DSS_CLKCTRL, OMAP4430_OPTFCLKEN_48MHZ_CLK_SHIFT,
840 0x0, NULL);
841
842DEFINE_CLK_GATE(dss_fck, "l3_div_ck", &l3_div_ck, 0x0,
843 OMAP4430_CM_DSS_DSS_CLKCTRL, OMAP4430_MODULEMODE_SWCTRL_SHIFT,
844 0x0, NULL);
845
846DEFINE_CLK_DIVIDER(fdif_fck, "dpll_per_m4x2_ck", &dpll_per_m4x2_ck, 0x0,
847 OMAP4430_CM_CAM_FDIF_CLKCTRL, OMAP4430_CLKSEL_FCLK_SHIFT,
848 OMAP4430_CLKSEL_FCLK_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
849
850DEFINE_CLK_GATE(gpio1_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
851 OMAP4430_CM_WKUP_GPIO1_CLKCTRL,
852 OMAP4430_OPTFCLKEN_DBCLK_SHIFT, 0x0, NULL);
853
854DEFINE_CLK_GATE(gpio2_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
855 OMAP4430_CM_L4PER_GPIO2_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
856 0x0, NULL);
857
858DEFINE_CLK_GATE(gpio3_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
859 OMAP4430_CM_L4PER_GPIO3_CLKCTRL,
860 OMAP4430_OPTFCLKEN_DBCLK_SHIFT, 0x0, NULL);
861
862DEFINE_CLK_GATE(gpio4_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
863 OMAP4430_CM_L4PER_GPIO4_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
864 0x0, NULL);
865
866DEFINE_CLK_GATE(gpio5_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
867 OMAP4430_CM_L4PER_GPIO5_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
868 0x0, NULL);
869
870DEFINE_CLK_GATE(gpio6_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
871 OMAP4430_CM_L4PER_GPIO6_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
872 0x0, NULL);
873
874static const struct clksel sgx_clk_mux_sel[] = {
875 { .parent = &dpll_core_m7x2_ck, .rates = div_1_0_rates },
876 { .parent = &dpll_per_m7x2_ck, .rates = div_1_1_rates },
877 { .parent = NULL },
878};
879
880static const char *sgx_clk_mux_parents[] = {
881 "dpll_core_m7x2_ck", "dpll_per_m7x2_ck",
882};
883
884DEFINE_CLK_OMAP_MUX(sgx_clk_mux, "l3_gfx_clkdm", sgx_clk_mux_sel,
885 OMAP4430_CM_GFX_GFX_CLKCTRL, OMAP4430_CLKSEL_SGX_FCLK_MASK,
886 sgx_clk_mux_parents, func_dmic_abe_gfclk_ops);
887
888DEFINE_CLK_DIVIDER(hsi_fck, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck, 0x0,
889 OMAP4430_CM_L3INIT_HSI_CLKCTRL, OMAP4430_CLKSEL_24_25_SHIFT,
890 OMAP4430_CLKSEL_24_25_WIDTH, CLK_DIVIDER_POWER_OF_TWO,
891 NULL);
892
893DEFINE_CLK_GATE(iss_ctrlclk, "func_96m_fclk", &func_96m_fclk, 0x0,
894 OMAP4430_CM_CAM_ISS_CLKCTRL, OMAP4430_OPTFCLKEN_CTRLCLK_SHIFT,
895 0x0, NULL);
896
897DEFINE_CLK_MUX(mcasp_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0,
898 OMAP4430_CM1_ABE_MCASP_CLKCTRL,
899 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
900 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
901
902static const struct clksel func_mcasp_abe_gfclk_sel[] = {
903 { .parent = &mcasp_sync_mux_ck, .rates = div_1_0_rates },
904 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
905 { .parent = &slimbus_clk, .rates = div_1_2_rates },
906 { .parent = NULL },
907};
908
909static const char *func_mcasp_abe_gfclk_parents[] = {
910 "mcasp_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
911};
912
913DEFINE_CLK_OMAP_MUX(func_mcasp_abe_gfclk, "abe_clkdm", func_mcasp_abe_gfclk_sel,
914 OMAP4430_CM1_ABE_MCASP_CLKCTRL, OMAP4430_CLKSEL_SOURCE_MASK,
915 func_mcasp_abe_gfclk_parents, func_dmic_abe_gfclk_ops);
916
917DEFINE_CLK_MUX(mcbsp1_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0,
918 OMAP4430_CM1_ABE_MCBSP1_CLKCTRL,
919 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
920 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
921
922static const struct clksel func_mcbsp1_gfclk_sel[] = {
923 { .parent = &mcbsp1_sync_mux_ck, .rates = div_1_0_rates },
924 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
925 { .parent = &slimbus_clk, .rates = div_1_2_rates },
926 { .parent = NULL },
927};
928
929static const char *func_mcbsp1_gfclk_parents[] = {
930 "mcbsp1_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
931};
932
933DEFINE_CLK_OMAP_MUX(func_mcbsp1_gfclk, "abe_clkdm", func_mcbsp1_gfclk_sel,
934 OMAP4430_CM1_ABE_MCBSP1_CLKCTRL,
935 OMAP4430_CLKSEL_SOURCE_MASK, func_mcbsp1_gfclk_parents,
936 func_dmic_abe_gfclk_ops);
937
938DEFINE_CLK_MUX(mcbsp2_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0,
939 OMAP4430_CM1_ABE_MCBSP2_CLKCTRL,
940 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
941 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
942
943static const struct clksel func_mcbsp2_gfclk_sel[] = {
944 { .parent = &mcbsp2_sync_mux_ck, .rates = div_1_0_rates },
945 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
946 { .parent = &slimbus_clk, .rates = div_1_2_rates },
947 { .parent = NULL },
948};
949
950static const char *func_mcbsp2_gfclk_parents[] = {
951 "mcbsp2_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
952};
953
954DEFINE_CLK_OMAP_MUX(func_mcbsp2_gfclk, "abe_clkdm", func_mcbsp2_gfclk_sel,
955 OMAP4430_CM1_ABE_MCBSP2_CLKCTRL,
956 OMAP4430_CLKSEL_SOURCE_MASK, func_mcbsp2_gfclk_parents,
957 func_dmic_abe_gfclk_ops);
958
959DEFINE_CLK_MUX(mcbsp3_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0,
960 OMAP4430_CM1_ABE_MCBSP3_CLKCTRL,
961 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
962 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
963
964static const struct clksel func_mcbsp3_gfclk_sel[] = {
965 { .parent = &mcbsp3_sync_mux_ck, .rates = div_1_0_rates },
966 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
967 { .parent = &slimbus_clk, .rates = div_1_2_rates },
968 { .parent = NULL },
969};
970
971static const char *func_mcbsp3_gfclk_parents[] = {
972 "mcbsp3_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
973};
974
975DEFINE_CLK_OMAP_MUX(func_mcbsp3_gfclk, "abe_clkdm", func_mcbsp3_gfclk_sel,
976 OMAP4430_CM1_ABE_MCBSP3_CLKCTRL,
977 OMAP4430_CLKSEL_SOURCE_MASK, func_mcbsp3_gfclk_parents,
978 func_dmic_abe_gfclk_ops);
979
980static const char *mcbsp4_sync_mux_ck_parents[] = {
981 "func_96m_fclk", "per_abe_nc_fclk",
982};
983
984DEFINE_CLK_MUX(mcbsp4_sync_mux_ck, mcbsp4_sync_mux_ck_parents, NULL, 0x0,
985 OMAP4430_CM_L4PER_MCBSP4_CLKCTRL,
986 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
987 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
988
989static const struct clksel per_mcbsp4_gfclk_sel[] = {
990 { .parent = &mcbsp4_sync_mux_ck, .rates = div_1_0_rates },
991 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
992 { .parent = NULL },
993};
994
995static const char *per_mcbsp4_gfclk_parents[] = {
996 "mcbsp4_sync_mux_ck", "pad_clks_ck",
997};
998
999DEFINE_CLK_OMAP_MUX(per_mcbsp4_gfclk, "l4_per_clkdm", per_mcbsp4_gfclk_sel,
1000 OMAP4430_CM_L4PER_MCBSP4_CLKCTRL,
1001 OMAP4430_CLKSEL_SOURCE_24_24_MASK, per_mcbsp4_gfclk_parents,
1002 func_dmic_abe_gfclk_ops);
1003
1004static const struct clksel hsmmc1_fclk_sel[] = {
1005 { .parent = &func_64m_fclk, .rates = div_1_0_rates },
1006 { .parent = &func_96m_fclk, .rates = div_1_1_rates },
1007 { .parent = NULL },
1008};
1009
1010static const char *hsmmc1_fclk_parents[] = {
1011 "func_64m_fclk", "func_96m_fclk",
1012};
1013
1014DEFINE_CLK_OMAP_MUX(hsmmc1_fclk, "l3_init_clkdm", hsmmc1_fclk_sel,
1015 OMAP4430_CM_L3INIT_MMC1_CLKCTRL, OMAP4430_CLKSEL_MASK,
1016 hsmmc1_fclk_parents, func_dmic_abe_gfclk_ops);
1017
1018DEFINE_CLK_OMAP_MUX(hsmmc2_fclk, "l3_init_clkdm", hsmmc1_fclk_sel,
1019 OMAP4430_CM_L3INIT_MMC2_CLKCTRL, OMAP4430_CLKSEL_MASK,
1020 hsmmc1_fclk_parents, func_dmic_abe_gfclk_ops);
1021
1022DEFINE_CLK_GATE(ocp2scp_usb_phy_phy_48m, "func_48m_fclk", &func_48m_fclk, 0x0,
1023 OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL,
1024 OMAP4430_OPTFCLKEN_PHY_48M_SHIFT, 0x0, NULL);
1025
1026DEFINE_CLK_GATE(sha2md5_fck, "l3_div_ck", &l3_div_ck, 0x0,
1027 OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL,
1028 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1029
1030DEFINE_CLK_GATE(slimbus1_fclk_1, "func_24m_clk", &func_24m_clk, 0x0,
1031 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
1032 OMAP4430_OPTFCLKEN_FCLK1_SHIFT, 0x0, NULL);
1033
1034DEFINE_CLK_GATE(slimbus1_fclk_0, "abe_24m_fclk", &abe_24m_fclk, 0x0,
1035 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
1036 OMAP4430_OPTFCLKEN_FCLK0_SHIFT, 0x0, NULL);
1037
1038DEFINE_CLK_GATE(slimbus1_fclk_2, "pad_clks_ck", &pad_clks_ck, 0x0,
1039 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
1040 OMAP4430_OPTFCLKEN_FCLK2_SHIFT, 0x0, NULL);
1041
1042DEFINE_CLK_GATE(slimbus1_slimbus_clk, "slimbus_clk", &slimbus_clk, 0x0,
1043 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
1044 OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_SHIFT, 0x0, NULL);
1045
1046DEFINE_CLK_GATE(slimbus2_fclk_1, "per_abe_24m_fclk", &per_abe_24m_fclk, 0x0,
1047 OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
1048 OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_SHIFT, 0x0, NULL);
1049
1050DEFINE_CLK_GATE(slimbus2_fclk_0, "func_24mc_fclk", &func_24mc_fclk, 0x0,
1051 OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
1052 OMAP4430_OPTFCLKEN_PER24MC_GFCLK_SHIFT, 0x0, NULL);
1053
1054DEFINE_CLK_GATE(slimbus2_slimbus_clk, "pad_slimbus_core_clks_ck",
1055 &pad_slimbus_core_clks_ck, 0x0,
1056 OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
1057 OMAP4430_OPTFCLKEN_SLIMBUS_CLK_SHIFT, 0x0, NULL);
1058
1059DEFINE_CLK_GATE(smartreflex_core_fck, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck,
1060 0x0, OMAP4430_CM_ALWON_SR_CORE_CLKCTRL,
1061 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1062
1063DEFINE_CLK_GATE(smartreflex_iva_fck, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck,
1064 0x0, OMAP4430_CM_ALWON_SR_IVA_CLKCTRL,
1065 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1066
1067DEFINE_CLK_GATE(smartreflex_mpu_fck, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck,
1068 0x0, OMAP4430_CM_ALWON_SR_MPU_CLKCTRL,
1069 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1070
1071static const struct clksel dmt1_clk_mux_sel[] = {
1072 { .parent = &sys_clkin_ck, .rates = div_1_0_rates },
1073 { .parent = &sys_32k_ck, .rates = div_1_1_rates },
1074 { .parent = NULL },
1075};
1076
1077DEFINE_CLK_OMAP_MUX(dmt1_clk_mux, "l4_wkup_clkdm", dmt1_clk_mux_sel,
1078 OMAP4430_CM_WKUP_TIMER1_CLKCTRL, OMAP4430_CLKSEL_MASK,
1079 abe_dpll_bypass_clk_mux_ck_parents,
1080 func_dmic_abe_gfclk_ops);
1081
1082DEFINE_CLK_OMAP_MUX(cm2_dm10_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1083 OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL, OMAP4430_CLKSEL_MASK,
1084 abe_dpll_bypass_clk_mux_ck_parents,
1085 func_dmic_abe_gfclk_ops);
1086
1087DEFINE_CLK_OMAP_MUX(cm2_dm11_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1088 OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL, OMAP4430_CLKSEL_MASK,
1089 abe_dpll_bypass_clk_mux_ck_parents,
1090 func_dmic_abe_gfclk_ops);
1091
1092DEFINE_CLK_OMAP_MUX(cm2_dm2_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1093 OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL, OMAP4430_CLKSEL_MASK,
1094 abe_dpll_bypass_clk_mux_ck_parents,
1095 func_dmic_abe_gfclk_ops);
1096
1097DEFINE_CLK_OMAP_MUX(cm2_dm3_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1098 OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL, OMAP4430_CLKSEL_MASK,
1099 abe_dpll_bypass_clk_mux_ck_parents,
1100 func_dmic_abe_gfclk_ops);
1101
1102DEFINE_CLK_OMAP_MUX(cm2_dm4_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1103 OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL, OMAP4430_CLKSEL_MASK,
1104 abe_dpll_bypass_clk_mux_ck_parents,
1105 func_dmic_abe_gfclk_ops);
1106
1107static const struct clksel timer5_sync_mux_sel[] = {
1108 { .parent = &syc_clk_div_ck, .rates = div_1_0_rates },
1109 { .parent = &sys_32k_ck, .rates = div_1_1_rates },
1110 { .parent = NULL },
1111};
1112
1113static const char *timer5_sync_mux_parents[] = {
1114 "syc_clk_div_ck", "sys_32k_ck",
1115};
1116
1117DEFINE_CLK_OMAP_MUX(timer5_sync_mux, "abe_clkdm", timer5_sync_mux_sel,
1118 OMAP4430_CM1_ABE_TIMER5_CLKCTRL, OMAP4430_CLKSEL_MASK,
1119 timer5_sync_mux_parents, func_dmic_abe_gfclk_ops);
1120
1121DEFINE_CLK_OMAP_MUX(timer6_sync_mux, "abe_clkdm", timer5_sync_mux_sel,
1122 OMAP4430_CM1_ABE_TIMER6_CLKCTRL, OMAP4430_CLKSEL_MASK,
1123 timer5_sync_mux_parents, func_dmic_abe_gfclk_ops);
1124
1125DEFINE_CLK_OMAP_MUX(timer7_sync_mux, "abe_clkdm", timer5_sync_mux_sel,
1126 OMAP4430_CM1_ABE_TIMER7_CLKCTRL, OMAP4430_CLKSEL_MASK,
1127 timer5_sync_mux_parents, func_dmic_abe_gfclk_ops);
1128
1129DEFINE_CLK_OMAP_MUX(timer8_sync_mux, "abe_clkdm", timer5_sync_mux_sel,
1130 OMAP4430_CM1_ABE_TIMER8_CLKCTRL, OMAP4430_CLKSEL_MASK,
1131 timer5_sync_mux_parents, func_dmic_abe_gfclk_ops);
1132
1133DEFINE_CLK_OMAP_MUX(cm2_dm9_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1134 OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL, OMAP4430_CLKSEL_MASK,
1135 abe_dpll_bypass_clk_mux_ck_parents,
1136 func_dmic_abe_gfclk_ops);
1137
1138static struct clk usb_host_fs_fck;
1139
1140static const char *usb_host_fs_fck_parent_names[] = {
1141 "func_48mc_fclk",
1142};
1143
1144static const struct clk_ops usb_host_fs_fck_ops = {
1145 .enable = &omap2_dflt_clk_enable,
1146 .disable = &omap2_dflt_clk_disable,
1147 .is_enabled = &omap2_dflt_clk_is_enabled,
1148};
1149
1150static struct clk_hw_omap usb_host_fs_fck_hw = {
1151 .hw = {
1152 .clk = &usb_host_fs_fck,
1153 },
1154 .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_FS_CLKCTRL,
1155 .enable_bit = OMAP4430_MODULEMODE_SWCTRL_SHIFT,
1156 .clkdm_name = "l3_init_clkdm",
1157};
1158
1159DEFINE_STRUCT_CLK(usb_host_fs_fck, usb_host_fs_fck_parent_names,
1160 usb_host_fs_fck_ops);
1161
1162static const char *utmi_p1_gfclk_parents[] = {
1163 "init_60m_fclk", "xclk60mhsp1_ck",
1164};
1165
1166DEFINE_CLK_MUX(utmi_p1_gfclk, utmi_p1_gfclk_parents, NULL, 0x0,
1167 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1168 OMAP4430_CLKSEL_UTMI_P1_SHIFT, OMAP4430_CLKSEL_UTMI_P1_WIDTH,
1169 0x0, NULL);
1170
1171DEFINE_CLK_GATE(usb_host_hs_utmi_p1_clk, "utmi_p1_gfclk", &utmi_p1_gfclk, 0x0,
1172 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1173 OMAP4430_OPTFCLKEN_UTMI_P1_CLK_SHIFT, 0x0, NULL);
1174
1175static const char *utmi_p2_gfclk_parents[] = {
1176 "init_60m_fclk", "xclk60mhsp2_ck",
1177};
1178
1179DEFINE_CLK_MUX(utmi_p2_gfclk, utmi_p2_gfclk_parents, NULL, 0x0,
1180 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1181 OMAP4430_CLKSEL_UTMI_P2_SHIFT, OMAP4430_CLKSEL_UTMI_P2_WIDTH,
1182 0x0, NULL);
1183
1184DEFINE_CLK_GATE(usb_host_hs_utmi_p2_clk, "utmi_p2_gfclk", &utmi_p2_gfclk, 0x0,
1185 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1186 OMAP4430_OPTFCLKEN_UTMI_P2_CLK_SHIFT, 0x0, NULL);
1187
1188DEFINE_CLK_GATE(usb_host_hs_utmi_p3_clk, "init_60m_fclk", &init_60m_fclk, 0x0,
1189 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1190 OMAP4430_OPTFCLKEN_UTMI_P3_CLK_SHIFT, 0x0, NULL);
1191
1192DEFINE_CLK_GATE(usb_host_hs_hsic480m_p1_clk, "dpll_usb_m2_ck",
1193 &dpll_usb_m2_ck, 0x0,
1194 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1195 OMAP4430_OPTFCLKEN_HSIC480M_P1_CLK_SHIFT, 0x0, NULL);
1196
1197DEFINE_CLK_GATE(usb_host_hs_hsic60m_p1_clk, "init_60m_fclk",
1198 &init_60m_fclk, 0x0,
1199 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1200 OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_SHIFT, 0x0, NULL);
1201
1202DEFINE_CLK_GATE(usb_host_hs_hsic60m_p2_clk, "init_60m_fclk",
1203 &init_60m_fclk, 0x0,
1204 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1205 OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_SHIFT, 0x0, NULL);
1206
1207DEFINE_CLK_GATE(usb_host_hs_hsic480m_p2_clk, "dpll_usb_m2_ck",
1208 &dpll_usb_m2_ck, 0x0,
1209 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1210 OMAP4430_OPTFCLKEN_HSIC480M_P2_CLK_SHIFT, 0x0, NULL);
1211
1212DEFINE_CLK_GATE(usb_host_hs_func48mclk, "func_48mc_fclk", &func_48mc_fclk, 0x0,
1213 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1214 OMAP4430_OPTFCLKEN_FUNC48MCLK_SHIFT, 0x0, NULL);
1215
1216DEFINE_CLK_GATE(usb_host_hs_fck, "init_60m_fclk", &init_60m_fclk, 0x0,
1217 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1218 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1219
1220static const char *otg_60m_gfclk_parents[] = {
1221 "utmi_phy_clkout_ck", "xclk60motg_ck",
1222};
1223
1224DEFINE_CLK_MUX(otg_60m_gfclk, otg_60m_gfclk_parents, NULL, 0x0,
1225 OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL, OMAP4430_CLKSEL_60M_SHIFT,
1226 OMAP4430_CLKSEL_60M_WIDTH, 0x0, NULL);
1227
1228DEFINE_CLK_GATE(usb_otg_hs_xclk, "otg_60m_gfclk", &otg_60m_gfclk, 0x0,
1229 OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL,
1230 OMAP4430_OPTFCLKEN_XCLK_SHIFT, 0x0, NULL);
1231
1232DEFINE_CLK_GATE(usb_otg_hs_ick, "l3_div_ck", &l3_div_ck, 0x0,
1233 OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL,
1234 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
1235
1236DEFINE_CLK_GATE(usb_phy_cm_clk32k, "sys_32k_ck", &sys_32k_ck, 0x0,
1237 OMAP4430_CM_ALWON_USBPHY_CLKCTRL,
1238 OMAP4430_OPTFCLKEN_CLK32K_SHIFT, 0x0, NULL);
1239
1240DEFINE_CLK_GATE(usb_tll_hs_usb_ch2_clk, "init_60m_fclk", &init_60m_fclk, 0x0,
1241 OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL,
1242 OMAP4430_OPTFCLKEN_USB_CH2_CLK_SHIFT, 0x0, NULL);
1243
1244DEFINE_CLK_GATE(usb_tll_hs_usb_ch0_clk, "init_60m_fclk", &init_60m_fclk, 0x0,
1245 OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL,
1246 OMAP4430_OPTFCLKEN_USB_CH0_CLK_SHIFT, 0x0, NULL);
1247
1248DEFINE_CLK_GATE(usb_tll_hs_usb_ch1_clk, "init_60m_fclk", &init_60m_fclk, 0x0,
1249 OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL,
1250 OMAP4430_OPTFCLKEN_USB_CH1_CLK_SHIFT, 0x0, NULL);
1251
1252DEFINE_CLK_GATE(usb_tll_hs_ick, "l4_div_ck", &l4_div_ck, 0x0,
1253 OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL,
1254 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
1255
1256static const struct clk_div_table usim_ck_rates[] = {
1257 { .div = 14, .val = 0 },
1258 { .div = 18, .val = 1 },
1259 { .div = 0 },
1260};
1261DEFINE_CLK_DIVIDER_TABLE(usim_ck, "dpll_per_m4x2_ck", &dpll_per_m4x2_ck, 0x0,
1262 OMAP4430_CM_WKUP_USIM_CLKCTRL,
1263 OMAP4430_CLKSEL_DIV_SHIFT, OMAP4430_CLKSEL_DIV_WIDTH,
1264 0x0, usim_ck_rates, NULL);
1265
1266DEFINE_CLK_GATE(usim_fclk, "usim_ck", &usim_ck, 0x0,
1267 OMAP4430_CM_WKUP_USIM_CLKCTRL, OMAP4430_OPTFCLKEN_FCLK_SHIFT,
1268 0x0, NULL);
1269
1270/* Remaining optional clocks */
1271static const char *pmd_stm_clock_mux_ck_parents[] = {
1272 "sys_clkin_ck", "dpll_core_m6x2_ck", "tie_low_clock_ck",
1273};
1274
1275DEFINE_CLK_MUX(pmd_stm_clock_mux_ck, pmd_stm_clock_mux_ck_parents, NULL, 0x0,
1276 OMAP4430_CM_EMU_DEBUGSS_CLKCTRL, OMAP4430_PMD_STM_MUX_CTRL_SHIFT,
1277 OMAP4430_PMD_STM_MUX_CTRL_WIDTH, 0x0, NULL);
1278
1279DEFINE_CLK_MUX(pmd_trace_clk_mux_ck, pmd_stm_clock_mux_ck_parents, NULL, 0x0,
1280 OMAP4430_CM_EMU_DEBUGSS_CLKCTRL,
1281 OMAP4430_PMD_TRACE_MUX_CTRL_SHIFT,
1282 OMAP4430_PMD_TRACE_MUX_CTRL_WIDTH, 0x0, NULL);
1283
1284DEFINE_CLK_DIVIDER(stm_clk_div_ck, "pmd_stm_clock_mux_ck",
1285 &pmd_stm_clock_mux_ck, 0x0, OMAP4430_CM_EMU_DEBUGSS_CLKCTRL,
1286 OMAP4430_CLKSEL_PMD_STM_CLK_SHIFT,
1287 OMAP4430_CLKSEL_PMD_STM_CLK_WIDTH, CLK_DIVIDER_POWER_OF_TWO,
1288 NULL);
1289
1290static const char *trace_clk_div_ck_parents[] = {
1291 "pmd_trace_clk_mux_ck",
1292};
1293
1294static const struct clksel trace_clk_div_div[] = {
1295 { .parent = &pmd_trace_clk_mux_ck, .rates = div3_1to4_rates },
1296 { .parent = NULL },
1297};
1298
1299static struct clk trace_clk_div_ck;
1300
1301static const struct clk_ops trace_clk_div_ck_ops = {
1302 .recalc_rate = &omap2_clksel_recalc,
1303 .set_rate = &omap2_clksel_set_rate,
1304 .round_rate = &omap2_clksel_round_rate,
1305 .init = &omap2_init_clk_clkdm,
1306 .enable = &omap2_clkops_enable_clkdm,
1307 .disable = &omap2_clkops_disable_clkdm,
1308};
1309
1310static struct clk_hw_omap trace_clk_div_ck_hw = {
1311 .hw = {
1312 .clk = &trace_clk_div_ck,
1313 },
1314 .clkdm_name = "emu_sys_clkdm",
1315 .clksel = trace_clk_div_div,
1316 .clksel_reg = OMAP4430_CM_EMU_DEBUGSS_CLKCTRL,
1317 .clksel_mask = OMAP4430_CLKSEL_PMD_TRACE_CLK_MASK,
1318};
1319
1320DEFINE_STRUCT_CLK(trace_clk_div_ck, trace_clk_div_ck_parents,
1321 trace_clk_div_ck_ops);
1322
1323/* SCRM aux clk nodes */
1324
1325static const struct clksel auxclk_src_sel[] = {
1326 { .parent = &sys_clkin_ck, .rates = div_1_0_rates },
1327 { .parent = &dpll_core_m3x2_ck, .rates = div_1_1_rates },
1328 { .parent = &dpll_per_m3x2_ck, .rates = div_1_2_rates },
1329 { .parent = NULL },
1330};
1331
1332static const char *auxclk_src_ck_parents[] = {
1333 "sys_clkin_ck", "dpll_core_m3x2_ck", "dpll_per_m3x2_ck",
1334};
1335
1336static const struct clk_ops auxclk_src_ck_ops = {
1337 .enable = &omap2_dflt_clk_enable,
1338 .disable = &omap2_dflt_clk_disable,
1339 .is_enabled = &omap2_dflt_clk_is_enabled,
1340 .recalc_rate = &omap2_clksel_recalc,
1341 .get_parent = &omap2_clksel_find_parent_index,
1342};
1343
1344DEFINE_CLK_OMAP_MUX_GATE(auxclk0_src_ck, NULL, auxclk_src_sel,
1345 OMAP4_SCRM_AUXCLK0, OMAP4_SRCSELECT_MASK,
1346 OMAP4_SCRM_AUXCLK0, OMAP4_ENABLE_SHIFT, NULL,
1347 auxclk_src_ck_parents, auxclk_src_ck_ops);
1348
1349DEFINE_CLK_DIVIDER(auxclk0_ck, "auxclk0_src_ck", &auxclk0_src_ck, 0x0,
1350 OMAP4_SCRM_AUXCLK0, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1351 0x0, NULL);
1352
1353DEFINE_CLK_OMAP_MUX_GATE(auxclk1_src_ck, NULL, auxclk_src_sel,
1354 OMAP4_SCRM_AUXCLK1, OMAP4_SRCSELECT_MASK,
1355 OMAP4_SCRM_AUXCLK1, OMAP4_ENABLE_SHIFT, NULL,
1356 auxclk_src_ck_parents, auxclk_src_ck_ops);
1357
1358DEFINE_CLK_DIVIDER(auxclk1_ck, "auxclk1_src_ck", &auxclk1_src_ck, 0x0,
1359 OMAP4_SCRM_AUXCLK1, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1360 0x0, NULL);
1361
1362DEFINE_CLK_OMAP_MUX_GATE(auxclk2_src_ck, NULL, auxclk_src_sel,
1363 OMAP4_SCRM_AUXCLK2, OMAP4_SRCSELECT_MASK,
1364 OMAP4_SCRM_AUXCLK2, OMAP4_ENABLE_SHIFT, NULL,
1365 auxclk_src_ck_parents, auxclk_src_ck_ops);
1366
1367DEFINE_CLK_DIVIDER(auxclk2_ck, "auxclk2_src_ck", &auxclk2_src_ck, 0x0,
1368 OMAP4_SCRM_AUXCLK2, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1369 0x0, NULL);
1370
1371DEFINE_CLK_OMAP_MUX_GATE(auxclk3_src_ck, NULL, auxclk_src_sel,
1372 OMAP4_SCRM_AUXCLK3, OMAP4_SRCSELECT_MASK,
1373 OMAP4_SCRM_AUXCLK3, OMAP4_ENABLE_SHIFT, NULL,
1374 auxclk_src_ck_parents, auxclk_src_ck_ops);
1375
1376DEFINE_CLK_DIVIDER(auxclk3_ck, "auxclk3_src_ck", &auxclk3_src_ck, 0x0,
1377 OMAP4_SCRM_AUXCLK3, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1378 0x0, NULL);
1379
1380DEFINE_CLK_OMAP_MUX_GATE(auxclk4_src_ck, NULL, auxclk_src_sel,
1381 OMAP4_SCRM_AUXCLK4, OMAP4_SRCSELECT_MASK,
1382 OMAP4_SCRM_AUXCLK4, OMAP4_ENABLE_SHIFT, NULL,
1383 auxclk_src_ck_parents, auxclk_src_ck_ops);
1384
1385DEFINE_CLK_DIVIDER(auxclk4_ck, "auxclk4_src_ck", &auxclk4_src_ck, 0x0,
1386 OMAP4_SCRM_AUXCLK4, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1387 0x0, NULL);
1388
1389DEFINE_CLK_OMAP_MUX_GATE(auxclk5_src_ck, NULL, auxclk_src_sel,
1390 OMAP4_SCRM_AUXCLK5, OMAP4_SRCSELECT_MASK,
1391 OMAP4_SCRM_AUXCLK5, OMAP4_ENABLE_SHIFT, NULL,
1392 auxclk_src_ck_parents, auxclk_src_ck_ops);
1393
1394DEFINE_CLK_DIVIDER(auxclk5_ck, "auxclk5_src_ck", &auxclk5_src_ck, 0x0,
1395 OMAP4_SCRM_AUXCLK5, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1396 0x0, NULL);
1397
1398static const char *auxclkreq_ck_parents[] = {
1399 "auxclk0_ck", "auxclk1_ck", "auxclk2_ck", "auxclk3_ck", "auxclk4_ck",
1400 "auxclk5_ck",
1401};
1402
1403DEFINE_CLK_MUX(auxclkreq0_ck, auxclkreq_ck_parents, NULL, 0x0,
1404 OMAP4_SCRM_AUXCLKREQ0, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1405 0x0, NULL);
1406
1407DEFINE_CLK_MUX(auxclkreq1_ck, auxclkreq_ck_parents, NULL, 0x0,
1408 OMAP4_SCRM_AUXCLKREQ1, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1409 0x0, NULL);
1410
1411DEFINE_CLK_MUX(auxclkreq2_ck, auxclkreq_ck_parents, NULL, 0x0,
1412 OMAP4_SCRM_AUXCLKREQ2, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1413 0x0, NULL);
1414
1415DEFINE_CLK_MUX(auxclkreq3_ck, auxclkreq_ck_parents, NULL, 0x0,
1416 OMAP4_SCRM_AUXCLKREQ3, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1417 0x0, NULL);
1418
1419DEFINE_CLK_MUX(auxclkreq4_ck, auxclkreq_ck_parents, NULL, 0x0,
1420 OMAP4_SCRM_AUXCLKREQ4, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1421 0x0, NULL);
1422
1423DEFINE_CLK_MUX(auxclkreq5_ck, auxclkreq_ck_parents, NULL, 0x0,
1424 OMAP4_SCRM_AUXCLKREQ5, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1425 0x0, NULL);
1426
1427/*
1428 * clocks specific to omap4460
1429 */
1430static struct omap_clk omap446x_clks[] = {
1431 CLK(NULL, "div_ts_ck", &div_ts_ck),
1432 CLK(NULL, "bandgap_ts_fclk", &bandgap_ts_fclk),
1433};
1434
1435/*
1436 * clocks specific to omap4430
1437 */
1438static struct omap_clk omap443x_clks[] = {
1439 CLK(NULL, "bandgap_fclk", &bandgap_fclk),
1440};
1441
1442/*
1443 * clocks common to omap44xx
1444 */
1445static struct omap_clk omap44xx_clks[] = {
1446 CLK(NULL, "extalt_clkin_ck", &extalt_clkin_ck),
1447 CLK(NULL, "pad_clks_src_ck", &pad_clks_src_ck),
1448 CLK(NULL, "pad_clks_ck", &pad_clks_ck),
1449 CLK(NULL, "pad_slimbus_core_clks_ck", &pad_slimbus_core_clks_ck),
1450 CLK(NULL, "secure_32k_clk_src_ck", &secure_32k_clk_src_ck),
1451 CLK(NULL, "slimbus_src_clk", &slimbus_src_clk),
1452 CLK(NULL, "slimbus_clk", &slimbus_clk),
1453 CLK(NULL, "sys_32k_ck", &sys_32k_ck),
1454 CLK(NULL, "virt_12000000_ck", &virt_12000000_ck),
1455 CLK(NULL, "virt_13000000_ck", &virt_13000000_ck),
1456 CLK(NULL, "virt_16800000_ck", &virt_16800000_ck),
1457 CLK(NULL, "virt_19200000_ck", &virt_19200000_ck),
1458 CLK(NULL, "virt_26000000_ck", &virt_26000000_ck),
1459 CLK(NULL, "virt_27000000_ck", &virt_27000000_ck),
1460 CLK(NULL, "virt_38400000_ck", &virt_38400000_ck),
1461 CLK(NULL, "sys_clkin_ck", &sys_clkin_ck),
1462 CLK(NULL, "tie_low_clock_ck", &tie_low_clock_ck),
1463 CLK(NULL, "utmi_phy_clkout_ck", &utmi_phy_clkout_ck),
1464 CLK(NULL, "xclk60mhsp1_ck", &xclk60mhsp1_ck),
1465 CLK(NULL, "xclk60mhsp2_ck", &xclk60mhsp2_ck),
1466 CLK(NULL, "xclk60motg_ck", &xclk60motg_ck),
1467 CLK(NULL, "abe_dpll_bypass_clk_mux_ck", &abe_dpll_bypass_clk_mux_ck),
1468 CLK(NULL, "abe_dpll_refclk_mux_ck", &abe_dpll_refclk_mux_ck),
1469 CLK(NULL, "dpll_abe_ck", &dpll_abe_ck),
1470 CLK(NULL, "dpll_abe_x2_ck", &dpll_abe_x2_ck),
1471 CLK(NULL, "dpll_abe_m2x2_ck", &dpll_abe_m2x2_ck),
1472 CLK(NULL, "abe_24m_fclk", &abe_24m_fclk),
1473 CLK(NULL, "abe_clk", &abe_clk),
1474 CLK(NULL, "aess_fclk", &aess_fclk),
1475 CLK(NULL, "dpll_abe_m3x2_ck", &dpll_abe_m3x2_ck),
1476 CLK(NULL, "core_hsd_byp_clk_mux_ck", &core_hsd_byp_clk_mux_ck),
1477 CLK(NULL, "dpll_core_ck", &dpll_core_ck),
1478 CLK(NULL, "dpll_core_x2_ck", &dpll_core_x2_ck),
1479 CLK(NULL, "dpll_core_m6x2_ck", &dpll_core_m6x2_ck),
1480 CLK(NULL, "dbgclk_mux_ck", &dbgclk_mux_ck),
1481 CLK(NULL, "dpll_core_m2_ck", &dpll_core_m2_ck),
1482 CLK(NULL, "ddrphy_ck", &ddrphy_ck),
1483 CLK(NULL, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck),
1484 CLK(NULL, "div_core_ck", &div_core_ck),
1485 CLK(NULL, "div_iva_hs_clk", &div_iva_hs_clk),
1486 CLK(NULL, "div_mpu_hs_clk", &div_mpu_hs_clk),
1487 CLK(NULL, "dpll_core_m4x2_ck", &dpll_core_m4x2_ck),
1488 CLK(NULL, "dll_clk_div_ck", &dll_clk_div_ck),
1489 CLK(NULL, "dpll_abe_m2_ck", &dpll_abe_m2_ck),
1490 CLK(NULL, "dpll_core_m3x2_ck", &dpll_core_m3x2_ck),
1491 CLK(NULL, "dpll_core_m7x2_ck", &dpll_core_m7x2_ck),
1492 CLK(NULL, "iva_hsd_byp_clk_mux_ck", &iva_hsd_byp_clk_mux_ck),
1493 CLK(NULL, "dpll_iva_ck", &dpll_iva_ck),
1494 CLK(NULL, "dpll_iva_x2_ck", &dpll_iva_x2_ck),
1495 CLK(NULL, "dpll_iva_m4x2_ck", &dpll_iva_m4x2_ck),
1496 CLK(NULL, "dpll_iva_m5x2_ck", &dpll_iva_m5x2_ck),
1497 CLK(NULL, "dpll_mpu_ck", &dpll_mpu_ck),
1498 CLK(NULL, "dpll_mpu_m2_ck", &dpll_mpu_m2_ck),
1499 CLK(NULL, "per_hs_clk_div_ck", &per_hs_clk_div_ck),
1500 CLK(NULL, "per_hsd_byp_clk_mux_ck", &per_hsd_byp_clk_mux_ck),
1501 CLK(NULL, "dpll_per_ck", &dpll_per_ck),
1502 CLK(NULL, "dpll_per_m2_ck", &dpll_per_m2_ck),
1503 CLK(NULL, "dpll_per_x2_ck", &dpll_per_x2_ck),
1504 CLK(NULL, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck),
1505 CLK(NULL, "dpll_per_m3x2_ck", &dpll_per_m3x2_ck),
1506 CLK(NULL, "dpll_per_m4x2_ck", &dpll_per_m4x2_ck),
1507 CLK(NULL, "dpll_per_m5x2_ck", &dpll_per_m5x2_ck),
1508 CLK(NULL, "dpll_per_m6x2_ck", &dpll_per_m6x2_ck),
1509 CLK(NULL, "dpll_per_m7x2_ck", &dpll_per_m7x2_ck),
1510 CLK(NULL, "usb_hs_clk_div_ck", &usb_hs_clk_div_ck),
1511 CLK(NULL, "dpll_usb_ck", &dpll_usb_ck),
1512 CLK(NULL, "dpll_usb_clkdcoldo_ck", &dpll_usb_clkdcoldo_ck),
1513 CLK(NULL, "dpll_usb_m2_ck", &dpll_usb_m2_ck),
1514 CLK(NULL, "ducati_clk_mux_ck", &ducati_clk_mux_ck),
1515 CLK(NULL, "func_12m_fclk", &func_12m_fclk),
1516 CLK(NULL, "func_24m_clk", &func_24m_clk),
1517 CLK(NULL, "func_24mc_fclk", &func_24mc_fclk),
1518 CLK(NULL, "func_48m_fclk", &func_48m_fclk),
1519 CLK(NULL, "func_48mc_fclk", &func_48mc_fclk),
1520 CLK(NULL, "func_64m_fclk", &func_64m_fclk),
1521 CLK(NULL, "func_96m_fclk", &func_96m_fclk),
1522 CLK(NULL, "init_60m_fclk", &init_60m_fclk),
1523 CLK(NULL, "l3_div_ck", &l3_div_ck),
1524 CLK(NULL, "l4_div_ck", &l4_div_ck),
1525 CLK(NULL, "lp_clk_div_ck", &lp_clk_div_ck),
1526 CLK(NULL, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck),
1527 CLK("smp_twd", NULL, &mpu_periphclk),
1528 CLK(NULL, "ocp_abe_iclk", &ocp_abe_iclk),
1529 CLK(NULL, "per_abe_24m_fclk", &per_abe_24m_fclk),
1530 CLK(NULL, "per_abe_nc_fclk", &per_abe_nc_fclk),
1531 CLK(NULL, "syc_clk_div_ck", &syc_clk_div_ck),
1532 CLK(NULL, "aes1_fck", &aes1_fck),
1533 CLK(NULL, "aes2_fck", &aes2_fck),
1534 CLK(NULL, "dmic_sync_mux_ck", &dmic_sync_mux_ck),
1535 CLK(NULL, "func_dmic_abe_gfclk", &func_dmic_abe_gfclk),
1536 CLK(NULL, "dss_sys_clk", &dss_sys_clk),
1537 CLK(NULL, "dss_tv_clk", &dss_tv_clk),
1538 CLK(NULL, "dss_dss_clk", &dss_dss_clk),
1539 CLK(NULL, "dss_48mhz_clk", &dss_48mhz_clk),
1540 CLK(NULL, "dss_fck", &dss_fck),
1541 CLK("omapdss_dss", "ick", &dss_fck),
1542 CLK(NULL, "fdif_fck", &fdif_fck),
1543 CLK(NULL, "gpio1_dbclk", &gpio1_dbclk),
1544 CLK(NULL, "gpio2_dbclk", &gpio2_dbclk),
1545 CLK(NULL, "gpio3_dbclk", &gpio3_dbclk),
1546 CLK(NULL, "gpio4_dbclk", &gpio4_dbclk),
1547 CLK(NULL, "gpio5_dbclk", &gpio5_dbclk),
1548 CLK(NULL, "gpio6_dbclk", &gpio6_dbclk),
1549 CLK(NULL, "sgx_clk_mux", &sgx_clk_mux),
1550 CLK(NULL, "hsi_fck", &hsi_fck),
1551 CLK(NULL, "iss_ctrlclk", &iss_ctrlclk),
1552 CLK(NULL, "mcasp_sync_mux_ck", &mcasp_sync_mux_ck),
1553 CLK(NULL, "func_mcasp_abe_gfclk", &func_mcasp_abe_gfclk),
1554 CLK(NULL, "mcbsp1_sync_mux_ck", &mcbsp1_sync_mux_ck),
1555 CLK(NULL, "func_mcbsp1_gfclk", &func_mcbsp1_gfclk),
1556 CLK(NULL, "mcbsp2_sync_mux_ck", &mcbsp2_sync_mux_ck),
1557 CLK(NULL, "func_mcbsp2_gfclk", &func_mcbsp2_gfclk),
1558 CLK(NULL, "mcbsp3_sync_mux_ck", &mcbsp3_sync_mux_ck),
1559 CLK(NULL, "func_mcbsp3_gfclk", &func_mcbsp3_gfclk),
1560 CLK(NULL, "mcbsp4_sync_mux_ck", &mcbsp4_sync_mux_ck),
1561 CLK(NULL, "per_mcbsp4_gfclk", &per_mcbsp4_gfclk),
1562 CLK(NULL, "hsmmc1_fclk", &hsmmc1_fclk),
1563 CLK(NULL, "hsmmc2_fclk", &hsmmc2_fclk),
1564 CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m),
1565 CLK(NULL, "sha2md5_fck", &sha2md5_fck),
1566 CLK(NULL, "slimbus1_fclk_1", &slimbus1_fclk_1),
1567 CLK(NULL, "slimbus1_fclk_0", &slimbus1_fclk_0),
1568 CLK(NULL, "slimbus1_fclk_2", &slimbus1_fclk_2),
1569 CLK(NULL, "slimbus1_slimbus_clk", &slimbus1_slimbus_clk),
1570 CLK(NULL, "slimbus2_fclk_1", &slimbus2_fclk_1),
1571 CLK(NULL, "slimbus2_fclk_0", &slimbus2_fclk_0),
1572 CLK(NULL, "slimbus2_slimbus_clk", &slimbus2_slimbus_clk),
1573 CLK(NULL, "smartreflex_core_fck", &smartreflex_core_fck),
1574 CLK(NULL, "smartreflex_iva_fck", &smartreflex_iva_fck),
1575 CLK(NULL, "smartreflex_mpu_fck", &smartreflex_mpu_fck),
1576 CLK(NULL, "dmt1_clk_mux", &dmt1_clk_mux),
1577 CLK(NULL, "cm2_dm10_mux", &cm2_dm10_mux),
1578 CLK(NULL, "cm2_dm11_mux", &cm2_dm11_mux),
1579 CLK(NULL, "cm2_dm2_mux", &cm2_dm2_mux),
1580 CLK(NULL, "cm2_dm3_mux", &cm2_dm3_mux),
1581 CLK(NULL, "cm2_dm4_mux", &cm2_dm4_mux),
1582 CLK(NULL, "timer5_sync_mux", &timer5_sync_mux),
1583 CLK(NULL, "timer6_sync_mux", &timer6_sync_mux),
1584 CLK(NULL, "timer7_sync_mux", &timer7_sync_mux),
1585 CLK(NULL, "timer8_sync_mux", &timer8_sync_mux),
1586 CLK(NULL, "cm2_dm9_mux", &cm2_dm9_mux),
1587 CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck),
1588 CLK("usbhs_omap", "fs_fck", &usb_host_fs_fck),
1589 CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk),
1590 CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk),
1591 CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk),
1592 CLK(NULL, "usb_host_hs_utmi_p2_clk", &usb_host_hs_utmi_p2_clk),
1593 CLK(NULL, "usb_host_hs_utmi_p3_clk", &usb_host_hs_utmi_p3_clk),
1594 CLK(NULL, "usb_host_hs_hsic480m_p1_clk", &usb_host_hs_hsic480m_p1_clk),
1595 CLK(NULL, "usb_host_hs_hsic60m_p1_clk", &usb_host_hs_hsic60m_p1_clk),
1596 CLK(NULL, "usb_host_hs_hsic60m_p2_clk", &usb_host_hs_hsic60m_p2_clk),
1597 CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk),
1598 CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk),
1599 CLK(NULL, "usb_host_hs_fck", &usb_host_hs_fck),
1600 CLK("usbhs_omap", "hs_fck", &usb_host_hs_fck),
1601 CLK(NULL, "otg_60m_gfclk", &otg_60m_gfclk),
1602 CLK(NULL, "usb_otg_hs_xclk", &usb_otg_hs_xclk),
1603 CLK(NULL, "usb_otg_hs_ick", &usb_otg_hs_ick),
1604 CLK("musb-omap2430", "ick", &usb_otg_hs_ick),
1605 CLK(NULL, "usb_phy_cm_clk32k", &usb_phy_cm_clk32k),
1606 CLK(NULL, "usb_tll_hs_usb_ch2_clk", &usb_tll_hs_usb_ch2_clk),
1607 CLK(NULL, "usb_tll_hs_usb_ch0_clk", &usb_tll_hs_usb_ch0_clk),
1608 CLK(NULL, "usb_tll_hs_usb_ch1_clk", &usb_tll_hs_usb_ch1_clk),
1609 CLK(NULL, "usb_tll_hs_ick", &usb_tll_hs_ick),
1610 CLK("usbhs_omap", "usbtll_ick", &usb_tll_hs_ick),
1611 CLK("usbhs_tll", "usbtll_ick", &usb_tll_hs_ick),
1612 CLK(NULL, "usim_ck", &usim_ck),
1613 CLK(NULL, "usim_fclk", &usim_fclk),
1614 CLK(NULL, "pmd_stm_clock_mux_ck", &pmd_stm_clock_mux_ck),
1615 CLK(NULL, "pmd_trace_clk_mux_ck", &pmd_trace_clk_mux_ck),
1616 CLK(NULL, "stm_clk_div_ck", &stm_clk_div_ck),
1617 CLK(NULL, "trace_clk_div_ck", &trace_clk_div_ck),
1618 CLK(NULL, "auxclk0_src_ck", &auxclk0_src_ck),
1619 CLK(NULL, "auxclk0_ck", &auxclk0_ck),
1620 CLK(NULL, "auxclkreq0_ck", &auxclkreq0_ck),
1621 CLK(NULL, "auxclk1_src_ck", &auxclk1_src_ck),
1622 CLK(NULL, "auxclk1_ck", &auxclk1_ck),
1623 CLK(NULL, "auxclkreq1_ck", &auxclkreq1_ck),
1624 CLK(NULL, "auxclk2_src_ck", &auxclk2_src_ck),
1625 CLK(NULL, "auxclk2_ck", &auxclk2_ck),
1626 CLK(NULL, "auxclkreq2_ck", &auxclkreq2_ck),
1627 CLK(NULL, "auxclk3_src_ck", &auxclk3_src_ck),
1628 CLK(NULL, "auxclk3_ck", &auxclk3_ck),
1629 CLK(NULL, "auxclkreq3_ck", &auxclkreq3_ck),
1630 CLK(NULL, "auxclk4_src_ck", &auxclk4_src_ck),
1631 CLK(NULL, "auxclk4_ck", &auxclk4_ck),
1632 CLK(NULL, "auxclkreq4_ck", &auxclkreq4_ck),
1633 CLK(NULL, "auxclk5_src_ck", &auxclk5_src_ck),
1634 CLK(NULL, "auxclk5_ck", &auxclk5_ck),
1635 CLK(NULL, "auxclkreq5_ck", &auxclkreq5_ck),
1636 CLK("50000000.gpmc", "fck", &dummy_ck),
1637 CLK("omap_i2c.1", "ick", &dummy_ck),
1638 CLK("omap_i2c.2", "ick", &dummy_ck),
1639 CLK("omap_i2c.3", "ick", &dummy_ck),
1640 CLK("omap_i2c.4", "ick", &dummy_ck),
1641 CLK(NULL, "mailboxes_ick", &dummy_ck),
1642 CLK("omap_hsmmc.0", "ick", &dummy_ck),
1643 CLK("omap_hsmmc.1", "ick", &dummy_ck),
1644 CLK("omap_hsmmc.2", "ick", &dummy_ck),
1645 CLK("omap_hsmmc.3", "ick", &dummy_ck),
1646 CLK("omap_hsmmc.4", "ick", &dummy_ck),
1647 CLK("omap-mcbsp.1", "ick", &dummy_ck),
1648 CLK("omap-mcbsp.2", "ick", &dummy_ck),
1649 CLK("omap-mcbsp.3", "ick", &dummy_ck),
1650 CLK("omap-mcbsp.4", "ick", &dummy_ck),
1651 CLK("omap2_mcspi.1", "ick", &dummy_ck),
1652 CLK("omap2_mcspi.2", "ick", &dummy_ck),
1653 CLK("omap2_mcspi.3", "ick", &dummy_ck),
1654 CLK("omap2_mcspi.4", "ick", &dummy_ck),
1655 CLK(NULL, "uart1_ick", &dummy_ck),
1656 CLK(NULL, "uart2_ick", &dummy_ck),
1657 CLK(NULL, "uart3_ick", &dummy_ck),
1658 CLK(NULL, "uart4_ick", &dummy_ck),
1659 CLK("usbhs_omap", "usbhost_ick", &dummy_ck),
1660 CLK("usbhs_omap", "usbtll_fck", &dummy_ck),
1661 CLK("usbhs_tll", "usbtll_fck", &dummy_ck),
1662 CLK("omap_wdt", "ick", &dummy_ck),
1663 CLK(NULL, "timer_32k_ck", &sys_32k_ck),
1664 /* TODO: Remove "omap_timer.X" aliases once DT migration is complete */
1665 CLK("omap_timer.1", "timer_sys_ck", &sys_clkin_ck),
1666 CLK("omap_timer.2", "timer_sys_ck", &sys_clkin_ck),
1667 CLK("omap_timer.3", "timer_sys_ck", &sys_clkin_ck),
1668 CLK("omap_timer.4", "timer_sys_ck", &sys_clkin_ck),
1669 CLK("omap_timer.9", "timer_sys_ck", &sys_clkin_ck),
1670 CLK("omap_timer.10", "timer_sys_ck", &sys_clkin_ck),
1671 CLK("omap_timer.11", "timer_sys_ck", &sys_clkin_ck),
1672 CLK("omap_timer.5", "timer_sys_ck", &syc_clk_div_ck),
1673 CLK("omap_timer.6", "timer_sys_ck", &syc_clk_div_ck),
1674 CLK("omap_timer.7", "timer_sys_ck", &syc_clk_div_ck),
1675 CLK("omap_timer.8", "timer_sys_ck", &syc_clk_div_ck),
1676 CLK("4a318000.timer", "timer_sys_ck", &sys_clkin_ck),
1677 CLK("48032000.timer", "timer_sys_ck", &sys_clkin_ck),
1678 CLK("48034000.timer", "timer_sys_ck", &sys_clkin_ck),
1679 CLK("48036000.timer", "timer_sys_ck", &sys_clkin_ck),
1680 CLK("4803e000.timer", "timer_sys_ck", &sys_clkin_ck),
1681 CLK("48086000.timer", "timer_sys_ck", &sys_clkin_ck),
1682 CLK("48088000.timer", "timer_sys_ck", &sys_clkin_ck),
1683 CLK("40138000.timer", "timer_sys_ck", &syc_clk_div_ck),
1684 CLK("4013a000.timer", "timer_sys_ck", &syc_clk_div_ck),
1685 CLK("4013c000.timer", "timer_sys_ck", &syc_clk_div_ck),
1686 CLK("4013e000.timer", "timer_sys_ck", &syc_clk_div_ck),
1687 CLK(NULL, "cpufreq_ck", &dpll_mpu_ck),
1688};
1689
1690int __init omap4xxx_clk_init(void)
1691{
1692 int rc;
1693
1694 if (cpu_is_omap443x()) {
1695 cpu_mask = RATE_IN_4430;
1696 omap_clocks_register(omap443x_clks, ARRAY_SIZE(omap443x_clks));
1697 } else if (cpu_is_omap446x() || cpu_is_omap447x()) {
1698 cpu_mask = RATE_IN_4460 | RATE_IN_4430;
1699 omap_clocks_register(omap446x_clks, ARRAY_SIZE(omap446x_clks));
1700 if (cpu_is_omap447x())
1701 pr_warn("WARNING: OMAP4470 clock data incomplete!\n");
1702 } else {
1703 return 0;
1704 }
1705
1706 omap_clocks_register(omap44xx_clks, ARRAY_SIZE(omap44xx_clks));
1707
1708 omap2_clk_disable_autoidle_all();
1709
1710 /*
1711 * A set rate of ABE DPLL inturn triggers a set rate of USB DPLL
1712 * when its in bypass. So always lock USB before ABE DPLL.
1713 */
1714 /*
1715 * Lock USB DPLL on OMAP4 devices so that the L3INIT power
1716 * domain can transition to retention state when not in use.
1717 */
1718 rc = clk_set_rate(&dpll_usb_ck, OMAP4_DPLL_USB_DEFFREQ);
1719 if (rc)
1720 pr_err("%s: failed to configure USB DPLL!\n", __func__);
1721
1722 /*
1723 * On OMAP4460 the ABE DPLL fails to turn on if in idle low-power
1724 * state when turning the ABE clock domain. Workaround this by
1725 * locking the ABE DPLL on boot.
1726 * Lock the ABE DPLL in any case to avoid issues with audio.
1727 */
1728 rc = clk_set_parent(&abe_dpll_refclk_mux_ck, &sys_32k_ck);
1729 if (!rc)
1730 rc = clk_set_rate(&dpll_abe_ck, OMAP4_DPLL_ABE_DEFFREQ);
1731 if (rc)
1732 pr_err("%s: failed to configure ABE DPLL!\n", __func__);
1733
1734 return 0;
1735}
diff --git a/arch/arm/mach-omap2/clkt_clksel.c b/arch/arm/mach-omap2/clkt_clksel.c
index 0ec9f6fdf046..7ee26108ac0d 100644
--- a/arch/arm/mach-omap2/clkt_clksel.c
+++ b/arch/arm/mach-omap2/clkt_clksel.c
@@ -97,12 +97,12 @@ static void _write_clksel_reg(struct clk_hw_omap *clk, u32 field_val)
97{ 97{
98 u32 v; 98 u32 v;
99 99
100 v = __raw_readl(clk->clksel_reg); 100 v = omap2_clk_readl(clk, clk->clksel_reg);
101 v &= ~clk->clksel_mask; 101 v &= ~clk->clksel_mask;
102 v |= field_val << __ffs(clk->clksel_mask); 102 v |= field_val << __ffs(clk->clksel_mask);
103 __raw_writel(v, clk->clksel_reg); 103 omap2_clk_writel(v, clk, clk->clksel_reg);
104 104
105 v = __raw_readl(clk->clksel_reg); /* OCP barrier */ 105 v = omap2_clk_readl(clk, clk->clksel_reg); /* OCP barrier */
106} 106}
107 107
108/** 108/**
@@ -204,7 +204,7 @@ static u32 _read_divisor(struct clk_hw_omap *clk)
204 if (!clk->clksel || !clk->clksel_mask) 204 if (!clk->clksel || !clk->clksel_mask)
205 return 0; 205 return 0;
206 206
207 v = __raw_readl(clk->clksel_reg); 207 v = omap2_clk_readl(clk, clk->clksel_reg);
208 v &= clk->clksel_mask; 208 v &= clk->clksel_mask;
209 v >>= __ffs(clk->clksel_mask); 209 v >>= __ffs(clk->clksel_mask);
210 210
@@ -320,7 +320,7 @@ u8 omap2_clksel_find_parent_index(struct clk_hw *hw)
320 WARN((!clk->clksel || !clk->clksel_mask), 320 WARN((!clk->clksel || !clk->clksel_mask),
321 "clock: %s: attempt to call on a non-clksel clock", clk_name); 321 "clock: %s: attempt to call on a non-clksel clock", clk_name);
322 322
323 r = __raw_readl(clk->clksel_reg) & clk->clksel_mask; 323 r = omap2_clk_readl(clk, clk->clksel_reg) & clk->clksel_mask;
324 r >>= __ffs(clk->clksel_mask); 324 r >>= __ffs(clk->clksel_mask);
325 325
326 for (clks = clk->clksel; clks->parent && !found; clks++) { 326 for (clks = clk->clksel; clks->parent && !found; clks++) {
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c
index 924c230f8948..47f9562ca7aa 100644
--- a/arch/arm/mach-omap2/clkt_dpll.c
+++ b/arch/arm/mach-omap2/clkt_dpll.c
@@ -196,7 +196,7 @@ u8 omap2_init_dpll_parent(struct clk_hw *hw)
196 if (!dd) 196 if (!dd)
197 return -EINVAL; 197 return -EINVAL;
198 198
199 v = __raw_readl(dd->control_reg); 199 v = omap2_clk_readl(clk, dd->control_reg);
200 v &= dd->enable_mask; 200 v &= dd->enable_mask;
201 v >>= __ffs(dd->enable_mask); 201 v >>= __ffs(dd->enable_mask);
202 202
@@ -243,7 +243,7 @@ unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk)
243 return 0; 243 return 0;
244 244
245 /* Return bypass rate if DPLL is bypassed */ 245 /* Return bypass rate if DPLL is bypassed */
246 v = __raw_readl(dd->control_reg); 246 v = omap2_clk_readl(clk, dd->control_reg);
247 v &= dd->enable_mask; 247 v &= dd->enable_mask;
248 v >>= __ffs(dd->enable_mask); 248 v >>= __ffs(dd->enable_mask);
249 249
@@ -262,7 +262,7 @@ unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk)
262 return __clk_get_rate(dd->clk_bypass); 262 return __clk_get_rate(dd->clk_bypass);
263 } 263 }
264 264
265 v = __raw_readl(dd->mult_div1_reg); 265 v = omap2_clk_readl(clk, dd->mult_div1_reg);
266 dpll_mult = v & dd->mult_mask; 266 dpll_mult = v & dd->mult_mask;
267 dpll_mult >>= __ffs(dd->mult_mask); 267 dpll_mult >>= __ffs(dd->mult_mask);
268 dpll_div = v & dd->div1_mask; 268 dpll_div = v & dd->div1_mask;
diff --git a/arch/arm/mach-omap2/clkt_iclk.c b/arch/arm/mach-omap2/clkt_iclk.c
index f10eb03ce3e2..333f0a666171 100644
--- a/arch/arm/mach-omap2/clkt_iclk.c
+++ b/arch/arm/mach-omap2/clkt_iclk.c
@@ -25,25 +25,29 @@
25/* XXX */ 25/* XXX */
26void omap2_clkt_iclk_allow_idle(struct clk_hw_omap *clk) 26void omap2_clkt_iclk_allow_idle(struct clk_hw_omap *clk)
27{ 27{
28 u32 v, r; 28 u32 v;
29 void __iomem *r;
29 30
30 r = ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN)); 31 r = (__force void __iomem *)
32 ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN));
31 33
32 v = __raw_readl((__force void __iomem *)r); 34 v = omap2_clk_readl(clk, r);
33 v |= (1 << clk->enable_bit); 35 v |= (1 << clk->enable_bit);
34 __raw_writel(v, (__force void __iomem *)r); 36 omap2_clk_writel(v, clk, r);
35} 37}
36 38
37/* XXX */ 39/* XXX */
38void omap2_clkt_iclk_deny_idle(struct clk_hw_omap *clk) 40void omap2_clkt_iclk_deny_idle(struct clk_hw_omap *clk)
39{ 41{
40 u32 v, r; 42 u32 v;
43 void __iomem *r;
41 44
42 r = ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN)); 45 r = (__force void __iomem *)
46 ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN));
43 47
44 v = __raw_readl((__force void __iomem *)r); 48 v = omap2_clk_readl(clk, r);
45 v &= ~(1 << clk->enable_bit); 49 v &= ~(1 << clk->enable_bit);
46 __raw_writel(v, (__force void __iomem *)r); 50 omap2_clk_writel(v, clk, r);
47} 51}
48 52
49/* Public data */ 53/* Public data */
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index c7c5d31e9082..591581a66532 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -26,7 +26,6 @@
26#include <linux/clk-private.h> 26#include <linux/clk-private.h>
27#include <asm/cpu.h> 27#include <asm/cpu.h>
28 28
29
30#include <trace/events/power.h> 29#include <trace/events/power.h>
31 30
32#include "soc.h" 31#include "soc.h"
@@ -56,6 +55,31 @@ u16 cpu_mask;
56static bool clkdm_control = true; 55static bool clkdm_control = true;
57 56
58static LIST_HEAD(clk_hw_omap_clocks); 57static LIST_HEAD(clk_hw_omap_clocks);
58void __iomem *clk_memmaps[CLK_MAX_MEMMAPS];
59
60void omap2_clk_writel(u32 val, struct clk_hw_omap *clk, void __iomem *reg)
61{
62 if (clk->flags & MEMMAP_ADDRESSING) {
63 struct clk_omap_reg *r = (struct clk_omap_reg *)&reg;
64 writel_relaxed(val, clk_memmaps[r->index] + r->offset);
65 } else {
66 writel_relaxed(val, reg);
67 }
68}
69
70u32 omap2_clk_readl(struct clk_hw_omap *clk, void __iomem *reg)
71{
72 u32 val;
73
74 if (clk->flags & MEMMAP_ADDRESSING) {
75 struct clk_omap_reg *r = (struct clk_omap_reg *)&reg;
76 val = readl_relaxed(clk_memmaps[r->index] + r->offset);
77 } else {
78 val = readl_relaxed(reg);
79 }
80
81 return val;
82}
59 83
60/* 84/*
61 * Used for clocks that have the same value as the parent clock, 85 * Used for clocks that have the same value as the parent clock,
@@ -87,6 +111,7 @@ unsigned long omap_fixed_divisor_recalc(struct clk_hw *hw,
87 111
88/** 112/**
89 * _wait_idlest_generic - wait for a module to leave the idle state 113 * _wait_idlest_generic - wait for a module to leave the idle state
114 * @clk: module clock to wait for (needed for register offsets)
90 * @reg: virtual address of module IDLEST register 115 * @reg: virtual address of module IDLEST register
91 * @mask: value to mask against to determine if the module is active 116 * @mask: value to mask against to determine if the module is active
92 * @idlest: idle state indicator (0 or 1) for the clock 117 * @idlest: idle state indicator (0 or 1) for the clock
@@ -98,14 +123,14 @@ unsigned long omap_fixed_divisor_recalc(struct clk_hw *hw,
98 * elapsed. XXX Deprecated - should be moved into drivers for the 123 * elapsed. XXX Deprecated - should be moved into drivers for the
99 * individual IP block that the IDLEST register exists in. 124 * individual IP block that the IDLEST register exists in.
100 */ 125 */
101static int _wait_idlest_generic(void __iomem *reg, u32 mask, u8 idlest, 126static int _wait_idlest_generic(struct clk_hw_omap *clk, void __iomem *reg,
102 const char *name) 127 u32 mask, u8 idlest, const char *name)
103{ 128{
104 int i = 0, ena = 0; 129 int i = 0, ena = 0;
105 130
106 ena = (idlest) ? 0 : mask; 131 ena = (idlest) ? 0 : mask;
107 132
108 omap_test_timeout(((__raw_readl(reg) & mask) == ena), 133 omap_test_timeout(((omap2_clk_readl(clk, reg) & mask) == ena),
109 MAX_MODULE_ENABLE_WAIT, i); 134 MAX_MODULE_ENABLE_WAIT, i);
110 135
111 if (i < MAX_MODULE_ENABLE_WAIT) 136 if (i < MAX_MODULE_ENABLE_WAIT)
@@ -138,7 +163,7 @@ static void _omap2_module_wait_ready(struct clk_hw_omap *clk)
138 /* Not all modules have multiple clocks that their IDLEST depends on */ 163 /* Not all modules have multiple clocks that their IDLEST depends on */
139 if (clk->ops->find_companion) { 164 if (clk->ops->find_companion) {
140 clk->ops->find_companion(clk, &companion_reg, &other_bit); 165 clk->ops->find_companion(clk, &companion_reg, &other_bit);
141 if (!(__raw_readl(companion_reg) & (1 << other_bit))) 166 if (!(omap2_clk_readl(clk, companion_reg) & (1 << other_bit)))
142 return; 167 return;
143 } 168 }
144 169
@@ -146,8 +171,8 @@ static void _omap2_module_wait_ready(struct clk_hw_omap *clk)
146 r = cm_split_idlest_reg(idlest_reg, &prcm_mod, &idlest_reg_id); 171 r = cm_split_idlest_reg(idlest_reg, &prcm_mod, &idlest_reg_id);
147 if (r) { 172 if (r) {
148 /* IDLEST register not in the CM module */ 173 /* IDLEST register not in the CM module */
149 _wait_idlest_generic(idlest_reg, (1 << idlest_bit), idlest_val, 174 _wait_idlest_generic(clk, idlest_reg, (1 << idlest_bit),
150 __clk_get_name(clk->hw.clk)); 175 idlest_val, __clk_get_name(clk->hw.clk));
151 } else { 176 } else {
152 cm_wait_module_ready(prcm_mod, idlest_reg_id, idlest_bit); 177 cm_wait_module_ready(prcm_mod, idlest_reg_id, idlest_bit);
153 }; 178 };
@@ -309,13 +334,13 @@ int omap2_dflt_clk_enable(struct clk_hw *hw)
309 } 334 }
310 335
311 /* FIXME should not have INVERT_ENABLE bit here */ 336 /* FIXME should not have INVERT_ENABLE bit here */
312 v = __raw_readl(clk->enable_reg); 337 v = omap2_clk_readl(clk, clk->enable_reg);
313 if (clk->flags & INVERT_ENABLE) 338 if (clk->flags & INVERT_ENABLE)
314 v &= ~(1 << clk->enable_bit); 339 v &= ~(1 << clk->enable_bit);
315 else 340 else
316 v |= (1 << clk->enable_bit); 341 v |= (1 << clk->enable_bit);
317 __raw_writel(v, clk->enable_reg); 342 omap2_clk_writel(v, clk, clk->enable_reg);
318 v = __raw_readl(clk->enable_reg); /* OCP barrier */ 343 v = omap2_clk_readl(clk, clk->enable_reg); /* OCP barrier */
319 344
320 if (clk->ops && clk->ops->find_idlest) 345 if (clk->ops && clk->ops->find_idlest)
321 _omap2_module_wait_ready(clk); 346 _omap2_module_wait_ready(clk);
@@ -353,12 +378,12 @@ void omap2_dflt_clk_disable(struct clk_hw *hw)
353 return; 378 return;
354 } 379 }
355 380
356 v = __raw_readl(clk->enable_reg); 381 v = omap2_clk_readl(clk, clk->enable_reg);
357 if (clk->flags & INVERT_ENABLE) 382 if (clk->flags & INVERT_ENABLE)
358 v |= (1 << clk->enable_bit); 383 v |= (1 << clk->enable_bit);
359 else 384 else
360 v &= ~(1 << clk->enable_bit); 385 v &= ~(1 << clk->enable_bit);
361 __raw_writel(v, clk->enable_reg); 386 omap2_clk_writel(v, clk, clk->enable_reg);
362 /* No OCP barrier needed here since it is a disable operation */ 387 /* No OCP barrier needed here since it is a disable operation */
363 388
364 if (clkdm_control && clk->clkdm) 389 if (clkdm_control && clk->clkdm)
@@ -454,7 +479,7 @@ int omap2_dflt_clk_is_enabled(struct clk_hw *hw)
454 struct clk_hw_omap *clk = to_clk_hw_omap(hw); 479 struct clk_hw_omap *clk = to_clk_hw_omap(hw);
455 u32 v; 480 u32 v;
456 481
457 v = __raw_readl(clk->enable_reg); 482 v = omap2_clk_readl(clk, clk->enable_reg);
458 483
459 if (clk->flags & INVERT_ENABLE) 484 if (clk->flags & INVERT_ENABLE)
460 v ^= BIT(clk->enable_bit); 485 v ^= BIT(clk->enable_bit);
@@ -520,6 +545,9 @@ int omap2_clk_enable_autoidle_all(void)
520 list_for_each_entry(c, &clk_hw_omap_clocks, node) 545 list_for_each_entry(c, &clk_hw_omap_clocks, node)
521 if (c->ops && c->ops->allow_idle) 546 if (c->ops && c->ops->allow_idle)
522 c->ops->allow_idle(c); 547 c->ops->allow_idle(c);
548
549 of_ti_clk_allow_autoidle_all();
550
523 return 0; 551 return 0;
524} 552}
525 553
@@ -539,6 +567,9 @@ int omap2_clk_disable_autoidle_all(void)
539 list_for_each_entry(c, &clk_hw_omap_clocks, node) 567 list_for_each_entry(c, &clk_hw_omap_clocks, node)
540 if (c->ops && c->ops->deny_idle) 568 if (c->ops && c->ops->deny_idle)
541 c->ops->deny_idle(c); 569 c->ops->deny_idle(c);
570
571 of_ti_clk_deny_autoidle_all();
572
542 return 0; 573 return 0;
543} 574}
544 575
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 82916cc82c92..bda767a9dea8 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -21,6 +21,7 @@
21 21
22#include <linux/clkdev.h> 22#include <linux/clkdev.h>
23#include <linux/clk-provider.h> 23#include <linux/clk-provider.h>
24#include <linux/clk/ti.h>
24 25
25struct omap_clk { 26struct omap_clk {
26 u16 cpu; 27 u16 cpu;
@@ -37,7 +38,6 @@ struct omap_clk {
37 } 38 }
38 39
39struct clockdomain; 40struct clockdomain;
40#define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)
41 41
42#define DEFINE_STRUCT_CLK(_name, _parent_array_name, _clkops_name) \ 42#define DEFINE_STRUCT_CLK(_name, _parent_array_name, _clkops_name) \
43 static struct clk _name = { \ 43 static struct clk _name = { \
@@ -178,141 +178,6 @@ struct clksel {
178 const struct clksel_rate *rates; 178 const struct clksel_rate *rates;
179}; 179};
180 180
181/**
182 * struct dpll_data - DPLL registers and integration data
183 * @mult_div1_reg: register containing the DPLL M and N bitfields
184 * @mult_mask: mask of the DPLL M bitfield in @mult_div1_reg
185 * @div1_mask: mask of the DPLL N bitfield in @mult_div1_reg
186 * @clk_bypass: struct clk pointer to the clock's bypass clock input
187 * @clk_ref: struct clk pointer to the clock's reference clock input
188 * @control_reg: register containing the DPLL mode bitfield
189 * @enable_mask: mask of the DPLL mode bitfield in @control_reg
190 * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate()
191 * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate()
192 * @last_rounded_m4xen: cache of the last M4X result of
193 * omap4_dpll_regm4xen_round_rate()
194 * @last_rounded_lpmode: cache of the last lpmode result of
195 * omap4_dpll_lpmode_recalc()
196 * @max_multiplier: maximum valid non-bypass multiplier value (actual)
197 * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()
198 * @min_divider: minimum valid non-bypass divider value (actual)
199 * @max_divider: maximum valid non-bypass divider value (actual)
200 * @modes: possible values of @enable_mask
201 * @autoidle_reg: register containing the DPLL autoidle mode bitfield
202 * @idlest_reg: register containing the DPLL idle status bitfield
203 * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg
204 * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg
205 * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg
206 * @lpmode_mask: mask of the DPLL low-power mode bitfield in @control_reg
207 * @m4xen_mask: mask of the DPLL M4X multiplier bitfield in @control_reg
208 * @auto_recal_bit: bitshift of the driftguard enable bit in @control_reg
209 * @recal_en_bit: bitshift of the PRM_IRQENABLE_* bit for recalibration IRQs
210 * @recal_st_bit: bitshift of the PRM_IRQSTATUS_* bit for recalibration IRQs
211 * @flags: DPLL type/features (see below)
212 *
213 * Possible values for @flags:
214 * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs)
215 *
216 * @freqsel_mask is only used on the OMAP34xx family and AM35xx.
217 *
218 * XXX Some DPLLs have multiple bypass inputs, so it's not technically
219 * correct to only have one @clk_bypass pointer.
220 *
221 * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m,
222 * @last_rounded_n) should be separated from the runtime-fixed fields
223 * and placed into a different structure, so that the runtime-fixed data
224 * can be placed into read-only space.
225 */
226struct dpll_data {
227 void __iomem *mult_div1_reg;
228 u32 mult_mask;
229 u32 div1_mask;
230 struct clk *clk_bypass;
231 struct clk *clk_ref;
232 void __iomem *control_reg;
233 u32 enable_mask;
234 unsigned long last_rounded_rate;
235 u16 last_rounded_m;
236 u8 last_rounded_m4xen;
237 u8 last_rounded_lpmode;
238 u16 max_multiplier;
239 u8 last_rounded_n;
240 u8 min_divider;
241 u16 max_divider;
242 u8 modes;
243 void __iomem *autoidle_reg;
244 void __iomem *idlest_reg;
245 u32 autoidle_mask;
246 u32 freqsel_mask;
247 u32 idlest_mask;
248 u32 dco_mask;
249 u32 sddiv_mask;
250 u32 lpmode_mask;
251 u32 m4xen_mask;
252 u8 auto_recal_bit;
253 u8 recal_en_bit;
254 u8 recal_st_bit;
255 u8 flags;
256};
257
258/*
259 * struct clk.flags possibilities
260 *
261 * XXX document the rest of the clock flags here
262 *
263 * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
264 * bits share the same register. This flag allows the
265 * omap4_dpllmx*() code to determine which GATE_CTRL bit field
266 * should be used. This is a temporary solution - a better approach
267 * would be to associate clock type-specific data with the clock,
268 * similar to the struct dpll_data approach.
269 */
270#define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */
271#define CLOCK_IDLE_CONTROL (1 << 1)
272#define CLOCK_NO_IDLE_PARENT (1 << 2)
273#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */
274#define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */
275#define CLOCK_CLKOUTX2 (1 << 5)
276
277/**
278 * struct clk_hw_omap - OMAP struct clk
279 * @node: list_head connecting this clock into the full clock list
280 * @enable_reg: register to write to enable the clock (see @enable_bit)
281 * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg)
282 * @flags: see "struct clk.flags possibilities" above
283 * @clksel_reg: for clksel clks, register va containing src/divisor select
284 * @clksel_mask: bitmask in @clksel_reg for the src/divisor selector
285 * @clksel: for clksel clks, pointer to struct clksel for this clock
286 * @dpll_data: for DPLLs, pointer to struct dpll_data for this clock
287 * @clkdm_name: clockdomain name that this clock is contained in
288 * @clkdm: pointer to struct clockdomain, resolved from @clkdm_name at runtime
289 * @rate_offset: bitshift for rate selection bitfield (OMAP1 only)
290 * @src_offset: bitshift for source selection bitfield (OMAP1 only)
291 *
292 * XXX @rate_offset, @src_offset should probably be removed and OMAP1
293 * clock code converted to use clksel.
294 *
295 */
296
297struct clk_hw_omap_ops;
298
299struct clk_hw_omap {
300 struct clk_hw hw;
301 struct list_head node;
302 unsigned long fixed_rate;
303 u8 fixed_div;
304 void __iomem *enable_reg;
305 u8 enable_bit;
306 u8 flags;
307 void __iomem *clksel_reg;
308 u32 clksel_mask;
309 const struct clksel *clksel;
310 struct dpll_data *dpll_data;
311 const char *clkdm_name;
312 struct clockdomain *clkdm;
313 const struct clk_hw_omap_ops *ops;
314};
315
316struct clk_hw_omap_ops { 181struct clk_hw_omap_ops {
317 void (*find_idlest)(struct clk_hw_omap *oclk, 182 void (*find_idlest)(struct clk_hw_omap *oclk,
318 void __iomem **idlest_reg, 183 void __iomem **idlest_reg,
@@ -348,36 +213,13 @@ unsigned long omap_fixed_divisor_recalc(struct clk_hw *hw,
348#define OMAP4XXX_EN_DPLL_FRBYPASS 0x6 213#define OMAP4XXX_EN_DPLL_FRBYPASS 0x6
349#define OMAP4XXX_EN_DPLL_LOCKED 0x7 214#define OMAP4XXX_EN_DPLL_LOCKED 0x7
350 215
351/* CM_CLKEN_PLL*.EN* bit values - not all are available for every DPLL */
352#define DPLL_LOW_POWER_STOP 0x1
353#define DPLL_LOW_POWER_BYPASS 0x5
354#define DPLL_LOCKED 0x7
355
356/* DPLL Type and DCO Selection Flags */
357#define DPLL_J_TYPE 0x1
358
359long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
360 unsigned long *parent_rate);
361unsigned long omap3_dpll_recalc(struct clk_hw *hw, unsigned long parent_rate);
362int omap3_noncore_dpll_enable(struct clk_hw *hw);
363void omap3_noncore_dpll_disable(struct clk_hw *hw);
364int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate,
365 unsigned long parent_rate);
366u32 omap3_dpll_autoidle_read(struct clk_hw_omap *clk); 216u32 omap3_dpll_autoidle_read(struct clk_hw_omap *clk);
367void omap3_dpll_allow_idle(struct clk_hw_omap *clk); 217void omap3_dpll_allow_idle(struct clk_hw_omap *clk);
368void omap3_dpll_deny_idle(struct clk_hw_omap *clk); 218void omap3_dpll_deny_idle(struct clk_hw_omap *clk);
369unsigned long omap3_clkoutx2_recalc(struct clk_hw *hw,
370 unsigned long parent_rate);
371int omap4_dpllmx_gatectrl_read(struct clk_hw_omap *clk); 219int omap4_dpllmx_gatectrl_read(struct clk_hw_omap *clk);
372void omap4_dpllmx_allow_gatectrl(struct clk_hw_omap *clk); 220void omap4_dpllmx_allow_gatectrl(struct clk_hw_omap *clk);
373void omap4_dpllmx_deny_gatectrl(struct clk_hw_omap *clk); 221void omap4_dpllmx_deny_gatectrl(struct clk_hw_omap *clk);
374unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw,
375 unsigned long parent_rate);
376long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw,
377 unsigned long target_rate,
378 unsigned long *parent_rate);
379 222
380void omap2_init_clk_clkdm(struct clk_hw *clk);
381void __init omap2_clk_disable_clkdm_control(void); 223void __init omap2_clk_disable_clkdm_control(void);
382 224
383/* clkt_clksel.c public functions */ 225/* clkt_clksel.c public functions */
@@ -396,29 +238,25 @@ int omap2_clksel_set_parent(struct clk_hw *hw, u8 field_val);
396extern void omap2_clkt_iclk_allow_idle(struct clk_hw_omap *clk); 238extern void omap2_clkt_iclk_allow_idle(struct clk_hw_omap *clk);
397extern void omap2_clkt_iclk_deny_idle(struct clk_hw_omap *clk); 239extern void omap2_clkt_iclk_deny_idle(struct clk_hw_omap *clk);
398 240
399u8 omap2_init_dpll_parent(struct clk_hw *hw);
400unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk); 241unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk);
401 242
402int omap2_dflt_clk_enable(struct clk_hw *hw);
403void omap2_dflt_clk_disable(struct clk_hw *hw);
404int omap2_dflt_clk_is_enabled(struct clk_hw *hw);
405void omap2_clk_dflt_find_companion(struct clk_hw_omap *clk, 243void omap2_clk_dflt_find_companion(struct clk_hw_omap *clk,
406 void __iomem **other_reg, 244 void __iomem **other_reg,
407 u8 *other_bit); 245 u8 *other_bit);
408void omap2_clk_dflt_find_idlest(struct clk_hw_omap *clk, 246void omap2_clk_dflt_find_idlest(struct clk_hw_omap *clk,
409 void __iomem **idlest_reg, 247 void __iomem **idlest_reg,
410 u8 *idlest_bit, u8 *idlest_val); 248 u8 *idlest_bit, u8 *idlest_val);
411void omap2_init_clk_hw_omap_clocks(struct clk *clk);
412int omap2_clk_enable_autoidle_all(void); 249int omap2_clk_enable_autoidle_all(void);
413int omap2_clk_disable_autoidle_all(void);
414int omap2_clk_allow_idle(struct clk *clk); 250int omap2_clk_allow_idle(struct clk *clk);
415int omap2_clk_deny_idle(struct clk *clk); 251int omap2_clk_deny_idle(struct clk *clk);
416void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks);
417int omap2_clk_switch_mpurate_at_boot(const char *mpurate_ck_name); 252int omap2_clk_switch_mpurate_at_boot(const char *mpurate_ck_name);
418void omap2_clk_print_new_rates(const char *hfclkin_ck_name, 253void omap2_clk_print_new_rates(const char *hfclkin_ck_name,
419 const char *core_ck_name, 254 const char *core_ck_name,
420 const char *mpu_ck_name); 255 const char *mpu_ck_name);
421 256
257u32 omap2_clk_readl(struct clk_hw_omap *clk, void __iomem *reg);
258void omap2_clk_writel(u32 val, struct clk_hw_omap *clk, void __iomem *reg);
259
422extern u16 cpu_mask; 260extern u16 cpu_mask;
423 261
424extern const struct clkops clkops_omap2_dflt_wait; 262extern const struct clkops clkops_omap2_dflt_wait;
@@ -433,19 +271,12 @@ extern const struct clksel_rate gfx_l3_rates[];
433extern const struct clksel_rate dsp_ick_rates[]; 271extern const struct clksel_rate dsp_ick_rates[];
434extern struct clk dummy_ck; 272extern struct clk dummy_ck;
435 273
436extern const struct clk_hw_omap_ops clkhwops_omap3_dpll;
437extern const struct clk_hw_omap_ops clkhwops_iclk_wait; 274extern const struct clk_hw_omap_ops clkhwops_iclk_wait;
438extern const struct clk_hw_omap_ops clkhwops_wait; 275extern const struct clk_hw_omap_ops clkhwops_wait;
439extern const struct clk_hw_omap_ops clkhwops_omap4_dpllmx;
440extern const struct clk_hw_omap_ops clkhwops_iclk;
441extern const struct clk_hw_omap_ops clkhwops_omap3430es2_ssi_wait; 276extern const struct clk_hw_omap_ops clkhwops_omap3430es2_ssi_wait;
442extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_ssi_wait;
443extern const struct clk_hw_omap_ops clkhwops_omap3430es2_dss_usbhost_wait; 277extern const struct clk_hw_omap_ops clkhwops_omap3430es2_dss_usbhost_wait;
444extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_dss_usbhost_wait;
445extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_hsotgusb_wait;
446extern const struct clk_hw_omap_ops clkhwops_omap3430es2_hsotgusb_wait; 278extern const struct clk_hw_omap_ops clkhwops_omap3430es2_hsotgusb_wait;
447extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait; 279extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait;
448extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_wait;
449extern const struct clk_hw_omap_ops clkhwops_apll54; 280extern const struct clk_hw_omap_ops clkhwops_apll54;
450extern const struct clk_hw_omap_ops clkhwops_apll96; 281extern const struct clk_hw_omap_ops clkhwops_apll96;
451extern const struct clk_hw_omap_ops clkhwops_omap2xxx_dpll; 282extern const struct clk_hw_omap_ops clkhwops_omap2xxx_dpll;
@@ -460,6 +291,8 @@ extern const struct clksel_rate div_1_3_rates[];
460extern const struct clksel_rate div_1_4_rates[]; 291extern const struct clksel_rate div_1_4_rates[];
461extern const struct clksel_rate div31_1to31_rates[]; 292extern const struct clksel_rate div31_1to31_rates[];
462 293
294extern void __iomem *clk_memmaps[];
295
463extern int am33xx_clk_init(void); 296extern int am33xx_clk_init(void);
464 297
465extern int omap2_clkops_enable_clkdm(struct clk_hw *hw); 298extern int omap2_clkops_enable_clkdm(struct clk_hw *hw);
diff --git a/arch/arm/mach-omap2/clock36xx.c b/arch/arm/mach-omap2/clock36xx.c
index bbd6a3f717e6..91ccb962e09e 100644
--- a/arch/arm/mach-omap2/clock36xx.c
+++ b/arch/arm/mach-omap2/clock36xx.c
@@ -43,6 +43,7 @@ int omap36xx_pwrdn_clk_enable_with_hsdiv_restore(struct clk_hw *clk)
43 struct clk_divider *parent; 43 struct clk_divider *parent;
44 struct clk_hw *parent_hw; 44 struct clk_hw *parent_hw;
45 u32 dummy_v, orig_v; 45 u32 dummy_v, orig_v;
46 struct clk_hw_omap *omap_clk = to_clk_hw_omap(clk);
46 int ret; 47 int ret;
47 48
48 /* Clear PWRDN bit of HSDIVIDER */ 49 /* Clear PWRDN bit of HSDIVIDER */
@@ -53,15 +54,15 @@ int omap36xx_pwrdn_clk_enable_with_hsdiv_restore(struct clk_hw *clk)
53 54
54 /* Restore the dividers */ 55 /* Restore the dividers */
55 if (!ret) { 56 if (!ret) {
56 orig_v = __raw_readl(parent->reg); 57 orig_v = omap2_clk_readl(omap_clk, parent->reg);
57 dummy_v = orig_v; 58 dummy_v = orig_v;
58 59
59 /* Write any other value different from the Read value */ 60 /* Write any other value different from the Read value */
60 dummy_v ^= (1 << parent->shift); 61 dummy_v ^= (1 << parent->shift);
61 __raw_writel(dummy_v, parent->reg); 62 omap2_clk_writel(dummy_v, omap_clk, parent->reg);
62 63
63 /* Write the original divider */ 64 /* Write the original divider */
64 __raw_writel(orig_v, parent->reg); 65 omap2_clk_writel(orig_v, omap_clk, parent->reg);
65 } 66 }
66 67
67 return ret; 68 return ret;
diff --git a/arch/arm/mach-omap2/clock3xxx.h b/arch/arm/mach-omap2/clock3xxx.h
index 8cd4b0a882ae..78d9f562e3ce 100644
--- a/arch/arm/mach-omap2/clock3xxx.h
+++ b/arch/arm/mach-omap2/clock3xxx.h
@@ -9,11 +9,8 @@
9#define __ARCH_ARM_MACH_OMAP2_CLOCK3XXX_H 9#define __ARCH_ARM_MACH_OMAP2_CLOCK3XXX_H
10 10
11int omap3xxx_clk_init(void); 11int omap3xxx_clk_init(void);
12int omap3_dpll4_set_rate(struct clk_hw *clk, unsigned long rate,
13 unsigned long parent_rate);
14int omap3_core_dpll_m2_set_rate(struct clk_hw *clk, unsigned long rate, 12int omap3_core_dpll_m2_set_rate(struct clk_hw *clk, unsigned long rate,
15 unsigned long parent_rate); 13 unsigned long parent_rate);
16void omap3_clk_lock_dpll5(void);
17 14
18extern struct clk *sdrc_ick_p; 15extern struct clk *sdrc_ick_p;
19extern struct clk *arm_fck_p; 16extern struct clk *arm_fck_p;
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 240db38f232c..e51527835160 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -306,7 +306,7 @@ struct omap_hwmod;
306extern int omap_dss_reset(struct omap_hwmod *); 306extern int omap_dss_reset(struct omap_hwmod *);
307 307
308/* SoC specific clock initializer */ 308/* SoC specific clock initializer */
309extern int (*omap_clk_init)(void); 309int omap_clk_init(void);
310 310
311#endif /* __ASSEMBLER__ */ 311#endif /* __ASSEMBLER__ */
312#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ 312#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
index 3a0296cfcace..3185ced807c9 100644
--- a/arch/arm/mach-omap2/dpll3xxx.c
+++ b/arch/arm/mach-omap2/dpll3xxx.c
@@ -50,10 +50,10 @@ static void _omap3_dpll_write_clken(struct clk_hw_omap *clk, u8 clken_bits)
50 50
51 dd = clk->dpll_data; 51 dd = clk->dpll_data;
52 52
53 v = __raw_readl(dd->control_reg); 53 v = omap2_clk_readl(clk, dd->control_reg);
54 v &= ~dd->enable_mask; 54 v &= ~dd->enable_mask;
55 v |= clken_bits << __ffs(dd->enable_mask); 55 v |= clken_bits << __ffs(dd->enable_mask);
56 __raw_writel(v, dd->control_reg); 56 omap2_clk_writel(v, clk, dd->control_reg);
57} 57}
58 58
59/* _omap3_wait_dpll_status: wait for a DPLL to enter a specific state */ 59/* _omap3_wait_dpll_status: wait for a DPLL to enter a specific state */
@@ -69,8 +69,8 @@ static int _omap3_wait_dpll_status(struct clk_hw_omap *clk, u8 state)
69 69
70 state <<= __ffs(dd->idlest_mask); 70 state <<= __ffs(dd->idlest_mask);
71 71
72 while (((__raw_readl(dd->idlest_reg) & dd->idlest_mask) != state) && 72 while (((omap2_clk_readl(clk, dd->idlest_reg) & dd->idlest_mask)
73 i < MAX_DPLL_WAIT_TRIES) { 73 != state) && i < MAX_DPLL_WAIT_TRIES) {
74 i++; 74 i++;
75 udelay(1); 75 udelay(1);
76 } 76 }
@@ -147,7 +147,7 @@ static int _omap3_noncore_dpll_lock(struct clk_hw_omap *clk)
147 state <<= __ffs(dd->idlest_mask); 147 state <<= __ffs(dd->idlest_mask);
148 148
149 /* Check if already locked */ 149 /* Check if already locked */
150 if ((__raw_readl(dd->idlest_reg) & dd->idlest_mask) == state) 150 if ((omap2_clk_readl(clk, dd->idlest_reg) & dd->idlest_mask) == state)
151 goto done; 151 goto done;
152 152
153 ai = omap3_dpll_autoidle_read(clk); 153 ai = omap3_dpll_autoidle_read(clk);
@@ -311,14 +311,14 @@ static int omap3_noncore_dpll_program(struct clk_hw_omap *clk, u16 freqsel)
311 * only since freqsel field is no longer present on other devices. 311 * only since freqsel field is no longer present on other devices.
312 */ 312 */
313 if (cpu_is_omap343x()) { 313 if (cpu_is_omap343x()) {
314 v = __raw_readl(dd->control_reg); 314 v = omap2_clk_readl(clk, dd->control_reg);
315 v &= ~dd->freqsel_mask; 315 v &= ~dd->freqsel_mask;
316 v |= freqsel << __ffs(dd->freqsel_mask); 316 v |= freqsel << __ffs(dd->freqsel_mask);
317 __raw_writel(v, dd->control_reg); 317 omap2_clk_writel(v, clk, dd->control_reg);
318 } 318 }
319 319
320 /* Set DPLL multiplier, divider */ 320 /* Set DPLL multiplier, divider */
321 v = __raw_readl(dd->mult_div1_reg); 321 v = omap2_clk_readl(clk, dd->mult_div1_reg);
322 v &= ~(dd->mult_mask | dd->div1_mask); 322 v &= ~(dd->mult_mask | dd->div1_mask);
323 v |= dd->last_rounded_m << __ffs(dd->mult_mask); 323 v |= dd->last_rounded_m << __ffs(dd->mult_mask);
324 v |= (dd->last_rounded_n - 1) << __ffs(dd->div1_mask); 324 v |= (dd->last_rounded_n - 1) << __ffs(dd->div1_mask);
@@ -336,11 +336,11 @@ static int omap3_noncore_dpll_program(struct clk_hw_omap *clk, u16 freqsel)
336 v |= sd_div << __ffs(dd->sddiv_mask); 336 v |= sd_div << __ffs(dd->sddiv_mask);
337 } 337 }
338 338
339 __raw_writel(v, dd->mult_div1_reg); 339 omap2_clk_writel(v, clk, dd->mult_div1_reg);
340 340
341 /* Set 4X multiplier and low-power mode */ 341 /* Set 4X multiplier and low-power mode */
342 if (dd->m4xen_mask || dd->lpmode_mask) { 342 if (dd->m4xen_mask || dd->lpmode_mask) {
343 v = __raw_readl(dd->control_reg); 343 v = omap2_clk_readl(clk, dd->control_reg);
344 344
345 if (dd->m4xen_mask) { 345 if (dd->m4xen_mask) {
346 if (dd->last_rounded_m4xen) 346 if (dd->last_rounded_m4xen)
@@ -356,7 +356,7 @@ static int omap3_noncore_dpll_program(struct clk_hw_omap *clk, u16 freqsel)
356 v &= ~dd->lpmode_mask; 356 v &= ~dd->lpmode_mask;
357 } 357 }
358 358
359 __raw_writel(v, dd->control_reg); 359 omap2_clk_writel(v, clk, dd->control_reg);
360 } 360 }
361 361
362 /* We let the clock framework set the other output dividers later */ 362 /* We let the clock framework set the other output dividers later */
@@ -554,7 +554,7 @@ u32 omap3_dpll_autoidle_read(struct clk_hw_omap *clk)
554 if (!dd->autoidle_reg) 554 if (!dd->autoidle_reg)
555 return -EINVAL; 555 return -EINVAL;
556 556
557 v = __raw_readl(dd->autoidle_reg); 557 v = omap2_clk_readl(clk, dd->autoidle_reg);
558 v &= dd->autoidle_mask; 558 v &= dd->autoidle_mask;
559 v >>= __ffs(dd->autoidle_mask); 559 v >>= __ffs(dd->autoidle_mask);
560 560
@@ -588,10 +588,10 @@ void omap3_dpll_allow_idle(struct clk_hw_omap *clk)
588 * by writing 0x5 instead of 0x1. Add some mechanism to 588 * by writing 0x5 instead of 0x1. Add some mechanism to
589 * optionally enter this mode. 589 * optionally enter this mode.
590 */ 590 */
591 v = __raw_readl(dd->autoidle_reg); 591 v = omap2_clk_readl(clk, dd->autoidle_reg);
592 v &= ~dd->autoidle_mask; 592 v &= ~dd->autoidle_mask;
593 v |= DPLL_AUTOIDLE_LOW_POWER_STOP << __ffs(dd->autoidle_mask); 593 v |= DPLL_AUTOIDLE_LOW_POWER_STOP << __ffs(dd->autoidle_mask);
594 __raw_writel(v, dd->autoidle_reg); 594 omap2_clk_writel(v, clk, dd->autoidle_reg);
595 595
596} 596}
597 597
@@ -614,10 +614,10 @@ void omap3_dpll_deny_idle(struct clk_hw_omap *clk)
614 if (!dd->autoidle_reg) 614 if (!dd->autoidle_reg)
615 return; 615 return;
616 616
617 v = __raw_readl(dd->autoidle_reg); 617 v = omap2_clk_readl(clk, dd->autoidle_reg);
618 v &= ~dd->autoidle_mask; 618 v &= ~dd->autoidle_mask;
619 v |= DPLL_AUTOIDLE_DISABLE << __ffs(dd->autoidle_mask); 619 v |= DPLL_AUTOIDLE_DISABLE << __ffs(dd->autoidle_mask);
620 __raw_writel(v, dd->autoidle_reg); 620 omap2_clk_writel(v, clk, dd->autoidle_reg);
621 621
622} 622}
623 623
@@ -639,6 +639,9 @@ unsigned long omap3_clkoutx2_recalc(struct clk_hw *hw,
639 struct clk_hw_omap *pclk = NULL; 639 struct clk_hw_omap *pclk = NULL;
640 struct clk *parent; 640 struct clk *parent;
641 641
642 if (!parent_rate)
643 return 0;
644
642 /* Walk up the parents of clk, looking for a DPLL */ 645 /* Walk up the parents of clk, looking for a DPLL */
643 do { 646 do {
644 do { 647 do {
@@ -660,7 +663,7 @@ unsigned long omap3_clkoutx2_recalc(struct clk_hw *hw,
660 663
661 WARN_ON(!dd->enable_mask); 664 WARN_ON(!dd->enable_mask);
662 665
663 v = __raw_readl(dd->control_reg) & dd->enable_mask; 666 v = omap2_clk_readl(pclk, dd->control_reg) & dd->enable_mask;
664 v >>= __ffs(dd->enable_mask); 667 v >>= __ffs(dd->enable_mask);
665 if ((v != OMAP3XXX_EN_DPLL_LOCKED) || (dd->flags & DPLL_J_TYPE)) 668 if ((v != OMAP3XXX_EN_DPLL_LOCKED) || (dd->flags & DPLL_J_TYPE))
666 rate = parent_rate; 669 rate = parent_rate;
diff --git a/arch/arm/mach-omap2/dpll44xx.c b/arch/arm/mach-omap2/dpll44xx.c
index d28b0f726715..52f9438b92f2 100644
--- a/arch/arm/mach-omap2/dpll44xx.c
+++ b/arch/arm/mach-omap2/dpll44xx.c
@@ -42,7 +42,7 @@ int omap4_dpllmx_gatectrl_read(struct clk_hw_omap *clk)
42 OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK : 42 OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK :
43 OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK; 43 OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK;
44 44
45 v = __raw_readl(clk->clksel_reg); 45 v = omap2_clk_readl(clk, clk->clksel_reg);
46 v &= mask; 46 v &= mask;
47 v >>= __ffs(mask); 47 v >>= __ffs(mask);
48 48
@@ -61,10 +61,10 @@ void omap4_dpllmx_allow_gatectrl(struct clk_hw_omap *clk)
61 OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK : 61 OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK :
62 OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK; 62 OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK;
63 63
64 v = __raw_readl(clk->clksel_reg); 64 v = omap2_clk_readl(clk, clk->clksel_reg);
65 /* Clear the bit to allow gatectrl */ 65 /* Clear the bit to allow gatectrl */
66 v &= ~mask; 66 v &= ~mask;
67 __raw_writel(v, clk->clksel_reg); 67 omap2_clk_writel(v, clk, clk->clksel_reg);
68} 68}
69 69
70void omap4_dpllmx_deny_gatectrl(struct clk_hw_omap *clk) 70void omap4_dpllmx_deny_gatectrl(struct clk_hw_omap *clk)
@@ -79,10 +79,10 @@ void omap4_dpllmx_deny_gatectrl(struct clk_hw_omap *clk)
79 OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK : 79 OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK :
80 OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK; 80 OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK;
81 81
82 v = __raw_readl(clk->clksel_reg); 82 v = omap2_clk_readl(clk, clk->clksel_reg);
83 /* Set the bit to deny gatectrl */ 83 /* Set the bit to deny gatectrl */
84 v |= mask; 84 v |= mask;
85 __raw_writel(v, clk->clksel_reg); 85 omap2_clk_writel(v, clk, clk->clksel_reg);
86} 86}
87 87
88const struct clk_hw_omap_ops clkhwops_omap4_dpllmx = { 88const struct clk_hw_omap_ops clkhwops_omap4_dpllmx = {
@@ -140,7 +140,7 @@ unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw,
140 rate = omap2_get_dpll_rate(clk); 140 rate = omap2_get_dpll_rate(clk);
141 141
142 /* regm4xen adds a multiplier of 4 to DPLL calculations */ 142 /* regm4xen adds a multiplier of 4 to DPLL calculations */
143 v = __raw_readl(dd->control_reg); 143 v = omap2_clk_readl(clk, dd->control_reg);
144 if (v & OMAP4430_DPLL_REGM4XEN_MASK) 144 if (v & OMAP4430_DPLL_REGM4XEN_MASK)
145 rate *= OMAP4430_REGM4XEN_MULT; 145 rate *= OMAP4430_REGM4XEN_MULT;
146 146
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 07b68d5a7940..47381fd8746f 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -55,10 +55,10 @@
55#include "prm44xx.h" 55#include "prm44xx.h"
56 56
57/* 57/*
58 * omap_clk_init: points to a function that does the SoC-specific 58 * omap_clk_soc_init: points to a function that does the SoC-specific
59 * clock initializations 59 * clock initializations
60 */ 60 */
61int (*omap_clk_init)(void); 61static int (*omap_clk_soc_init)(void);
62 62
63/* 63/*
64 * The machine specific code may provide the extra mapping besides the 64 * The machine specific code may provide the extra mapping besides the
@@ -419,7 +419,7 @@ void __init omap2420_init_early(void)
419 omap242x_clockdomains_init(); 419 omap242x_clockdomains_init();
420 omap2420_hwmod_init(); 420 omap2420_hwmod_init();
421 omap_hwmod_init_postsetup(); 421 omap_hwmod_init_postsetup();
422 omap_clk_init = omap2420_clk_init; 422 omap_clk_soc_init = omap2420_clk_init;
423} 423}
424 424
425void __init omap2420_init_late(void) 425void __init omap2420_init_late(void)
@@ -448,7 +448,7 @@ void __init omap2430_init_early(void)
448 omap243x_clockdomains_init(); 448 omap243x_clockdomains_init();
449 omap2430_hwmod_init(); 449 omap2430_hwmod_init();
450 omap_hwmod_init_postsetup(); 450 omap_hwmod_init_postsetup();
451 omap_clk_init = omap2430_clk_init; 451 omap_clk_soc_init = omap2430_clk_init;
452} 452}
453 453
454void __init omap2430_init_late(void) 454void __init omap2430_init_late(void)
@@ -482,27 +482,35 @@ void __init omap3_init_early(void)
482 omap3xxx_clockdomains_init(); 482 omap3xxx_clockdomains_init();
483 omap3xxx_hwmod_init(); 483 omap3xxx_hwmod_init();
484 omap_hwmod_init_postsetup(); 484 omap_hwmod_init_postsetup();
485 omap_clk_init = omap3xxx_clk_init; 485 omap_clk_soc_init = omap3xxx_clk_init;
486} 486}
487 487
488void __init omap3430_init_early(void) 488void __init omap3430_init_early(void)
489{ 489{
490 omap3_init_early(); 490 omap3_init_early();
491 if (of_have_populated_dt())
492 omap_clk_soc_init = omap3430_dt_clk_init;
491} 493}
492 494
493void __init omap35xx_init_early(void) 495void __init omap35xx_init_early(void)
494{ 496{
495 omap3_init_early(); 497 omap3_init_early();
498 if (of_have_populated_dt())
499 omap_clk_soc_init = omap3430_dt_clk_init;
496} 500}
497 501
498void __init omap3630_init_early(void) 502void __init omap3630_init_early(void)
499{ 503{
500 omap3_init_early(); 504 omap3_init_early();
505 if (of_have_populated_dt())
506 omap_clk_soc_init = omap3630_dt_clk_init;
501} 507}
502 508
503void __init am35xx_init_early(void) 509void __init am35xx_init_early(void)
504{ 510{
505 omap3_init_early(); 511 omap3_init_early();
512 if (of_have_populated_dt())
513 omap_clk_soc_init = am35xx_dt_clk_init;
506} 514}
507 515
508void __init ti81xx_init_early(void) 516void __init ti81xx_init_early(void)
@@ -520,7 +528,10 @@ void __init ti81xx_init_early(void)
520 omap3xxx_clockdomains_init(); 528 omap3xxx_clockdomains_init();
521 omap3xxx_hwmod_init(); 529 omap3xxx_hwmod_init();
522 omap_hwmod_init_postsetup(); 530 omap_hwmod_init_postsetup();
523 omap_clk_init = omap3xxx_clk_init; 531 if (of_have_populated_dt())
532 omap_clk_soc_init = ti81xx_dt_clk_init;
533 else
534 omap_clk_soc_init = omap3xxx_clk_init;
524} 535}
525 536
526void __init omap3_init_late(void) 537void __init omap3_init_late(void)
@@ -581,7 +592,7 @@ void __init am33xx_init_early(void)
581 am33xx_clockdomains_init(); 592 am33xx_clockdomains_init();
582 am33xx_hwmod_init(); 593 am33xx_hwmod_init();
583 omap_hwmod_init_postsetup(); 594 omap_hwmod_init_postsetup();
584 omap_clk_init = am33xx_clk_init; 595 omap_clk_soc_init = am33xx_dt_clk_init;
585} 596}
586 597
587void __init am33xx_init_late(void) 598void __init am33xx_init_late(void)
@@ -606,6 +617,7 @@ void __init am43xx_init_early(void)
606 am43xx_clockdomains_init(); 617 am43xx_clockdomains_init();
607 am43xx_hwmod_init(); 618 am43xx_hwmod_init();
608 omap_hwmod_init_postsetup(); 619 omap_hwmod_init_postsetup();
620 omap_clk_soc_init = am43xx_dt_clk_init;
609} 621}
610 622
611void __init am43xx_init_late(void) 623void __init am43xx_init_late(void)
@@ -635,7 +647,7 @@ void __init omap4430_init_early(void)
635 omap44xx_clockdomains_init(); 647 omap44xx_clockdomains_init();
636 omap44xx_hwmod_init(); 648 omap44xx_hwmod_init();
637 omap_hwmod_init_postsetup(); 649 omap_hwmod_init_postsetup();
638 omap_clk_init = omap4xxx_clk_init; 650 omap_clk_soc_init = omap4xxx_dt_clk_init;
639} 651}
640 652
641void __init omap4430_init_late(void) 653void __init omap4430_init_late(void)
@@ -666,6 +678,7 @@ void __init omap5_init_early(void)
666 omap54xx_clockdomains_init(); 678 omap54xx_clockdomains_init();
667 omap54xx_hwmod_init(); 679 omap54xx_hwmod_init();
668 omap_hwmod_init_postsetup(); 680 omap_hwmod_init_postsetup();
681 omap_clk_soc_init = omap5xxx_dt_clk_init;
669} 682}
670 683
671void __init omap5_init_late(void) 684void __init omap5_init_late(void)
@@ -691,6 +704,7 @@ void __init dra7xx_init_early(void)
691 dra7xx_clockdomains_init(); 704 dra7xx_clockdomains_init();
692 dra7xx_hwmod_init(); 705 dra7xx_hwmod_init();
693 omap_hwmod_init_postsetup(); 706 omap_hwmod_init_postsetup();
707 omap_clk_soc_init = dra7xx_dt_clk_init;
694} 708}
695 709
696void __init dra7xx_init_late(void) 710void __init dra7xx_init_late(void)
@@ -710,3 +724,17 @@ void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
710 _omap2_init_reprogram_sdrc(); 724 _omap2_init_reprogram_sdrc();
711 } 725 }
712} 726}
727
728int __init omap_clk_init(void)
729{
730 int ret = 0;
731
732 if (!omap_clk_soc_init)
733 return 0;
734
735 ret = of_prcm_init();
736 if (!ret)
737 ret = omap_clk_soc_init();
738
739 return ret;
740}
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index f7a6fd35b1e4..42d81885c700 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -686,6 +686,8 @@ static struct clockdomain *_get_clkdm(struct omap_hwmod *oh)
686 if (oh->clkdm) { 686 if (oh->clkdm) {
687 return oh->clkdm; 687 return oh->clkdm;
688 } else if (oh->_clk) { 688 } else if (oh->_clk) {
689 if (__clk_get_flags(oh->_clk) & CLK_IS_BASIC)
690 return NULL;
689 clk = to_clk_hw_omap(__clk_get_hw(oh->_clk)); 691 clk = to_clk_hw_omap(__clk_get_hw(oh->_clk));
690 return clk->clkdm; 692 return clk->clkdm;
691 } 693 }
@@ -1576,7 +1578,7 @@ static int _init_clkdm(struct omap_hwmod *oh)
1576 if (!oh->clkdm) { 1578 if (!oh->clkdm) {
1577 pr_warning("omap_hwmod: %s: could not associate to clkdm %s\n", 1579 pr_warning("omap_hwmod: %s: could not associate to clkdm %s\n",
1578 oh->name, oh->clkdm_name); 1580 oh->name, oh->clkdm_name);
1579 return -EINVAL; 1581 return 0;
1580 } 1582 }
1581 1583
1582 pr_debug("omap_hwmod: %s: associated to clkdm %s\n", 1584 pr_debug("omap_hwmod: %s: associated to clkdm %s\n",
@@ -4231,6 +4233,7 @@ void __init omap_hwmod_init(void)
4231 soc_ops.assert_hardreset = _omap2_assert_hardreset; 4233 soc_ops.assert_hardreset = _omap2_assert_hardreset;
4232 soc_ops.deassert_hardreset = _omap2_deassert_hardreset; 4234 soc_ops.deassert_hardreset = _omap2_deassert_hardreset;
4233 soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted; 4235 soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted;
4236 soc_ops.init_clkdm = _init_clkdm;
4234 } else if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) { 4237 } else if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) {
4235 soc_ops.enable_module = _omap4_enable_module; 4238 soc_ops.enable_module = _omap4_enable_module;
4236 soc_ops.disable_module = _omap4_disable_module; 4239 soc_ops.disable_module = _omap4_disable_module;
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index ac25ae6667cf..623db40fdbbd 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -18,6 +18,7 @@
18# ifndef __ASSEMBLER__ 18# ifndef __ASSEMBLER__
19extern void __iomem *prm_base; 19extern void __iomem *prm_base;
20extern void omap2_set_globals_prm(void __iomem *prm); 20extern void omap2_set_globals_prm(void __iomem *prm);
21int of_prcm_init(void);
21# endif 22# endif
22 23
23 24
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index a2e1174ad1b6..b4c4ab9c8044 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -23,6 +23,10 @@
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/of.h>
27#include <linux/of_address.h>
28#include <linux/clk-provider.h>
29#include <linux/clk/ti.h>
26 30
27#include "soc.h" 31#include "soc.h"
28#include "prm2xxx_3xxx.h" 32#include "prm2xxx_3xxx.h"
@@ -30,6 +34,7 @@
30#include "prm3xxx.h" 34#include "prm3xxx.h"
31#include "prm44xx.h" 35#include "prm44xx.h"
32#include "common.h" 36#include "common.h"
37#include "clock.h"
33 38
34/* 39/*
35 * OMAP_PRCM_MAX_NR_PENDING_REG: maximum number of PRM_IRQ*_MPU regs 40 * OMAP_PRCM_MAX_NR_PENDING_REG: maximum number of PRM_IRQ*_MPU regs
@@ -464,3 +469,64 @@ int prm_unregister(struct prm_ll_data *pld)
464 469
465 return 0; 470 return 0;
466} 471}
472
473static struct of_device_id omap_prcm_dt_match_table[] = {
474 { .compatible = "ti,am3-prcm" },
475 { .compatible = "ti,am3-scrm" },
476 { .compatible = "ti,am4-prcm" },
477 { .compatible = "ti,am4-scrm" },
478 { .compatible = "ti,omap3-prm" },
479 { .compatible = "ti,omap3-cm" },
480 { .compatible = "ti,omap3-scrm" },
481 { .compatible = "ti,omap4-cm1" },
482 { .compatible = "ti,omap4-prm" },
483 { .compatible = "ti,omap4-cm2" },
484 { .compatible = "ti,omap4-scrm" },
485 { .compatible = "ti,omap5-prm" },
486 { .compatible = "ti,omap5-cm-core-aon" },
487 { .compatible = "ti,omap5-scrm" },
488 { .compatible = "ti,omap5-cm-core" },
489 { .compatible = "ti,dra7-prm" },
490 { .compatible = "ti,dra7-cm-core-aon" },
491 { .compatible = "ti,dra7-cm-core" },
492 { }
493};
494
495static struct clk_hw_omap memmap_dummy_ck = {
496 .flags = MEMMAP_ADDRESSING,
497};
498
499static u32 prm_clk_readl(void __iomem *reg)
500{
501 return omap2_clk_readl(&memmap_dummy_ck, reg);
502}
503
504static void prm_clk_writel(u32 val, void __iomem *reg)
505{
506 omap2_clk_writel(val, &memmap_dummy_ck, reg);
507}
508
509static struct ti_clk_ll_ops omap_clk_ll_ops = {
510 .clk_readl = prm_clk_readl,
511 .clk_writel = prm_clk_writel,
512};
513
514int __init of_prcm_init(void)
515{
516 struct device_node *np;
517 void __iomem *mem;
518 int memmap_index = 0;
519
520 ti_clk_ll_ops = &omap_clk_ll_ops;
521
522 for_each_matching_node(np, omap_prcm_dt_match_table) {
523 mem = of_iomap(np, 0);
524 clk_memmaps[memmap_index] = mem;
525 ti_dt_clk_init_provider(np, memmap_index);
526 memmap_index++;
527 }
528
529 ti_dt_clockdomains_setup();
530
531 return 0;
532}
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index ec084d158f64..74044aaf438b 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -570,8 +570,7 @@ static inline void __init realtime_counter_init(void)
570 clksrc_nr, clksrc_src, clksrc_prop) \ 570 clksrc_nr, clksrc_src, clksrc_prop) \
571void __init omap##name##_gptimer_timer_init(void) \ 571void __init omap##name##_gptimer_timer_init(void) \
572{ \ 572{ \
573 if (omap_clk_init) \ 573 omap_clk_init(); \
574 omap_clk_init(); \
575 omap_dmtimer_init(); \ 574 omap_dmtimer_init(); \
576 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \ 575 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \
577 omap2_gptimer_clocksource_init((clksrc_nr), clksrc_src, \ 576 omap2_gptimer_clocksource_init((clksrc_nr), clksrc_src, \
@@ -582,8 +581,7 @@ void __init omap##name##_gptimer_timer_init(void) \
582 clksrc_nr, clksrc_src, clksrc_prop) \ 581 clksrc_nr, clksrc_src, clksrc_prop) \
583void __init omap##name##_sync32k_timer_init(void) \ 582void __init omap##name##_sync32k_timer_init(void) \
584{ \ 583{ \
585 if (omap_clk_init) \ 584 omap_clk_init(); \
586 omap_clk_init(); \
587 omap_dmtimer_init(); \ 585 omap_dmtimer_init(); \
588 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \ 586 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \
589 /* Enable the use of clocksource="gp_timer" kernel parameter */ \ 587 /* Enable the use of clocksource="gp_timer" kernel parameter */ \
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
index 0c16e9cdfb87..a367a9831717 100644
--- a/drivers/clk/Makefile
+++ b/drivers/clk/Makefile
@@ -9,45 +9,44 @@ obj-$(CONFIG_COMMON_CLK) += clk-gate.o
9obj-$(CONFIG_COMMON_CLK) += clk-mux.o 9obj-$(CONFIG_COMMON_CLK) += clk-mux.o
10obj-$(CONFIG_COMMON_CLK) += clk-composite.o 10obj-$(CONFIG_COMMON_CLK) += clk-composite.o
11 11
12# SoCs specific 12# hardware specific clock types
13obj-$(CONFIG_ARCH_BCM2835) += clk-bcm2835.o 13# please keep this section sorted lexicographically by file/directory path name
14obj-$(CONFIG_ARCH_EFM32) += clk-efm32gg.o 14obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN) += clk-axi-clkgen.o
15obj-$(CONFIG_ARCH_NOMADIK) += clk-nomadik.o 15obj-$(CONFIG_ARCH_BCM2835) += clk-bcm2835.o
16obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o 16obj-$(CONFIG_ARCH_EFM32) += clk-efm32gg.o
17obj-$(CONFIG_ARCH_HI3xxx) += hisilicon/ 17obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o
18obj-$(CONFIG_ARCH_NSPIRE) += clk-nspire.o 18obj-$(CONFIG_MACH_LOONGSON1) += clk-ls1x.o
19obj-$(CONFIG_ARCH_MXS) += mxs/ 19obj-$(CONFIG_COMMON_CLK_MAX77686) += clk-max77686.o
20obj-$(CONFIG_ARCH_SOCFPGA) += socfpga/ 20obj-$(CONFIG_ARCH_NOMADIK) += clk-nomadik.o
21obj-$(CONFIG_PLAT_SPEAR) += spear/ 21obj-$(CONFIG_ARCH_NSPIRE) += clk-nspire.o
22obj-$(CONFIG_ARCH_U300) += clk-u300.o 22obj-$(CONFIG_CLK_PPC_CORENET) += clk-ppc-corenet.o
23obj-$(CONFIG_COMMON_CLK_VERSATILE) += versatile/ 23obj-$(CONFIG_COMMON_CLK_S2MPS11) += clk-s2mps11.o
24obj-$(CONFIG_COMMON_CLK_QCOM) += qcom/ 24obj-$(CONFIG_COMMON_CLK_SI5351) += clk-si5351.o
25obj-$(CONFIG_PLAT_ORION) += mvebu/ 25obj-$(CONFIG_COMMON_CLK_SI570) += clk-si570.o
26obj-$(CONFIG_CLK_TWL6040) += clk-twl6040.o
27obj-$(CONFIG_ARCH_U300) += clk-u300.o
28obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o
29obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o
30obj-$(CONFIG_COMMON_CLK_XGENE) += clk-xgene.o
31obj-$(CONFIG_COMMON_CLK_AT91) += at91/
32obj-$(CONFIG_ARCH_HI3xxx) += hisilicon/
33obj-$(CONFIG_COMMON_CLK_KEYSTONE) += keystone/
26ifeq ($(CONFIG_COMMON_CLK), y) 34ifeq ($(CONFIG_COMMON_CLK), y)
27obj-$(CONFIG_ARCH_MMP) += mmp/ 35obj-$(CONFIG_ARCH_MMP) += mmp/
28endif 36endif
29obj-$(CONFIG_MACH_LOONGSON1) += clk-ls1x.o 37obj-$(CONFIG_PLAT_ORION) += mvebu/
30obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/ 38obj-$(CONFIG_ARCH_MXS) += mxs/
31obj-$(CONFIG_ARCH_SUNXI) += sunxi/ 39obj-$(CONFIG_COMMON_CLK_QCOM) += qcom/
32obj-$(CONFIG_ARCH_U8500) += ux500/ 40obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/
33obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o 41obj-$(CONFIG_PLAT_SAMSUNG) += samsung/
34obj-$(CONFIG_ARCH_SIRF) += sirf/
35obj-$(CONFIG_ARCH_ZYNQ) += zynq/
36obj-$(CONFIG_ARCH_TEGRA) += tegra/
37obj-$(CONFIG_PLAT_SAMSUNG) += samsung/
38obj-$(CONFIG_COMMON_CLK_XGENE) += clk-xgene.o
39obj-$(CONFIG_COMMON_CLK_KEYSTONE) += keystone/
40obj-$(CONFIG_COMMON_CLK_AT91) += at91/
41obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += shmobile/ 42obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += shmobile/
42 43obj-$(CONFIG_ARCH_SIRF) += sirf/
43obj-$(CONFIG_X86) += x86/ 44obj-$(CONFIG_ARCH_SOCFPGA) += socfpga/
44 45obj-$(CONFIG_PLAT_SPEAR) += spear/
45# Chip specific 46obj-$(CONFIG_ARCH_SUNXI) += sunxi/
46obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN) += clk-axi-clkgen.o 47obj-$(CONFIG_ARCH_TEGRA) += tegra/
47obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o 48obj-$(CONFIG_ARCH_OMAP2PLUS) += ti/
48obj-$(CONFIG_COMMON_CLK_MAX77686) += clk-max77686.o 49obj-$(CONFIG_ARCH_U8500) += ux500/
49obj-$(CONFIG_COMMON_CLK_SI5351) += clk-si5351.o 50obj-$(CONFIG_COMMON_CLK_VERSATILE) += versatile/
50obj-$(CONFIG_COMMON_CLK_SI570) += clk-si570.o 51obj-$(CONFIG_X86) += x86/
51obj-$(CONFIG_COMMON_CLK_S2MPS11) += clk-s2mps11.o 52obj-$(CONFIG_ARCH_ZYNQ) += zynq/
52obj-$(CONFIG_CLK_TWL6040) += clk-twl6040.o
53obj-$(CONFIG_CLK_PPC_CORENET) += clk-ppc-corenet.o
diff --git a/drivers/clk/clk-si5351.c b/drivers/clk/clk-si5351.c
index c50e83744b0a..3b2a66f78755 100644
--- a/drivers/clk/clk-si5351.c
+++ b/drivers/clk/clk-si5351.c
@@ -1111,11 +1111,11 @@ static const struct of_device_id si5351_dt_ids[] = {
1111}; 1111};
1112MODULE_DEVICE_TABLE(of, si5351_dt_ids); 1112MODULE_DEVICE_TABLE(of, si5351_dt_ids);
1113 1113
1114static int si5351_dt_parse(struct i2c_client *client) 1114static int si5351_dt_parse(struct i2c_client *client,
1115 enum si5351_variant variant)
1115{ 1116{
1116 struct device_node *child, *np = client->dev.of_node; 1117 struct device_node *child, *np = client->dev.of_node;
1117 struct si5351_platform_data *pdata; 1118 struct si5351_platform_data *pdata;
1118 const struct of_device_id *match;
1119 struct property *prop; 1119 struct property *prop;
1120 const __be32 *p; 1120 const __be32 *p;
1121 int num = 0; 1121 int num = 0;
@@ -1124,15 +1124,10 @@ static int si5351_dt_parse(struct i2c_client *client)
1124 if (np == NULL) 1124 if (np == NULL)
1125 return 0; 1125 return 0;
1126 1126
1127 match = of_match_node(si5351_dt_ids, np);
1128 if (match == NULL)
1129 return -EINVAL;
1130
1131 pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL); 1127 pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
1132 if (!pdata) 1128 if (!pdata)
1133 return -ENOMEM; 1129 return -ENOMEM;
1134 1130
1135 pdata->variant = (enum si5351_variant)match->data;
1136 pdata->clk_xtal = of_clk_get(np, 0); 1131 pdata->clk_xtal = of_clk_get(np, 0);
1137 if (!IS_ERR(pdata->clk_xtal)) 1132 if (!IS_ERR(pdata->clk_xtal))
1138 clk_put(pdata->clk_xtal); 1133 clk_put(pdata->clk_xtal);
@@ -1163,7 +1158,7 @@ static int si5351_dt_parse(struct i2c_client *client)
1163 pdata->pll_src[num] = SI5351_PLL_SRC_XTAL; 1158 pdata->pll_src[num] = SI5351_PLL_SRC_XTAL;
1164 break; 1159 break;
1165 case 1: 1160 case 1:
1166 if (pdata->variant != SI5351_VARIANT_C) { 1161 if (variant != SI5351_VARIANT_C) {
1167 dev_err(&client->dev, 1162 dev_err(&client->dev,
1168 "invalid parent %d for pll %d\n", 1163 "invalid parent %d for pll %d\n",
1169 val, num); 1164 val, num);
@@ -1187,7 +1182,7 @@ static int si5351_dt_parse(struct i2c_client *client)
1187 } 1182 }
1188 1183
1189 if (num >= 8 || 1184 if (num >= 8 ||
1190 (pdata->variant == SI5351_VARIANT_A3 && num >= 3)) { 1185 (variant == SI5351_VARIANT_A3 && num >= 3)) {
1191 dev_err(&client->dev, "invalid clkout %d\n", num); 1186 dev_err(&client->dev, "invalid clkout %d\n", num);
1192 return -EINVAL; 1187 return -EINVAL;
1193 } 1188 }
@@ -1226,7 +1221,7 @@ static int si5351_dt_parse(struct i2c_client *client)
1226 SI5351_CLKOUT_SRC_XTAL; 1221 SI5351_CLKOUT_SRC_XTAL;
1227 break; 1222 break;
1228 case 3: 1223 case 3:
1229 if (pdata->variant != SI5351_VARIANT_C) { 1224 if (variant != SI5351_VARIANT_C) {
1230 dev_err(&client->dev, 1225 dev_err(&client->dev,
1231 "invalid parent %d for clkout %d\n", 1226 "invalid parent %d for clkout %d\n",
1232 val, num); 1227 val, num);
@@ -1298,7 +1293,7 @@ static int si5351_dt_parse(struct i2c_client *client)
1298 return 0; 1293 return 0;
1299} 1294}
1300#else 1295#else
1301static int si5351_dt_parse(struct i2c_client *client) 1296static int si5351_dt_parse(struct i2c_client *client, enum si5351_variant variant)
1302{ 1297{
1303 return 0; 1298 return 0;
1304} 1299}
@@ -1307,6 +1302,7 @@ static int si5351_dt_parse(struct i2c_client *client)
1307static int si5351_i2c_probe(struct i2c_client *client, 1302static int si5351_i2c_probe(struct i2c_client *client,
1308 const struct i2c_device_id *id) 1303 const struct i2c_device_id *id)
1309{ 1304{
1305 enum si5351_variant variant = (enum si5351_variant)id->driver_data;
1310 struct si5351_platform_data *pdata; 1306 struct si5351_platform_data *pdata;
1311 struct si5351_driver_data *drvdata; 1307 struct si5351_driver_data *drvdata;
1312 struct clk_init_data init; 1308 struct clk_init_data init;
@@ -1315,7 +1311,7 @@ static int si5351_i2c_probe(struct i2c_client *client,
1315 u8 num_parents, num_clocks; 1311 u8 num_parents, num_clocks;
1316 int ret, n; 1312 int ret, n;
1317 1313
1318 ret = si5351_dt_parse(client); 1314 ret = si5351_dt_parse(client, variant);
1319 if (ret) 1315 if (ret)
1320 return ret; 1316 return ret;
1321 1317
@@ -1331,7 +1327,7 @@ static int si5351_i2c_probe(struct i2c_client *client,
1331 1327
1332 i2c_set_clientdata(client, drvdata); 1328 i2c_set_clientdata(client, drvdata);
1333 drvdata->client = client; 1329 drvdata->client = client;
1334 drvdata->variant = pdata->variant; 1330 drvdata->variant = variant;
1335 drvdata->pxtal = pdata->clk_xtal; 1331 drvdata->pxtal = pdata->clk_xtal;
1336 drvdata->pclkin = pdata->clk_clkin; 1332 drvdata->pclkin = pdata->clk_clkin;
1337 1333
@@ -1568,10 +1564,10 @@ static int si5351_i2c_probe(struct i2c_client *client,
1568} 1564}
1569 1565
1570static const struct i2c_device_id si5351_i2c_ids[] = { 1566static const struct i2c_device_id si5351_i2c_ids[] = {
1571 { "si5351a", 0 }, 1567 { "si5351a", SI5351_VARIANT_A },
1572 { "si5351a-msop", 0 }, 1568 { "si5351a-msop", SI5351_VARIANT_A3 },
1573 { "si5351b", 0 }, 1569 { "si5351b", SI5351_VARIANT_B },
1574 { "si5351c", 0 }, 1570 { "si5351c", SI5351_VARIANT_C },
1575 { } 1571 { }
1576}; 1572};
1577MODULE_DEVICE_TABLE(i2c, si5351_i2c_ids); 1573MODULE_DEVICE_TABLE(i2c, si5351_i2c_ids);
diff --git a/drivers/clk/clk-si5351.h b/drivers/clk/clk-si5351.h
index c0dbf2676872..4d0746b50c32 100644
--- a/drivers/clk/clk-si5351.h
+++ b/drivers/clk/clk-si5351.h
@@ -153,4 +153,18 @@
153#define SI5351_XTAL_ENABLE (1<<6) 153#define SI5351_XTAL_ENABLE (1<<6)
154#define SI5351_MULTISYNTH_ENABLE (1<<4) 154#define SI5351_MULTISYNTH_ENABLE (1<<4)
155 155
156/**
157 * enum si5351_variant - SiLabs Si5351 chip variant
158 * @SI5351_VARIANT_A: Si5351A (8 output clocks, XTAL input)
159 * @SI5351_VARIANT_A3: Si5351A MSOP10 (3 output clocks, XTAL input)
160 * @SI5351_VARIANT_B: Si5351B (8 output clocks, XTAL/VXCO input)
161 * @SI5351_VARIANT_C: Si5351C (8 output clocks, XTAL/CLKIN input)
162 */
163enum si5351_variant {
164 SI5351_VARIANT_A = 1,
165 SI5351_VARIANT_A3 = 2,
166 SI5351_VARIANT_B = 3,
167 SI5351_VARIANT_C = 4,
168};
169
156#endif 170#endif
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 2b38dc99063f..5517944495d8 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -575,16 +575,19 @@ struct clk_hw *__clk_get_hw(struct clk *clk)
575{ 575{
576 return !clk ? NULL : clk->hw; 576 return !clk ? NULL : clk->hw;
577} 577}
578EXPORT_SYMBOL_GPL(__clk_get_hw);
578 579
579u8 __clk_get_num_parents(struct clk *clk) 580u8 __clk_get_num_parents(struct clk *clk)
580{ 581{
581 return !clk ? 0 : clk->num_parents; 582 return !clk ? 0 : clk->num_parents;
582} 583}
584EXPORT_SYMBOL_GPL(__clk_get_num_parents);
583 585
584struct clk *__clk_get_parent(struct clk *clk) 586struct clk *__clk_get_parent(struct clk *clk)
585{ 587{
586 return !clk ? NULL : clk->parent; 588 return !clk ? NULL : clk->parent;
587} 589}
590EXPORT_SYMBOL_GPL(__clk_get_parent);
588 591
589struct clk *clk_get_parent_by_index(struct clk *clk, u8 index) 592struct clk *clk_get_parent_by_index(struct clk *clk, u8 index)
590{ 593{
@@ -598,6 +601,7 @@ struct clk *clk_get_parent_by_index(struct clk *clk, u8 index)
598 else 601 else
599 return clk->parents[index]; 602 return clk->parents[index];
600} 603}
604EXPORT_SYMBOL_GPL(clk_get_parent_by_index);
601 605
602unsigned int __clk_get_enable_count(struct clk *clk) 606unsigned int __clk_get_enable_count(struct clk *clk)
603{ 607{
@@ -629,6 +633,7 @@ unsigned long __clk_get_rate(struct clk *clk)
629out: 633out:
630 return ret; 634 return ret;
631} 635}
636EXPORT_SYMBOL_GPL(__clk_get_rate);
632 637
633unsigned long __clk_get_accuracy(struct clk *clk) 638unsigned long __clk_get_accuracy(struct clk *clk)
634{ 639{
@@ -685,6 +690,7 @@ bool __clk_is_enabled(struct clk *clk)
685out: 690out:
686 return !!ret; 691 return !!ret;
687} 692}
693EXPORT_SYMBOL_GPL(__clk_is_enabled);
688 694
689static struct clk *__clk_lookup_subtree(const char *name, struct clk *clk) 695static struct clk *__clk_lookup_subtree(const char *name, struct clk *clk)
690{ 696{
@@ -776,6 +782,7 @@ out:
776 782
777 return best; 783 return best;
778} 784}
785EXPORT_SYMBOL_GPL(__clk_mux_determine_rate);
779 786
780/*** clk api ***/ 787/*** clk api ***/
781 788
@@ -2373,8 +2380,6 @@ struct of_clk_provider {
2373 void *data; 2380 void *data;
2374}; 2381};
2375 2382
2376extern struct of_device_id __clk_of_table[];
2377
2378static const struct of_device_id __clk_of_table_sentinel 2383static const struct of_device_id __clk_of_table_sentinel
2379 __used __section(__clk_of_table_end); 2384 __used __section(__clk_of_table_end);
2380 2385
@@ -2534,7 +2539,7 @@ void __init of_clk_init(const struct of_device_id *matches)
2534 struct device_node *np; 2539 struct device_node *np;
2535 2540
2536 if (!matches) 2541 if (!matches)
2537 matches = __clk_of_table; 2542 matches = &__clk_of_table;
2538 2543
2539 for_each_matching_node_and_match(np, matches, &match) { 2544 for_each_matching_node_and_match(np, matches, &match) {
2540 of_clk_init_cb_t clk_init_cb = match->data; 2545 of_clk_init_cb_t clk_init_cb = match->data;
diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile
index 190d38433202..f60db2ef1aee 100644
--- a/drivers/clk/qcom/Makefile
+++ b/drivers/clk/qcom/Makefile
@@ -1,11 +1,11 @@
1obj-$(CONFIG_COMMON_CLK_QCOM) += clk-qcom.o 1obj-$(CONFIG_COMMON_CLK_QCOM) += clk-qcom.o
2 2
3clk-qcom-$(CONFIG_COMMON_CLK_QCOM) += clk-regmap.o 3clk-qcom-y += clk-regmap.o
4clk-qcom-$(CONFIG_COMMON_CLK_QCOM) += clk-pll.o 4clk-qcom-y += clk-pll.o
5clk-qcom-$(CONFIG_COMMON_CLK_QCOM) += clk-rcg.o 5clk-qcom-y += clk-rcg.o
6clk-qcom-$(CONFIG_COMMON_CLK_QCOM) += clk-rcg2.o 6clk-qcom-y += clk-rcg2.o
7clk-qcom-$(CONFIG_COMMON_CLK_QCOM) += clk-branch.o 7clk-qcom-y += clk-branch.o
8clk-qcom-$(CONFIG_COMMON_CLK_QCOM) += reset.o 8clk-qcom-y += reset.o
9 9
10obj-$(CONFIG_MSM_GCC_8660) += gcc-msm8660.o 10obj-$(CONFIG_MSM_GCC_8660) += gcc-msm8660.o
11obj-$(CONFIG_MSM_GCC_8960) += gcc-msm8960.o 11obj-$(CONFIG_MSM_GCC_8960) += gcc-msm8960.o
diff --git a/drivers/clk/samsung/clk-pll.c b/drivers/clk/samsung/clk-pll.c
index 529e11dc2c6b..81e6d2f49aa0 100644
--- a/drivers/clk/samsung/clk-pll.c
+++ b/drivers/clk/samsung/clk-pll.c
@@ -375,7 +375,7 @@ static int samsung_pll45xx_set_rate(struct clk_hw *hw, unsigned long drate,
375 break; 375 break;
376 default: 376 default:
377 break; 377 break;
378 }; 378 }
379 379
380 /* Set new configuration. */ 380 /* Set new configuration. */
381 __raw_writel(con1, pll->con_reg + 0x4); 381 __raw_writel(con1, pll->con_reg + 0x4);
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index 659e4ea31893..abb6c5ac8a10 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -875,7 +875,7 @@ static void __init sunxi_divs_clk_setup(struct device_node *node,
875 if (!clk_data) 875 if (!clk_data)
876 return; 876 return;
877 877
878 clks = kzalloc(SUNXI_DIVS_MAX_QTY * sizeof(struct clk *), GFP_KERNEL); 878 clks = kzalloc((SUNXI_DIVS_MAX_QTY+1) * sizeof(*clks), GFP_KERNEL);
879 if (!clks) 879 if (!clks)
880 goto free_clkdata; 880 goto free_clkdata;
881 881
diff --git a/drivers/clk/ti/Makefile b/drivers/clk/ti/Makefile
new file mode 100644
index 000000000000..4319d4031aa3
--- /dev/null
+++ b/drivers/clk/ti/Makefile
@@ -0,0 +1,11 @@
1ifneq ($(CONFIG_OF),)
2obj-y += clk.o autoidle.o clockdomain.o
3clk-common = dpll.o composite.o divider.o gate.o \
4 fixed-factor.o mux.o apll.o
5obj-$(CONFIG_SOC_AM33XX) += $(clk-common) clk-33xx.o
6obj-$(CONFIG_ARCH_OMAP3) += $(clk-common) interface.o clk-3xxx.o
7obj-$(CONFIG_ARCH_OMAP4) += $(clk-common) clk-44xx.o
8obj-$(CONFIG_SOC_OMAP5) += $(clk-common) clk-54xx.o
9obj-$(CONFIG_SOC_DRA7XX) += $(clk-common) clk-7xx.o
10obj-$(CONFIG_SOC_AM43XX) += $(clk-common) clk-43xx.o
11endif
diff --git a/drivers/clk/ti/apll.c b/drivers/clk/ti/apll.c
new file mode 100644
index 000000000000..b986f61f5a77
--- /dev/null
+++ b/drivers/clk/ti/apll.c
@@ -0,0 +1,223 @@
1/*
2 * OMAP APLL clock support
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * J Keerthy <j-keerthy@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether express or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#include <linux/clk-provider.h>
19#include <linux/module.h>
20#include <linux/slab.h>
21#include <linux/io.h>
22#include <linux/err.h>
23#include <linux/string.h>
24#include <linux/log2.h>
25#include <linux/of.h>
26#include <linux/of_address.h>
27#include <linux/clk/ti.h>
28#include <linux/delay.h>
29
30#define APLL_FORCE_LOCK 0x1
31#define APLL_AUTO_IDLE 0x2
32#define MAX_APLL_WAIT_TRIES 1000000
33
34#undef pr_fmt
35#define pr_fmt(fmt) "%s: " fmt, __func__
36
37static int dra7_apll_enable(struct clk_hw *hw)
38{
39 struct clk_hw_omap *clk = to_clk_hw_omap(hw);
40 int r = 0, i = 0;
41 struct dpll_data *ad;
42 const char *clk_name;
43 u8 state = 1;
44 u32 v;
45
46 ad = clk->dpll_data;
47 if (!ad)
48 return -EINVAL;
49
50 clk_name = __clk_get_name(clk->hw.clk);
51
52 state <<= __ffs(ad->idlest_mask);
53
54 /* Check is already locked */
55 v = ti_clk_ll_ops->clk_readl(ad->idlest_reg);
56
57 if ((v & ad->idlest_mask) == state)
58 return r;
59
60 v = ti_clk_ll_ops->clk_readl(ad->control_reg);
61 v &= ~ad->enable_mask;
62 v |= APLL_FORCE_LOCK << __ffs(ad->enable_mask);
63 ti_clk_ll_ops->clk_writel(v, ad->control_reg);
64
65 state <<= __ffs(ad->idlest_mask);
66
67 while (1) {
68 v = ti_clk_ll_ops->clk_readl(ad->idlest_reg);
69 if ((v & ad->idlest_mask) == state)
70 break;
71 if (i > MAX_APLL_WAIT_TRIES)
72 break;
73 i++;
74 udelay(1);
75 }
76
77 if (i == MAX_APLL_WAIT_TRIES) {
78 pr_warn("clock: %s failed transition to '%s'\n",
79 clk_name, (state) ? "locked" : "bypassed");
80 } else {
81 pr_debug("clock: %s transition to '%s' in %d loops\n",
82 clk_name, (state) ? "locked" : "bypassed", i);
83
84 r = 0;
85 }
86
87 return r;
88}
89
90static void dra7_apll_disable(struct clk_hw *hw)
91{
92 struct clk_hw_omap *clk = to_clk_hw_omap(hw);
93 struct dpll_data *ad;
94 u8 state = 1;
95 u32 v;
96
97 ad = clk->dpll_data;
98
99 state <<= __ffs(ad->idlest_mask);
100
101 v = ti_clk_ll_ops->clk_readl(ad->control_reg);
102 v &= ~ad->enable_mask;
103 v |= APLL_AUTO_IDLE << __ffs(ad->enable_mask);
104 ti_clk_ll_ops->clk_writel(v, ad->control_reg);
105}
106
107static int dra7_apll_is_enabled(struct clk_hw *hw)
108{
109 struct clk_hw_omap *clk = to_clk_hw_omap(hw);
110 struct dpll_data *ad;
111 u32 v;
112
113 ad = clk->dpll_data;
114
115 v = ti_clk_ll_ops->clk_readl(ad->control_reg);
116 v &= ad->enable_mask;
117
118 v >>= __ffs(ad->enable_mask);
119
120 return v == APLL_AUTO_IDLE ? 0 : 1;
121}
122
123static u8 dra7_init_apll_parent(struct clk_hw *hw)
124{
125 return 0;
126}
127
128static const struct clk_ops apll_ck_ops = {
129 .enable = &dra7_apll_enable,
130 .disable = &dra7_apll_disable,
131 .is_enabled = &dra7_apll_is_enabled,
132 .get_parent = &dra7_init_apll_parent,
133};
134
135static void __init omap_clk_register_apll(struct clk_hw *hw,
136 struct device_node *node)
137{
138 struct clk_hw_omap *clk_hw = to_clk_hw_omap(hw);
139 struct dpll_data *ad = clk_hw->dpll_data;
140 struct clk *clk;
141
142 ad->clk_ref = of_clk_get(node, 0);
143 ad->clk_bypass = of_clk_get(node, 1);
144
145 if (IS_ERR(ad->clk_ref) || IS_ERR(ad->clk_bypass)) {
146 pr_debug("clk-ref or clk-bypass for %s not ready, retry\n",
147 node->name);
148 if (!ti_clk_retry_init(node, hw, omap_clk_register_apll))
149 return;
150
151 goto cleanup;
152 }
153
154 clk = clk_register(NULL, &clk_hw->hw);
155 if (!IS_ERR(clk)) {
156 of_clk_add_provider(node, of_clk_src_simple_get, clk);
157 kfree(clk_hw->hw.init->parent_names);
158 kfree(clk_hw->hw.init);
159 return;
160 }
161
162cleanup:
163 kfree(clk_hw->dpll_data);
164 kfree(clk_hw->hw.init->parent_names);
165 kfree(clk_hw->hw.init);
166 kfree(clk_hw);
167}
168
169static void __init of_dra7_apll_setup(struct device_node *node)
170{
171 struct dpll_data *ad = NULL;
172 struct clk_hw_omap *clk_hw = NULL;
173 struct clk_init_data *init = NULL;
174 const char **parent_names = NULL;
175 int i;
176
177 ad = kzalloc(sizeof(*ad), GFP_KERNEL);
178 clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL);
179 init = kzalloc(sizeof(*init), GFP_KERNEL);
180 if (!ad || !clk_hw || !init)
181 goto cleanup;
182
183 clk_hw->dpll_data = ad;
184 clk_hw->hw.init = init;
185 clk_hw->flags = MEMMAP_ADDRESSING;
186
187 init->name = node->name;
188 init->ops = &apll_ck_ops;
189
190 init->num_parents = of_clk_get_parent_count(node);
191 if (init->num_parents < 1) {
192 pr_err("dra7 apll %s must have parent(s)\n", node->name);
193 goto cleanup;
194 }
195
196 parent_names = kzalloc(sizeof(char *) * init->num_parents, GFP_KERNEL);
197 if (!parent_names)
198 goto cleanup;
199
200 for (i = 0; i < init->num_parents; i++)
201 parent_names[i] = of_clk_get_parent_name(node, i);
202
203 init->parent_names = parent_names;
204
205 ad->control_reg = ti_clk_get_reg_addr(node, 0);
206 ad->idlest_reg = ti_clk_get_reg_addr(node, 1);
207
208 if (!ad->control_reg || !ad->idlest_reg)
209 goto cleanup;
210
211 ad->idlest_mask = 0x1;
212 ad->enable_mask = 0x3;
213
214 omap_clk_register_apll(&clk_hw->hw, node);
215 return;
216
217cleanup:
218 kfree(parent_names);
219 kfree(ad);
220 kfree(clk_hw);
221 kfree(init);
222}
223CLK_OF_DECLARE(dra7_apll_clock, "ti,dra7-apll-clock", of_dra7_apll_setup);
diff --git a/drivers/clk/ti/autoidle.c b/drivers/clk/ti/autoidle.c
new file mode 100644
index 000000000000..8912ff80af34
--- /dev/null
+++ b/drivers/clk/ti/autoidle.c
@@ -0,0 +1,133 @@
1/*
2 * TI clock autoidle support
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * Tero Kristo <t-kristo@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether express or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#include <linux/clk-provider.h>
19#include <linux/slab.h>
20#include <linux/io.h>
21#include <linux/of.h>
22#include <linux/of_address.h>
23#include <linux/clk/ti.h>
24
25struct clk_ti_autoidle {
26 void __iomem *reg;
27 u8 shift;
28 u8 flags;
29 const char *name;
30 struct list_head node;
31};
32
33#define AUTOIDLE_LOW 0x1
34
35static LIST_HEAD(autoidle_clks);
36
37static void ti_allow_autoidle(struct clk_ti_autoidle *clk)
38{
39 u32 val;
40
41 val = ti_clk_ll_ops->clk_readl(clk->reg);
42
43 if (clk->flags & AUTOIDLE_LOW)
44 val &= ~(1 << clk->shift);
45 else
46 val |= (1 << clk->shift);
47
48 ti_clk_ll_ops->clk_writel(val, clk->reg);
49}
50
51static void ti_deny_autoidle(struct clk_ti_autoidle *clk)
52{
53 u32 val;
54
55 val = ti_clk_ll_ops->clk_readl(clk->reg);
56
57 if (clk->flags & AUTOIDLE_LOW)
58 val |= (1 << clk->shift);
59 else
60 val &= ~(1 << clk->shift);
61
62 ti_clk_ll_ops->clk_writel(val, clk->reg);
63}
64
65/**
66 * of_ti_clk_allow_autoidle_all - enable autoidle for all clocks
67 *
68 * Enables hardware autoidle for all registered DT clocks, which have
69 * the feature.
70 */
71void of_ti_clk_allow_autoidle_all(void)
72{
73 struct clk_ti_autoidle *c;
74
75 list_for_each_entry(c, &autoidle_clks, node)
76 ti_allow_autoidle(c);
77}
78
79/**
80 * of_ti_clk_deny_autoidle_all - disable autoidle for all clocks
81 *
82 * Disables hardware autoidle for all registered DT clocks, which have
83 * the feature.
84 */
85void of_ti_clk_deny_autoidle_all(void)
86{
87 struct clk_ti_autoidle *c;
88
89 list_for_each_entry(c, &autoidle_clks, node)
90 ti_deny_autoidle(c);
91}
92
93/**
94 * of_ti_clk_autoidle_setup - sets up hardware autoidle for a clock
95 * @node: pointer to the clock device node
96 *
97 * Checks if a clock has hardware autoidle support or not (check
98 * for presence of 'ti,autoidle-shift' property in the device tree
99 * node) and sets up the hardware autoidle feature for the clock
100 * if available. If autoidle is available, the clock is also added
101 * to the autoidle list for later processing. Returns 0 on success,
102 * negative error value on failure.
103 */
104int __init of_ti_clk_autoidle_setup(struct device_node *node)
105{
106 u32 shift;
107 struct clk_ti_autoidle *clk;
108
109 /* Check if this clock has autoidle support or not */
110 if (of_property_read_u32(node, "ti,autoidle-shift", &shift))
111 return 0;
112
113 clk = kzalloc(sizeof(*clk), GFP_KERNEL);
114
115 if (!clk)
116 return -ENOMEM;
117
118 clk->shift = shift;
119 clk->name = node->name;
120 clk->reg = ti_clk_get_reg_addr(node, 0);
121
122 if (!clk->reg) {
123 kfree(clk);
124 return -EINVAL;
125 }
126
127 if (of_property_read_bool(node, "ti,invert-autoidle-bit"))
128 clk->flags |= AUTOIDLE_LOW;
129
130 list_add(&clk->node, &autoidle_clks);
131
132 return 0;
133}
diff --git a/drivers/clk/ti/clk-33xx.c b/drivers/clk/ti/clk-33xx.c
new file mode 100644
index 000000000000..776ee4594bd4
--- /dev/null
+++ b/drivers/clk/ti/clk-33xx.c
@@ -0,0 +1,161 @@
1/*
2 * AM33XX Clock init
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc
5 * Tero Kristo (t-kristo@ti.com)
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation version 2.
10 *
11 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12 * kind, whether express or implied; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#include <linux/kernel.h>
18#include <linux/list.h>
19#include <linux/clk-provider.h>
20#include <linux/clk/ti.h>
21
22static struct ti_dt_clk am33xx_clks[] = {
23 DT_CLK(NULL, "clk_32768_ck", "clk_32768_ck"),
24 DT_CLK(NULL, "clk_rc32k_ck", "clk_rc32k_ck"),
25 DT_CLK(NULL, "virt_19200000_ck", "virt_19200000_ck"),
26 DT_CLK(NULL, "virt_24000000_ck", "virt_24000000_ck"),
27 DT_CLK(NULL, "virt_25000000_ck", "virt_25000000_ck"),
28 DT_CLK(NULL, "virt_26000000_ck", "virt_26000000_ck"),
29 DT_CLK(NULL, "sys_clkin_ck", "sys_clkin_ck"),
30 DT_CLK(NULL, "tclkin_ck", "tclkin_ck"),
31 DT_CLK(NULL, "dpll_core_ck", "dpll_core_ck"),
32 DT_CLK(NULL, "dpll_core_x2_ck", "dpll_core_x2_ck"),
33 DT_CLK(NULL, "dpll_core_m4_ck", "dpll_core_m4_ck"),
34 DT_CLK(NULL, "dpll_core_m5_ck", "dpll_core_m5_ck"),
35 DT_CLK(NULL, "dpll_core_m6_ck", "dpll_core_m6_ck"),
36 DT_CLK(NULL, "dpll_mpu_ck", "dpll_mpu_ck"),
37 DT_CLK("cpu0", NULL, "dpll_mpu_ck"),
38 DT_CLK(NULL, "dpll_mpu_m2_ck", "dpll_mpu_m2_ck"),
39 DT_CLK(NULL, "dpll_ddr_ck", "dpll_ddr_ck"),
40 DT_CLK(NULL, "dpll_ddr_m2_ck", "dpll_ddr_m2_ck"),
41 DT_CLK(NULL, "dpll_ddr_m2_div2_ck", "dpll_ddr_m2_div2_ck"),
42 DT_CLK(NULL, "dpll_disp_ck", "dpll_disp_ck"),
43 DT_CLK(NULL, "dpll_disp_m2_ck", "dpll_disp_m2_ck"),
44 DT_CLK(NULL, "dpll_per_ck", "dpll_per_ck"),
45 DT_CLK(NULL, "dpll_per_m2_ck", "dpll_per_m2_ck"),
46 DT_CLK(NULL, "dpll_per_m2_div4_wkupdm_ck", "dpll_per_m2_div4_wkupdm_ck"),
47 DT_CLK(NULL, "dpll_per_m2_div4_ck", "dpll_per_m2_div4_ck"),
48 DT_CLK(NULL, "adc_tsc_fck", "adc_tsc_fck"),
49 DT_CLK(NULL, "cefuse_fck", "cefuse_fck"),
50 DT_CLK(NULL, "clkdiv32k_ck", "clkdiv32k_ck"),
51 DT_CLK(NULL, "clkdiv32k_ick", "clkdiv32k_ick"),
52 DT_CLK(NULL, "dcan0_fck", "dcan0_fck"),
53 DT_CLK("481cc000.d_can", NULL, "dcan0_fck"),
54 DT_CLK(NULL, "dcan1_fck", "dcan1_fck"),
55 DT_CLK("481d0000.d_can", NULL, "dcan1_fck"),
56 DT_CLK(NULL, "pruss_ocp_gclk", "pruss_ocp_gclk"),
57 DT_CLK(NULL, "mcasp0_fck", "mcasp0_fck"),
58 DT_CLK(NULL, "mcasp1_fck", "mcasp1_fck"),
59 DT_CLK(NULL, "mmu_fck", "mmu_fck"),
60 DT_CLK(NULL, "smartreflex0_fck", "smartreflex0_fck"),
61 DT_CLK(NULL, "smartreflex1_fck", "smartreflex1_fck"),
62 DT_CLK(NULL, "sha0_fck", "sha0_fck"),
63 DT_CLK(NULL, "aes0_fck", "aes0_fck"),
64 DT_CLK(NULL, "rng_fck", "rng_fck"),
65 DT_CLK(NULL, "timer1_fck", "timer1_fck"),
66 DT_CLK(NULL, "timer2_fck", "timer2_fck"),
67 DT_CLK(NULL, "timer3_fck", "timer3_fck"),
68 DT_CLK(NULL, "timer4_fck", "timer4_fck"),
69 DT_CLK(NULL, "timer5_fck", "timer5_fck"),
70 DT_CLK(NULL, "timer6_fck", "timer6_fck"),
71 DT_CLK(NULL, "timer7_fck", "timer7_fck"),
72 DT_CLK(NULL, "usbotg_fck", "usbotg_fck"),
73 DT_CLK(NULL, "ieee5000_fck", "ieee5000_fck"),
74 DT_CLK(NULL, "wdt1_fck", "wdt1_fck"),
75 DT_CLK(NULL, "l4_rtc_gclk", "l4_rtc_gclk"),
76 DT_CLK(NULL, "l3_gclk", "l3_gclk"),
77 DT_CLK(NULL, "dpll_core_m4_div2_ck", "dpll_core_m4_div2_ck"),
78 DT_CLK(NULL, "l4hs_gclk", "l4hs_gclk"),
79 DT_CLK(NULL, "l3s_gclk", "l3s_gclk"),
80 DT_CLK(NULL, "l4fw_gclk", "l4fw_gclk"),
81 DT_CLK(NULL, "l4ls_gclk", "l4ls_gclk"),
82 DT_CLK(NULL, "clk_24mhz", "clk_24mhz"),
83 DT_CLK(NULL, "sysclk_div_ck", "sysclk_div_ck"),
84 DT_CLK(NULL, "cpsw_125mhz_gclk", "cpsw_125mhz_gclk"),
85 DT_CLK(NULL, "cpsw_cpts_rft_clk", "cpsw_cpts_rft_clk"),
86 DT_CLK(NULL, "gpio0_dbclk_mux_ck", "gpio0_dbclk_mux_ck"),
87 DT_CLK(NULL, "gpio0_dbclk", "gpio0_dbclk"),
88 DT_CLK(NULL, "gpio1_dbclk", "gpio1_dbclk"),
89 DT_CLK(NULL, "gpio2_dbclk", "gpio2_dbclk"),
90 DT_CLK(NULL, "gpio3_dbclk", "gpio3_dbclk"),
91 DT_CLK(NULL, "lcd_gclk", "lcd_gclk"),
92 DT_CLK(NULL, "mmc_clk", "mmc_clk"),
93 DT_CLK(NULL, "gfx_fclk_clksel_ck", "gfx_fclk_clksel_ck"),
94 DT_CLK(NULL, "gfx_fck_div_ck", "gfx_fck_div_ck"),
95 DT_CLK(NULL, "sysclkout_pre_ck", "sysclkout_pre_ck"),
96 DT_CLK(NULL, "clkout2_div_ck", "clkout2_div_ck"),
97 DT_CLK(NULL, "timer_32k_ck", "clkdiv32k_ick"),
98 DT_CLK(NULL, "timer_sys_ck", "sys_clkin_ck"),
99 DT_CLK(NULL, "dbg_sysclk_ck", "dbg_sysclk_ck"),
100 DT_CLK(NULL, "dbg_clka_ck", "dbg_clka_ck"),
101 DT_CLK(NULL, "stm_pmd_clock_mux_ck", "stm_pmd_clock_mux_ck"),
102 DT_CLK(NULL, "trace_pmd_clk_mux_ck", "trace_pmd_clk_mux_ck"),
103 DT_CLK(NULL, "stm_clk_div_ck", "stm_clk_div_ck"),
104 DT_CLK(NULL, "trace_clk_div_ck", "trace_clk_div_ck"),
105 DT_CLK(NULL, "clkout2_ck", "clkout2_ck"),
106 DT_CLK("48300200.ehrpwm", "tbclk", "ehrpwm0_tbclk"),
107 DT_CLK("48302200.ehrpwm", "tbclk", "ehrpwm1_tbclk"),
108 DT_CLK("48304200.ehrpwm", "tbclk", "ehrpwm2_tbclk"),
109 { .node_name = NULL },
110};
111
112static const char *enable_init_clks[] = {
113 "dpll_ddr_m2_ck",
114 "dpll_mpu_m2_ck",
115 "l3_gclk",
116 "l4hs_gclk",
117 "l4fw_gclk",
118 "l4ls_gclk",
119 /* Required for external peripherals like, Audio codecs */
120 "clkout2_ck",
121};
122
123int __init am33xx_dt_clk_init(void)
124{
125 struct clk *clk1, *clk2;
126
127 ti_dt_clocks_register(am33xx_clks);
128
129 omap2_clk_disable_autoidle_all();
130
131 omap2_clk_enable_init_clocks(enable_init_clks,
132 ARRAY_SIZE(enable_init_clks));
133
134 /* TRM ERRATA: Timer 3 & 6 default parent (TCLKIN) may not be always
135 * physically present, in such a case HWMOD enabling of
136 * clock would be failure with default parent. And timer
137 * probe thinks clock is already enabled, this leads to
138 * crash upon accessing timer 3 & 6 registers in probe.
139 * Fix by setting parent of both these timers to master
140 * oscillator clock.
141 */
142
143 clk1 = clk_get_sys(NULL, "sys_clkin_ck");
144 clk2 = clk_get_sys(NULL, "timer3_fck");
145 clk_set_parent(clk2, clk1);
146
147 clk2 = clk_get_sys(NULL, "timer6_fck");
148 clk_set_parent(clk2, clk1);
149 /*
150 * The On-Chip 32K RC Osc clock is not an accurate clock-source as per
151 * the design/spec, so as a result, for example, timer which supposed
152 * to get expired @60Sec, but will expire somewhere ~@40Sec, which is
153 * not expected by any use-case, so change WDT1 clock source to PRCM
154 * 32KHz clock.
155 */
156 clk1 = clk_get_sys(NULL, "wdt1_fck");
157 clk2 = clk_get_sys(NULL, "clkdiv32k_ick");
158 clk_set_parent(clk1, clk2);
159
160 return 0;
161}
diff --git a/drivers/clk/ti/clk-3xxx.c b/drivers/clk/ti/clk-3xxx.c
new file mode 100644
index 000000000000..d3230234f07b
--- /dev/null
+++ b/drivers/clk/ti/clk-3xxx.c
@@ -0,0 +1,401 @@
1/*
2 * OMAP3 Clock init
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc
5 * Tero Kristo (t-kristo@ti.com)
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation version 2.
10 *
11 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12 * kind, whether express or implied; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#include <linux/kernel.h>
18#include <linux/list.h>
19#include <linux/clk-provider.h>
20#include <linux/clk/ti.h>
21
22
23static struct ti_dt_clk omap3xxx_clks[] = {
24 DT_CLK(NULL, "apb_pclk", "dummy_apb_pclk"),
25 DT_CLK(NULL, "omap_32k_fck", "omap_32k_fck"),
26 DT_CLK(NULL, "virt_12m_ck", "virt_12m_ck"),
27 DT_CLK(NULL, "virt_13m_ck", "virt_13m_ck"),
28 DT_CLK(NULL, "virt_19200000_ck", "virt_19200000_ck"),
29 DT_CLK(NULL, "virt_26000000_ck", "virt_26000000_ck"),
30 DT_CLK(NULL, "virt_38_4m_ck", "virt_38_4m_ck"),
31 DT_CLK(NULL, "osc_sys_ck", "osc_sys_ck"),
32 DT_CLK("twl", "fck", "osc_sys_ck"),
33 DT_CLK(NULL, "sys_ck", "sys_ck"),
34 DT_CLK(NULL, "omap_96m_alwon_fck", "omap_96m_alwon_fck"),
35 DT_CLK("etb", "emu_core_alwon_ck", "emu_core_alwon_ck"),
36 DT_CLK(NULL, "sys_altclk", "sys_altclk"),
37 DT_CLK(NULL, "mcbsp_clks", "mcbsp_clks"),
38 DT_CLK(NULL, "sys_clkout1", "sys_clkout1"),
39 DT_CLK(NULL, "dpll1_ck", "dpll1_ck"),
40 DT_CLK(NULL, "dpll1_x2_ck", "dpll1_x2_ck"),
41 DT_CLK(NULL, "dpll1_x2m2_ck", "dpll1_x2m2_ck"),
42 DT_CLK(NULL, "dpll3_ck", "dpll3_ck"),
43 DT_CLK(NULL, "core_ck", "core_ck"),
44 DT_CLK(NULL, "dpll3_x2_ck", "dpll3_x2_ck"),
45 DT_CLK(NULL, "dpll3_m2_ck", "dpll3_m2_ck"),
46 DT_CLK(NULL, "dpll3_m2x2_ck", "dpll3_m2x2_ck"),
47 DT_CLK(NULL, "dpll3_m3_ck", "dpll3_m3_ck"),
48 DT_CLK(NULL, "dpll3_m3x2_ck", "dpll3_m3x2_ck"),
49 DT_CLK(NULL, "dpll4_ck", "dpll4_ck"),
50 DT_CLK(NULL, "dpll4_x2_ck", "dpll4_x2_ck"),
51 DT_CLK(NULL, "omap_96m_fck", "omap_96m_fck"),
52 DT_CLK(NULL, "cm_96m_fck", "cm_96m_fck"),
53 DT_CLK(NULL, "omap_54m_fck", "omap_54m_fck"),
54 DT_CLK(NULL, "omap_48m_fck", "omap_48m_fck"),
55 DT_CLK(NULL, "omap_12m_fck", "omap_12m_fck"),
56 DT_CLK(NULL, "dpll4_m2_ck", "dpll4_m2_ck"),
57 DT_CLK(NULL, "dpll4_m2x2_ck", "dpll4_m2x2_ck"),
58 DT_CLK(NULL, "dpll4_m3_ck", "dpll4_m3_ck"),
59 DT_CLK(NULL, "dpll4_m3x2_ck", "dpll4_m3x2_ck"),
60 DT_CLK(NULL, "dpll4_m4_ck", "dpll4_m4_ck"),
61 DT_CLK(NULL, "dpll4_m4x2_ck", "dpll4_m4x2_ck"),
62 DT_CLK(NULL, "dpll4_m5_ck", "dpll4_m5_ck"),
63 DT_CLK(NULL, "dpll4_m5x2_ck", "dpll4_m5x2_ck"),
64 DT_CLK(NULL, "dpll4_m6_ck", "dpll4_m6_ck"),
65 DT_CLK(NULL, "dpll4_m6x2_ck", "dpll4_m6x2_ck"),
66 DT_CLK("etb", "emu_per_alwon_ck", "emu_per_alwon_ck"),
67 DT_CLK(NULL, "clkout2_src_ck", "clkout2_src_ck"),
68 DT_CLK(NULL, "sys_clkout2", "sys_clkout2"),
69 DT_CLK(NULL, "corex2_fck", "corex2_fck"),
70 DT_CLK(NULL, "dpll1_fck", "dpll1_fck"),
71 DT_CLK(NULL, "mpu_ck", "mpu_ck"),
72 DT_CLK(NULL, "arm_fck", "arm_fck"),
73 DT_CLK("etb", "emu_mpu_alwon_ck", "emu_mpu_alwon_ck"),
74 DT_CLK(NULL, "l3_ick", "l3_ick"),
75 DT_CLK(NULL, "l4_ick", "l4_ick"),
76 DT_CLK(NULL, "rm_ick", "rm_ick"),
77 DT_CLK(NULL, "gpt10_fck", "gpt10_fck"),
78 DT_CLK(NULL, "gpt11_fck", "gpt11_fck"),
79 DT_CLK(NULL, "core_96m_fck", "core_96m_fck"),
80 DT_CLK(NULL, "mmchs2_fck", "mmchs2_fck"),
81 DT_CLK(NULL, "mmchs1_fck", "mmchs1_fck"),
82 DT_CLK(NULL, "i2c3_fck", "i2c3_fck"),
83 DT_CLK(NULL, "i2c2_fck", "i2c2_fck"),
84 DT_CLK(NULL, "i2c1_fck", "i2c1_fck"),
85 DT_CLK(NULL, "mcbsp5_fck", "mcbsp5_fck"),
86 DT_CLK(NULL, "mcbsp1_fck", "mcbsp1_fck"),
87 DT_CLK(NULL, "core_48m_fck", "core_48m_fck"),
88 DT_CLK(NULL, "mcspi4_fck", "mcspi4_fck"),
89 DT_CLK(NULL, "mcspi3_fck", "mcspi3_fck"),
90 DT_CLK(NULL, "mcspi2_fck", "mcspi2_fck"),
91 DT_CLK(NULL, "mcspi1_fck", "mcspi1_fck"),
92 DT_CLK(NULL, "uart2_fck", "uart2_fck"),
93 DT_CLK(NULL, "uart1_fck", "uart1_fck"),
94 DT_CLK(NULL, "core_12m_fck", "core_12m_fck"),
95 DT_CLK("omap_hdq.0", "fck", "hdq_fck"),
96 DT_CLK(NULL, "hdq_fck", "hdq_fck"),
97 DT_CLK(NULL, "core_l3_ick", "core_l3_ick"),
98 DT_CLK(NULL, "sdrc_ick", "sdrc_ick"),
99 DT_CLK(NULL, "gpmc_fck", "gpmc_fck"),
100 DT_CLK(NULL, "core_l4_ick", "core_l4_ick"),
101 DT_CLK("omap_hsmmc.1", "ick", "mmchs2_ick"),
102 DT_CLK("omap_hsmmc.0", "ick", "mmchs1_ick"),
103 DT_CLK(NULL, "mmchs2_ick", "mmchs2_ick"),
104 DT_CLK(NULL, "mmchs1_ick", "mmchs1_ick"),
105 DT_CLK("omap_hdq.0", "ick", "hdq_ick"),
106 DT_CLK(NULL, "hdq_ick", "hdq_ick"),
107 DT_CLK("omap2_mcspi.4", "ick", "mcspi4_ick"),
108 DT_CLK("omap2_mcspi.3", "ick", "mcspi3_ick"),
109 DT_CLK("omap2_mcspi.2", "ick", "mcspi2_ick"),
110 DT_CLK("omap2_mcspi.1", "ick", "mcspi1_ick"),
111 DT_CLK(NULL, "mcspi4_ick", "mcspi4_ick"),
112 DT_CLK(NULL, "mcspi3_ick", "mcspi3_ick"),
113 DT_CLK(NULL, "mcspi2_ick", "mcspi2_ick"),
114 DT_CLK(NULL, "mcspi1_ick", "mcspi1_ick"),
115 DT_CLK("omap_i2c.3", "ick", "i2c3_ick"),
116 DT_CLK("omap_i2c.2", "ick", "i2c2_ick"),
117 DT_CLK("omap_i2c.1", "ick", "i2c1_ick"),
118 DT_CLK(NULL, "i2c3_ick", "i2c3_ick"),
119 DT_CLK(NULL, "i2c2_ick", "i2c2_ick"),
120 DT_CLK(NULL, "i2c1_ick", "i2c1_ick"),
121 DT_CLK(NULL, "uart2_ick", "uart2_ick"),
122 DT_CLK(NULL, "uart1_ick", "uart1_ick"),
123 DT_CLK(NULL, "gpt11_ick", "gpt11_ick"),
124 DT_CLK(NULL, "gpt10_ick", "gpt10_ick"),
125 DT_CLK("omap-mcbsp.5", "ick", "mcbsp5_ick"),
126 DT_CLK("omap-mcbsp.1", "ick", "mcbsp1_ick"),
127 DT_CLK(NULL, "mcbsp5_ick", "mcbsp5_ick"),
128 DT_CLK(NULL, "mcbsp1_ick", "mcbsp1_ick"),
129 DT_CLK(NULL, "omapctrl_ick", "omapctrl_ick"),
130 DT_CLK(NULL, "dss_tv_fck", "dss_tv_fck"),
131 DT_CLK(NULL, "dss_96m_fck", "dss_96m_fck"),
132 DT_CLK(NULL, "dss2_alwon_fck", "dss2_alwon_fck"),
133 DT_CLK(NULL, "utmi_p1_gfclk", "dummy_ck"),
134 DT_CLK(NULL, "utmi_p2_gfclk", "dummy_ck"),
135 DT_CLK(NULL, "xclk60mhsp1_ck", "dummy_ck"),
136 DT_CLK(NULL, "xclk60mhsp2_ck", "dummy_ck"),
137 DT_CLK(NULL, "init_60m_fclk", "dummy_ck"),
138 DT_CLK(NULL, "gpt1_fck", "gpt1_fck"),
139 DT_CLK(NULL, "aes2_ick", "aes2_ick"),
140 DT_CLK(NULL, "wkup_32k_fck", "wkup_32k_fck"),
141 DT_CLK(NULL, "gpio1_dbck", "gpio1_dbck"),
142 DT_CLK(NULL, "sha12_ick", "sha12_ick"),
143 DT_CLK(NULL, "wdt2_fck", "wdt2_fck"),
144 DT_CLK("omap_wdt", "ick", "wdt2_ick"),
145 DT_CLK(NULL, "wdt2_ick", "wdt2_ick"),
146 DT_CLK(NULL, "wdt1_ick", "wdt1_ick"),
147 DT_CLK(NULL, "gpio1_ick", "gpio1_ick"),
148 DT_CLK(NULL, "omap_32ksync_ick", "omap_32ksync_ick"),
149 DT_CLK(NULL, "gpt12_ick", "gpt12_ick"),
150 DT_CLK(NULL, "gpt1_ick", "gpt1_ick"),
151 DT_CLK(NULL, "per_96m_fck", "per_96m_fck"),
152 DT_CLK(NULL, "per_48m_fck", "per_48m_fck"),
153 DT_CLK(NULL, "uart3_fck", "uart3_fck"),
154 DT_CLK(NULL, "gpt2_fck", "gpt2_fck"),
155 DT_CLK(NULL, "gpt3_fck", "gpt3_fck"),
156 DT_CLK(NULL, "gpt4_fck", "gpt4_fck"),
157 DT_CLK(NULL, "gpt5_fck", "gpt5_fck"),
158 DT_CLK(NULL, "gpt6_fck", "gpt6_fck"),
159 DT_CLK(NULL, "gpt7_fck", "gpt7_fck"),
160 DT_CLK(NULL, "gpt8_fck", "gpt8_fck"),
161 DT_CLK(NULL, "gpt9_fck", "gpt9_fck"),
162 DT_CLK(NULL, "per_32k_alwon_fck", "per_32k_alwon_fck"),
163 DT_CLK(NULL, "gpio6_dbck", "gpio6_dbck"),
164 DT_CLK(NULL, "gpio5_dbck", "gpio5_dbck"),
165 DT_CLK(NULL, "gpio4_dbck", "gpio4_dbck"),
166 DT_CLK(NULL, "gpio3_dbck", "gpio3_dbck"),
167 DT_CLK(NULL, "gpio2_dbck", "gpio2_dbck"),
168 DT_CLK(NULL, "wdt3_fck", "wdt3_fck"),
169 DT_CLK(NULL, "per_l4_ick", "per_l4_ick"),
170 DT_CLK(NULL, "gpio6_ick", "gpio6_ick"),
171 DT_CLK(NULL, "gpio5_ick", "gpio5_ick"),
172 DT_CLK(NULL, "gpio4_ick", "gpio4_ick"),
173 DT_CLK(NULL, "gpio3_ick", "gpio3_ick"),
174 DT_CLK(NULL, "gpio2_ick", "gpio2_ick"),
175 DT_CLK(NULL, "wdt3_ick", "wdt3_ick"),
176 DT_CLK(NULL, "uart3_ick", "uart3_ick"),
177 DT_CLK(NULL, "uart4_ick", "uart4_ick"),
178 DT_CLK(NULL, "gpt9_ick", "gpt9_ick"),
179 DT_CLK(NULL, "gpt8_ick", "gpt8_ick"),
180 DT_CLK(NULL, "gpt7_ick", "gpt7_ick"),
181 DT_CLK(NULL, "gpt6_ick", "gpt6_ick"),
182 DT_CLK(NULL, "gpt5_ick", "gpt5_ick"),
183 DT_CLK(NULL, "gpt4_ick", "gpt4_ick"),
184 DT_CLK(NULL, "gpt3_ick", "gpt3_ick"),
185 DT_CLK(NULL, "gpt2_ick", "gpt2_ick"),
186 DT_CLK("omap-mcbsp.2", "ick", "mcbsp2_ick"),
187 DT_CLK("omap-mcbsp.3", "ick", "mcbsp3_ick"),
188 DT_CLK("omap-mcbsp.4", "ick", "mcbsp4_ick"),
189 DT_CLK(NULL, "mcbsp4_ick", "mcbsp2_ick"),
190 DT_CLK(NULL, "mcbsp3_ick", "mcbsp3_ick"),
191 DT_CLK(NULL, "mcbsp2_ick", "mcbsp4_ick"),
192 DT_CLK(NULL, "mcbsp2_fck", "mcbsp2_fck"),
193 DT_CLK(NULL, "mcbsp3_fck", "mcbsp3_fck"),
194 DT_CLK(NULL, "mcbsp4_fck", "mcbsp4_fck"),
195 DT_CLK("etb", "emu_src_ck", "emu_src_ck"),
196 DT_CLK(NULL, "emu_src_ck", "emu_src_ck"),
197 DT_CLK(NULL, "pclk_fck", "pclk_fck"),
198 DT_CLK(NULL, "pclkx2_fck", "pclkx2_fck"),
199 DT_CLK(NULL, "atclk_fck", "atclk_fck"),
200 DT_CLK(NULL, "traceclk_src_fck", "traceclk_src_fck"),
201 DT_CLK(NULL, "traceclk_fck", "traceclk_fck"),
202 DT_CLK(NULL, "secure_32k_fck", "secure_32k_fck"),
203 DT_CLK(NULL, "gpt12_fck", "gpt12_fck"),
204 DT_CLK(NULL, "wdt1_fck", "wdt1_fck"),
205 DT_CLK(NULL, "timer_32k_ck", "omap_32k_fck"),
206 DT_CLK(NULL, "timer_sys_ck", "sys_ck"),
207 DT_CLK(NULL, "cpufreq_ck", "dpll1_ck"),
208 { .node_name = NULL },
209};
210
211static struct ti_dt_clk omap34xx_omap36xx_clks[] = {
212 DT_CLK(NULL, "aes1_ick", "aes1_ick"),
213 DT_CLK("omap_rng", "ick", "rng_ick"),
214 DT_CLK("omap3-rom-rng", "ick", "rng_ick"),
215 DT_CLK(NULL, "sha11_ick", "sha11_ick"),
216 DT_CLK(NULL, "des1_ick", "des1_ick"),
217 DT_CLK(NULL, "cam_mclk", "cam_mclk"),
218 DT_CLK(NULL, "cam_ick", "cam_ick"),
219 DT_CLK(NULL, "csi2_96m_fck", "csi2_96m_fck"),
220 DT_CLK(NULL, "security_l3_ick", "security_l3_ick"),
221 DT_CLK(NULL, "pka_ick", "pka_ick"),
222 DT_CLK(NULL, "icr_ick", "icr_ick"),
223 DT_CLK("omap-aes", "ick", "aes2_ick"),
224 DT_CLK("omap-sham", "ick", "sha12_ick"),
225 DT_CLK(NULL, "des2_ick", "des2_ick"),
226 DT_CLK(NULL, "mspro_ick", "mspro_ick"),
227 DT_CLK(NULL, "mailboxes_ick", "mailboxes_ick"),
228 DT_CLK(NULL, "ssi_l4_ick", "ssi_l4_ick"),
229 DT_CLK(NULL, "sr1_fck", "sr1_fck"),
230 DT_CLK(NULL, "sr2_fck", "sr2_fck"),
231 DT_CLK(NULL, "sr_l4_ick", "sr_l4_ick"),
232 DT_CLK(NULL, "security_l4_ick2", "security_l4_ick2"),
233 DT_CLK(NULL, "wkup_l4_ick", "wkup_l4_ick"),
234 DT_CLK(NULL, "dpll2_fck", "dpll2_fck"),
235 DT_CLK(NULL, "iva2_ck", "iva2_ck"),
236 DT_CLK(NULL, "modem_fck", "modem_fck"),
237 DT_CLK(NULL, "sad2d_ick", "sad2d_ick"),
238 DT_CLK(NULL, "mad2d_ick", "mad2d_ick"),
239 DT_CLK(NULL, "mspro_fck", "mspro_fck"),
240 DT_CLK(NULL, "dpll2_ck", "dpll2_ck"),
241 DT_CLK(NULL, "dpll2_m2_ck", "dpll2_m2_ck"),
242 { .node_name = NULL },
243};
244
245static struct ti_dt_clk omap36xx_omap3430es2plus_clks[] = {
246 DT_CLK(NULL, "ssi_ssr_fck", "ssi_ssr_fck_3430es2"),
247 DT_CLK(NULL, "ssi_sst_fck", "ssi_sst_fck_3430es2"),
248 DT_CLK("musb-omap2430", "ick", "hsotgusb_ick_3430es2"),
249 DT_CLK(NULL, "hsotgusb_ick", "hsotgusb_ick_3430es2"),
250 DT_CLK(NULL, "ssi_ick", "ssi_ick_3430es2"),
251 DT_CLK(NULL, "usim_fck", "usim_fck"),
252 DT_CLK(NULL, "usim_ick", "usim_ick"),
253 { .node_name = NULL },
254};
255
256static struct ti_dt_clk omap3430es1_clks[] = {
257 DT_CLK(NULL, "gfx_l3_ck", "gfx_l3_ck"),
258 DT_CLK(NULL, "gfx_l3_fck", "gfx_l3_fck"),
259 DT_CLK(NULL, "gfx_l3_ick", "gfx_l3_ick"),
260 DT_CLK(NULL, "gfx_cg1_ck", "gfx_cg1_ck"),
261 DT_CLK(NULL, "gfx_cg2_ck", "gfx_cg2_ck"),
262 DT_CLK(NULL, "d2d_26m_fck", "d2d_26m_fck"),
263 DT_CLK(NULL, "fshostusb_fck", "fshostusb_fck"),
264 DT_CLK(NULL, "ssi_ssr_fck", "ssi_ssr_fck_3430es1"),
265 DT_CLK(NULL, "ssi_sst_fck", "ssi_sst_fck_3430es1"),
266 DT_CLK("musb-omap2430", "ick", "hsotgusb_ick_3430es1"),
267 DT_CLK(NULL, "hsotgusb_ick", "hsotgusb_ick_3430es1"),
268 DT_CLK(NULL, "fac_ick", "fac_ick"),
269 DT_CLK(NULL, "ssi_ick", "ssi_ick_3430es1"),
270 DT_CLK(NULL, "usb_l4_ick", "usb_l4_ick"),
271 DT_CLK(NULL, "dss1_alwon_fck", "dss1_alwon_fck_3430es1"),
272 DT_CLK("omapdss_dss", "ick", "dss_ick_3430es1"),
273 DT_CLK(NULL, "dss_ick", "dss_ick_3430es1"),
274 { .node_name = NULL },
275};
276
277static struct ti_dt_clk omap36xx_am35xx_omap3430es2plus_clks[] = {
278 DT_CLK(NULL, "virt_16_8m_ck", "virt_16_8m_ck"),
279 DT_CLK(NULL, "dpll5_ck", "dpll5_ck"),
280 DT_CLK(NULL, "dpll5_m2_ck", "dpll5_m2_ck"),
281 DT_CLK(NULL, "sgx_fck", "sgx_fck"),
282 DT_CLK(NULL, "sgx_ick", "sgx_ick"),
283 DT_CLK(NULL, "cpefuse_fck", "cpefuse_fck"),
284 DT_CLK(NULL, "ts_fck", "ts_fck"),
285 DT_CLK(NULL, "usbtll_fck", "usbtll_fck"),
286 DT_CLK(NULL, "usbtll_ick", "usbtll_ick"),
287 DT_CLK("omap_hsmmc.2", "ick", "mmchs3_ick"),
288 DT_CLK(NULL, "mmchs3_ick", "mmchs3_ick"),
289 DT_CLK(NULL, "mmchs3_fck", "mmchs3_fck"),
290 DT_CLK(NULL, "dss1_alwon_fck", "dss1_alwon_fck_3430es2"),
291 DT_CLK("omapdss_dss", "ick", "dss_ick_3430es2"),
292 DT_CLK(NULL, "dss_ick", "dss_ick_3430es2"),
293 DT_CLK(NULL, "usbhost_120m_fck", "usbhost_120m_fck"),
294 DT_CLK(NULL, "usbhost_48m_fck", "usbhost_48m_fck"),
295 DT_CLK(NULL, "usbhost_ick", "usbhost_ick"),
296 { .node_name = NULL },
297};
298
299static struct ti_dt_clk am35xx_clks[] = {
300 DT_CLK(NULL, "ipss_ick", "ipss_ick"),
301 DT_CLK(NULL, "rmii_ck", "rmii_ck"),
302 DT_CLK(NULL, "pclk_ck", "pclk_ck"),
303 DT_CLK(NULL, "emac_ick", "emac_ick"),
304 DT_CLK(NULL, "emac_fck", "emac_fck"),
305 DT_CLK("davinci_emac.0", NULL, "emac_ick"),
306 DT_CLK("davinci_mdio.0", NULL, "emac_fck"),
307 DT_CLK("vpfe-capture", "master", "vpfe_ick"),
308 DT_CLK("vpfe-capture", "slave", "vpfe_fck"),
309 DT_CLK(NULL, "hsotgusb_ick", "hsotgusb_ick_am35xx"),
310 DT_CLK(NULL, "hsotgusb_fck", "hsotgusb_fck_am35xx"),
311 DT_CLK(NULL, "hecc_ck", "hecc_ck"),
312 DT_CLK(NULL, "uart4_ick", "uart4_ick_am35xx"),
313 DT_CLK(NULL, "uart4_fck", "uart4_fck_am35xx"),
314 { .node_name = NULL },
315};
316
317static struct ti_dt_clk omap36xx_clks[] = {
318 DT_CLK(NULL, "omap_192m_alwon_fck", "omap_192m_alwon_fck"),
319 DT_CLK(NULL, "uart4_fck", "uart4_fck"),
320 { .node_name = NULL },
321};
322
323static const char *enable_init_clks[] = {
324 "sdrc_ick",
325 "gpmc_fck",
326 "omapctrl_ick",
327};
328
329enum {
330 OMAP3_SOC_AM35XX,
331 OMAP3_SOC_OMAP3430_ES1,
332 OMAP3_SOC_OMAP3430_ES2_PLUS,
333 OMAP3_SOC_OMAP3630,
334 OMAP3_SOC_TI81XX,
335};
336
337static int __init omap3xxx_dt_clk_init(int soc_type)
338{
339 if (soc_type == OMAP3_SOC_AM35XX || soc_type == OMAP3_SOC_OMAP3630 ||
340 soc_type == OMAP3_SOC_OMAP3430_ES1 ||
341 soc_type == OMAP3_SOC_OMAP3430_ES2_PLUS)
342 ti_dt_clocks_register(omap3xxx_clks);
343
344 if (soc_type == OMAP3_SOC_AM35XX)
345 ti_dt_clocks_register(am35xx_clks);
346
347 if (soc_type == OMAP3_SOC_OMAP3630 || soc_type == OMAP3_SOC_AM35XX ||
348 soc_type == OMAP3_SOC_OMAP3430_ES2_PLUS)
349 ti_dt_clocks_register(omap36xx_am35xx_omap3430es2plus_clks);
350
351 if (soc_type == OMAP3_SOC_OMAP3430_ES1)
352 ti_dt_clocks_register(omap3430es1_clks);
353
354 if (soc_type == OMAP3_SOC_OMAP3430_ES2_PLUS ||
355 soc_type == OMAP3_SOC_OMAP3630)
356 ti_dt_clocks_register(omap36xx_omap3430es2plus_clks);
357
358 if (soc_type == OMAP3_SOC_OMAP3430_ES1 ||
359 soc_type == OMAP3_SOC_OMAP3430_ES2_PLUS ||
360 soc_type == OMAP3_SOC_OMAP3630)
361 ti_dt_clocks_register(omap34xx_omap36xx_clks);
362
363 if (soc_type == OMAP3_SOC_OMAP3630)
364 ti_dt_clocks_register(omap36xx_clks);
365
366 omap2_clk_disable_autoidle_all();
367
368 omap2_clk_enable_init_clocks(enable_init_clks,
369 ARRAY_SIZE(enable_init_clks));
370
371 pr_info("Clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n",
372 (clk_get_rate(clk_get_sys(NULL, "osc_sys_ck")) / 1000000),
373 (clk_get_rate(clk_get_sys(NULL, "osc_sys_ck")) / 100000) % 10,
374 (clk_get_rate(clk_get_sys(NULL, "core_ck")) / 1000000),
375 (clk_get_rate(clk_get_sys(NULL, "arm_fck")) / 1000000));
376
377 if (soc_type != OMAP3_SOC_TI81XX && soc_type != OMAP3_SOC_OMAP3430_ES1)
378 omap3_clk_lock_dpll5();
379
380 return 0;
381}
382
383int __init omap3430_dt_clk_init(void)
384{
385 return omap3xxx_dt_clk_init(OMAP3_SOC_OMAP3430_ES2_PLUS);
386}
387
388int __init omap3630_dt_clk_init(void)
389{
390 return omap3xxx_dt_clk_init(OMAP3_SOC_OMAP3630);
391}
392
393int __init am35xx_dt_clk_init(void)
394{
395 return omap3xxx_dt_clk_init(OMAP3_SOC_AM35XX);
396}
397
398int __init ti81xx_dt_clk_init(void)
399{
400 return omap3xxx_dt_clk_init(OMAP3_SOC_TI81XX);
401}
diff --git a/drivers/clk/ti/clk-43xx.c b/drivers/clk/ti/clk-43xx.c
new file mode 100644
index 000000000000..67c8de572c50
--- /dev/null
+++ b/drivers/clk/ti/clk-43xx.c
@@ -0,0 +1,118 @@
1/*
2 * AM43XX Clock init
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc
5 * Tero Kristo (t-kristo@ti.com)
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation version 2.
10 *
11 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12 * kind, whether express or implied; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#include <linux/kernel.h>
18#include <linux/list.h>
19#include <linux/clk-provider.h>
20#include <linux/clk/ti.h>
21
22static struct ti_dt_clk am43xx_clks[] = {
23 DT_CLK(NULL, "clk_32768_ck", "clk_32768_ck"),
24 DT_CLK(NULL, "clk_rc32k_ck", "clk_rc32k_ck"),
25 DT_CLK(NULL, "virt_19200000_ck", "virt_19200000_ck"),
26 DT_CLK(NULL, "virt_24000000_ck", "virt_24000000_ck"),
27 DT_CLK(NULL, "virt_25000000_ck", "virt_25000000_ck"),
28 DT_CLK(NULL, "virt_26000000_ck", "virt_26000000_ck"),
29 DT_CLK(NULL, "sys_clkin_ck", "sys_clkin_ck"),
30 DT_CLK(NULL, "tclkin_ck", "tclkin_ck"),
31 DT_CLK(NULL, "dpll_core_ck", "dpll_core_ck"),
32 DT_CLK(NULL, "dpll_core_x2_ck", "dpll_core_x2_ck"),
33 DT_CLK(NULL, "dpll_core_m4_ck", "dpll_core_m4_ck"),
34 DT_CLK(NULL, "dpll_core_m5_ck", "dpll_core_m5_ck"),
35 DT_CLK(NULL, "dpll_core_m6_ck", "dpll_core_m6_ck"),
36 DT_CLK(NULL, "dpll_mpu_ck", "dpll_mpu_ck"),
37 DT_CLK(NULL, "dpll_mpu_m2_ck", "dpll_mpu_m2_ck"),
38 DT_CLK(NULL, "dpll_ddr_ck", "dpll_ddr_ck"),
39 DT_CLK(NULL, "dpll_ddr_m2_ck", "dpll_ddr_m2_ck"),
40 DT_CLK(NULL, "dpll_disp_ck", "dpll_disp_ck"),
41 DT_CLK(NULL, "dpll_disp_m2_ck", "dpll_disp_m2_ck"),
42 DT_CLK(NULL, "dpll_per_ck", "dpll_per_ck"),
43 DT_CLK(NULL, "dpll_per_m2_ck", "dpll_per_m2_ck"),
44 DT_CLK(NULL, "dpll_per_m2_div4_wkupdm_ck", "dpll_per_m2_div4_wkupdm_ck"),
45 DT_CLK(NULL, "dpll_per_m2_div4_ck", "dpll_per_m2_div4_ck"),
46 DT_CLK(NULL, "adc_tsc_fck", "adc_tsc_fck"),
47 DT_CLK(NULL, "clkdiv32k_ck", "clkdiv32k_ck"),
48 DT_CLK(NULL, "clkdiv32k_ick", "clkdiv32k_ick"),
49 DT_CLK(NULL, "dcan0_fck", "dcan0_fck"),
50 DT_CLK(NULL, "dcan1_fck", "dcan1_fck"),
51 DT_CLK(NULL, "pruss_ocp_gclk", "pruss_ocp_gclk"),
52 DT_CLK(NULL, "mcasp0_fck", "mcasp0_fck"),
53 DT_CLK(NULL, "mcasp1_fck", "mcasp1_fck"),
54 DT_CLK(NULL, "smartreflex0_fck", "smartreflex0_fck"),
55 DT_CLK(NULL, "smartreflex1_fck", "smartreflex1_fck"),
56 DT_CLK(NULL, "sha0_fck", "sha0_fck"),
57 DT_CLK(NULL, "aes0_fck", "aes0_fck"),
58 DT_CLK(NULL, "timer1_fck", "timer1_fck"),
59 DT_CLK(NULL, "timer2_fck", "timer2_fck"),
60 DT_CLK(NULL, "timer3_fck", "timer3_fck"),
61 DT_CLK(NULL, "timer4_fck", "timer4_fck"),
62 DT_CLK(NULL, "timer5_fck", "timer5_fck"),
63 DT_CLK(NULL, "timer6_fck", "timer6_fck"),
64 DT_CLK(NULL, "timer7_fck", "timer7_fck"),
65 DT_CLK(NULL, "wdt1_fck", "wdt1_fck"),
66 DT_CLK(NULL, "l3_gclk", "l3_gclk"),
67 DT_CLK(NULL, "dpll_core_m4_div2_ck", "dpll_core_m4_div2_ck"),
68 DT_CLK(NULL, "l4hs_gclk", "l4hs_gclk"),
69 DT_CLK(NULL, "l3s_gclk", "l3s_gclk"),
70 DT_CLK(NULL, "l4ls_gclk", "l4ls_gclk"),
71 DT_CLK(NULL, "clk_24mhz", "clk_24mhz"),
72 DT_CLK(NULL, "cpsw_125mhz_gclk", "cpsw_125mhz_gclk"),
73 DT_CLK(NULL, "cpsw_cpts_rft_clk", "cpsw_cpts_rft_clk"),
74 DT_CLK(NULL, "gpio0_dbclk_mux_ck", "gpio0_dbclk_mux_ck"),
75 DT_CLK(NULL, "gpio0_dbclk", "gpio0_dbclk"),
76 DT_CLK(NULL, "gpio1_dbclk", "gpio1_dbclk"),
77 DT_CLK(NULL, "gpio2_dbclk", "gpio2_dbclk"),
78 DT_CLK(NULL, "gpio3_dbclk", "gpio3_dbclk"),
79 DT_CLK(NULL, "gpio4_dbclk", "gpio4_dbclk"),
80 DT_CLK(NULL, "gpio5_dbclk", "gpio5_dbclk"),
81 DT_CLK(NULL, "mmc_clk", "mmc_clk"),
82 DT_CLK(NULL, "gfx_fclk_clksel_ck", "gfx_fclk_clksel_ck"),
83 DT_CLK(NULL, "gfx_fck_div_ck", "gfx_fck_div_ck"),
84 DT_CLK(NULL, "timer_32k_ck", "clkdiv32k_ick"),
85 DT_CLK(NULL, "timer_sys_ck", "sys_clkin_ck"),
86 DT_CLK(NULL, "sysclk_div", "sysclk_div"),
87 DT_CLK(NULL, "disp_clk", "disp_clk"),
88 DT_CLK(NULL, "clk_32k_mosc_ck", "clk_32k_mosc_ck"),
89 DT_CLK(NULL, "clk_32k_tpm_ck", "clk_32k_tpm_ck"),
90 DT_CLK(NULL, "dpll_extdev_ck", "dpll_extdev_ck"),
91 DT_CLK(NULL, "dpll_extdev_m2_ck", "dpll_extdev_m2_ck"),
92 DT_CLK(NULL, "mux_synctimer32k_ck", "mux_synctimer32k_ck"),
93 DT_CLK(NULL, "synctimer_32kclk", "synctimer_32kclk"),
94 DT_CLK(NULL, "timer8_fck", "timer8_fck"),
95 DT_CLK(NULL, "timer9_fck", "timer9_fck"),
96 DT_CLK(NULL, "timer10_fck", "timer10_fck"),
97 DT_CLK(NULL, "timer11_fck", "timer11_fck"),
98 DT_CLK(NULL, "cpsw_50m_clkdiv", "cpsw_50m_clkdiv"),
99 DT_CLK(NULL, "cpsw_5m_clkdiv", "cpsw_5m_clkdiv"),
100 DT_CLK(NULL, "dpll_ddr_x2_ck", "dpll_ddr_x2_ck"),
101 DT_CLK(NULL, "dpll_ddr_m4_ck", "dpll_ddr_m4_ck"),
102 DT_CLK(NULL, "dpll_per_clkdcoldo", "dpll_per_clkdcoldo"),
103 DT_CLK(NULL, "dll_aging_clk_div", "dll_aging_clk_div"),
104 DT_CLK(NULL, "div_core_25m_ck", "div_core_25m_ck"),
105 DT_CLK(NULL, "func_12m_clk", "func_12m_clk"),
106 DT_CLK(NULL, "vtp_clk_div", "vtp_clk_div"),
107 DT_CLK(NULL, "usbphy_32khz_clkmux", "usbphy_32khz_clkmux"),
108 { .node_name = NULL },
109};
110
111int __init am43xx_dt_clk_init(void)
112{
113 ti_dt_clocks_register(am43xx_clks);
114
115 omap2_clk_disable_autoidle_all();
116
117 return 0;
118}
diff --git a/drivers/clk/ti/clk-44xx.c b/drivers/clk/ti/clk-44xx.c
new file mode 100644
index 000000000000..ae00218b5da3
--- /dev/null
+++ b/drivers/clk/ti/clk-44xx.c
@@ -0,0 +1,316 @@
1/*
2 * OMAP4 Clock init
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * Tero Kristo (t-kristo@ti.com)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/kernel.h>
14#include <linux/list.h>
15#include <linux/clk-private.h>
16#include <linux/clkdev.h>
17#include <linux/clk/ti.h>
18
19/*
20 * OMAP4 ABE DPLL default frequency. In OMAP4460 TRM version V, section
21 * "3.6.3.2.3 CM1_ABE Clock Generator" states that the "DPLL_ABE_X2_CLK
22 * must be set to 196.608 MHz" and hence, the DPLL locked frequency is
23 * half of this value.
24 */
25#define OMAP4_DPLL_ABE_DEFFREQ 98304000
26
27/*
28 * OMAP4 USB DPLL default frequency. In OMAP4430 TRM version V, section
29 * "3.6.3.9.5 DPLL_USB Preferred Settings" shows that the preferred
30 * locked frequency for the USB DPLL is 960MHz.
31 */
32#define OMAP4_DPLL_USB_DEFFREQ 960000000
33
34static struct ti_dt_clk omap44xx_clks[] = {
35 DT_CLK(NULL, "extalt_clkin_ck", "extalt_clkin_ck"),
36 DT_CLK(NULL, "pad_clks_src_ck", "pad_clks_src_ck"),
37 DT_CLK(NULL, "pad_clks_ck", "pad_clks_ck"),
38 DT_CLK(NULL, "pad_slimbus_core_clks_ck", "pad_slimbus_core_clks_ck"),
39 DT_CLK(NULL, "secure_32k_clk_src_ck", "secure_32k_clk_src_ck"),
40 DT_CLK(NULL, "slimbus_src_clk", "slimbus_src_clk"),
41 DT_CLK(NULL, "slimbus_clk", "slimbus_clk"),
42 DT_CLK(NULL, "sys_32k_ck", "sys_32k_ck"),
43 DT_CLK(NULL, "virt_12000000_ck", "virt_12000000_ck"),
44 DT_CLK(NULL, "virt_13000000_ck", "virt_13000000_ck"),
45 DT_CLK(NULL, "virt_16800000_ck", "virt_16800000_ck"),
46 DT_CLK(NULL, "virt_19200000_ck", "virt_19200000_ck"),
47 DT_CLK(NULL, "virt_26000000_ck", "virt_26000000_ck"),
48 DT_CLK(NULL, "virt_27000000_ck", "virt_27000000_ck"),
49 DT_CLK(NULL, "virt_38400000_ck", "virt_38400000_ck"),
50 DT_CLK(NULL, "sys_clkin_ck", "sys_clkin_ck"),
51 DT_CLK(NULL, "tie_low_clock_ck", "tie_low_clock_ck"),
52 DT_CLK(NULL, "utmi_phy_clkout_ck", "utmi_phy_clkout_ck"),
53 DT_CLK(NULL, "xclk60mhsp1_ck", "xclk60mhsp1_ck"),
54 DT_CLK(NULL, "xclk60mhsp2_ck", "xclk60mhsp2_ck"),
55 DT_CLK(NULL, "xclk60motg_ck", "xclk60motg_ck"),
56 DT_CLK(NULL, "abe_dpll_bypass_clk_mux_ck", "abe_dpll_bypass_clk_mux_ck"),
57 DT_CLK(NULL, "abe_dpll_refclk_mux_ck", "abe_dpll_refclk_mux_ck"),
58 DT_CLK(NULL, "dpll_abe_ck", "dpll_abe_ck"),
59 DT_CLK(NULL, "dpll_abe_x2_ck", "dpll_abe_x2_ck"),
60 DT_CLK(NULL, "dpll_abe_m2x2_ck", "dpll_abe_m2x2_ck"),
61 DT_CLK(NULL, "abe_24m_fclk", "abe_24m_fclk"),
62 DT_CLK(NULL, "abe_clk", "abe_clk"),
63 DT_CLK(NULL, "aess_fclk", "aess_fclk"),
64 DT_CLK(NULL, "dpll_abe_m3x2_ck", "dpll_abe_m3x2_ck"),
65 DT_CLK(NULL, "core_hsd_byp_clk_mux_ck", "core_hsd_byp_clk_mux_ck"),
66 DT_CLK(NULL, "dpll_core_ck", "dpll_core_ck"),
67 DT_CLK(NULL, "dpll_core_x2_ck", "dpll_core_x2_ck"),
68 DT_CLK(NULL, "dpll_core_m6x2_ck", "dpll_core_m6x2_ck"),
69 DT_CLK(NULL, "dbgclk_mux_ck", "dbgclk_mux_ck"),
70 DT_CLK(NULL, "dpll_core_m2_ck", "dpll_core_m2_ck"),
71 DT_CLK(NULL, "ddrphy_ck", "ddrphy_ck"),
72 DT_CLK(NULL, "dpll_core_m5x2_ck", "dpll_core_m5x2_ck"),
73 DT_CLK(NULL, "div_core_ck", "div_core_ck"),
74 DT_CLK(NULL, "div_iva_hs_clk", "div_iva_hs_clk"),
75 DT_CLK(NULL, "div_mpu_hs_clk", "div_mpu_hs_clk"),
76 DT_CLK(NULL, "dpll_core_m4x2_ck", "dpll_core_m4x2_ck"),
77 DT_CLK(NULL, "dll_clk_div_ck", "dll_clk_div_ck"),
78 DT_CLK(NULL, "dpll_abe_m2_ck", "dpll_abe_m2_ck"),
79 DT_CLK(NULL, "dpll_core_m3x2_ck", "dpll_core_m3x2_ck"),
80 DT_CLK(NULL, "dpll_core_m7x2_ck", "dpll_core_m7x2_ck"),
81 DT_CLK(NULL, "iva_hsd_byp_clk_mux_ck", "iva_hsd_byp_clk_mux_ck"),
82 DT_CLK(NULL, "dpll_iva_ck", "dpll_iva_ck"),
83 DT_CLK(NULL, "dpll_iva_x2_ck", "dpll_iva_x2_ck"),
84 DT_CLK(NULL, "dpll_iva_m4x2_ck", "dpll_iva_m4x2_ck"),
85 DT_CLK(NULL, "dpll_iva_m5x2_ck", "dpll_iva_m5x2_ck"),
86 DT_CLK(NULL, "dpll_mpu_ck", "dpll_mpu_ck"),
87 DT_CLK(NULL, "dpll_mpu_m2_ck", "dpll_mpu_m2_ck"),
88 DT_CLK(NULL, "per_hs_clk_div_ck", "per_hs_clk_div_ck"),
89 DT_CLK(NULL, "per_hsd_byp_clk_mux_ck", "per_hsd_byp_clk_mux_ck"),
90 DT_CLK(NULL, "dpll_per_ck", "dpll_per_ck"),
91 DT_CLK(NULL, "dpll_per_m2_ck", "dpll_per_m2_ck"),
92 DT_CLK(NULL, "dpll_per_x2_ck", "dpll_per_x2_ck"),
93 DT_CLK(NULL, "dpll_per_m2x2_ck", "dpll_per_m2x2_ck"),
94 DT_CLK(NULL, "dpll_per_m3x2_ck", "dpll_per_m3x2_ck"),
95 DT_CLK(NULL, "dpll_per_m4x2_ck", "dpll_per_m4x2_ck"),
96 DT_CLK(NULL, "dpll_per_m5x2_ck", "dpll_per_m5x2_ck"),
97 DT_CLK(NULL, "dpll_per_m6x2_ck", "dpll_per_m6x2_ck"),
98 DT_CLK(NULL, "dpll_per_m7x2_ck", "dpll_per_m7x2_ck"),
99 DT_CLK(NULL, "usb_hs_clk_div_ck", "usb_hs_clk_div_ck"),
100 DT_CLK(NULL, "dpll_usb_ck", "dpll_usb_ck"),
101 DT_CLK(NULL, "dpll_usb_clkdcoldo_ck", "dpll_usb_clkdcoldo_ck"),
102 DT_CLK(NULL, "dpll_usb_m2_ck", "dpll_usb_m2_ck"),
103 DT_CLK(NULL, "ducati_clk_mux_ck", "ducati_clk_mux_ck"),
104 DT_CLK(NULL, "func_12m_fclk", "func_12m_fclk"),
105 DT_CLK(NULL, "func_24m_clk", "func_24m_clk"),
106 DT_CLK(NULL, "func_24mc_fclk", "func_24mc_fclk"),
107 DT_CLK(NULL, "func_48m_fclk", "func_48m_fclk"),
108 DT_CLK(NULL, "func_48mc_fclk", "func_48mc_fclk"),
109 DT_CLK(NULL, "func_64m_fclk", "func_64m_fclk"),
110 DT_CLK(NULL, "func_96m_fclk", "func_96m_fclk"),
111 DT_CLK(NULL, "init_60m_fclk", "init_60m_fclk"),
112 DT_CLK(NULL, "l3_div_ck", "l3_div_ck"),
113 DT_CLK(NULL, "l4_div_ck", "l4_div_ck"),
114 DT_CLK(NULL, "lp_clk_div_ck", "lp_clk_div_ck"),
115 DT_CLK(NULL, "l4_wkup_clk_mux_ck", "l4_wkup_clk_mux_ck"),
116 DT_CLK("smp_twd", NULL, "mpu_periphclk"),
117 DT_CLK(NULL, "ocp_abe_iclk", "ocp_abe_iclk"),
118 DT_CLK(NULL, "per_abe_24m_fclk", "per_abe_24m_fclk"),
119 DT_CLK(NULL, "per_abe_nc_fclk", "per_abe_nc_fclk"),
120 DT_CLK(NULL, "syc_clk_div_ck", "syc_clk_div_ck"),
121 DT_CLK(NULL, "aes1_fck", "aes1_fck"),
122 DT_CLK(NULL, "aes2_fck", "aes2_fck"),
123 DT_CLK(NULL, "dmic_sync_mux_ck", "dmic_sync_mux_ck"),
124 DT_CLK(NULL, "func_dmic_abe_gfclk", "func_dmic_abe_gfclk"),
125 DT_CLK(NULL, "dss_sys_clk", "dss_sys_clk"),
126 DT_CLK(NULL, "dss_tv_clk", "dss_tv_clk"),
127 DT_CLK(NULL, "dss_dss_clk", "dss_dss_clk"),
128 DT_CLK(NULL, "dss_48mhz_clk", "dss_48mhz_clk"),
129 DT_CLK(NULL, "dss_fck", "dss_fck"),
130 DT_CLK("omapdss_dss", "ick", "dss_fck"),
131 DT_CLK(NULL, "fdif_fck", "fdif_fck"),
132 DT_CLK(NULL, "gpio1_dbclk", "gpio1_dbclk"),
133 DT_CLK(NULL, "gpio2_dbclk", "gpio2_dbclk"),
134 DT_CLK(NULL, "gpio3_dbclk", "gpio3_dbclk"),
135 DT_CLK(NULL, "gpio4_dbclk", "gpio4_dbclk"),
136 DT_CLK(NULL, "gpio5_dbclk", "gpio5_dbclk"),
137 DT_CLK(NULL, "gpio6_dbclk", "gpio6_dbclk"),
138 DT_CLK(NULL, "sgx_clk_mux", "sgx_clk_mux"),
139 DT_CLK(NULL, "hsi_fck", "hsi_fck"),
140 DT_CLK(NULL, "iss_ctrlclk", "iss_ctrlclk"),
141 DT_CLK(NULL, "mcasp_sync_mux_ck", "mcasp_sync_mux_ck"),
142 DT_CLK(NULL, "func_mcasp_abe_gfclk", "func_mcasp_abe_gfclk"),
143 DT_CLK(NULL, "mcbsp1_sync_mux_ck", "mcbsp1_sync_mux_ck"),
144 DT_CLK(NULL, "func_mcbsp1_gfclk", "func_mcbsp1_gfclk"),
145 DT_CLK(NULL, "mcbsp2_sync_mux_ck", "mcbsp2_sync_mux_ck"),
146 DT_CLK(NULL, "func_mcbsp2_gfclk", "func_mcbsp2_gfclk"),
147 DT_CLK(NULL, "mcbsp3_sync_mux_ck", "mcbsp3_sync_mux_ck"),
148 DT_CLK(NULL, "func_mcbsp3_gfclk", "func_mcbsp3_gfclk"),
149 DT_CLK(NULL, "mcbsp4_sync_mux_ck", "mcbsp4_sync_mux_ck"),
150 DT_CLK(NULL, "per_mcbsp4_gfclk", "per_mcbsp4_gfclk"),
151 DT_CLK(NULL, "hsmmc1_fclk", "hsmmc1_fclk"),
152 DT_CLK(NULL, "hsmmc2_fclk", "hsmmc2_fclk"),
153 DT_CLK(NULL, "ocp2scp_usb_phy_phy_48m", "ocp2scp_usb_phy_phy_48m"),
154 DT_CLK(NULL, "sha2md5_fck", "sha2md5_fck"),
155 DT_CLK(NULL, "slimbus1_fclk_1", "slimbus1_fclk_1"),
156 DT_CLK(NULL, "slimbus1_fclk_0", "slimbus1_fclk_0"),
157 DT_CLK(NULL, "slimbus1_fclk_2", "slimbus1_fclk_2"),
158 DT_CLK(NULL, "slimbus1_slimbus_clk", "slimbus1_slimbus_clk"),
159 DT_CLK(NULL, "slimbus2_fclk_1", "slimbus2_fclk_1"),
160 DT_CLK(NULL, "slimbus2_fclk_0", "slimbus2_fclk_0"),
161 DT_CLK(NULL, "slimbus2_slimbus_clk", "slimbus2_slimbus_clk"),
162 DT_CLK(NULL, "smartreflex_core_fck", "smartreflex_core_fck"),
163 DT_CLK(NULL, "smartreflex_iva_fck", "smartreflex_iva_fck"),
164 DT_CLK(NULL, "smartreflex_mpu_fck", "smartreflex_mpu_fck"),
165 DT_CLK(NULL, "dmt1_clk_mux", "dmt1_clk_mux"),
166 DT_CLK(NULL, "cm2_dm10_mux", "cm2_dm10_mux"),
167 DT_CLK(NULL, "cm2_dm11_mux", "cm2_dm11_mux"),
168 DT_CLK(NULL, "cm2_dm2_mux", "cm2_dm2_mux"),
169 DT_CLK(NULL, "cm2_dm3_mux", "cm2_dm3_mux"),
170 DT_CLK(NULL, "cm2_dm4_mux", "cm2_dm4_mux"),
171 DT_CLK(NULL, "timer5_sync_mux", "timer5_sync_mux"),
172 DT_CLK(NULL, "timer6_sync_mux", "timer6_sync_mux"),
173 DT_CLK(NULL, "timer7_sync_mux", "timer7_sync_mux"),
174 DT_CLK(NULL, "timer8_sync_mux", "timer8_sync_mux"),
175 DT_CLK(NULL, "cm2_dm9_mux", "cm2_dm9_mux"),
176 DT_CLK(NULL, "usb_host_fs_fck", "usb_host_fs_fck"),
177 DT_CLK("usbhs_omap", "fs_fck", "usb_host_fs_fck"),
178 DT_CLK(NULL, "utmi_p1_gfclk", "utmi_p1_gfclk"),
179 DT_CLK(NULL, "usb_host_hs_utmi_p1_clk", "usb_host_hs_utmi_p1_clk"),
180 DT_CLK(NULL, "utmi_p2_gfclk", "utmi_p2_gfclk"),
181 DT_CLK(NULL, "usb_host_hs_utmi_p2_clk", "usb_host_hs_utmi_p2_clk"),
182 DT_CLK(NULL, "usb_host_hs_utmi_p3_clk", "usb_host_hs_utmi_p3_clk"),
183 DT_CLK(NULL, "usb_host_hs_hsic480m_p1_clk", "usb_host_hs_hsic480m_p1_clk"),
184 DT_CLK(NULL, "usb_host_hs_hsic60m_p1_clk", "usb_host_hs_hsic60m_p1_clk"),
185 DT_CLK(NULL, "usb_host_hs_hsic60m_p2_clk", "usb_host_hs_hsic60m_p2_clk"),
186 DT_CLK(NULL, "usb_host_hs_hsic480m_p2_clk", "usb_host_hs_hsic480m_p2_clk"),
187 DT_CLK(NULL, "usb_host_hs_func48mclk", "usb_host_hs_func48mclk"),
188 DT_CLK(NULL, "usb_host_hs_fck", "usb_host_hs_fck"),
189 DT_CLK("usbhs_omap", "hs_fck", "usb_host_hs_fck"),
190 DT_CLK(NULL, "otg_60m_gfclk", "otg_60m_gfclk"),
191 DT_CLK(NULL, "usb_otg_hs_xclk", "usb_otg_hs_xclk"),
192 DT_CLK(NULL, "usb_otg_hs_ick", "usb_otg_hs_ick"),
193 DT_CLK("musb-omap2430", "ick", "usb_otg_hs_ick"),
194 DT_CLK(NULL, "usb_phy_cm_clk32k", "usb_phy_cm_clk32k"),
195 DT_CLK(NULL, "usb_tll_hs_usb_ch2_clk", "usb_tll_hs_usb_ch2_clk"),
196 DT_CLK(NULL, "usb_tll_hs_usb_ch0_clk", "usb_tll_hs_usb_ch0_clk"),
197 DT_CLK(NULL, "usb_tll_hs_usb_ch1_clk", "usb_tll_hs_usb_ch1_clk"),
198 DT_CLK(NULL, "usb_tll_hs_ick", "usb_tll_hs_ick"),
199 DT_CLK("usbhs_omap", "usbtll_ick", "usb_tll_hs_ick"),
200 DT_CLK("usbhs_tll", "usbtll_ick", "usb_tll_hs_ick"),
201 DT_CLK(NULL, "usim_ck", "usim_ck"),
202 DT_CLK(NULL, "usim_fclk", "usim_fclk"),
203 DT_CLK(NULL, "pmd_stm_clock_mux_ck", "pmd_stm_clock_mux_ck"),
204 DT_CLK(NULL, "pmd_trace_clk_mux_ck", "pmd_trace_clk_mux_ck"),
205 DT_CLK(NULL, "stm_clk_div_ck", "stm_clk_div_ck"),
206 DT_CLK(NULL, "trace_clk_div_ck", "trace_clk_div_ck"),
207 DT_CLK(NULL, "auxclk0_src_ck", "auxclk0_src_ck"),
208 DT_CLK(NULL, "auxclk0_ck", "auxclk0_ck"),
209 DT_CLK(NULL, "auxclkreq0_ck", "auxclkreq0_ck"),
210 DT_CLK(NULL, "auxclk1_src_ck", "auxclk1_src_ck"),
211 DT_CLK(NULL, "auxclk1_ck", "auxclk1_ck"),
212 DT_CLK(NULL, "auxclkreq1_ck", "auxclkreq1_ck"),
213 DT_CLK(NULL, "auxclk2_src_ck", "auxclk2_src_ck"),
214 DT_CLK(NULL, "auxclk2_ck", "auxclk2_ck"),
215 DT_CLK(NULL, "auxclkreq2_ck", "auxclkreq2_ck"),
216 DT_CLK(NULL, "auxclk3_src_ck", "auxclk3_src_ck"),
217 DT_CLK(NULL, "auxclk3_ck", "auxclk3_ck"),
218 DT_CLK(NULL, "auxclkreq3_ck", "auxclkreq3_ck"),
219 DT_CLK(NULL, "auxclk4_src_ck", "auxclk4_src_ck"),
220 DT_CLK(NULL, "auxclk4_ck", "auxclk4_ck"),
221 DT_CLK(NULL, "auxclkreq4_ck", "auxclkreq4_ck"),
222 DT_CLK(NULL, "auxclk5_src_ck", "auxclk5_src_ck"),
223 DT_CLK(NULL, "auxclk5_ck", "auxclk5_ck"),
224 DT_CLK(NULL, "auxclkreq5_ck", "auxclkreq5_ck"),
225 DT_CLK("50000000.gpmc", "fck", "dummy_ck"),
226 DT_CLK("omap_i2c.1", "ick", "dummy_ck"),
227 DT_CLK("omap_i2c.2", "ick", "dummy_ck"),
228 DT_CLK("omap_i2c.3", "ick", "dummy_ck"),
229 DT_CLK("omap_i2c.4", "ick", "dummy_ck"),
230 DT_CLK(NULL, "mailboxes_ick", "dummy_ck"),
231 DT_CLK("omap_hsmmc.0", "ick", "dummy_ck"),
232 DT_CLK("omap_hsmmc.1", "ick", "dummy_ck"),
233 DT_CLK("omap_hsmmc.2", "ick", "dummy_ck"),
234 DT_CLK("omap_hsmmc.3", "ick", "dummy_ck"),
235 DT_CLK("omap_hsmmc.4", "ick", "dummy_ck"),
236 DT_CLK("omap-mcbsp.1", "ick", "dummy_ck"),
237 DT_CLK("omap-mcbsp.2", "ick", "dummy_ck"),
238 DT_CLK("omap-mcbsp.3", "ick", "dummy_ck"),
239 DT_CLK("omap-mcbsp.4", "ick", "dummy_ck"),
240 DT_CLK("omap2_mcspi.1", "ick", "dummy_ck"),
241 DT_CLK("omap2_mcspi.2", "ick", "dummy_ck"),
242 DT_CLK("omap2_mcspi.3", "ick", "dummy_ck"),
243 DT_CLK("omap2_mcspi.4", "ick", "dummy_ck"),
244 DT_CLK(NULL, "uart1_ick", "dummy_ck"),
245 DT_CLK(NULL, "uart2_ick", "dummy_ck"),
246 DT_CLK(NULL, "uart3_ick", "dummy_ck"),
247 DT_CLK(NULL, "uart4_ick", "dummy_ck"),
248 DT_CLK("usbhs_omap", "usbhost_ick", "dummy_ck"),
249 DT_CLK("usbhs_omap", "usbtll_fck", "dummy_ck"),
250 DT_CLK("usbhs_tll", "usbtll_fck", "dummy_ck"),
251 DT_CLK("omap_wdt", "ick", "dummy_ck"),
252 DT_CLK(NULL, "timer_32k_ck", "sys_32k_ck"),
253 DT_CLK("omap_timer.1", "timer_sys_ck", "sys_clkin_ck"),
254 DT_CLK("omap_timer.2", "timer_sys_ck", "sys_clkin_ck"),
255 DT_CLK("omap_timer.3", "timer_sys_ck", "sys_clkin_ck"),
256 DT_CLK("omap_timer.4", "timer_sys_ck", "sys_clkin_ck"),
257 DT_CLK("omap_timer.9", "timer_sys_ck", "sys_clkin_ck"),
258 DT_CLK("omap_timer.10", "timer_sys_ck", "sys_clkin_ck"),
259 DT_CLK("omap_timer.11", "timer_sys_ck", "sys_clkin_ck"),
260 DT_CLK("omap_timer.5", "timer_sys_ck", "syc_clk_div_ck"),
261 DT_CLK("omap_timer.6", "timer_sys_ck", "syc_clk_div_ck"),
262 DT_CLK("omap_timer.7", "timer_sys_ck", "syc_clk_div_ck"),
263 DT_CLK("omap_timer.8", "timer_sys_ck", "syc_clk_div_ck"),
264 DT_CLK("4a318000.timer", "timer_sys_ck", "sys_clkin_ck"),
265 DT_CLK("48032000.timer", "timer_sys_ck", "sys_clkin_ck"),
266 DT_CLK("48034000.timer", "timer_sys_ck", "sys_clkin_ck"),
267 DT_CLK("48036000.timer", "timer_sys_ck", "sys_clkin_ck"),
268 DT_CLK("4803e000.timer", "timer_sys_ck", "sys_clkin_ck"),
269 DT_CLK("48086000.timer", "timer_sys_ck", "sys_clkin_ck"),
270 DT_CLK("48088000.timer", "timer_sys_ck", "sys_clkin_ck"),
271 DT_CLK("40138000.timer", "timer_sys_ck", "syc_clk_div_ck"),
272 DT_CLK("4013a000.timer", "timer_sys_ck", "syc_clk_div_ck"),
273 DT_CLK("4013c000.timer", "timer_sys_ck", "syc_clk_div_ck"),
274 DT_CLK("4013e000.timer", "timer_sys_ck", "syc_clk_div_ck"),
275 DT_CLK(NULL, "cpufreq_ck", "dpll_mpu_ck"),
276 DT_CLK(NULL, "bandgap_fclk", "bandgap_fclk"),
277 DT_CLK(NULL, "div_ts_ck", "div_ts_ck"),
278 DT_CLK(NULL, "bandgap_ts_fclk", "bandgap_ts_fclk"),
279 { .node_name = NULL },
280};
281
282int __init omap4xxx_dt_clk_init(void)
283{
284 int rc;
285 struct clk *abe_dpll_ref, *abe_dpll, *sys_32k_ck, *usb_dpll;
286
287 ti_dt_clocks_register(omap44xx_clks);
288
289 omap2_clk_disable_autoidle_all();
290
291 /*
292 * Lock USB DPLL on OMAP4 devices so that the L3INIT power
293 * domain can transition to retention state when not in use.
294 */
295 usb_dpll = clk_get_sys(NULL, "dpll_usb_ck");
296 rc = clk_set_rate(usb_dpll, OMAP4_DPLL_USB_DEFFREQ);
297 if (rc)
298 pr_err("%s: failed to configure USB DPLL!\n", __func__);
299
300 /*
301 * On OMAP4460 the ABE DPLL fails to turn on if in idle low-power
302 * state when turning the ABE clock domain. Workaround this by
303 * locking the ABE DPLL on boot.
304 * Lock the ABE DPLL in any case to avoid issues with audio.
305 */
306 abe_dpll_ref = clk_get_sys(NULL, "abe_dpll_refclk_mux_ck");
307 sys_32k_ck = clk_get_sys(NULL, "sys_32k_ck");
308 rc = clk_set_parent(abe_dpll_ref, sys_32k_ck);
309 abe_dpll = clk_get_sys(NULL, "dpll_abe_ck");
310 if (!rc)
311 rc = clk_set_rate(abe_dpll, OMAP4_DPLL_ABE_DEFFREQ);
312 if (rc)
313 pr_err("%s: failed to configure ABE DPLL!\n", __func__);
314
315 return 0;
316}
diff --git a/drivers/clk/ti/clk-54xx.c b/drivers/clk/ti/clk-54xx.c
new file mode 100644
index 000000000000..0ef9f581286b
--- /dev/null
+++ b/drivers/clk/ti/clk-54xx.c
@@ -0,0 +1,255 @@
1/*
2 * OMAP5 Clock init
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * Tero Kristo (t-kristo@ti.com)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/kernel.h>
14#include <linux/list.h>
15#include <linux/clk-private.h>
16#include <linux/clkdev.h>
17#include <linux/io.h>
18#include <linux/clk/ti.h>
19
20#define OMAP5_DPLL_ABE_DEFFREQ 98304000
21
22/*
23 * OMAP543x TRM, section "3.6.3.9.5 DPLL_USB Preferred Settings"
24 * states it must be at 960MHz
25 */
26#define OMAP5_DPLL_USB_DEFFREQ 960000000
27
28static struct ti_dt_clk omap54xx_clks[] = {
29 DT_CLK(NULL, "pad_clks_src_ck", "pad_clks_src_ck"),
30 DT_CLK(NULL, "pad_clks_ck", "pad_clks_ck"),
31 DT_CLK(NULL, "secure_32k_clk_src_ck", "secure_32k_clk_src_ck"),
32 DT_CLK(NULL, "slimbus_src_clk", "slimbus_src_clk"),
33 DT_CLK(NULL, "slimbus_clk", "slimbus_clk"),
34 DT_CLK(NULL, "sys_32k_ck", "sys_32k_ck"),
35 DT_CLK(NULL, "virt_12000000_ck", "virt_12000000_ck"),
36 DT_CLK(NULL, "virt_13000000_ck", "virt_13000000_ck"),
37 DT_CLK(NULL, "virt_16800000_ck", "virt_16800000_ck"),
38 DT_CLK(NULL, "virt_19200000_ck", "virt_19200000_ck"),
39 DT_CLK(NULL, "virt_26000000_ck", "virt_26000000_ck"),
40 DT_CLK(NULL, "virt_27000000_ck", "virt_27000000_ck"),
41 DT_CLK(NULL, "virt_38400000_ck", "virt_38400000_ck"),
42 DT_CLK(NULL, "sys_clkin", "sys_clkin"),
43 DT_CLK(NULL, "xclk60mhsp1_ck", "xclk60mhsp1_ck"),
44 DT_CLK(NULL, "xclk60mhsp2_ck", "xclk60mhsp2_ck"),
45 DT_CLK(NULL, "abe_dpll_bypass_clk_mux", "abe_dpll_bypass_clk_mux"),
46 DT_CLK(NULL, "abe_dpll_clk_mux", "abe_dpll_clk_mux"),
47 DT_CLK(NULL, "dpll_abe_ck", "dpll_abe_ck"),
48 DT_CLK(NULL, "dpll_abe_x2_ck", "dpll_abe_x2_ck"),
49 DT_CLK(NULL, "dpll_abe_m2x2_ck", "dpll_abe_m2x2_ck"),
50 DT_CLK(NULL, "abe_24m_fclk", "abe_24m_fclk"),
51 DT_CLK(NULL, "abe_clk", "abe_clk"),
52 DT_CLK(NULL, "abe_iclk", "abe_iclk"),
53 DT_CLK(NULL, "abe_lp_clk_div", "abe_lp_clk_div"),
54 DT_CLK(NULL, "dpll_abe_m3x2_ck", "dpll_abe_m3x2_ck"),
55 DT_CLK(NULL, "dpll_core_ck", "dpll_core_ck"),
56 DT_CLK(NULL, "dpll_core_x2_ck", "dpll_core_x2_ck"),
57 DT_CLK(NULL, "dpll_core_h21x2_ck", "dpll_core_h21x2_ck"),
58 DT_CLK(NULL, "c2c_fclk", "c2c_fclk"),
59 DT_CLK(NULL, "c2c_iclk", "c2c_iclk"),
60 DT_CLK(NULL, "custefuse_sys_gfclk_div", "custefuse_sys_gfclk_div"),
61 DT_CLK(NULL, "dpll_core_h11x2_ck", "dpll_core_h11x2_ck"),
62 DT_CLK(NULL, "dpll_core_h12x2_ck", "dpll_core_h12x2_ck"),
63 DT_CLK(NULL, "dpll_core_h13x2_ck", "dpll_core_h13x2_ck"),
64 DT_CLK(NULL, "dpll_core_h14x2_ck", "dpll_core_h14x2_ck"),
65 DT_CLK(NULL, "dpll_core_h22x2_ck", "dpll_core_h22x2_ck"),
66 DT_CLK(NULL, "dpll_core_h23x2_ck", "dpll_core_h23x2_ck"),
67 DT_CLK(NULL, "dpll_core_h24x2_ck", "dpll_core_h24x2_ck"),
68 DT_CLK(NULL, "dpll_core_m2_ck", "dpll_core_m2_ck"),
69 DT_CLK(NULL, "dpll_core_m3x2_ck", "dpll_core_m3x2_ck"),
70 DT_CLK(NULL, "iva_dpll_hs_clk_div", "iva_dpll_hs_clk_div"),
71 DT_CLK(NULL, "dpll_iva_ck", "dpll_iva_ck"),
72 DT_CLK(NULL, "dpll_iva_x2_ck", "dpll_iva_x2_ck"),
73 DT_CLK(NULL, "dpll_iva_h11x2_ck", "dpll_iva_h11x2_ck"),
74 DT_CLK(NULL, "dpll_iva_h12x2_ck", "dpll_iva_h12x2_ck"),
75 DT_CLK(NULL, "mpu_dpll_hs_clk_div", "mpu_dpll_hs_clk_div"),
76 DT_CLK(NULL, "dpll_mpu_ck", "dpll_mpu_ck"),
77 DT_CLK(NULL, "dpll_mpu_m2_ck", "dpll_mpu_m2_ck"),
78 DT_CLK(NULL, "per_dpll_hs_clk_div", "per_dpll_hs_clk_div"),
79 DT_CLK(NULL, "dpll_per_ck", "dpll_per_ck"),
80 DT_CLK(NULL, "dpll_per_x2_ck", "dpll_per_x2_ck"),
81 DT_CLK(NULL, "dpll_per_h11x2_ck", "dpll_per_h11x2_ck"),
82 DT_CLK(NULL, "dpll_per_h12x2_ck", "dpll_per_h12x2_ck"),
83 DT_CLK(NULL, "dpll_per_h14x2_ck", "dpll_per_h14x2_ck"),
84 DT_CLK(NULL, "dpll_per_m2_ck", "dpll_per_m2_ck"),
85 DT_CLK(NULL, "dpll_per_m2x2_ck", "dpll_per_m2x2_ck"),
86 DT_CLK(NULL, "dpll_per_m3x2_ck", "dpll_per_m3x2_ck"),
87 DT_CLK(NULL, "dpll_unipro1_ck", "dpll_unipro1_ck"),
88 DT_CLK(NULL, "dpll_unipro1_clkdcoldo", "dpll_unipro1_clkdcoldo"),
89 DT_CLK(NULL, "dpll_unipro1_m2_ck", "dpll_unipro1_m2_ck"),
90 DT_CLK(NULL, "dpll_unipro2_ck", "dpll_unipro2_ck"),
91 DT_CLK(NULL, "dpll_unipro2_clkdcoldo", "dpll_unipro2_clkdcoldo"),
92 DT_CLK(NULL, "dpll_unipro2_m2_ck", "dpll_unipro2_m2_ck"),
93 DT_CLK(NULL, "usb_dpll_hs_clk_div", "usb_dpll_hs_clk_div"),
94 DT_CLK(NULL, "dpll_usb_ck", "dpll_usb_ck"),
95 DT_CLK(NULL, "dpll_usb_clkdcoldo", "dpll_usb_clkdcoldo"),
96 DT_CLK(NULL, "dpll_usb_m2_ck", "dpll_usb_m2_ck"),
97 DT_CLK(NULL, "dss_syc_gfclk_div", "dss_syc_gfclk_div"),
98 DT_CLK(NULL, "func_128m_clk", "func_128m_clk"),
99 DT_CLK(NULL, "func_12m_fclk", "func_12m_fclk"),
100 DT_CLK(NULL, "func_24m_clk", "func_24m_clk"),
101 DT_CLK(NULL, "func_48m_fclk", "func_48m_fclk"),
102 DT_CLK(NULL, "func_96m_fclk", "func_96m_fclk"),
103 DT_CLK(NULL, "l3_iclk_div", "l3_iclk_div"),
104 DT_CLK(NULL, "gpu_l3_iclk", "gpu_l3_iclk"),
105 DT_CLK(NULL, "l3init_60m_fclk", "l3init_60m_fclk"),
106 DT_CLK(NULL, "wkupaon_iclk_mux", "wkupaon_iclk_mux"),
107 DT_CLK(NULL, "l3instr_ts_gclk_div", "l3instr_ts_gclk_div"),
108 DT_CLK(NULL, "l4_root_clk_div", "l4_root_clk_div"),
109 DT_CLK(NULL, "dss_32khz_clk", "dss_32khz_clk"),
110 DT_CLK(NULL, "dss_48mhz_clk", "dss_48mhz_clk"),
111 DT_CLK(NULL, "dss_dss_clk", "dss_dss_clk"),
112 DT_CLK(NULL, "dss_sys_clk", "dss_sys_clk"),
113 DT_CLK(NULL, "gpio1_dbclk", "gpio1_dbclk"),
114 DT_CLK(NULL, "gpio2_dbclk", "gpio2_dbclk"),
115 DT_CLK(NULL, "gpio3_dbclk", "gpio3_dbclk"),
116 DT_CLK(NULL, "gpio4_dbclk", "gpio4_dbclk"),
117 DT_CLK(NULL, "gpio5_dbclk", "gpio5_dbclk"),
118 DT_CLK(NULL, "gpio6_dbclk", "gpio6_dbclk"),
119 DT_CLK(NULL, "gpio7_dbclk", "gpio7_dbclk"),
120 DT_CLK(NULL, "gpio8_dbclk", "gpio8_dbclk"),
121 DT_CLK(NULL, "iss_ctrlclk", "iss_ctrlclk"),
122 DT_CLK(NULL, "lli_txphy_clk", "lli_txphy_clk"),
123 DT_CLK(NULL, "lli_txphy_ls_clk", "lli_txphy_ls_clk"),
124 DT_CLK(NULL, "mmc1_32khz_clk", "mmc1_32khz_clk"),
125 DT_CLK(NULL, "sata_ref_clk", "sata_ref_clk"),
126 DT_CLK(NULL, "slimbus1_slimbus_clk", "slimbus1_slimbus_clk"),
127 DT_CLK(NULL, "usb_host_hs_hsic480m_p1_clk", "usb_host_hs_hsic480m_p1_clk"),
128 DT_CLK(NULL, "usb_host_hs_hsic480m_p2_clk", "usb_host_hs_hsic480m_p2_clk"),
129 DT_CLK(NULL, "usb_host_hs_hsic480m_p3_clk", "usb_host_hs_hsic480m_p3_clk"),
130 DT_CLK(NULL, "usb_host_hs_hsic60m_p1_clk", "usb_host_hs_hsic60m_p1_clk"),
131 DT_CLK(NULL, "usb_host_hs_hsic60m_p2_clk", "usb_host_hs_hsic60m_p2_clk"),
132 DT_CLK(NULL, "usb_host_hs_hsic60m_p3_clk", "usb_host_hs_hsic60m_p3_clk"),
133 DT_CLK(NULL, "usb_host_hs_utmi_p1_clk", "usb_host_hs_utmi_p1_clk"),
134 DT_CLK(NULL, "usb_host_hs_utmi_p2_clk", "usb_host_hs_utmi_p2_clk"),
135 DT_CLK(NULL, "usb_host_hs_utmi_p3_clk", "usb_host_hs_utmi_p3_clk"),
136 DT_CLK(NULL, "usb_otg_ss_refclk960m", "usb_otg_ss_refclk960m"),
137 DT_CLK(NULL, "usb_phy_cm_clk32k", "usb_phy_cm_clk32k"),
138 DT_CLK(NULL, "usb_tll_hs_usb_ch0_clk", "usb_tll_hs_usb_ch0_clk"),
139 DT_CLK(NULL, "usb_tll_hs_usb_ch1_clk", "usb_tll_hs_usb_ch1_clk"),
140 DT_CLK(NULL, "usb_tll_hs_usb_ch2_clk", "usb_tll_hs_usb_ch2_clk"),
141 DT_CLK(NULL, "aess_fclk", "aess_fclk"),
142 DT_CLK(NULL, "dmic_sync_mux_ck", "dmic_sync_mux_ck"),
143 DT_CLK(NULL, "dmic_gfclk", "dmic_gfclk"),
144 DT_CLK(NULL, "fdif_fclk", "fdif_fclk"),
145 DT_CLK(NULL, "gpu_core_gclk_mux", "gpu_core_gclk_mux"),
146 DT_CLK(NULL, "gpu_hyd_gclk_mux", "gpu_hyd_gclk_mux"),
147 DT_CLK(NULL, "hsi_fclk", "hsi_fclk"),
148 DT_CLK(NULL, "mcasp_sync_mux_ck", "mcasp_sync_mux_ck"),
149 DT_CLK(NULL, "mcasp_gfclk", "mcasp_gfclk"),
150 DT_CLK(NULL, "mcbsp1_sync_mux_ck", "mcbsp1_sync_mux_ck"),
151 DT_CLK(NULL, "mcbsp1_gfclk", "mcbsp1_gfclk"),
152 DT_CLK(NULL, "mcbsp2_sync_mux_ck", "mcbsp2_sync_mux_ck"),
153 DT_CLK(NULL, "mcbsp2_gfclk", "mcbsp2_gfclk"),
154 DT_CLK(NULL, "mcbsp3_sync_mux_ck", "mcbsp3_sync_mux_ck"),
155 DT_CLK(NULL, "mcbsp3_gfclk", "mcbsp3_gfclk"),
156 DT_CLK(NULL, "mmc1_fclk_mux", "mmc1_fclk_mux"),
157 DT_CLK(NULL, "mmc1_fclk", "mmc1_fclk"),
158 DT_CLK(NULL, "mmc2_fclk_mux", "mmc2_fclk_mux"),
159 DT_CLK(NULL, "mmc2_fclk", "mmc2_fclk"),
160 DT_CLK(NULL, "timer10_gfclk_mux", "timer10_gfclk_mux"),
161 DT_CLK(NULL, "timer11_gfclk_mux", "timer11_gfclk_mux"),
162 DT_CLK(NULL, "timer1_gfclk_mux", "timer1_gfclk_mux"),
163 DT_CLK(NULL, "timer2_gfclk_mux", "timer2_gfclk_mux"),
164 DT_CLK(NULL, "timer3_gfclk_mux", "timer3_gfclk_mux"),
165 DT_CLK(NULL, "timer4_gfclk_mux", "timer4_gfclk_mux"),
166 DT_CLK(NULL, "timer5_gfclk_mux", "timer5_gfclk_mux"),
167 DT_CLK(NULL, "timer6_gfclk_mux", "timer6_gfclk_mux"),
168 DT_CLK(NULL, "timer7_gfclk_mux", "timer7_gfclk_mux"),
169 DT_CLK(NULL, "timer8_gfclk_mux", "timer8_gfclk_mux"),
170 DT_CLK(NULL, "timer9_gfclk_mux", "timer9_gfclk_mux"),
171 DT_CLK(NULL, "utmi_p1_gfclk", "utmi_p1_gfclk"),
172 DT_CLK(NULL, "utmi_p2_gfclk", "utmi_p2_gfclk"),
173 DT_CLK(NULL, "auxclk0_src_ck", "auxclk0_src_ck"),
174 DT_CLK(NULL, "auxclk0_ck", "auxclk0_ck"),
175 DT_CLK(NULL, "auxclkreq0_ck", "auxclkreq0_ck"),
176 DT_CLK(NULL, "auxclk1_src_ck", "auxclk1_src_ck"),
177 DT_CLK(NULL, "auxclk1_ck", "auxclk1_ck"),
178 DT_CLK(NULL, "auxclkreq1_ck", "auxclkreq1_ck"),
179 DT_CLK(NULL, "auxclk2_src_ck", "auxclk2_src_ck"),
180 DT_CLK(NULL, "auxclk2_ck", "auxclk2_ck"),
181 DT_CLK(NULL, "auxclkreq2_ck", "auxclkreq2_ck"),
182 DT_CLK(NULL, "auxclk3_src_ck", "auxclk3_src_ck"),
183 DT_CLK(NULL, "auxclk3_ck", "auxclk3_ck"),
184 DT_CLK(NULL, "auxclkreq3_ck", "auxclkreq3_ck"),
185 DT_CLK(NULL, "gpmc_ck", "dummy_ck"),
186 DT_CLK("omap_i2c.1", "ick", "dummy_ck"),
187 DT_CLK("omap_i2c.2", "ick", "dummy_ck"),
188 DT_CLK("omap_i2c.3", "ick", "dummy_ck"),
189 DT_CLK("omap_i2c.4", "ick", "dummy_ck"),
190 DT_CLK(NULL, "mailboxes_ick", "dummy_ck"),
191 DT_CLK("omap_hsmmc.0", "ick", "dummy_ck"),
192 DT_CLK("omap_hsmmc.1", "ick", "dummy_ck"),
193 DT_CLK("omap_hsmmc.2", "ick", "dummy_ck"),
194 DT_CLK("omap_hsmmc.3", "ick", "dummy_ck"),
195 DT_CLK("omap_hsmmc.4", "ick", "dummy_ck"),
196 DT_CLK("omap-mcbsp.1", "ick", "dummy_ck"),
197 DT_CLK("omap-mcbsp.2", "ick", "dummy_ck"),
198 DT_CLK("omap-mcbsp.3", "ick", "dummy_ck"),
199 DT_CLK("omap-mcbsp.4", "ick", "dummy_ck"),
200 DT_CLK("omap2_mcspi.1", "ick", "dummy_ck"),
201 DT_CLK("omap2_mcspi.2", "ick", "dummy_ck"),
202 DT_CLK("omap2_mcspi.3", "ick", "dummy_ck"),
203 DT_CLK("omap2_mcspi.4", "ick", "dummy_ck"),
204 DT_CLK(NULL, "uart1_ick", "dummy_ck"),
205 DT_CLK(NULL, "uart2_ick", "dummy_ck"),
206 DT_CLK(NULL, "uart3_ick", "dummy_ck"),
207 DT_CLK(NULL, "uart4_ick", "dummy_ck"),
208 DT_CLK("usbhs_omap", "usbhost_ick", "dummy_ck"),
209 DT_CLK("usbhs_omap", "usbtll_fck", "dummy_ck"),
210 DT_CLK("omap_wdt", "ick", "dummy_ck"),
211 DT_CLK(NULL, "timer_32k_ck", "sys_32k_ck"),
212 DT_CLK("omap_timer.1", "sys_ck", "sys_clkin"),
213 DT_CLK("omap_timer.2", "sys_ck", "sys_clkin"),
214 DT_CLK("omap_timer.3", "sys_ck", "sys_clkin"),
215 DT_CLK("omap_timer.4", "sys_ck", "sys_clkin"),
216 DT_CLK("omap_timer.9", "sys_ck", "sys_clkin"),
217 DT_CLK("omap_timer.10", "sys_ck", "sys_clkin"),
218 DT_CLK("omap_timer.11", "sys_ck", "sys_clkin"),
219 DT_CLK("omap_timer.5", "sys_ck", "dss_syc_gfclk_div"),
220 DT_CLK("omap_timer.6", "sys_ck", "dss_syc_gfclk_div"),
221 DT_CLK("omap_timer.7", "sys_ck", "dss_syc_gfclk_div"),
222 DT_CLK("omap_timer.8", "sys_ck", "dss_syc_gfclk_div"),
223 { .node_name = NULL },
224};
225
226int __init omap5xxx_dt_clk_init(void)
227{
228 int rc;
229 struct clk *abe_dpll_ref, *abe_dpll, *sys_32k_ck, *usb_dpll;
230
231 ti_dt_clocks_register(omap54xx_clks);
232
233 omap2_clk_disable_autoidle_all();
234
235 abe_dpll_ref = clk_get_sys(NULL, "abe_dpll_clk_mux");
236 sys_32k_ck = clk_get_sys(NULL, "sys_32k_ck");
237 rc = clk_set_parent(abe_dpll_ref, sys_32k_ck);
238 abe_dpll = clk_get_sys(NULL, "dpll_abe_ck");
239 if (!rc)
240 rc = clk_set_rate(abe_dpll, OMAP5_DPLL_ABE_DEFFREQ);
241 if (rc)
242 pr_err("%s: failed to configure ABE DPLL!\n", __func__);
243
244 usb_dpll = clk_get_sys(NULL, "dpll_usb_ck");
245 rc = clk_set_rate(usb_dpll, OMAP5_DPLL_USB_DEFFREQ);
246 if (rc)
247 pr_err("%s: failed to configure USB DPLL!\n", __func__);
248
249 usb_dpll = clk_get_sys(NULL, "dpll_usb_m2_ck");
250 rc = clk_set_rate(usb_dpll, OMAP5_DPLL_USB_DEFFREQ/2);
251 if (rc)
252 pr_err("%s: failed to set USB_DPLL M2 OUT\n", __func__);
253
254 return 0;
255}
diff --git a/drivers/clk/ti/clk-7xx.c b/drivers/clk/ti/clk-7xx.c
new file mode 100644
index 000000000000..9977653f2d63
--- /dev/null
+++ b/drivers/clk/ti/clk-7xx.c
@@ -0,0 +1,332 @@
1/*
2 * DRA7 Clock init
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * Tero Kristo (t-kristo@ti.com)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/kernel.h>
14#include <linux/list.h>
15#include <linux/clk-private.h>
16#include <linux/clkdev.h>
17#include <linux/clk/ti.h>
18
19#define DRA7_DPLL_ABE_DEFFREQ 361267200
20#define DRA7_DPLL_GMAC_DEFFREQ 1000000000
21
22
23static struct ti_dt_clk dra7xx_clks[] = {
24 DT_CLK(NULL, "atl_clkin0_ck", "atl_clkin0_ck"),
25 DT_CLK(NULL, "atl_clkin1_ck", "atl_clkin1_ck"),
26 DT_CLK(NULL, "atl_clkin2_ck", "atl_clkin2_ck"),
27 DT_CLK(NULL, "atlclkin3_ck", "atlclkin3_ck"),
28 DT_CLK(NULL, "hdmi_clkin_ck", "hdmi_clkin_ck"),
29 DT_CLK(NULL, "mlb_clkin_ck", "mlb_clkin_ck"),
30 DT_CLK(NULL, "mlbp_clkin_ck", "mlbp_clkin_ck"),
31 DT_CLK(NULL, "pciesref_acs_clk_ck", "pciesref_acs_clk_ck"),
32 DT_CLK(NULL, "ref_clkin0_ck", "ref_clkin0_ck"),
33 DT_CLK(NULL, "ref_clkin1_ck", "ref_clkin1_ck"),
34 DT_CLK(NULL, "ref_clkin2_ck", "ref_clkin2_ck"),
35 DT_CLK(NULL, "ref_clkin3_ck", "ref_clkin3_ck"),
36 DT_CLK(NULL, "rmii_clk_ck", "rmii_clk_ck"),
37 DT_CLK(NULL, "sdvenc_clkin_ck", "sdvenc_clkin_ck"),
38 DT_CLK(NULL, "secure_32k_clk_src_ck", "secure_32k_clk_src_ck"),
39 DT_CLK(NULL, "sys_32k_ck", "sys_32k_ck"),
40 DT_CLK(NULL, "virt_12000000_ck", "virt_12000000_ck"),
41 DT_CLK(NULL, "virt_13000000_ck", "virt_13000000_ck"),
42 DT_CLK(NULL, "virt_16800000_ck", "virt_16800000_ck"),
43 DT_CLK(NULL, "virt_19200000_ck", "virt_19200000_ck"),
44 DT_CLK(NULL, "virt_20000000_ck", "virt_20000000_ck"),
45 DT_CLK(NULL, "virt_26000000_ck", "virt_26000000_ck"),
46 DT_CLK(NULL, "virt_27000000_ck", "virt_27000000_ck"),
47 DT_CLK(NULL, "virt_38400000_ck", "virt_38400000_ck"),
48 DT_CLK(NULL, "sys_clkin1", "sys_clkin1"),
49 DT_CLK(NULL, "sys_clkin2", "sys_clkin2"),
50 DT_CLK(NULL, "usb_otg_clkin_ck", "usb_otg_clkin_ck"),
51 DT_CLK(NULL, "video1_clkin_ck", "video1_clkin_ck"),
52 DT_CLK(NULL, "video1_m2_clkin_ck", "video1_m2_clkin_ck"),
53 DT_CLK(NULL, "video2_clkin_ck", "video2_clkin_ck"),
54 DT_CLK(NULL, "video2_m2_clkin_ck", "video2_m2_clkin_ck"),
55 DT_CLK(NULL, "abe_dpll_sys_clk_mux", "abe_dpll_sys_clk_mux"),
56 DT_CLK(NULL, "abe_dpll_bypass_clk_mux", "abe_dpll_bypass_clk_mux"),
57 DT_CLK(NULL, "abe_dpll_clk_mux", "abe_dpll_clk_mux"),
58 DT_CLK(NULL, "dpll_abe_ck", "dpll_abe_ck"),
59 DT_CLK(NULL, "dpll_abe_x2_ck", "dpll_abe_x2_ck"),
60 DT_CLK(NULL, "dpll_abe_m2x2_ck", "dpll_abe_m2x2_ck"),
61 DT_CLK(NULL, "abe_24m_fclk", "abe_24m_fclk"),
62 DT_CLK(NULL, "abe_clk", "abe_clk"),
63 DT_CLK(NULL, "aess_fclk", "aess_fclk"),
64 DT_CLK(NULL, "abe_giclk_div", "abe_giclk_div"),
65 DT_CLK(NULL, "abe_lp_clk_div", "abe_lp_clk_div"),
66 DT_CLK(NULL, "abe_sys_clk_div", "abe_sys_clk_div"),
67 DT_CLK(NULL, "adc_gfclk_mux", "adc_gfclk_mux"),
68 DT_CLK(NULL, "dpll_pcie_ref_ck", "dpll_pcie_ref_ck"),
69 DT_CLK(NULL, "dpll_pcie_ref_m2ldo_ck", "dpll_pcie_ref_m2ldo_ck"),
70 DT_CLK(NULL, "apll_pcie_ck", "apll_pcie_ck"),
71 DT_CLK(NULL, "apll_pcie_clkvcoldo", "apll_pcie_clkvcoldo"),
72 DT_CLK(NULL, "apll_pcie_clkvcoldo_div", "apll_pcie_clkvcoldo_div"),
73 DT_CLK(NULL, "apll_pcie_m2_ck", "apll_pcie_m2_ck"),
74 DT_CLK(NULL, "sys_clk1_dclk_div", "sys_clk1_dclk_div"),
75 DT_CLK(NULL, "sys_clk2_dclk_div", "sys_clk2_dclk_div"),
76 DT_CLK(NULL, "dpll_abe_m2_ck", "dpll_abe_m2_ck"),
77 DT_CLK(NULL, "per_abe_x1_dclk_div", "per_abe_x1_dclk_div"),
78 DT_CLK(NULL, "dpll_abe_m3x2_ck", "dpll_abe_m3x2_ck"),
79 DT_CLK(NULL, "dpll_core_ck", "dpll_core_ck"),
80 DT_CLK(NULL, "dpll_core_x2_ck", "dpll_core_x2_ck"),
81 DT_CLK(NULL, "dpll_core_h12x2_ck", "dpll_core_h12x2_ck"),
82 DT_CLK(NULL, "mpu_dpll_hs_clk_div", "mpu_dpll_hs_clk_div"),
83 DT_CLK(NULL, "dpll_mpu_ck", "dpll_mpu_ck"),
84 DT_CLK(NULL, "dpll_mpu_m2_ck", "dpll_mpu_m2_ck"),
85 DT_CLK(NULL, "mpu_dclk_div", "mpu_dclk_div"),
86 DT_CLK(NULL, "dsp_dpll_hs_clk_div", "dsp_dpll_hs_clk_div"),
87 DT_CLK(NULL, "dpll_dsp_ck", "dpll_dsp_ck"),
88 DT_CLK(NULL, "dpll_dsp_m2_ck", "dpll_dsp_m2_ck"),
89 DT_CLK(NULL, "dsp_gclk_div", "dsp_gclk_div"),
90 DT_CLK(NULL, "iva_dpll_hs_clk_div", "iva_dpll_hs_clk_div"),
91 DT_CLK(NULL, "dpll_iva_ck", "dpll_iva_ck"),
92 DT_CLK(NULL, "dpll_iva_m2_ck", "dpll_iva_m2_ck"),
93 DT_CLK(NULL, "iva_dclk", "iva_dclk"),
94 DT_CLK(NULL, "dpll_gpu_ck", "dpll_gpu_ck"),
95 DT_CLK(NULL, "dpll_gpu_m2_ck", "dpll_gpu_m2_ck"),
96 DT_CLK(NULL, "gpu_dclk", "gpu_dclk"),
97 DT_CLK(NULL, "dpll_core_m2_ck", "dpll_core_m2_ck"),
98 DT_CLK(NULL, "core_dpll_out_dclk_div", "core_dpll_out_dclk_div"),
99 DT_CLK(NULL, "dpll_ddr_ck", "dpll_ddr_ck"),
100 DT_CLK(NULL, "dpll_ddr_m2_ck", "dpll_ddr_m2_ck"),
101 DT_CLK(NULL, "emif_phy_dclk_div", "emif_phy_dclk_div"),
102 DT_CLK(NULL, "dpll_gmac_ck", "dpll_gmac_ck"),
103 DT_CLK(NULL, "dpll_gmac_m2_ck", "dpll_gmac_m2_ck"),
104 DT_CLK(NULL, "gmac_250m_dclk_div", "gmac_250m_dclk_div"),
105 DT_CLK(NULL, "video2_dclk_div", "video2_dclk_div"),
106 DT_CLK(NULL, "video1_dclk_div", "video1_dclk_div"),
107 DT_CLK(NULL, "hdmi_dclk_div", "hdmi_dclk_div"),
108 DT_CLK(NULL, "per_dpll_hs_clk_div", "per_dpll_hs_clk_div"),
109 DT_CLK(NULL, "dpll_per_ck", "dpll_per_ck"),
110 DT_CLK(NULL, "dpll_per_m2_ck", "dpll_per_m2_ck"),
111 DT_CLK(NULL, "func_96m_aon_dclk_div", "func_96m_aon_dclk_div"),
112 DT_CLK(NULL, "usb_dpll_hs_clk_div", "usb_dpll_hs_clk_div"),
113 DT_CLK(NULL, "dpll_usb_ck", "dpll_usb_ck"),
114 DT_CLK(NULL, "dpll_usb_m2_ck", "dpll_usb_m2_ck"),
115 DT_CLK(NULL, "l3init_480m_dclk_div", "l3init_480m_dclk_div"),
116 DT_CLK(NULL, "usb_otg_dclk_div", "usb_otg_dclk_div"),
117 DT_CLK(NULL, "sata_dclk_div", "sata_dclk_div"),
118 DT_CLK(NULL, "dpll_pcie_ref_m2_ck", "dpll_pcie_ref_m2_ck"),
119 DT_CLK(NULL, "pcie2_dclk_div", "pcie2_dclk_div"),
120 DT_CLK(NULL, "pcie_dclk_div", "pcie_dclk_div"),
121 DT_CLK(NULL, "emu_dclk_div", "emu_dclk_div"),
122 DT_CLK(NULL, "secure_32k_dclk_div", "secure_32k_dclk_div"),
123 DT_CLK(NULL, "eve_dpll_hs_clk_div", "eve_dpll_hs_clk_div"),
124 DT_CLK(NULL, "dpll_eve_ck", "dpll_eve_ck"),
125 DT_CLK(NULL, "dpll_eve_m2_ck", "dpll_eve_m2_ck"),
126 DT_CLK(NULL, "eve_dclk_div", "eve_dclk_div"),
127 DT_CLK(NULL, "clkoutmux0_clk_mux", "clkoutmux0_clk_mux"),
128 DT_CLK(NULL, "clkoutmux1_clk_mux", "clkoutmux1_clk_mux"),
129 DT_CLK(NULL, "clkoutmux2_clk_mux", "clkoutmux2_clk_mux"),
130 DT_CLK(NULL, "custefuse_sys_gfclk_div", "custefuse_sys_gfclk_div"),
131 DT_CLK(NULL, "dpll_core_h13x2_ck", "dpll_core_h13x2_ck"),
132 DT_CLK(NULL, "dpll_core_h14x2_ck", "dpll_core_h14x2_ck"),
133 DT_CLK(NULL, "dpll_core_h22x2_ck", "dpll_core_h22x2_ck"),
134 DT_CLK(NULL, "dpll_core_h23x2_ck", "dpll_core_h23x2_ck"),
135 DT_CLK(NULL, "dpll_core_h24x2_ck", "dpll_core_h24x2_ck"),
136 DT_CLK(NULL, "dpll_ddr_x2_ck", "dpll_ddr_x2_ck"),
137 DT_CLK(NULL, "dpll_ddr_h11x2_ck", "dpll_ddr_h11x2_ck"),
138 DT_CLK(NULL, "dpll_dsp_x2_ck", "dpll_dsp_x2_ck"),
139 DT_CLK(NULL, "dpll_dsp_m3x2_ck", "dpll_dsp_m3x2_ck"),
140 DT_CLK(NULL, "dpll_gmac_x2_ck", "dpll_gmac_x2_ck"),
141 DT_CLK(NULL, "dpll_gmac_h11x2_ck", "dpll_gmac_h11x2_ck"),
142 DT_CLK(NULL, "dpll_gmac_h12x2_ck", "dpll_gmac_h12x2_ck"),
143 DT_CLK(NULL, "dpll_gmac_h13x2_ck", "dpll_gmac_h13x2_ck"),
144 DT_CLK(NULL, "dpll_gmac_m3x2_ck", "dpll_gmac_m3x2_ck"),
145 DT_CLK(NULL, "dpll_per_x2_ck", "dpll_per_x2_ck"),
146 DT_CLK(NULL, "dpll_per_h11x2_ck", "dpll_per_h11x2_ck"),
147 DT_CLK(NULL, "dpll_per_h12x2_ck", "dpll_per_h12x2_ck"),
148 DT_CLK(NULL, "dpll_per_h13x2_ck", "dpll_per_h13x2_ck"),
149 DT_CLK(NULL, "dpll_per_h14x2_ck", "dpll_per_h14x2_ck"),
150 DT_CLK(NULL, "dpll_per_m2x2_ck", "dpll_per_m2x2_ck"),
151 DT_CLK(NULL, "dpll_usb_clkdcoldo", "dpll_usb_clkdcoldo"),
152 DT_CLK(NULL, "eve_clk", "eve_clk"),
153 DT_CLK(NULL, "func_128m_clk", "func_128m_clk"),
154 DT_CLK(NULL, "func_12m_fclk", "func_12m_fclk"),
155 DT_CLK(NULL, "func_24m_clk", "func_24m_clk"),
156 DT_CLK(NULL, "func_48m_fclk", "func_48m_fclk"),
157 DT_CLK(NULL, "func_96m_fclk", "func_96m_fclk"),
158 DT_CLK(NULL, "gmii_m_clk_div", "gmii_m_clk_div"),
159 DT_CLK(NULL, "hdmi_clk2_div", "hdmi_clk2_div"),
160 DT_CLK(NULL, "hdmi_div_clk", "hdmi_div_clk"),
161 DT_CLK(NULL, "hdmi_dpll_clk_mux", "hdmi_dpll_clk_mux"),
162 DT_CLK(NULL, "l3_iclk_div", "l3_iclk_div"),
163 DT_CLK(NULL, "l3init_60m_fclk", "l3init_60m_fclk"),
164 DT_CLK(NULL, "l4_root_clk_div", "l4_root_clk_div"),
165 DT_CLK(NULL, "mlb_clk", "mlb_clk"),
166 DT_CLK(NULL, "mlbp_clk", "mlbp_clk"),
167 DT_CLK(NULL, "per_abe_x1_gfclk2_div", "per_abe_x1_gfclk2_div"),
168 DT_CLK(NULL, "timer_sys_clk_div", "timer_sys_clk_div"),
169 DT_CLK(NULL, "video1_clk2_div", "video1_clk2_div"),
170 DT_CLK(NULL, "video1_div_clk", "video1_div_clk"),
171 DT_CLK(NULL, "video1_dpll_clk_mux", "video1_dpll_clk_mux"),
172 DT_CLK(NULL, "video2_clk2_div", "video2_clk2_div"),
173 DT_CLK(NULL, "video2_div_clk", "video2_div_clk"),
174 DT_CLK(NULL, "video2_dpll_clk_mux", "video2_dpll_clk_mux"),
175 DT_CLK(NULL, "wkupaon_iclk_mux", "wkupaon_iclk_mux"),
176 DT_CLK(NULL, "dss_32khz_clk", "dss_32khz_clk"),
177 DT_CLK(NULL, "dss_48mhz_clk", "dss_48mhz_clk"),
178 DT_CLK(NULL, "dss_dss_clk", "dss_dss_clk"),
179 DT_CLK(NULL, "dss_hdmi_clk", "dss_hdmi_clk"),
180 DT_CLK(NULL, "dss_video1_clk", "dss_video1_clk"),
181 DT_CLK(NULL, "dss_video2_clk", "dss_video2_clk"),
182 DT_CLK(NULL, "gpio1_dbclk", "gpio1_dbclk"),
183 DT_CLK(NULL, "gpio2_dbclk", "gpio2_dbclk"),
184 DT_CLK(NULL, "gpio3_dbclk", "gpio3_dbclk"),
185 DT_CLK(NULL, "gpio4_dbclk", "gpio4_dbclk"),
186 DT_CLK(NULL, "gpio5_dbclk", "gpio5_dbclk"),
187 DT_CLK(NULL, "gpio6_dbclk", "gpio6_dbclk"),
188 DT_CLK(NULL, "gpio7_dbclk", "gpio7_dbclk"),
189 DT_CLK(NULL, "gpio8_dbclk", "gpio8_dbclk"),
190 DT_CLK(NULL, "mmc1_clk32k", "mmc1_clk32k"),
191 DT_CLK(NULL, "mmc2_clk32k", "mmc2_clk32k"),
192 DT_CLK(NULL, "mmc3_clk32k", "mmc3_clk32k"),
193 DT_CLK(NULL, "mmc4_clk32k", "mmc4_clk32k"),
194 DT_CLK(NULL, "sata_ref_clk", "sata_ref_clk"),
195 DT_CLK(NULL, "usb_otg_ss1_refclk960m", "usb_otg_ss1_refclk960m"),
196 DT_CLK(NULL, "usb_otg_ss2_refclk960m", "usb_otg_ss2_refclk960m"),
197 DT_CLK(NULL, "usb_phy1_always_on_clk32k", "usb_phy1_always_on_clk32k"),
198 DT_CLK(NULL, "usb_phy2_always_on_clk32k", "usb_phy2_always_on_clk32k"),
199 DT_CLK(NULL, "usb_phy3_always_on_clk32k", "usb_phy3_always_on_clk32k"),
200 DT_CLK(NULL, "atl_dpll_clk_mux", "atl_dpll_clk_mux"),
201 DT_CLK(NULL, "atl_gfclk_mux", "atl_gfclk_mux"),
202 DT_CLK(NULL, "dcan1_sys_clk_mux", "dcan1_sys_clk_mux"),
203 DT_CLK(NULL, "gmac_gmii_ref_clk_div", "gmac_gmii_ref_clk_div"),
204 DT_CLK(NULL, "gmac_rft_clk_mux", "gmac_rft_clk_mux"),
205 DT_CLK(NULL, "gpu_core_gclk_mux", "gpu_core_gclk_mux"),
206 DT_CLK(NULL, "gpu_hyd_gclk_mux", "gpu_hyd_gclk_mux"),
207 DT_CLK(NULL, "ipu1_gfclk_mux", "ipu1_gfclk_mux"),
208 DT_CLK(NULL, "l3instr_ts_gclk_div", "l3instr_ts_gclk_div"),
209 DT_CLK(NULL, "mcasp1_ahclkr_mux", "mcasp1_ahclkr_mux"),
210 DT_CLK(NULL, "mcasp1_ahclkx_mux", "mcasp1_ahclkx_mux"),
211 DT_CLK(NULL, "mcasp1_aux_gfclk_mux", "mcasp1_aux_gfclk_mux"),
212 DT_CLK(NULL, "mcasp2_ahclkr_mux", "mcasp2_ahclkr_mux"),
213 DT_CLK(NULL, "mcasp2_ahclkx_mux", "mcasp2_ahclkx_mux"),
214 DT_CLK(NULL, "mcasp2_aux_gfclk_mux", "mcasp2_aux_gfclk_mux"),
215 DT_CLK(NULL, "mcasp3_ahclkx_mux", "mcasp3_ahclkx_mux"),
216 DT_CLK(NULL, "mcasp3_aux_gfclk_mux", "mcasp3_aux_gfclk_mux"),
217 DT_CLK(NULL, "mcasp4_ahclkx_mux", "mcasp4_ahclkx_mux"),
218 DT_CLK(NULL, "mcasp4_aux_gfclk_mux", "mcasp4_aux_gfclk_mux"),
219 DT_CLK(NULL, "mcasp5_ahclkx_mux", "mcasp5_ahclkx_mux"),
220 DT_CLK(NULL, "mcasp5_aux_gfclk_mux", "mcasp5_aux_gfclk_mux"),
221 DT_CLK(NULL, "mcasp6_ahclkx_mux", "mcasp6_ahclkx_mux"),
222 DT_CLK(NULL, "mcasp6_aux_gfclk_mux", "mcasp6_aux_gfclk_mux"),
223 DT_CLK(NULL, "mcasp7_ahclkx_mux", "mcasp7_ahclkx_mux"),
224 DT_CLK(NULL, "mcasp7_aux_gfclk_mux", "mcasp7_aux_gfclk_mux"),
225 DT_CLK(NULL, "mcasp8_ahclk_mux", "mcasp8_ahclk_mux"),
226 DT_CLK(NULL, "mcasp8_aux_gfclk_mux", "mcasp8_aux_gfclk_mux"),
227 DT_CLK(NULL, "mmc1_fclk_mux", "mmc1_fclk_mux"),
228 DT_CLK(NULL, "mmc1_fclk_div", "mmc1_fclk_div"),
229 DT_CLK(NULL, "mmc2_fclk_mux", "mmc2_fclk_mux"),
230 DT_CLK(NULL, "mmc2_fclk_div", "mmc2_fclk_div"),
231 DT_CLK(NULL, "mmc3_gfclk_mux", "mmc3_gfclk_mux"),
232 DT_CLK(NULL, "mmc3_gfclk_div", "mmc3_gfclk_div"),
233 DT_CLK(NULL, "mmc4_gfclk_mux", "mmc4_gfclk_mux"),
234 DT_CLK(NULL, "mmc4_gfclk_div", "mmc4_gfclk_div"),
235 DT_CLK(NULL, "qspi_gfclk_mux", "qspi_gfclk_mux"),
236 DT_CLK(NULL, "qspi_gfclk_div", "qspi_gfclk_div"),
237 DT_CLK(NULL, "timer10_gfclk_mux", "timer10_gfclk_mux"),
238 DT_CLK(NULL, "timer11_gfclk_mux", "timer11_gfclk_mux"),
239 DT_CLK(NULL, "timer13_gfclk_mux", "timer13_gfclk_mux"),
240 DT_CLK(NULL, "timer14_gfclk_mux", "timer14_gfclk_mux"),
241 DT_CLK(NULL, "timer15_gfclk_mux", "timer15_gfclk_mux"),
242 DT_CLK(NULL, "timer16_gfclk_mux", "timer16_gfclk_mux"),
243 DT_CLK(NULL, "timer1_gfclk_mux", "timer1_gfclk_mux"),
244 DT_CLK(NULL, "timer2_gfclk_mux", "timer2_gfclk_mux"),
245 DT_CLK(NULL, "timer3_gfclk_mux", "timer3_gfclk_mux"),
246 DT_CLK(NULL, "timer4_gfclk_mux", "timer4_gfclk_mux"),
247 DT_CLK(NULL, "timer5_gfclk_mux", "timer5_gfclk_mux"),
248 DT_CLK(NULL, "timer6_gfclk_mux", "timer6_gfclk_mux"),
249 DT_CLK(NULL, "timer7_gfclk_mux", "timer7_gfclk_mux"),
250 DT_CLK(NULL, "timer8_gfclk_mux", "timer8_gfclk_mux"),
251 DT_CLK(NULL, "timer9_gfclk_mux", "timer9_gfclk_mux"),
252 DT_CLK(NULL, "uart10_gfclk_mux", "uart10_gfclk_mux"),
253 DT_CLK(NULL, "uart1_gfclk_mux", "uart1_gfclk_mux"),
254 DT_CLK(NULL, "uart2_gfclk_mux", "uart2_gfclk_mux"),
255 DT_CLK(NULL, "uart3_gfclk_mux", "uart3_gfclk_mux"),
256 DT_CLK(NULL, "uart4_gfclk_mux", "uart4_gfclk_mux"),
257 DT_CLK(NULL, "uart5_gfclk_mux", "uart5_gfclk_mux"),
258 DT_CLK(NULL, "uart6_gfclk_mux", "uart6_gfclk_mux"),
259 DT_CLK(NULL, "uart7_gfclk_mux", "uart7_gfclk_mux"),
260 DT_CLK(NULL, "uart8_gfclk_mux", "uart8_gfclk_mux"),
261 DT_CLK(NULL, "uart9_gfclk_mux", "uart9_gfclk_mux"),
262 DT_CLK(NULL, "vip1_gclk_mux", "vip1_gclk_mux"),
263 DT_CLK(NULL, "vip2_gclk_mux", "vip2_gclk_mux"),
264 DT_CLK(NULL, "vip3_gclk_mux", "vip3_gclk_mux"),
265 DT_CLK(NULL, "gpmc_ck", "dummy_ck"),
266 DT_CLK("omap_i2c.1", "ick", "dummy_ck"),
267 DT_CLK("omap_i2c.2", "ick", "dummy_ck"),
268 DT_CLK("omap_i2c.3", "ick", "dummy_ck"),
269 DT_CLK("omap_i2c.4", "ick", "dummy_ck"),
270 DT_CLK(NULL, "mailboxes_ick", "dummy_ck"),
271 DT_CLK("omap_hsmmc.0", "ick", "dummy_ck"),
272 DT_CLK("omap_hsmmc.1", "ick", "dummy_ck"),
273 DT_CLK("omap_hsmmc.2", "ick", "dummy_ck"),
274 DT_CLK("omap_hsmmc.3", "ick", "dummy_ck"),
275 DT_CLK("omap_hsmmc.4", "ick", "dummy_ck"),
276 DT_CLK("omap-mcbsp.1", "ick", "dummy_ck"),
277 DT_CLK("omap-mcbsp.2", "ick", "dummy_ck"),
278 DT_CLK("omap-mcbsp.3", "ick", "dummy_ck"),
279 DT_CLK("omap-mcbsp.4", "ick", "dummy_ck"),
280 DT_CLK("omap2_mcspi.1", "ick", "dummy_ck"),
281 DT_CLK("omap2_mcspi.2", "ick", "dummy_ck"),
282 DT_CLK("omap2_mcspi.3", "ick", "dummy_ck"),
283 DT_CLK("omap2_mcspi.4", "ick", "dummy_ck"),
284 DT_CLK(NULL, "uart1_ick", "dummy_ck"),
285 DT_CLK(NULL, "uart2_ick", "dummy_ck"),
286 DT_CLK(NULL, "uart3_ick", "dummy_ck"),
287 DT_CLK(NULL, "uart4_ick", "dummy_ck"),
288 DT_CLK("usbhs_omap", "usbhost_ick", "dummy_ck"),
289 DT_CLK("usbhs_omap", "usbtll_fck", "dummy_ck"),
290 DT_CLK("omap_wdt", "ick", "dummy_ck"),
291 DT_CLK(NULL, "timer_32k_ck", "sys_32k_ck"),
292 DT_CLK("4ae18000.timer", "timer_sys_ck", "sys_clkin2"),
293 DT_CLK("48032000.timer", "timer_sys_ck", "sys_clkin2"),
294 DT_CLK("48034000.timer", "timer_sys_ck", "sys_clkin2"),
295 DT_CLK("48036000.timer", "timer_sys_ck", "sys_clkin2"),
296 DT_CLK("4803e000.timer", "timer_sys_ck", "sys_clkin2"),
297 DT_CLK("48086000.timer", "timer_sys_ck", "sys_clkin2"),
298 DT_CLK("48088000.timer", "timer_sys_ck", "sys_clkin2"),
299 DT_CLK("48820000.timer", "timer_sys_ck", "timer_sys_clk_div"),
300 DT_CLK("48822000.timer", "timer_sys_ck", "timer_sys_clk_div"),
301 DT_CLK("48824000.timer", "timer_sys_ck", "timer_sys_clk_div"),
302 DT_CLK("48826000.timer", "timer_sys_ck", "timer_sys_clk_div"),
303 DT_CLK(NULL, "sys_clkin", "sys_clkin1"),
304 { .node_name = NULL },
305};
306
307int __init dra7xx_dt_clk_init(void)
308{
309 int rc;
310 struct clk *abe_dpll_mux, *sys_clkin2, *dpll_ck;
311
312 ti_dt_clocks_register(dra7xx_clks);
313
314 omap2_clk_disable_autoidle_all();
315
316 abe_dpll_mux = clk_get_sys(NULL, "abe_dpll_sys_clk_mux");
317 sys_clkin2 = clk_get_sys(NULL, "sys_clkin2");
318 dpll_ck = clk_get_sys(NULL, "dpll_abe_ck");
319
320 rc = clk_set_parent(abe_dpll_mux, sys_clkin2);
321 if (!rc)
322 rc = clk_set_rate(dpll_ck, DRA7_DPLL_ABE_DEFFREQ);
323 if (rc)
324 pr_err("%s: failed to configure ABE DPLL!\n", __func__);
325
326 dpll_ck = clk_get_sys(NULL, "dpll_gmac_ck");
327 rc = clk_set_rate(dpll_ck, DRA7_DPLL_GMAC_DEFFREQ);
328 if (rc)
329 pr_err("%s: failed to configure GMAC DPLL!\n", __func__);
330
331 return rc;
332}
diff --git a/drivers/clk/ti/clk.c b/drivers/clk/ti/clk.c
new file mode 100644
index 000000000000..b1a6f7144f3f
--- /dev/null
+++ b/drivers/clk/ti/clk.c
@@ -0,0 +1,167 @@
1/*
2 * TI clock support
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * Tero Kristo <t-kristo@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether express or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#include <linux/clk-provider.h>
19#include <linux/clkdev.h>
20#include <linux/clk/ti.h>
21#include <linux/of.h>
22#include <linux/of_address.h>
23#include <linux/list.h>
24
25#undef pr_fmt
26#define pr_fmt(fmt) "%s: " fmt, __func__
27
28static int ti_dt_clk_memmap_index;
29struct ti_clk_ll_ops *ti_clk_ll_ops;
30
31/**
32 * ti_dt_clocks_register - register DT alias clocks during boot
33 * @oclks: list of clocks to register
34 *
35 * Register alias or non-standard DT clock entries during boot. By
36 * default, DT clocks are found based on their node name. If any
37 * additional con-id / dev-id -> clock mapping is required, use this
38 * function to list these.
39 */
40void __init ti_dt_clocks_register(struct ti_dt_clk oclks[])
41{
42 struct ti_dt_clk *c;
43 struct device_node *node;
44 struct clk *clk;
45 struct of_phandle_args clkspec;
46
47 for (c = oclks; c->node_name != NULL; c++) {
48 node = of_find_node_by_name(NULL, c->node_name);
49 clkspec.np = node;
50 clk = of_clk_get_from_provider(&clkspec);
51
52 if (!IS_ERR(clk)) {
53 c->lk.clk = clk;
54 clkdev_add(&c->lk);
55 } else {
56 pr_warn("failed to lookup clock node %s\n",
57 c->node_name);
58 }
59 }
60}
61
62struct clk_init_item {
63 struct device_node *node;
64 struct clk_hw *hw;
65 ti_of_clk_init_cb_t func;
66 struct list_head link;
67};
68
69static LIST_HEAD(retry_list);
70
71/**
72 * ti_clk_retry_init - retries a failed clock init at later phase
73 * @node: device not for the clock
74 * @hw: partially initialized clk_hw struct for the clock
75 * @func: init function to be called for the clock
76 *
77 * Adds a failed clock init to the retry list. The retry list is parsed
78 * once all the other clocks have been initialized.
79 */
80int __init ti_clk_retry_init(struct device_node *node, struct clk_hw *hw,
81 ti_of_clk_init_cb_t func)
82{
83 struct clk_init_item *retry;
84
85 pr_debug("%s: adding to retry list...\n", node->name);
86 retry = kzalloc(sizeof(*retry), GFP_KERNEL);
87 if (!retry)
88 return -ENOMEM;
89
90 retry->node = node;
91 retry->func = func;
92 retry->hw = hw;
93 list_add(&retry->link, &retry_list);
94
95 return 0;
96}
97
98/**
99 * ti_clk_get_reg_addr - get register address for a clock register
100 * @node: device node for the clock
101 * @index: register index from the clock node
102 *
103 * Builds clock register address from device tree information. This
104 * is a struct of type clk_omap_reg.
105 */
106void __iomem *ti_clk_get_reg_addr(struct device_node *node, int index)
107{
108 struct clk_omap_reg *reg;
109 u32 val;
110 u32 tmp;
111
112 reg = (struct clk_omap_reg *)&tmp;
113 reg->index = ti_dt_clk_memmap_index;
114
115 if (of_property_read_u32_index(node, "reg", index, &val)) {
116 pr_err("%s must have reg[%d]!\n", node->name, index);
117 return NULL;
118 }
119
120 reg->offset = val;
121
122 return (void __iomem *)tmp;
123}
124
125/**
126 * ti_dt_clk_init_provider - init master clock provider
127 * @parent: master node
128 * @index: internal index for clk_reg_ops
129 *
130 * Initializes a master clock IP block and its child clock nodes.
131 * Regmap is provided for accessing the register space for the
132 * IP block and all the clocks under it.
133 */
134void ti_dt_clk_init_provider(struct device_node *parent, int index)
135{
136 const struct of_device_id *match;
137 struct device_node *np;
138 struct device_node *clocks;
139 of_clk_init_cb_t clk_init_cb;
140 struct clk_init_item *retry;
141 struct clk_init_item *tmp;
142
143 ti_dt_clk_memmap_index = index;
144
145 /* get clocks for this parent */
146 clocks = of_get_child_by_name(parent, "clocks");
147 if (!clocks) {
148 pr_err("%s missing 'clocks' child node.\n", parent->name);
149 return;
150 }
151
152 for_each_child_of_node(clocks, np) {
153 match = of_match_node(&__clk_of_table, np);
154 if (!match)
155 continue;
156 clk_init_cb = (of_clk_init_cb_t)match->data;
157 pr_debug("%s: initializing: %s\n", __func__, np->name);
158 clk_init_cb(np);
159 }
160
161 list_for_each_entry_safe(retry, tmp, &retry_list, link) {
162 pr_debug("retry-init: %s\n", retry->node->name);
163 retry->func(retry->hw, retry->node);
164 list_del(&retry->link);
165 kfree(retry);
166 }
167}
diff --git a/drivers/clk/ti/clockdomain.c b/drivers/clk/ti/clockdomain.c
new file mode 100644
index 000000000000..f1e0038d76ac
--- /dev/null
+++ b/drivers/clk/ti/clockdomain.c
@@ -0,0 +1,70 @@
1/*
2 * OMAP clockdomain support
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * Tero Kristo <t-kristo@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether express or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#include <linux/clk-provider.h>
19#include <linux/slab.h>
20#include <linux/of.h>
21#include <linux/of_address.h>
22#include <linux/clk/ti.h>
23
24#undef pr_fmt
25#define pr_fmt(fmt) "%s: " fmt, __func__
26
27static void __init of_ti_clockdomain_setup(struct device_node *node)
28{
29 struct clk *clk;
30 struct clk_hw *clk_hw;
31 const char *clkdm_name = node->name;
32 int i;
33 int num_clks;
34
35 num_clks = of_count_phandle_with_args(node, "clocks", "#clock-cells");
36
37 for (i = 0; i < num_clks; i++) {
38 clk = of_clk_get(node, i);
39 if (__clk_get_flags(clk) & CLK_IS_BASIC) {
40 pr_warn("can't setup clkdm for basic clk %s\n",
41 __clk_get_name(clk));
42 continue;
43 }
44 clk_hw = __clk_get_hw(clk);
45 to_clk_hw_omap(clk_hw)->clkdm_name = clkdm_name;
46 omap2_init_clk_clkdm(clk_hw);
47 }
48}
49
50static struct of_device_id ti_clkdm_match_table[] __initdata = {
51 { .compatible = "ti,clockdomain" },
52 { }
53};
54
55/**
56 * ti_dt_clockdomains_setup - setup device tree clockdomains
57 *
58 * Initializes clockdomain nodes for a SoC. This parses through all the
59 * nodes with compatible = "ti,clockdomain", and add the clockdomain
60 * info for all the clocks listed under these. This function shall be
61 * called after rest of the DT clock init has completed and all
62 * clock nodes have been registered.
63 */
64void __init ti_dt_clockdomains_setup(void)
65{
66 struct device_node *np;
67 for_each_matching_node(np, ti_clkdm_match_table) {
68 of_ti_clockdomain_setup(np);
69 }
70}
diff --git a/drivers/clk/ti/composite.c b/drivers/clk/ti/composite.c
new file mode 100644
index 000000000000..19d8980ba458
--- /dev/null
+++ b/drivers/clk/ti/composite.c
@@ -0,0 +1,269 @@
1/*
2 * TI composite clock support
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * Tero Kristo <t-kristo@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether express or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#include <linux/clk-provider.h>
19#include <linux/slab.h>
20#include <linux/io.h>
21#include <linux/of.h>
22#include <linux/of_address.h>
23#include <linux/clk/ti.h>
24#include <linux/list.h>
25
26#undef pr_fmt
27#define pr_fmt(fmt) "%s: " fmt, __func__
28
29#define to_clk_divider(_hw) container_of(_hw, struct clk_divider, hw)
30
31static unsigned long ti_composite_recalc_rate(struct clk_hw *hw,
32 unsigned long parent_rate)
33{
34 return ti_clk_divider_ops.recalc_rate(hw, parent_rate);
35}
36
37static long ti_composite_round_rate(struct clk_hw *hw, unsigned long rate,
38 unsigned long *prate)
39{
40 return -EINVAL;
41}
42
43static int ti_composite_set_rate(struct clk_hw *hw, unsigned long rate,
44 unsigned long parent_rate)
45{
46 return -EINVAL;
47}
48
49static const struct clk_ops ti_composite_divider_ops = {
50 .recalc_rate = &ti_composite_recalc_rate,
51 .round_rate = &ti_composite_round_rate,
52 .set_rate = &ti_composite_set_rate,
53};
54
55static const struct clk_ops ti_composite_gate_ops = {
56 .enable = &omap2_dflt_clk_enable,
57 .disable = &omap2_dflt_clk_disable,
58 .is_enabled = &omap2_dflt_clk_is_enabled,
59};
60
61struct component_clk {
62 int num_parents;
63 const char **parent_names;
64 struct device_node *node;
65 int type;
66 struct clk_hw *hw;
67 struct list_head link;
68};
69
70static const char * __initconst component_clk_types[] = {
71 "gate", "divider", "mux"
72};
73
74static LIST_HEAD(component_clks);
75
76static struct device_node *_get_component_node(struct device_node *node, int i)
77{
78 int rc;
79 struct of_phandle_args clkspec;
80
81 rc = of_parse_phandle_with_args(node, "clocks", "#clock-cells", i,
82 &clkspec);
83 if (rc)
84 return NULL;
85
86 return clkspec.np;
87}
88
89static struct component_clk *_lookup_component(struct device_node *node)
90{
91 struct component_clk *comp;
92
93 list_for_each_entry(comp, &component_clks, link) {
94 if (comp->node == node)
95 return comp;
96 }
97 return NULL;
98}
99
100struct clk_hw_omap_comp {
101 struct clk_hw hw;
102 struct device_node *comp_nodes[CLK_COMPONENT_TYPE_MAX];
103 struct component_clk *comp_clks[CLK_COMPONENT_TYPE_MAX];
104};
105
106static inline struct clk_hw *_get_hw(struct clk_hw_omap_comp *clk, int idx)
107{
108 if (!clk)
109 return NULL;
110
111 if (!clk->comp_clks[idx])
112 return NULL;
113
114 return clk->comp_clks[idx]->hw;
115}
116
117#define to_clk_hw_comp(_hw) container_of(_hw, struct clk_hw_omap_comp, hw)
118
119static void __init ti_clk_register_composite(struct clk_hw *hw,
120 struct device_node *node)
121{
122 struct clk *clk;
123 struct clk_hw_omap_comp *cclk = to_clk_hw_comp(hw);
124 struct component_clk *comp;
125 int num_parents = 0;
126 const char **parent_names = NULL;
127 int i;
128
129 /* Check for presence of each component clock */
130 for (i = 0; i < CLK_COMPONENT_TYPE_MAX; i++) {
131 if (!cclk->comp_nodes[i])
132 continue;
133
134 comp = _lookup_component(cclk->comp_nodes[i]);
135 if (!comp) {
136 pr_debug("component %s not ready for %s, retry\n",
137 cclk->comp_nodes[i]->name, node->name);
138 if (!ti_clk_retry_init(node, hw,
139 ti_clk_register_composite))
140 return;
141
142 goto cleanup;
143 }
144 if (cclk->comp_clks[comp->type] != NULL) {
145 pr_err("duplicate component types for %s (%s)!\n",
146 node->name, component_clk_types[comp->type]);
147 goto cleanup;
148 }
149
150 cclk->comp_clks[comp->type] = comp;
151
152 /* Mark this node as found */
153 cclk->comp_nodes[i] = NULL;
154 }
155
156 /* All components exists, proceed with registration */
157 for (i = CLK_COMPONENT_TYPE_MAX - 1; i >= 0; i--) {
158 comp = cclk->comp_clks[i];
159 if (!comp)
160 continue;
161 if (comp->num_parents) {
162 num_parents = comp->num_parents;
163 parent_names = comp->parent_names;
164 break;
165 }
166 }
167
168 if (!num_parents) {
169 pr_err("%s: no parents found for %s!\n", __func__, node->name);
170 goto cleanup;
171 }
172
173 clk = clk_register_composite(NULL, node->name,
174 parent_names, num_parents,
175 _get_hw(cclk, CLK_COMPONENT_TYPE_MUX),
176 &ti_clk_mux_ops,
177 _get_hw(cclk, CLK_COMPONENT_TYPE_DIVIDER),
178 &ti_composite_divider_ops,
179 _get_hw(cclk, CLK_COMPONENT_TYPE_GATE),
180 &ti_composite_gate_ops, 0);
181
182 if (!IS_ERR(clk))
183 of_clk_add_provider(node, of_clk_src_simple_get, clk);
184
185cleanup:
186 /* Free component clock list entries */
187 for (i = 0; i < CLK_COMPONENT_TYPE_MAX; i++) {
188 if (!cclk->comp_clks[i])
189 continue;
190 list_del(&cclk->comp_clks[i]->link);
191 kfree(cclk->comp_clks[i]);
192 }
193
194 kfree(cclk);
195}
196
197static void __init of_ti_composite_clk_setup(struct device_node *node)
198{
199 int num_clks;
200 int i;
201 struct clk_hw_omap_comp *cclk;
202
203 /* Number of component clocks to be put inside this clock */
204 num_clks = of_clk_get_parent_count(node);
205
206 if (num_clks < 1) {
207 pr_err("composite clk %s must have component(s)\n", node->name);
208 return;
209 }
210
211 cclk = kzalloc(sizeof(*cclk), GFP_KERNEL);
212 if (!cclk)
213 return;
214
215 /* Get device node pointers for each component clock */
216 for (i = 0; i < num_clks; i++)
217 cclk->comp_nodes[i] = _get_component_node(node, i);
218
219 ti_clk_register_composite(&cclk->hw, node);
220}
221CLK_OF_DECLARE(ti_composite_clock, "ti,composite-clock",
222 of_ti_composite_clk_setup);
223
224/**
225 * ti_clk_add_component - add a component clock to the pool
226 * @node: device node of the component clock
227 * @hw: hardware clock definition for the component clock
228 * @type: type of the component clock
229 *
230 * Adds a component clock to the list of available components, so that
231 * it can be registered by a composite clock.
232 */
233int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw,
234 int type)
235{
236 int num_parents;
237 const char **parent_names;
238 struct component_clk *clk;
239 int i;
240
241 num_parents = of_clk_get_parent_count(node);
242
243 if (num_parents < 1) {
244 pr_err("component-clock %s must have parent(s)\n", node->name);
245 return -EINVAL;
246 }
247
248 parent_names = kzalloc((sizeof(char *) * num_parents), GFP_KERNEL);
249 if (!parent_names)
250 return -ENOMEM;
251
252 for (i = 0; i < num_parents; i++)
253 parent_names[i] = of_clk_get_parent_name(node, i);
254
255 clk = kzalloc(sizeof(*clk), GFP_KERNEL);
256 if (!clk) {
257 kfree(parent_names);
258 return -ENOMEM;
259 }
260
261 clk->num_parents = num_parents;
262 clk->parent_names = parent_names;
263 clk->hw = hw;
264 clk->node = node;
265 clk->type = type;
266 list_add(&clk->link, &component_clks);
267
268 return 0;
269}
diff --git a/drivers/clk/ti/divider.c b/drivers/clk/ti/divider.c
new file mode 100644
index 000000000000..a15e445570b2
--- /dev/null
+++ b/drivers/clk/ti/divider.c
@@ -0,0 +1,487 @@
1/*
2 * TI Divider Clock
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * Tero Kristo <t-kristo@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether express or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#include <linux/clk-provider.h>
19#include <linux/slab.h>
20#include <linux/err.h>
21#include <linux/of.h>
22#include <linux/of_address.h>
23#include <linux/clk/ti.h>
24
25#undef pr_fmt
26#define pr_fmt(fmt) "%s: " fmt, __func__
27
28#define to_clk_divider(_hw) container_of(_hw, struct clk_divider, hw)
29
30#define div_mask(d) ((1 << ((d)->width)) - 1)
31
32static unsigned int _get_table_maxdiv(const struct clk_div_table *table)
33{
34 unsigned int maxdiv = 0;
35 const struct clk_div_table *clkt;
36
37 for (clkt = table; clkt->div; clkt++)
38 if (clkt->div > maxdiv)
39 maxdiv = clkt->div;
40 return maxdiv;
41}
42
43static unsigned int _get_maxdiv(struct clk_divider *divider)
44{
45 if (divider->flags & CLK_DIVIDER_ONE_BASED)
46 return div_mask(divider);
47 if (divider->flags & CLK_DIVIDER_POWER_OF_TWO)
48 return 1 << div_mask(divider);
49 if (divider->table)
50 return _get_table_maxdiv(divider->table);
51 return div_mask(divider) + 1;
52}
53
54static unsigned int _get_table_div(const struct clk_div_table *table,
55 unsigned int val)
56{
57 const struct clk_div_table *clkt;
58
59 for (clkt = table; clkt->div; clkt++)
60 if (clkt->val == val)
61 return clkt->div;
62 return 0;
63}
64
65static unsigned int _get_div(struct clk_divider *divider, unsigned int val)
66{
67 if (divider->flags & CLK_DIVIDER_ONE_BASED)
68 return val;
69 if (divider->flags & CLK_DIVIDER_POWER_OF_TWO)
70 return 1 << val;
71 if (divider->table)
72 return _get_table_div(divider->table, val);
73 return val + 1;
74}
75
76static unsigned int _get_table_val(const struct clk_div_table *table,
77 unsigned int div)
78{
79 const struct clk_div_table *clkt;
80
81 for (clkt = table; clkt->div; clkt++)
82 if (clkt->div == div)
83 return clkt->val;
84 return 0;
85}
86
87static unsigned int _get_val(struct clk_divider *divider, u8 div)
88{
89 if (divider->flags & CLK_DIVIDER_ONE_BASED)
90 return div;
91 if (divider->flags & CLK_DIVIDER_POWER_OF_TWO)
92 return __ffs(div);
93 if (divider->table)
94 return _get_table_val(divider->table, div);
95 return div - 1;
96}
97
98static unsigned long ti_clk_divider_recalc_rate(struct clk_hw *hw,
99 unsigned long parent_rate)
100{
101 struct clk_divider *divider = to_clk_divider(hw);
102 unsigned int div, val;
103
104 val = ti_clk_ll_ops->clk_readl(divider->reg) >> divider->shift;
105 val &= div_mask(divider);
106
107 div = _get_div(divider, val);
108 if (!div) {
109 WARN(!(divider->flags & CLK_DIVIDER_ALLOW_ZERO),
110 "%s: Zero divisor and CLK_DIVIDER_ALLOW_ZERO not set\n",
111 __clk_get_name(hw->clk));
112 return parent_rate;
113 }
114
115 return parent_rate / div;
116}
117
118/*
119 * The reverse of DIV_ROUND_UP: The maximum number which
120 * divided by m is r
121 */
122#define MULT_ROUND_UP(r, m) ((r) * (m) + (m) - 1)
123
124static bool _is_valid_table_div(const struct clk_div_table *table,
125 unsigned int div)
126{
127 const struct clk_div_table *clkt;
128
129 for (clkt = table; clkt->div; clkt++)
130 if (clkt->div == div)
131 return true;
132 return false;
133}
134
135static bool _is_valid_div(struct clk_divider *divider, unsigned int div)
136{
137 if (divider->flags & CLK_DIVIDER_POWER_OF_TWO)
138 return is_power_of_2(div);
139 if (divider->table)
140 return _is_valid_table_div(divider->table, div);
141 return true;
142}
143
144static int ti_clk_divider_bestdiv(struct clk_hw *hw, unsigned long rate,
145 unsigned long *best_parent_rate)
146{
147 struct clk_divider *divider = to_clk_divider(hw);
148 int i, bestdiv = 0;
149 unsigned long parent_rate, best = 0, now, maxdiv;
150 unsigned long parent_rate_saved = *best_parent_rate;
151
152 if (!rate)
153 rate = 1;
154
155 maxdiv = _get_maxdiv(divider);
156
157 if (!(__clk_get_flags(hw->clk) & CLK_SET_RATE_PARENT)) {
158 parent_rate = *best_parent_rate;
159 bestdiv = DIV_ROUND_UP(parent_rate, rate);
160 bestdiv = bestdiv == 0 ? 1 : bestdiv;
161 bestdiv = bestdiv > maxdiv ? maxdiv : bestdiv;
162 return bestdiv;
163 }
164
165 /*
166 * The maximum divider we can use without overflowing
167 * unsigned long in rate * i below
168 */
169 maxdiv = min(ULONG_MAX / rate, maxdiv);
170
171 for (i = 1; i <= maxdiv; i++) {
172 if (!_is_valid_div(divider, i))
173 continue;
174 if (rate * i == parent_rate_saved) {
175 /*
176 * It's the most ideal case if the requested rate can be
177 * divided from parent clock without needing to change
178 * parent rate, so return the divider immediately.
179 */
180 *best_parent_rate = parent_rate_saved;
181 return i;
182 }
183 parent_rate = __clk_round_rate(__clk_get_parent(hw->clk),
184 MULT_ROUND_UP(rate, i));
185 now = parent_rate / i;
186 if (now <= rate && now > best) {
187 bestdiv = i;
188 best = now;
189 *best_parent_rate = parent_rate;
190 }
191 }
192
193 if (!bestdiv) {
194 bestdiv = _get_maxdiv(divider);
195 *best_parent_rate =
196 __clk_round_rate(__clk_get_parent(hw->clk), 1);
197 }
198
199 return bestdiv;
200}
201
202static long ti_clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
203 unsigned long *prate)
204{
205 int div;
206 div = ti_clk_divider_bestdiv(hw, rate, prate);
207
208 return *prate / div;
209}
210
211static int ti_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
212 unsigned long parent_rate)
213{
214 struct clk_divider *divider = to_clk_divider(hw);
215 unsigned int div, value;
216 unsigned long flags = 0;
217 u32 val;
218
219 div = parent_rate / rate;
220 value = _get_val(divider, div);
221
222 if (value > div_mask(divider))
223 value = div_mask(divider);
224
225 if (divider->lock)
226 spin_lock_irqsave(divider->lock, flags);
227
228 if (divider->flags & CLK_DIVIDER_HIWORD_MASK) {
229 val = div_mask(divider) << (divider->shift + 16);
230 } else {
231 val = ti_clk_ll_ops->clk_readl(divider->reg);
232 val &= ~(div_mask(divider) << divider->shift);
233 }
234 val |= value << divider->shift;
235 ti_clk_ll_ops->clk_writel(val, divider->reg);
236
237 if (divider->lock)
238 spin_unlock_irqrestore(divider->lock, flags);
239
240 return 0;
241}
242
243const struct clk_ops ti_clk_divider_ops = {
244 .recalc_rate = ti_clk_divider_recalc_rate,
245 .round_rate = ti_clk_divider_round_rate,
246 .set_rate = ti_clk_divider_set_rate,
247};
248
249static struct clk *_register_divider(struct device *dev, const char *name,
250 const char *parent_name,
251 unsigned long flags, void __iomem *reg,
252 u8 shift, u8 width, u8 clk_divider_flags,
253 const struct clk_div_table *table,
254 spinlock_t *lock)
255{
256 struct clk_divider *div;
257 struct clk *clk;
258 struct clk_init_data init;
259
260 if (clk_divider_flags & CLK_DIVIDER_HIWORD_MASK) {
261 if (width + shift > 16) {
262 pr_warn("divider value exceeds LOWORD field\n");
263 return ERR_PTR(-EINVAL);
264 }
265 }
266
267 /* allocate the divider */
268 div = kzalloc(sizeof(*div), GFP_KERNEL);
269 if (!div) {
270 pr_err("%s: could not allocate divider clk\n", __func__);
271 return ERR_PTR(-ENOMEM);
272 }
273
274 init.name = name;
275 init.ops = &ti_clk_divider_ops;
276 init.flags = flags | CLK_IS_BASIC;
277 init.parent_names = (parent_name ? &parent_name : NULL);
278 init.num_parents = (parent_name ? 1 : 0);
279
280 /* struct clk_divider assignments */
281 div->reg = reg;
282 div->shift = shift;
283 div->width = width;
284 div->flags = clk_divider_flags;
285 div->lock = lock;
286 div->hw.init = &init;
287 div->table = table;
288
289 /* register the clock */
290 clk = clk_register(dev, &div->hw);
291
292 if (IS_ERR(clk))
293 kfree(div);
294
295 return clk;
296}
297
298static struct clk_div_table
299__init *ti_clk_get_div_table(struct device_node *node)
300{
301 struct clk_div_table *table;
302 const __be32 *divspec;
303 u32 val;
304 u32 num_div;
305 u32 valid_div;
306 int i;
307
308 divspec = of_get_property(node, "ti,dividers", &num_div);
309
310 if (!divspec)
311 return NULL;
312
313 num_div /= 4;
314
315 valid_div = 0;
316
317 /* Determine required size for divider table */
318 for (i = 0; i < num_div; i++) {
319 of_property_read_u32_index(node, "ti,dividers", i, &val);
320 if (val)
321 valid_div++;
322 }
323
324 if (!valid_div) {
325 pr_err("no valid dividers for %s table\n", node->name);
326 return ERR_PTR(-EINVAL);
327 }
328
329 table = kzalloc(sizeof(*table) * (valid_div + 1), GFP_KERNEL);
330
331 if (!table)
332 return ERR_PTR(-ENOMEM);
333
334 valid_div = 0;
335
336 for (i = 0; i < num_div; i++) {
337 of_property_read_u32_index(node, "ti,dividers", i, &val);
338 if (val) {
339 table[valid_div].div = val;
340 table[valid_div].val = i;
341 valid_div++;
342 }
343 }
344
345 return table;
346}
347
348static int _get_divider_width(struct device_node *node,
349 const struct clk_div_table *table,
350 u8 flags)
351{
352 u32 min_div;
353 u32 max_div;
354 u32 val = 0;
355 u32 div;
356
357 if (!table) {
358 /* Clk divider table not provided, determine min/max divs */
359 if (of_property_read_u32(node, "ti,min-div", &min_div))
360 min_div = 1;
361
362 if (of_property_read_u32(node, "ti,max-div", &max_div)) {
363 pr_err("no max-div for %s!\n", node->name);
364 return -EINVAL;
365 }
366
367 /* Determine bit width for the field */
368 if (flags & CLK_DIVIDER_ONE_BASED)
369 val = 1;
370
371 div = min_div;
372
373 while (div < max_div) {
374 if (flags & CLK_DIVIDER_POWER_OF_TWO)
375 div <<= 1;
376 else
377 div++;
378 val++;
379 }
380 } else {
381 div = 0;
382
383 while (table[div].div) {
384 val = table[div].val;
385 div++;
386 }
387 }
388
389 return fls(val);
390}
391
392static int __init ti_clk_divider_populate(struct device_node *node,
393 void __iomem **reg, const struct clk_div_table **table,
394 u32 *flags, u8 *div_flags, u8 *width, u8 *shift)
395{
396 u32 val;
397
398 *reg = ti_clk_get_reg_addr(node, 0);
399 if (!*reg)
400 return -EINVAL;
401
402 if (!of_property_read_u32(node, "ti,bit-shift", &val))
403 *shift = val;
404 else
405 *shift = 0;
406
407 *flags = 0;
408 *div_flags = 0;
409
410 if (of_property_read_bool(node, "ti,index-starts-at-one"))
411 *div_flags |= CLK_DIVIDER_ONE_BASED;
412
413 if (of_property_read_bool(node, "ti,index-power-of-two"))
414 *div_flags |= CLK_DIVIDER_POWER_OF_TWO;
415
416 if (of_property_read_bool(node, "ti,set-rate-parent"))
417 *flags |= CLK_SET_RATE_PARENT;
418
419 *table = ti_clk_get_div_table(node);
420
421 if (IS_ERR(*table))
422 return PTR_ERR(*table);
423
424 *width = _get_divider_width(node, *table, *div_flags);
425
426 return 0;
427}
428
429/**
430 * of_ti_divider_clk_setup - Setup function for simple div rate clock
431 * @node: device node for this clock
432 *
433 * Sets up a basic divider clock.
434 */
435static void __init of_ti_divider_clk_setup(struct device_node *node)
436{
437 struct clk *clk;
438 const char *parent_name;
439 void __iomem *reg;
440 u8 clk_divider_flags = 0;
441 u8 width = 0;
442 u8 shift = 0;
443 const struct clk_div_table *table = NULL;
444 u32 flags = 0;
445
446 parent_name = of_clk_get_parent_name(node, 0);
447
448 if (ti_clk_divider_populate(node, &reg, &table, &flags,
449 &clk_divider_flags, &width, &shift))
450 goto cleanup;
451
452 clk = _register_divider(NULL, node->name, parent_name, flags, reg,
453 shift, width, clk_divider_flags, table, NULL);
454
455 if (!IS_ERR(clk)) {
456 of_clk_add_provider(node, of_clk_src_simple_get, clk);
457 of_ti_clk_autoidle_setup(node);
458 return;
459 }
460
461cleanup:
462 kfree(table);
463}
464CLK_OF_DECLARE(divider_clk, "ti,divider-clock", of_ti_divider_clk_setup);
465
466static void __init of_ti_composite_divider_clk_setup(struct device_node *node)
467{
468 struct clk_divider *div;
469 u32 val;
470
471 div = kzalloc(sizeof(*div), GFP_KERNEL);
472 if (!div)
473 return;
474
475 if (ti_clk_divider_populate(node, &div->reg, &div->table, &val,
476 &div->flags, &div->width, &div->shift) < 0)
477 goto cleanup;
478
479 if (!ti_clk_add_component(node, &div->hw, CLK_COMPONENT_TYPE_DIVIDER))
480 return;
481
482cleanup:
483 kfree(div->table);
484 kfree(div);
485}
486CLK_OF_DECLARE(ti_composite_divider_clk, "ti,composite-divider-clock",
487 of_ti_composite_divider_clk_setup);
diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c
new file mode 100644
index 000000000000..7e498a44f97d
--- /dev/null
+++ b/drivers/clk/ti/dpll.c
@@ -0,0 +1,558 @@
1/*
2 * OMAP DPLL clock support
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * Tero Kristo <t-kristo@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether express or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#include <linux/clk-provider.h>
19#include <linux/slab.h>
20#include <linux/err.h>
21#include <linux/of.h>
22#include <linux/of_address.h>
23#include <linux/clk/ti.h>
24
25#undef pr_fmt
26#define pr_fmt(fmt) "%s: " fmt, __func__
27
28#define DPLL_HAS_AUTOIDLE 0x1
29
30#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
31 defined(CONFIG_SOC_DRA7XX)
32static const struct clk_ops dpll_m4xen_ck_ops = {
33 .enable = &omap3_noncore_dpll_enable,
34 .disable = &omap3_noncore_dpll_disable,
35 .recalc_rate = &omap4_dpll_regm4xen_recalc,
36 .round_rate = &omap4_dpll_regm4xen_round_rate,
37 .set_rate = &omap3_noncore_dpll_set_rate,
38 .get_parent = &omap2_init_dpll_parent,
39};
40#endif
41
42static const struct clk_ops dpll_core_ck_ops = {
43 .recalc_rate = &omap3_dpll_recalc,
44 .get_parent = &omap2_init_dpll_parent,
45};
46
47#ifdef CONFIG_ARCH_OMAP3
48static const struct clk_ops omap3_dpll_core_ck_ops = {
49 .get_parent = &omap2_init_dpll_parent,
50 .recalc_rate = &omap3_dpll_recalc,
51 .round_rate = &omap2_dpll_round_rate,
52};
53#endif
54
55static const struct clk_ops dpll_ck_ops = {
56 .enable = &omap3_noncore_dpll_enable,
57 .disable = &omap3_noncore_dpll_disable,
58 .recalc_rate = &omap3_dpll_recalc,
59 .round_rate = &omap2_dpll_round_rate,
60 .set_rate = &omap3_noncore_dpll_set_rate,
61 .get_parent = &omap2_init_dpll_parent,
62};
63
64static const struct clk_ops dpll_no_gate_ck_ops = {
65 .recalc_rate = &omap3_dpll_recalc,
66 .get_parent = &omap2_init_dpll_parent,
67 .round_rate = &omap2_dpll_round_rate,
68 .set_rate = &omap3_noncore_dpll_set_rate,
69};
70
71#ifdef CONFIG_ARCH_OMAP3
72static const struct clk_ops omap3_dpll_ck_ops = {
73 .enable = &omap3_noncore_dpll_enable,
74 .disable = &omap3_noncore_dpll_disable,
75 .get_parent = &omap2_init_dpll_parent,
76 .recalc_rate = &omap3_dpll_recalc,
77 .set_rate = &omap3_noncore_dpll_set_rate,
78 .round_rate = &omap2_dpll_round_rate,
79};
80
81static const struct clk_ops omap3_dpll_per_ck_ops = {
82 .enable = &omap3_noncore_dpll_enable,
83 .disable = &omap3_noncore_dpll_disable,
84 .get_parent = &omap2_init_dpll_parent,
85 .recalc_rate = &omap3_dpll_recalc,
86 .set_rate = &omap3_dpll4_set_rate,
87 .round_rate = &omap2_dpll_round_rate,
88};
89#endif
90
91static const struct clk_ops dpll_x2_ck_ops = {
92 .recalc_rate = &omap3_clkoutx2_recalc,
93};
94
95/**
96 * ti_clk_register_dpll - low level registration of a DPLL clock
97 * @hw: hardware clock definition for the clock
98 * @node: device node for the clock
99 *
100 * Finalizes DPLL registration process. In case a failure (clk-ref or
101 * clk-bypass is missing), the clock is added to retry list and
102 * the initialization is retried on later stage.
103 */
104static void __init ti_clk_register_dpll(struct clk_hw *hw,
105 struct device_node *node)
106{
107 struct clk_hw_omap *clk_hw = to_clk_hw_omap(hw);
108 struct dpll_data *dd = clk_hw->dpll_data;
109 struct clk *clk;
110
111 dd->clk_ref = of_clk_get(node, 0);
112 dd->clk_bypass = of_clk_get(node, 1);
113
114 if (IS_ERR(dd->clk_ref) || IS_ERR(dd->clk_bypass)) {
115 pr_debug("clk-ref or clk-bypass missing for %s, retry later\n",
116 node->name);
117 if (!ti_clk_retry_init(node, hw, ti_clk_register_dpll))
118 return;
119
120 goto cleanup;
121 }
122
123 /* register the clock */
124 clk = clk_register(NULL, &clk_hw->hw);
125
126 if (!IS_ERR(clk)) {
127 omap2_init_clk_hw_omap_clocks(clk);
128 of_clk_add_provider(node, of_clk_src_simple_get, clk);
129 kfree(clk_hw->hw.init->parent_names);
130 kfree(clk_hw->hw.init);
131 return;
132 }
133
134cleanup:
135 kfree(clk_hw->dpll_data);
136 kfree(clk_hw->hw.init->parent_names);
137 kfree(clk_hw->hw.init);
138 kfree(clk_hw);
139}
140
141#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
142 defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM33XX)
143/**
144 * ti_clk_register_dpll_x2 - Registers a DPLLx2 clock
145 * @node: device node for this clock
146 * @ops: clk_ops for this clock
147 * @hw_ops: clk_hw_ops for this clock
148 *
149 * Initializes a DPLL x 2 clock from device tree data.
150 */
151static void ti_clk_register_dpll_x2(struct device_node *node,
152 const struct clk_ops *ops,
153 const struct clk_hw_omap_ops *hw_ops)
154{
155 struct clk *clk;
156 struct clk_init_data init = { NULL };
157 struct clk_hw_omap *clk_hw;
158 const char *name = node->name;
159 const char *parent_name;
160
161 parent_name = of_clk_get_parent_name(node, 0);
162 if (!parent_name) {
163 pr_err("%s must have parent\n", node->name);
164 return;
165 }
166
167 clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL);
168 if (!clk_hw)
169 return;
170
171 clk_hw->ops = hw_ops;
172 clk_hw->hw.init = &init;
173
174 init.name = name;
175 init.ops = ops;
176 init.parent_names = &parent_name;
177 init.num_parents = 1;
178
179 /* register the clock */
180 clk = clk_register(NULL, &clk_hw->hw);
181
182 if (IS_ERR(clk)) {
183 kfree(clk_hw);
184 } else {
185 omap2_init_clk_hw_omap_clocks(clk);
186 of_clk_add_provider(node, of_clk_src_simple_get, clk);
187 }
188}
189#endif
190
191/**
192 * of_ti_dpll_setup - Setup function for OMAP DPLL clocks
193 * @node: device node containing the DPLL info
194 * @ops: ops for the DPLL
195 * @ddt: DPLL data template to use
196 * @init_flags: flags for controlling init types
197 *
198 * Initializes a DPLL clock from device tree data.
199 */
200static void __init of_ti_dpll_setup(struct device_node *node,
201 const struct clk_ops *ops,
202 const struct dpll_data *ddt,
203 u8 init_flags)
204{
205 struct clk_hw_omap *clk_hw = NULL;
206 struct clk_init_data *init = NULL;
207 const char **parent_names = NULL;
208 struct dpll_data *dd = NULL;
209 int i;
210 u8 dpll_mode = 0;
211
212 dd = kzalloc(sizeof(*dd), GFP_KERNEL);
213 clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL);
214 init = kzalloc(sizeof(*init), GFP_KERNEL);
215 if (!dd || !clk_hw || !init)
216 goto cleanup;
217
218 memcpy(dd, ddt, sizeof(*dd));
219
220 clk_hw->dpll_data = dd;
221 clk_hw->ops = &clkhwops_omap3_dpll;
222 clk_hw->hw.init = init;
223 clk_hw->flags = MEMMAP_ADDRESSING;
224
225 init->name = node->name;
226 init->ops = ops;
227
228 init->num_parents = of_clk_get_parent_count(node);
229 if (init->num_parents < 1) {
230 pr_err("%s must have parent(s)\n", node->name);
231 goto cleanup;
232 }
233
234 parent_names = kzalloc(sizeof(char *) * init->num_parents, GFP_KERNEL);
235 if (!parent_names)
236 goto cleanup;
237
238 for (i = 0; i < init->num_parents; i++)
239 parent_names[i] = of_clk_get_parent_name(node, i);
240
241 init->parent_names = parent_names;
242
243 dd->control_reg = ti_clk_get_reg_addr(node, 0);
244 dd->idlest_reg = ti_clk_get_reg_addr(node, 1);
245 dd->mult_div1_reg = ti_clk_get_reg_addr(node, 2);
246
247 if (!dd->control_reg || !dd->idlest_reg || !dd->mult_div1_reg)
248 goto cleanup;
249
250 if (init_flags & DPLL_HAS_AUTOIDLE) {
251 dd->autoidle_reg = ti_clk_get_reg_addr(node, 3);
252 if (!dd->autoidle_reg)
253 goto cleanup;
254 }
255
256 if (of_property_read_bool(node, "ti,low-power-stop"))
257 dpll_mode |= 1 << DPLL_LOW_POWER_STOP;
258
259 if (of_property_read_bool(node, "ti,low-power-bypass"))
260 dpll_mode |= 1 << DPLL_LOW_POWER_BYPASS;
261
262 if (of_property_read_bool(node, "ti,lock"))
263 dpll_mode |= 1 << DPLL_LOCKED;
264
265 if (dpll_mode)
266 dd->modes = dpll_mode;
267
268 ti_clk_register_dpll(&clk_hw->hw, node);
269 return;
270
271cleanup:
272 kfree(dd);
273 kfree(parent_names);
274 kfree(init);
275 kfree(clk_hw);
276}
277
278#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
279 defined(CONFIG_SOC_DRA7XX)
280static void __init of_ti_omap4_dpll_x2_setup(struct device_node *node)
281{
282 ti_clk_register_dpll_x2(node, &dpll_x2_ck_ops, &clkhwops_omap4_dpllmx);
283}
284CLK_OF_DECLARE(ti_omap4_dpll_x2_clock, "ti,omap4-dpll-x2-clock",
285 of_ti_omap4_dpll_x2_setup);
286#endif
287
288#ifdef CONFIG_SOC_AM33XX
289static void __init of_ti_am3_dpll_x2_setup(struct device_node *node)
290{
291 ti_clk_register_dpll_x2(node, &dpll_x2_ck_ops, NULL);
292}
293CLK_OF_DECLARE(ti_am3_dpll_x2_clock, "ti,am3-dpll-x2-clock",
294 of_ti_am3_dpll_x2_setup);
295#endif
296
297#ifdef CONFIG_ARCH_OMAP3
298static void __init of_ti_omap3_dpll_setup(struct device_node *node)
299{
300 const struct dpll_data dd = {
301 .idlest_mask = 0x1,
302 .enable_mask = 0x7,
303 .autoidle_mask = 0x7,
304 .mult_mask = 0x7ff << 8,
305 .div1_mask = 0x7f,
306 .max_multiplier = 2047,
307 .max_divider = 128,
308 .min_divider = 1,
309 .freqsel_mask = 0xf0,
310 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
311 };
312
313 of_ti_dpll_setup(node, &omap3_dpll_ck_ops, &dd, DPLL_HAS_AUTOIDLE);
314}
315CLK_OF_DECLARE(ti_omap3_dpll_clock, "ti,omap3-dpll-clock",
316 of_ti_omap3_dpll_setup);
317
318static void __init of_ti_omap3_core_dpll_setup(struct device_node *node)
319{
320 const struct dpll_data dd = {
321 .idlest_mask = 0x1,
322 .enable_mask = 0x7,
323 .autoidle_mask = 0x7,
324 .mult_mask = 0x7ff << 16,
325 .div1_mask = 0x7f << 8,
326 .max_multiplier = 2047,
327 .max_divider = 128,
328 .min_divider = 1,
329 .freqsel_mask = 0xf0,
330 };
331
332 of_ti_dpll_setup(node, &omap3_dpll_core_ck_ops, &dd, DPLL_HAS_AUTOIDLE);
333}
334CLK_OF_DECLARE(ti_omap3_core_dpll_clock, "ti,omap3-dpll-core-clock",
335 of_ti_omap3_core_dpll_setup);
336
337static void __init of_ti_omap3_per_dpll_setup(struct device_node *node)
338{
339 const struct dpll_data dd = {
340 .idlest_mask = 0x1 << 1,
341 .enable_mask = 0x7 << 16,
342 .autoidle_mask = 0x7 << 3,
343 .mult_mask = 0x7ff << 8,
344 .div1_mask = 0x7f,
345 .max_multiplier = 2047,
346 .max_divider = 128,
347 .min_divider = 1,
348 .freqsel_mask = 0xf00000,
349 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
350 };
351
352 of_ti_dpll_setup(node, &omap3_dpll_per_ck_ops, &dd, DPLL_HAS_AUTOIDLE);
353}
354CLK_OF_DECLARE(ti_omap3_per_dpll_clock, "ti,omap3-dpll-per-clock",
355 of_ti_omap3_per_dpll_setup);
356
357static void __init of_ti_omap3_per_jtype_dpll_setup(struct device_node *node)
358{
359 const struct dpll_data dd = {
360 .idlest_mask = 0x1 << 1,
361 .enable_mask = 0x7 << 16,
362 .autoidle_mask = 0x7 << 3,
363 .mult_mask = 0xfff << 8,
364 .div1_mask = 0x7f,
365 .max_multiplier = 4095,
366 .max_divider = 128,
367 .min_divider = 1,
368 .sddiv_mask = 0xff << 24,
369 .dco_mask = 0xe << 20,
370 .flags = DPLL_J_TYPE,
371 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
372 };
373
374 of_ti_dpll_setup(node, &omap3_dpll_per_ck_ops, &dd, DPLL_HAS_AUTOIDLE);
375}
376CLK_OF_DECLARE(ti_omap3_per_jtype_dpll_clock, "ti,omap3-dpll-per-j-type-clock",
377 of_ti_omap3_per_jtype_dpll_setup);
378#endif
379
380static void __init of_ti_omap4_dpll_setup(struct device_node *node)
381{
382 const struct dpll_data dd = {
383 .idlest_mask = 0x1,
384 .enable_mask = 0x7,
385 .autoidle_mask = 0x7,
386 .mult_mask = 0x7ff << 8,
387 .div1_mask = 0x7f,
388 .max_multiplier = 2047,
389 .max_divider = 128,
390 .min_divider = 1,
391 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
392 };
393
394 of_ti_dpll_setup(node, &dpll_ck_ops, &dd, DPLL_HAS_AUTOIDLE);
395}
396CLK_OF_DECLARE(ti_omap4_dpll_clock, "ti,omap4-dpll-clock",
397 of_ti_omap4_dpll_setup);
398
399static void __init of_ti_omap4_core_dpll_setup(struct device_node *node)
400{
401 const struct dpll_data dd = {
402 .idlest_mask = 0x1,
403 .enable_mask = 0x7,
404 .autoidle_mask = 0x7,
405 .mult_mask = 0x7ff << 8,
406 .div1_mask = 0x7f,
407 .max_multiplier = 2047,
408 .max_divider = 128,
409 .min_divider = 1,
410 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
411 };
412
413 of_ti_dpll_setup(node, &dpll_core_ck_ops, &dd, DPLL_HAS_AUTOIDLE);
414}
415CLK_OF_DECLARE(ti_omap4_core_dpll_clock, "ti,omap4-dpll-core-clock",
416 of_ti_omap4_core_dpll_setup);
417
418#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
419 defined(CONFIG_SOC_DRA7XX)
420static void __init of_ti_omap4_m4xen_dpll_setup(struct device_node *node)
421{
422 const struct dpll_data dd = {
423 .idlest_mask = 0x1,
424 .enable_mask = 0x7,
425 .autoidle_mask = 0x7,
426 .mult_mask = 0x7ff << 8,
427 .div1_mask = 0x7f,
428 .max_multiplier = 2047,
429 .max_divider = 128,
430 .min_divider = 1,
431 .m4xen_mask = 0x800,
432 .lpmode_mask = 1 << 10,
433 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
434 };
435
436 of_ti_dpll_setup(node, &dpll_m4xen_ck_ops, &dd, DPLL_HAS_AUTOIDLE);
437}
438CLK_OF_DECLARE(ti_omap4_m4xen_dpll_clock, "ti,omap4-dpll-m4xen-clock",
439 of_ti_omap4_m4xen_dpll_setup);
440
441static void __init of_ti_omap4_jtype_dpll_setup(struct device_node *node)
442{
443 const struct dpll_data dd = {
444 .idlest_mask = 0x1,
445 .enable_mask = 0x7,
446 .autoidle_mask = 0x7,
447 .mult_mask = 0xfff << 8,
448 .div1_mask = 0xff,
449 .max_multiplier = 4095,
450 .max_divider = 256,
451 .min_divider = 1,
452 .sddiv_mask = 0xff << 24,
453 .flags = DPLL_J_TYPE,
454 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
455 };
456
457 of_ti_dpll_setup(node, &dpll_m4xen_ck_ops, &dd, DPLL_HAS_AUTOIDLE);
458}
459CLK_OF_DECLARE(ti_omap4_jtype_dpll_clock, "ti,omap4-dpll-j-type-clock",
460 of_ti_omap4_jtype_dpll_setup);
461#endif
462
463static void __init of_ti_am3_no_gate_dpll_setup(struct device_node *node)
464{
465 const struct dpll_data dd = {
466 .idlest_mask = 0x1,
467 .enable_mask = 0x7,
468 .autoidle_mask = 0x7,
469 .mult_mask = 0x7ff << 8,
470 .div1_mask = 0x7f,
471 .max_multiplier = 2047,
472 .max_divider = 128,
473 .min_divider = 1,
474 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
475 };
476
477 of_ti_dpll_setup(node, &dpll_no_gate_ck_ops, &dd, 0);
478}
479CLK_OF_DECLARE(ti_am3_no_gate_dpll_clock, "ti,am3-dpll-no-gate-clock",
480 of_ti_am3_no_gate_dpll_setup);
481
482static void __init of_ti_am3_jtype_dpll_setup(struct device_node *node)
483{
484 const struct dpll_data dd = {
485 .idlest_mask = 0x1,
486 .enable_mask = 0x7,
487 .autoidle_mask = 0x7,
488 .mult_mask = 0x7ff << 8,
489 .div1_mask = 0x7f,
490 .max_multiplier = 4095,
491 .max_divider = 256,
492 .min_divider = 2,
493 .flags = DPLL_J_TYPE,
494 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
495 };
496
497 of_ti_dpll_setup(node, &dpll_ck_ops, &dd, 0);
498}
499CLK_OF_DECLARE(ti_am3_jtype_dpll_clock, "ti,am3-dpll-j-type-clock",
500 of_ti_am3_jtype_dpll_setup);
501
502static void __init of_ti_am3_no_gate_jtype_dpll_setup(struct device_node *node)
503{
504 const struct dpll_data dd = {
505 .idlest_mask = 0x1,
506 .enable_mask = 0x7,
507 .autoidle_mask = 0x7,
508 .mult_mask = 0x7ff << 8,
509 .div1_mask = 0x7f,
510 .max_multiplier = 2047,
511 .max_divider = 128,
512 .min_divider = 1,
513 .flags = DPLL_J_TYPE,
514 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
515 };
516
517 of_ti_dpll_setup(node, &dpll_no_gate_ck_ops, &dd, 0);
518}
519CLK_OF_DECLARE(ti_am3_no_gate_jtype_dpll_clock,
520 "ti,am3-dpll-no-gate-j-type-clock",
521 of_ti_am3_no_gate_jtype_dpll_setup);
522
523static void __init of_ti_am3_dpll_setup(struct device_node *node)
524{
525 const struct dpll_data dd = {
526 .idlest_mask = 0x1,
527 .enable_mask = 0x7,
528 .autoidle_mask = 0x7,
529 .mult_mask = 0x7ff << 8,
530 .div1_mask = 0x7f,
531 .max_multiplier = 2047,
532 .max_divider = 128,
533 .min_divider = 1,
534 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
535 };
536
537 of_ti_dpll_setup(node, &dpll_ck_ops, &dd, 0);
538}
539CLK_OF_DECLARE(ti_am3_dpll_clock, "ti,am3-dpll-clock", of_ti_am3_dpll_setup);
540
541static void __init of_ti_am3_core_dpll_setup(struct device_node *node)
542{
543 const struct dpll_data dd = {
544 .idlest_mask = 0x1,
545 .enable_mask = 0x7,
546 .autoidle_mask = 0x7,
547 .mult_mask = 0x7ff << 8,
548 .div1_mask = 0x7f,
549 .max_multiplier = 2047,
550 .max_divider = 128,
551 .min_divider = 1,
552 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
553 };
554
555 of_ti_dpll_setup(node, &dpll_core_ck_ops, &dd, 0);
556}
557CLK_OF_DECLARE(ti_am3_core_dpll_clock, "ti,am3-dpll-core-clock",
558 of_ti_am3_core_dpll_setup);
diff --git a/drivers/clk/ti/fixed-factor.c b/drivers/clk/ti/fixed-factor.c
new file mode 100644
index 000000000000..c2c8a287408c
--- /dev/null
+++ b/drivers/clk/ti/fixed-factor.c
@@ -0,0 +1,66 @@
1/*
2 * TI Fixed Factor Clock
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * Tero Kristo <t-kristo@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether express or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#include <linux/clk-provider.h>
19#include <linux/slab.h>
20#include <linux/err.h>
21#include <linux/of.h>
22#include <linux/of_address.h>
23#include <linux/clk/ti.h>
24
25#undef pr_fmt
26#define pr_fmt(fmt) "%s: " fmt, __func__
27
28/**
29 * of_ti_fixed_factor_clk_setup - Setup function for TI fixed factor clock
30 * @node: device node for this clock
31 *
32 * Sets up a simple fixed factor clock based on device tree info.
33 */
34static void __init of_ti_fixed_factor_clk_setup(struct device_node *node)
35{
36 struct clk *clk;
37 const char *clk_name = node->name;
38 const char *parent_name;
39 u32 div, mult;
40 u32 flags = 0;
41
42 if (of_property_read_u32(node, "ti,clock-div", &div)) {
43 pr_err("%s must have a clock-div property\n", node->name);
44 return;
45 }
46
47 if (of_property_read_u32(node, "ti,clock-mult", &mult)) {
48 pr_err("%s must have a clock-mult property\n", node->name);
49 return;
50 }
51
52 if (of_property_read_bool(node, "ti,set-rate-parent"))
53 flags |= CLK_SET_RATE_PARENT;
54
55 parent_name = of_clk_get_parent_name(node, 0);
56
57 clk = clk_register_fixed_factor(NULL, clk_name, parent_name, flags,
58 mult, div);
59
60 if (!IS_ERR(clk)) {
61 of_clk_add_provider(node, of_clk_src_simple_get, clk);
62 of_ti_clk_autoidle_setup(node);
63 }
64}
65CLK_OF_DECLARE(ti_fixed_factor_clk, "ti,fixed-factor-clock",
66 of_ti_fixed_factor_clk_setup);
diff --git a/drivers/clk/ti/gate.c b/drivers/clk/ti/gate.c
new file mode 100644
index 000000000000..3e2999d11d15
--- /dev/null
+++ b/drivers/clk/ti/gate.c
@@ -0,0 +1,249 @@
1/*
2 * OMAP gate clock support
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * Tero Kristo <t-kristo@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether express or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#include <linux/clk-provider.h>
19#include <linux/slab.h>
20#include <linux/io.h>
21#include <linux/of.h>
22#include <linux/of_address.h>
23#include <linux/clk/ti.h>
24
25#define to_clk_divider(_hw) container_of(_hw, struct clk_divider, hw)
26
27#undef pr_fmt
28#define pr_fmt(fmt) "%s: " fmt, __func__
29
30static int omap36xx_gate_clk_enable_with_hsdiv_restore(struct clk_hw *clk);
31
32static const struct clk_ops omap_gate_clkdm_clk_ops = {
33 .init = &omap2_init_clk_clkdm,
34 .enable = &omap2_clkops_enable_clkdm,
35 .disable = &omap2_clkops_disable_clkdm,
36};
37
38static const struct clk_ops omap_gate_clk_ops = {
39 .init = &omap2_init_clk_clkdm,
40 .enable = &omap2_dflt_clk_enable,
41 .disable = &omap2_dflt_clk_disable,
42 .is_enabled = &omap2_dflt_clk_is_enabled,
43};
44
45static const struct clk_ops omap_gate_clk_hsdiv_restore_ops = {
46 .init = &omap2_init_clk_clkdm,
47 .enable = &omap36xx_gate_clk_enable_with_hsdiv_restore,
48 .disable = &omap2_dflt_clk_disable,
49 .is_enabled = &omap2_dflt_clk_is_enabled,
50};
51
52/**
53 * omap36xx_gate_clk_enable_with_hsdiv_restore - enable clocks suffering
54 * from HSDivider PWRDN problem Implements Errata ID: i556.
55 * @clk: DPLL output struct clk
56 *
57 * 3630 only: dpll3_m3_ck, dpll4_m2_ck, dpll4_m3_ck, dpll4_m4_ck,
58 * dpll4_m5_ck & dpll4_m6_ck dividers gets loaded with reset
59 * valueafter their respective PWRDN bits are set. Any dummy write
60 * (Any other value different from the Read value) to the
61 * corresponding CM_CLKSEL register will refresh the dividers.
62 */
63static int omap36xx_gate_clk_enable_with_hsdiv_restore(struct clk_hw *clk)
64{
65 struct clk_divider *parent;
66 struct clk_hw *parent_hw;
67 u32 dummy_v, orig_v;
68 int ret;
69
70 /* Clear PWRDN bit of HSDIVIDER */
71 ret = omap2_dflt_clk_enable(clk);
72
73 /* Parent is the x2 node, get parent of parent for the m2 div */
74 parent_hw = __clk_get_hw(__clk_get_parent(__clk_get_parent(clk->clk)));
75 parent = to_clk_divider(parent_hw);
76
77 /* Restore the dividers */
78 if (!ret) {
79 orig_v = ti_clk_ll_ops->clk_readl(parent->reg);
80 dummy_v = orig_v;
81
82 /* Write any other value different from the Read value */
83 dummy_v ^= (1 << parent->shift);
84 ti_clk_ll_ops->clk_writel(dummy_v, parent->reg);
85
86 /* Write the original divider */
87 ti_clk_ll_ops->clk_writel(orig_v, parent->reg);
88 }
89
90 return ret;
91}
92
93static void __init _of_ti_gate_clk_setup(struct device_node *node,
94 const struct clk_ops *ops,
95 const struct clk_hw_omap_ops *hw_ops)
96{
97 struct clk *clk;
98 struct clk_init_data init = { NULL };
99 struct clk_hw_omap *clk_hw;
100 const char *clk_name = node->name;
101 const char *parent_name;
102 u32 val;
103
104 clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL);
105 if (!clk_hw)
106 return;
107
108 clk_hw->hw.init = &init;
109
110 init.name = clk_name;
111 init.ops = ops;
112
113 if (ops != &omap_gate_clkdm_clk_ops) {
114 clk_hw->enable_reg = ti_clk_get_reg_addr(node, 0);
115 if (!clk_hw->enable_reg)
116 goto cleanup;
117
118 if (!of_property_read_u32(node, "ti,bit-shift", &val))
119 clk_hw->enable_bit = val;
120 }
121
122 clk_hw->ops = hw_ops;
123
124 clk_hw->flags = MEMMAP_ADDRESSING;
125
126 if (of_clk_get_parent_count(node) != 1) {
127 pr_err("%s must have 1 parent\n", clk_name);
128 goto cleanup;
129 }
130
131 parent_name = of_clk_get_parent_name(node, 0);
132 init.parent_names = &parent_name;
133 init.num_parents = 1;
134
135 if (of_property_read_bool(node, "ti,set-rate-parent"))
136 init.flags |= CLK_SET_RATE_PARENT;
137
138 if (of_property_read_bool(node, "ti,set-bit-to-disable"))
139 clk_hw->flags |= INVERT_ENABLE;
140
141 clk = clk_register(NULL, &clk_hw->hw);
142
143 if (!IS_ERR(clk)) {
144 of_clk_add_provider(node, of_clk_src_simple_get, clk);
145 return;
146 }
147
148cleanup:
149 kfree(clk_hw);
150}
151
152static void __init
153_of_ti_composite_gate_clk_setup(struct device_node *node,
154 const struct clk_hw_omap_ops *hw_ops)
155{
156 struct clk_hw_omap *gate;
157 u32 val = 0;
158
159 gate = kzalloc(sizeof(*gate), GFP_KERNEL);
160 if (!gate)
161 return;
162
163 gate->enable_reg = ti_clk_get_reg_addr(node, 0);
164 if (!gate->enable_reg)
165 goto cleanup;
166
167 of_property_read_u32(node, "ti,bit-shift", &val);
168
169 gate->enable_bit = val;
170 gate->ops = hw_ops;
171 gate->flags = MEMMAP_ADDRESSING;
172
173 if (!ti_clk_add_component(node, &gate->hw, CLK_COMPONENT_TYPE_GATE))
174 return;
175
176cleanup:
177 kfree(gate);
178}
179
180static void __init
181of_ti_composite_no_wait_gate_clk_setup(struct device_node *node)
182{
183 _of_ti_composite_gate_clk_setup(node, NULL);
184}
185CLK_OF_DECLARE(ti_composite_no_wait_gate_clk, "ti,composite-no-wait-gate-clock",
186 of_ti_composite_no_wait_gate_clk_setup);
187
188#ifdef CONFIG_ARCH_OMAP3
189static void __init of_ti_composite_interface_clk_setup(struct device_node *node)
190{
191 _of_ti_composite_gate_clk_setup(node, &clkhwops_iclk_wait);
192}
193CLK_OF_DECLARE(ti_composite_interface_clk, "ti,composite-interface-clock",
194 of_ti_composite_interface_clk_setup);
195#endif
196
197static void __init of_ti_composite_gate_clk_setup(struct device_node *node)
198{
199 _of_ti_composite_gate_clk_setup(node, &clkhwops_wait);
200}
201CLK_OF_DECLARE(ti_composite_gate_clk, "ti,composite-gate-clock",
202 of_ti_composite_gate_clk_setup);
203
204
205static void __init of_ti_clkdm_gate_clk_setup(struct device_node *node)
206{
207 _of_ti_gate_clk_setup(node, &omap_gate_clkdm_clk_ops, NULL);
208}
209CLK_OF_DECLARE(ti_clkdm_gate_clk, "ti,clkdm-gate-clock",
210 of_ti_clkdm_gate_clk_setup);
211
212static void __init of_ti_hsdiv_gate_clk_setup(struct device_node *node)
213{
214 _of_ti_gate_clk_setup(node, &omap_gate_clk_hsdiv_restore_ops,
215 &clkhwops_wait);
216}
217CLK_OF_DECLARE(ti_hsdiv_gate_clk, "ti,hsdiv-gate-clock",
218 of_ti_hsdiv_gate_clk_setup);
219
220static void __init of_ti_gate_clk_setup(struct device_node *node)
221{
222 _of_ti_gate_clk_setup(node, &omap_gate_clk_ops, NULL);
223}
224CLK_OF_DECLARE(ti_gate_clk, "ti,gate-clock", of_ti_gate_clk_setup)
225
226static void __init of_ti_wait_gate_clk_setup(struct device_node *node)
227{
228 _of_ti_gate_clk_setup(node, &omap_gate_clk_ops, &clkhwops_wait);
229}
230CLK_OF_DECLARE(ti_wait_gate_clk, "ti,wait-gate-clock",
231 of_ti_wait_gate_clk_setup);
232
233#ifdef CONFIG_ARCH_OMAP3
234static void __init of_ti_am35xx_gate_clk_setup(struct device_node *node)
235{
236 _of_ti_gate_clk_setup(node, &omap_gate_clk_ops,
237 &clkhwops_am35xx_ipss_module_wait);
238}
239CLK_OF_DECLARE(ti_am35xx_gate_clk, "ti,am35xx-gate-clock",
240 of_ti_am35xx_gate_clk_setup);
241
242static void __init of_ti_dss_gate_clk_setup(struct device_node *node)
243{
244 _of_ti_gate_clk_setup(node, &omap_gate_clk_ops,
245 &clkhwops_omap3430es2_dss_usbhost_wait);
246}
247CLK_OF_DECLARE(ti_dss_gate_clk, "ti,dss-gate-clock",
248 of_ti_dss_gate_clk_setup);
249#endif
diff --git a/drivers/clk/ti/interface.c b/drivers/clk/ti/interface.c
new file mode 100644
index 000000000000..320a2b168bb2
--- /dev/null
+++ b/drivers/clk/ti/interface.c
@@ -0,0 +1,125 @@
1/*
2 * OMAP interface clock support
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * Tero Kristo <t-kristo@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether express or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#include <linux/clk-provider.h>
19#include <linux/slab.h>
20#include <linux/of.h>
21#include <linux/of_address.h>
22#include <linux/clk/ti.h>
23
24#undef pr_fmt
25#define pr_fmt(fmt) "%s: " fmt, __func__
26
27static const struct clk_ops ti_interface_clk_ops = {
28 .init = &omap2_init_clk_clkdm,
29 .enable = &omap2_dflt_clk_enable,
30 .disable = &omap2_dflt_clk_disable,
31 .is_enabled = &omap2_dflt_clk_is_enabled,
32};
33
34static void __init _of_ti_interface_clk_setup(struct device_node *node,
35 const struct clk_hw_omap_ops *ops)
36{
37 struct clk *clk;
38 struct clk_init_data init = { NULL };
39 struct clk_hw_omap *clk_hw;
40 const char *parent_name;
41 u32 val;
42
43 clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL);
44 if (!clk_hw)
45 return;
46
47 clk_hw->hw.init = &init;
48 clk_hw->ops = ops;
49 clk_hw->flags = MEMMAP_ADDRESSING;
50
51 clk_hw->enable_reg = ti_clk_get_reg_addr(node, 0);
52 if (!clk_hw->enable_reg)
53 goto cleanup;
54
55 if (!of_property_read_u32(node, "ti,bit-shift", &val))
56 clk_hw->enable_bit = val;
57
58 init.name = node->name;
59 init.ops = &ti_interface_clk_ops;
60 init.flags = 0;
61
62 parent_name = of_clk_get_parent_name(node, 0);
63 if (!parent_name) {
64 pr_err("%s must have a parent\n", node->name);
65 goto cleanup;
66 }
67
68 init.num_parents = 1;
69 init.parent_names = &parent_name;
70
71 clk = clk_register(NULL, &clk_hw->hw);
72
73 if (!IS_ERR(clk)) {
74 of_clk_add_provider(node, of_clk_src_simple_get, clk);
75 omap2_init_clk_hw_omap_clocks(clk);
76 return;
77 }
78
79cleanup:
80 kfree(clk_hw);
81}
82
83static void __init of_ti_interface_clk_setup(struct device_node *node)
84{
85 _of_ti_interface_clk_setup(node, &clkhwops_iclk_wait);
86}
87CLK_OF_DECLARE(ti_interface_clk, "ti,omap3-interface-clock",
88 of_ti_interface_clk_setup);
89
90static void __init of_ti_no_wait_interface_clk_setup(struct device_node *node)
91{
92 _of_ti_interface_clk_setup(node, &clkhwops_iclk);
93}
94CLK_OF_DECLARE(ti_no_wait_interface_clk, "ti,omap3-no-wait-interface-clock",
95 of_ti_no_wait_interface_clk_setup);
96
97static void __init of_ti_hsotgusb_interface_clk_setup(struct device_node *node)
98{
99 _of_ti_interface_clk_setup(node,
100 &clkhwops_omap3430es2_iclk_hsotgusb_wait);
101}
102CLK_OF_DECLARE(ti_hsotgusb_interface_clk, "ti,omap3-hsotgusb-interface-clock",
103 of_ti_hsotgusb_interface_clk_setup);
104
105static void __init of_ti_dss_interface_clk_setup(struct device_node *node)
106{
107 _of_ti_interface_clk_setup(node,
108 &clkhwops_omap3430es2_iclk_dss_usbhost_wait);
109}
110CLK_OF_DECLARE(ti_dss_interface_clk, "ti,omap3-dss-interface-clock",
111 of_ti_dss_interface_clk_setup);
112
113static void __init of_ti_ssi_interface_clk_setup(struct device_node *node)
114{
115 _of_ti_interface_clk_setup(node, &clkhwops_omap3430es2_iclk_ssi_wait);
116}
117CLK_OF_DECLARE(ti_ssi_interface_clk, "ti,omap3-ssi-interface-clock",
118 of_ti_ssi_interface_clk_setup);
119
120static void __init of_ti_am35xx_interface_clk_setup(struct device_node *node)
121{
122 _of_ti_interface_clk_setup(node, &clkhwops_am35xx_ipss_wait);
123}
124CLK_OF_DECLARE(ti_am35xx_interface_clk, "ti,am35xx-interface-clock",
125 of_ti_am35xx_interface_clk_setup);
diff --git a/drivers/clk/ti/mux.c b/drivers/clk/ti/mux.c
new file mode 100644
index 000000000000..0197a478720c
--- /dev/null
+++ b/drivers/clk/ti/mux.c
@@ -0,0 +1,246 @@
1/*
2 * TI Multiplexer Clock
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * Tero Kristo <t-kristo@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether express or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#include <linux/clk-provider.h>
19#include <linux/slab.h>
20#include <linux/err.h>
21#include <linux/of.h>
22#include <linux/of_address.h>
23#include <linux/clk/ti.h>
24
25#undef pr_fmt
26#define pr_fmt(fmt) "%s: " fmt, __func__
27
28#define to_clk_mux(_hw) container_of(_hw, struct clk_mux, hw)
29
30static u8 ti_clk_mux_get_parent(struct clk_hw *hw)
31{
32 struct clk_mux *mux = to_clk_mux(hw);
33 int num_parents = __clk_get_num_parents(hw->clk);
34 u32 val;
35
36 /*
37 * FIXME need a mux-specific flag to determine if val is bitwise or
38 * numeric. e.g. sys_clkin_ck's clksel field is 3 bits wide, but ranges
39 * from 0x1 to 0x7 (index starts at one)
40 * OTOH, pmd_trace_clk_mux_ck uses a separate bit for each clock, so
41 * val = 0x4 really means "bit 2, index starts at bit 0"
42 */
43 val = ti_clk_ll_ops->clk_readl(mux->reg) >> mux->shift;
44 val &= mux->mask;
45
46 if (mux->table) {
47 int i;
48
49 for (i = 0; i < num_parents; i++)
50 if (mux->table[i] == val)
51 return i;
52 return -EINVAL;
53 }
54
55 if (val && (mux->flags & CLK_MUX_INDEX_BIT))
56 val = ffs(val) - 1;
57
58 if (val && (mux->flags & CLK_MUX_INDEX_ONE))
59 val--;
60
61 if (val >= num_parents)
62 return -EINVAL;
63
64 return val;
65}
66
67static int ti_clk_mux_set_parent(struct clk_hw *hw, u8 index)
68{
69 struct clk_mux *mux = to_clk_mux(hw);
70 u32 val;
71 unsigned long flags = 0;
72
73 if (mux->table) {
74 index = mux->table[index];
75 } else {
76 if (mux->flags & CLK_MUX_INDEX_BIT)
77 index = (1 << ffs(index));
78
79 if (mux->flags & CLK_MUX_INDEX_ONE)
80 index++;
81 }
82
83 if (mux->lock)
84 spin_lock_irqsave(mux->lock, flags);
85
86 if (mux->flags & CLK_MUX_HIWORD_MASK) {
87 val = mux->mask << (mux->shift + 16);
88 } else {
89 val = ti_clk_ll_ops->clk_readl(mux->reg);
90 val &= ~(mux->mask << mux->shift);
91 }
92 val |= index << mux->shift;
93 ti_clk_ll_ops->clk_writel(val, mux->reg);
94
95 if (mux->lock)
96 spin_unlock_irqrestore(mux->lock, flags);
97
98 return 0;
99}
100
101const struct clk_ops ti_clk_mux_ops = {
102 .get_parent = ti_clk_mux_get_parent,
103 .set_parent = ti_clk_mux_set_parent,
104 .determine_rate = __clk_mux_determine_rate,
105};
106
107static struct clk *_register_mux(struct device *dev, const char *name,
108 const char **parent_names, u8 num_parents,
109 unsigned long flags, void __iomem *reg,
110 u8 shift, u32 mask, u8 clk_mux_flags,
111 u32 *table, spinlock_t *lock)
112{
113 struct clk_mux *mux;
114 struct clk *clk;
115 struct clk_init_data init;
116
117 /* allocate the mux */
118 mux = kzalloc(sizeof(*mux), GFP_KERNEL);
119 if (!mux) {
120 pr_err("%s: could not allocate mux clk\n", __func__);
121 return ERR_PTR(-ENOMEM);
122 }
123
124 init.name = name;
125 init.ops = &ti_clk_mux_ops;
126 init.flags = flags | CLK_IS_BASIC;
127 init.parent_names = parent_names;
128 init.num_parents = num_parents;
129
130 /* struct clk_mux assignments */
131 mux->reg = reg;
132 mux->shift = shift;
133 mux->mask = mask;
134 mux->flags = clk_mux_flags;
135 mux->lock = lock;
136 mux->table = table;
137 mux->hw.init = &init;
138
139 clk = clk_register(dev, &mux->hw);
140
141 if (IS_ERR(clk))
142 kfree(mux);
143
144 return clk;
145}
146
147/**
148 * of_mux_clk_setup - Setup function for simple mux rate clock
149 * @node: DT node for the clock
150 *
151 * Sets up a basic clock multiplexer.
152 */
153static void of_mux_clk_setup(struct device_node *node)
154{
155 struct clk *clk;
156 void __iomem *reg;
157 int num_parents;
158 const char **parent_names;
159 int i;
160 u8 clk_mux_flags = 0;
161 u32 mask = 0;
162 u32 shift = 0;
163 u32 flags = 0;
164
165 num_parents = of_clk_get_parent_count(node);
166 if (num_parents < 2) {
167 pr_err("mux-clock %s must have parents\n", node->name);
168 return;
169 }
170 parent_names = kzalloc((sizeof(char *) * num_parents), GFP_KERNEL);
171 if (!parent_names)
172 goto cleanup;
173
174 for (i = 0; i < num_parents; i++)
175 parent_names[i] = of_clk_get_parent_name(node, i);
176
177 reg = ti_clk_get_reg_addr(node, 0);
178
179 if (!reg)
180 goto cleanup;
181
182 of_property_read_u32(node, "ti,bit-shift", &shift);
183
184 if (of_property_read_bool(node, "ti,index-starts-at-one"))
185 clk_mux_flags |= CLK_MUX_INDEX_ONE;
186
187 if (of_property_read_bool(node, "ti,set-rate-parent"))
188 flags |= CLK_SET_RATE_PARENT;
189
190 /* Generate bit-mask based on parent info */
191 mask = num_parents;
192 if (!(clk_mux_flags & CLK_MUX_INDEX_ONE))
193 mask--;
194
195 mask = (1 << fls(mask)) - 1;
196
197 clk = _register_mux(NULL, node->name, parent_names, num_parents, flags,
198 reg, shift, mask, clk_mux_flags, NULL, NULL);
199
200 if (!IS_ERR(clk))
201 of_clk_add_provider(node, of_clk_src_simple_get, clk);
202
203cleanup:
204 kfree(parent_names);
205}
206CLK_OF_DECLARE(mux_clk, "ti,mux-clock", of_mux_clk_setup);
207
208static void __init of_ti_composite_mux_clk_setup(struct device_node *node)
209{
210 struct clk_mux *mux;
211 int num_parents;
212 u32 val;
213
214 mux = kzalloc(sizeof(*mux), GFP_KERNEL);
215 if (!mux)
216 return;
217
218 mux->reg = ti_clk_get_reg_addr(node, 0);
219
220 if (!mux->reg)
221 goto cleanup;
222
223 if (!of_property_read_u32(node, "ti,bit-shift", &val))
224 mux->shift = val;
225
226 if (of_property_read_bool(node, "ti,index-starts-at-one"))
227 mux->flags |= CLK_MUX_INDEX_ONE;
228
229 num_parents = of_clk_get_parent_count(node);
230
231 if (num_parents < 2) {
232 pr_err("%s must have parents\n", node->name);
233 goto cleanup;
234 }
235
236 mux->mask = num_parents - 1;
237 mux->mask = (1 << fls(mux->mask)) - 1;
238
239 if (!ti_clk_add_component(node, &mux->hw, CLK_COMPONENT_TYPE_MUX))
240 return;
241
242cleanup:
243 kfree(mux);
244}
245CLK_OF_DECLARE(ti_composite_mux_clk_setup, "ti,composite-mux-clock",
246 of_ti_composite_mux_clk_setup);
diff --git a/include/dt-bindings/clock/qcom,mmcc-msm8974.h b/include/dt-bindings/clock/qcom,mmcc-msm8974.h
index 04d318d1187a..032ed87ef0f3 100644
--- a/include/dt-bindings/clock/qcom,mmcc-msm8974.h
+++ b/include/dt-bindings/clock/qcom,mmcc-msm8974.h
@@ -57,7 +57,7 @@
57#define EXTPCLK_CLK_SRC 40 57#define EXTPCLK_CLK_SRC 40
58#define HDMI_CLK_SRC 41 58#define HDMI_CLK_SRC 41
59#define VSYNC_CLK_SRC 42 59#define VSYNC_CLK_SRC 42
60#define RBCPR_CLK_SRC 43 60#define MMSS_RBCPR_CLK_SRC 43
61#define CAMSS_CCI_CCI_AHB_CLK 44 61#define CAMSS_CCI_CCI_AHB_CLK 44
62#define CAMSS_CCI_CCI_CLK 45 62#define CAMSS_CCI_CCI_CLK 45
63#define CAMSS_CSI0_AHB_CLK 46 63#define CAMSS_CSI0_AHB_CLK 46
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 999b28ba38f7..448b2294820f 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -488,6 +488,8 @@ struct clk_onecell_data {
488 unsigned int clk_num; 488 unsigned int clk_num;
489}; 489};
490 490
491extern struct of_device_id __clk_of_table;
492
491#define CLK_OF_DECLARE(name, compat, fn) \ 493#define CLK_OF_DECLARE(name, compat, fn) \
492 static const struct of_device_id __clk_of_table_##name \ 494 static const struct of_device_id __clk_of_table_##name \
493 __used __section(__clk_of_table) \ 495 __used __section(__clk_of_table) \
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
new file mode 100644
index 000000000000..092b64168d7f
--- /dev/null
+++ b/include/linux/clk/ti.h
@@ -0,0 +1,298 @@
1/*
2 * TI clock drivers support
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15#ifndef __LINUX_CLK_TI_H__
16#define __LINUX_CLK_TI_H__
17
18#include <linux/clkdev.h>
19
20/**
21 * struct dpll_data - DPLL registers and integration data
22 * @mult_div1_reg: register containing the DPLL M and N bitfields
23 * @mult_mask: mask of the DPLL M bitfield in @mult_div1_reg
24 * @div1_mask: mask of the DPLL N bitfield in @mult_div1_reg
25 * @clk_bypass: struct clk pointer to the clock's bypass clock input
26 * @clk_ref: struct clk pointer to the clock's reference clock input
27 * @control_reg: register containing the DPLL mode bitfield
28 * @enable_mask: mask of the DPLL mode bitfield in @control_reg
29 * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate()
30 * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate()
31 * @last_rounded_m4xen: cache of the last M4X result of
32 * omap4_dpll_regm4xen_round_rate()
33 * @last_rounded_lpmode: cache of the last lpmode result of
34 * omap4_dpll_lpmode_recalc()
35 * @max_multiplier: maximum valid non-bypass multiplier value (actual)
36 * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()
37 * @min_divider: minimum valid non-bypass divider value (actual)
38 * @max_divider: maximum valid non-bypass divider value (actual)
39 * @modes: possible values of @enable_mask
40 * @autoidle_reg: register containing the DPLL autoidle mode bitfield
41 * @idlest_reg: register containing the DPLL idle status bitfield
42 * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg
43 * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg
44 * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg
45 * @lpmode_mask: mask of the DPLL low-power mode bitfield in @control_reg
46 * @m4xen_mask: mask of the DPLL M4X multiplier bitfield in @control_reg
47 * @auto_recal_bit: bitshift of the driftguard enable bit in @control_reg
48 * @recal_en_bit: bitshift of the PRM_IRQENABLE_* bit for recalibration IRQs
49 * @recal_st_bit: bitshift of the PRM_IRQSTATUS_* bit for recalibration IRQs
50 * @flags: DPLL type/features (see below)
51 *
52 * Possible values for @flags:
53 * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs)
54 *
55 * @freqsel_mask is only used on the OMAP34xx family and AM35xx.
56 *
57 * XXX Some DPLLs have multiple bypass inputs, so it's not technically
58 * correct to only have one @clk_bypass pointer.
59 *
60 * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m,
61 * @last_rounded_n) should be separated from the runtime-fixed fields
62 * and placed into a different structure, so that the runtime-fixed data
63 * can be placed into read-only space.
64 */
65struct dpll_data {
66 void __iomem *mult_div1_reg;
67 u32 mult_mask;
68 u32 div1_mask;
69 struct clk *clk_bypass;
70 struct clk *clk_ref;
71 void __iomem *control_reg;
72 u32 enable_mask;
73 unsigned long last_rounded_rate;
74 u16 last_rounded_m;
75 u8 last_rounded_m4xen;
76 u8 last_rounded_lpmode;
77 u16 max_multiplier;
78 u8 last_rounded_n;
79 u8 min_divider;
80 u16 max_divider;
81 u8 modes;
82 void __iomem *autoidle_reg;
83 void __iomem *idlest_reg;
84 u32 autoidle_mask;
85 u32 freqsel_mask;
86 u32 idlest_mask;
87 u32 dco_mask;
88 u32 sddiv_mask;
89 u32 lpmode_mask;
90 u32 m4xen_mask;
91 u8 auto_recal_bit;
92 u8 recal_en_bit;
93 u8 recal_st_bit;
94 u8 flags;
95};
96
97struct clk_hw_omap_ops;
98
99/**
100 * struct clk_hw_omap - OMAP struct clk
101 * @node: list_head connecting this clock into the full clock list
102 * @enable_reg: register to write to enable the clock (see @enable_bit)
103 * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg)
104 * @flags: see "struct clk.flags possibilities" above
105 * @clksel_reg: for clksel clks, register va containing src/divisor select
106 * @clksel_mask: bitmask in @clksel_reg for the src/divisor selector
107 * @clksel: for clksel clks, pointer to struct clksel for this clock
108 * @dpll_data: for DPLLs, pointer to struct dpll_data for this clock
109 * @clkdm_name: clockdomain name that this clock is contained in
110 * @clkdm: pointer to struct clockdomain, resolved from @clkdm_name at runtime
111 * @ops: clock ops for this clock
112 */
113struct clk_hw_omap {
114 struct clk_hw hw;
115 struct list_head node;
116 unsigned long fixed_rate;
117 u8 fixed_div;
118 void __iomem *enable_reg;
119 u8 enable_bit;
120 u8 flags;
121 void __iomem *clksel_reg;
122 u32 clksel_mask;
123 const struct clksel *clksel;
124 struct dpll_data *dpll_data;
125 const char *clkdm_name;
126 struct clockdomain *clkdm;
127 const struct clk_hw_omap_ops *ops;
128};
129
130/*
131 * struct clk_hw_omap.flags possibilities
132 *
133 * XXX document the rest of the clock flags here
134 *
135 * ENABLE_REG_32BIT: (OMAP1 only) clock control register must be accessed
136 * with 32bit ops, by default OMAP1 uses 16bit ops.
137 * CLOCK_IDLE_CONTROL: (OMAP1 only) clock has autoidle support.
138 * CLOCK_NO_IDLE_PARENT: (OMAP1 only) when clock is enabled, its parent
139 * clock is put to no-idle mode.
140 * ENABLE_ON_INIT: Clock is enabled on init.
141 * INVERT_ENABLE: By default, clock enable bit behavior is '1' enable, '0'
142 * disable. This inverts the behavior making '0' enable and '1' disable.
143 * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
144 * bits share the same register. This flag allows the
145 * omap4_dpllmx*() code to determine which GATE_CTRL bit field
146 * should be used. This is a temporary solution - a better approach
147 * would be to associate clock type-specific data with the clock,
148 * similar to the struct dpll_data approach.
149 * MEMMAP_ADDRESSING: Use memmap addressing to access clock registers.
150 */
151#define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */
152#define CLOCK_IDLE_CONTROL (1 << 1)
153#define CLOCK_NO_IDLE_PARENT (1 << 2)
154#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */
155#define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */
156#define CLOCK_CLKOUTX2 (1 << 5)
157#define MEMMAP_ADDRESSING (1 << 6)
158
159/* CM_CLKEN_PLL*.EN* bit values - not all are available for every DPLL */
160#define DPLL_LOW_POWER_STOP 0x1
161#define DPLL_LOW_POWER_BYPASS 0x5
162#define DPLL_LOCKED 0x7
163
164/* DPLL Type and DCO Selection Flags */
165#define DPLL_J_TYPE 0x1
166
167/* Composite clock component types */
168enum {
169 CLK_COMPONENT_TYPE_GATE = 0,
170 CLK_COMPONENT_TYPE_DIVIDER,
171 CLK_COMPONENT_TYPE_MUX,
172 CLK_COMPONENT_TYPE_MAX,
173};
174
175/**
176 * struct ti_dt_clk - OMAP DT clock alias declarations
177 * @lk: clock lookup definition
178 * @node_name: clock DT node to map to
179 */
180struct ti_dt_clk {
181 struct clk_lookup lk;
182 char *node_name;
183};
184
185#define DT_CLK(dev, con, name) \
186 { \
187 .lk = { \
188 .dev_id = dev, \
189 .con_id = con, \
190 }, \
191 .node_name = name, \
192 }
193
194/* Maximum number of clock memmaps */
195#define CLK_MAX_MEMMAPS 4
196
197typedef void (*ti_of_clk_init_cb_t)(struct clk_hw *, struct device_node *);
198
199/**
200 * struct clk_omap_reg - OMAP register declaration
201 * @offset: offset from the master IP module base address
202 * @index: index of the master IP module
203 */
204struct clk_omap_reg {
205 u16 offset;
206 u16 index;
207};
208
209/**
210 * struct ti_clk_ll_ops - low-level register access ops for a clock
211 * @clk_readl: pointer to register read function
212 * @clk_writel: pointer to register write function
213 *
214 * Low-level register access ops are generally used by the basic clock types
215 * (clk-gate, clk-mux, clk-divider etc.) to provide support for various
216 * low-level hardware interfaces (direct MMIO, regmap etc.), but can also be
217 * used by other hardware-specific clock drivers if needed.
218 */
219struct ti_clk_ll_ops {
220 u32 (*clk_readl)(void __iomem *reg);
221 void (*clk_writel)(u32 val, void __iomem *reg);
222};
223
224extern struct ti_clk_ll_ops *ti_clk_ll_ops;
225
226extern const struct clk_ops ti_clk_divider_ops;
227extern const struct clk_ops ti_clk_mux_ops;
228
229#define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)
230
231void omap2_init_clk_hw_omap_clocks(struct clk *clk);
232int omap3_noncore_dpll_enable(struct clk_hw *hw);
233void omap3_noncore_dpll_disable(struct clk_hw *hw);
234int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate,
235 unsigned long parent_rate);
236unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw,
237 unsigned long parent_rate);
238long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw,
239 unsigned long target_rate,
240 unsigned long *parent_rate);
241u8 omap2_init_dpll_parent(struct clk_hw *hw);
242unsigned long omap3_dpll_recalc(struct clk_hw *hw, unsigned long parent_rate);
243long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
244 unsigned long *parent_rate);
245void omap2_init_clk_clkdm(struct clk_hw *clk);
246unsigned long omap3_clkoutx2_recalc(struct clk_hw *hw,
247 unsigned long parent_rate);
248int omap2_clkops_enable_clkdm(struct clk_hw *hw);
249void omap2_clkops_disable_clkdm(struct clk_hw *hw);
250int omap2_clk_disable_autoidle_all(void);
251void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks);
252int omap3_dpll4_set_rate(struct clk_hw *clk, unsigned long rate,
253 unsigned long parent_rate);
254int omap2_dflt_clk_enable(struct clk_hw *hw);
255void omap2_dflt_clk_disable(struct clk_hw *hw);
256int omap2_dflt_clk_is_enabled(struct clk_hw *hw);
257void omap3_clk_lock_dpll5(void);
258
259void __iomem *ti_clk_get_reg_addr(struct device_node *node, int index);
260void ti_dt_clocks_register(struct ti_dt_clk *oclks);
261void ti_dt_clk_init_provider(struct device_node *np, int index);
262void ti_dt_clockdomains_setup(void);
263int ti_clk_retry_init(struct device_node *node, struct clk_hw *hw,
264 ti_of_clk_init_cb_t func);
265int of_ti_clk_autoidle_setup(struct device_node *node);
266int ti_clk_add_component(struct device_node *node, struct clk_hw *hw, int type);
267
268int omap3430_dt_clk_init(void);
269int omap3630_dt_clk_init(void);
270int am35xx_dt_clk_init(void);
271int ti81xx_dt_clk_init(void);
272int omap4xxx_dt_clk_init(void);
273int omap5xxx_dt_clk_init(void);
274int dra7xx_dt_clk_init(void);
275int am33xx_dt_clk_init(void);
276int am43xx_dt_clk_init(void);
277
278#ifdef CONFIG_OF
279void of_ti_clk_allow_autoidle_all(void);
280void of_ti_clk_deny_autoidle_all(void);
281#else
282static inline void of_ti_clk_allow_autoidle_all(void) { }
283static inline void of_ti_clk_deny_autoidle_all(void) { }
284#endif
285
286extern const struct clk_hw_omap_ops clkhwops_omap3_dpll;
287extern const struct clk_hw_omap_ops clkhwops_omap4_dpllmx;
288extern const struct clk_hw_omap_ops clkhwops_wait;
289extern const struct clk_hw_omap_ops clkhwops_omap3430es2_dss_usbhost_wait;
290extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait;
291extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_wait;
292extern const struct clk_hw_omap_ops clkhwops_iclk;
293extern const struct clk_hw_omap_ops clkhwops_iclk_wait;
294extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_ssi_wait;
295extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_dss_usbhost_wait;
296extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_hsotgusb_wait;
297
298#endif
diff --git a/include/linux/platform_data/si5351.h b/include/linux/platform_data/si5351.h
index 54334393ab92..a947ab8b441a 100644
--- a/include/linux/platform_data/si5351.h
+++ b/include/linux/platform_data/si5351.h
@@ -8,20 +8,6 @@
8struct clk; 8struct clk;
9 9
10/** 10/**
11 * enum si5351_variant - SiLabs Si5351 chip variant
12 * @SI5351_VARIANT_A: Si5351A (8 output clocks, XTAL input)
13 * @SI5351_VARIANT_A3: Si5351A MSOP10 (3 output clocks, XTAL input)
14 * @SI5351_VARIANT_B: Si5351B (8 output clocks, XTAL/VXCO input)
15 * @SI5351_VARIANT_C: Si5351C (8 output clocks, XTAL/CLKIN input)
16 */
17enum si5351_variant {
18 SI5351_VARIANT_A = 1,
19 SI5351_VARIANT_A3 = 2,
20 SI5351_VARIANT_B = 3,
21 SI5351_VARIANT_C = 4,
22};
23
24/**
25 * enum si5351_pll_src - Si5351 pll clock source 11 * enum si5351_pll_src - Si5351 pll clock source
26 * @SI5351_PLL_SRC_DEFAULT: default, do not change eeprom config 12 * @SI5351_PLL_SRC_DEFAULT: default, do not change eeprom config
27 * @SI5351_PLL_SRC_XTAL: pll source clock is XTAL input 13 * @SI5351_PLL_SRC_XTAL: pll source clock is XTAL input
@@ -115,14 +101,12 @@ struct si5351_clkout_config {
115 101
116/** 102/**
117 * struct si5351_platform_data - Platform data for the Si5351 clock driver 103 * struct si5351_platform_data - Platform data for the Si5351 clock driver
118 * @variant: Si5351 chip variant
119 * @clk_xtal: xtal input clock 104 * @clk_xtal: xtal input clock
120 * @clk_clkin: clkin input clock 105 * @clk_clkin: clkin input clock
121 * @pll_src: array of pll source clock setting 106 * @pll_src: array of pll source clock setting
122 * @clkout: array of clkout configuration 107 * @clkout: array of clkout configuration
123 */ 108 */
124struct si5351_platform_data { 109struct si5351_platform_data {
125 enum si5351_variant variant;
126 struct clk *clk_xtal; 110 struct clk *clk_xtal;
127 struct clk *clk_clkin; 111 struct clk *clk_clkin;
128 enum si5351_pll_src pll_src[2]; 112 enum si5351_pll_src pll_src[2];