Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
3f3f0ea0
Commit
3f3f0ea0
authored
Aug 12, 2015
by
Simon Horman
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'clk-for-v4.3' into dt-for-v4.3
parents
94bdc48d
f04b486d
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
213 additions
and
11 deletions
+213
-11
Documentation/devicetree/bindings/clock/renesas,r8a7778-cpg-clocks.txt
.../devicetree/bindings/clock/renesas,r8a7778-cpg-clocks.txt
+26
-3
Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
.../devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
+26
-4
Documentation/devicetree/bindings/clock/renesas,rcar-gen2-cpg-clocks.txt
...evicetree/bindings/clock/renesas,rcar-gen2-cpg-clocks.txt
+24
-2
Documentation/devicetree/bindings/clock/renesas,rz-cpg-clocks.txt
...ation/devicetree/bindings/clock/renesas,rz-cpg-clocks.txt
+27
-2
arch/arm/mach-shmobile/Kconfig
arch/arm/mach-shmobile/Kconfig
+2
-0
drivers/clk/shmobile/clk-mstp.c
drivers/clk/shmobile/clk-mstp.c
+87
-0
drivers/clk/shmobile/clk-r8a7778.c
drivers/clk/shmobile/clk-r8a7778.c
+2
-0
drivers/clk/shmobile/clk-r8a7779.c
drivers/clk/shmobile/clk-r8a7779.c
+2
-0
drivers/clk/shmobile/clk-rcar-gen2.c
drivers/clk/shmobile/clk-rcar-gen2.c
+2
-0
drivers/clk/shmobile/clk-rz.c
drivers/clk/shmobile/clk-rz.c
+3
-0
include/linux/clk/shmobile.h
include/linux/clk/shmobile.h
+12
-0
No files found.
Documentation/devicetree/bindings/clock/renesas,r8a7778-cpg-clocks.txt
View file @
3f3f0ea0
* Renesas R8A7778 Clock Pulse Generator (CPG)
The CPG generates core clocks for the R8A7778. It includes two PLLs and
several fixed ratio dividers
several fixed ratio dividers.
The CPG also provides a Clock Domain for SoC devices, in combination with the
CPG Module Stop (MSTP) Clocks.
Required Properties:
...
...
@@ -10,10 +12,18 @@ Required Properties:
- #clock-cells: Must be 1
- clock-output-names: The names of the clocks. Supported clocks are
"plla", "pllb", "b", "out", "p", "s", and "s1".
- #power-domain-cells: Must be 0
SoC devices that are part of the CPG/MSTP Clock Domain and can be power-managed
through an MSTP clock should refer to the CPG device node in their
"power-domains" property, as documented by the generic PM domain bindings in
Documentation/devicetree/bindings/power/power_domain.txt.
Example
-------
Examples
--------
- CPG device node:
cpg_clocks: cpg_clocks@ffc80000 {
compatible = "renesas,r8a7778-cpg-clocks";
...
...
@@ -22,4 +32,17 @@ Example
clocks = <&extal_clk>;
clock-output-names = "plla", "pllb", "b",
"out", "p", "s", "s1";
#power-domain-cells = <0>;
};
- CPG/MSTP Clock Domain member device node:
sdhi0: sd@ffe4c000 {
compatible = "renesas,sdhi-r8a7778";
reg = <0xffe4c000 0x100>;
interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mstp3_clks R8A7778_CLK_SDHI0>;
power-domains = <&cpg_clocks>;
status = "disabled";
};
Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
View file @
3f3f0ea0
* Renesas R8A7779 Clock Pulse Generator (CPG)
The CPG generates core clocks for the R8A7779. It includes one PLL and
several fixed ratio dividers
several fixed ratio dividers.
The CPG also provides a Clock Domain for SoC devices, in combination with the
CPG Module Stop (MSTP) Clocks.
Required Properties:
...
...
@@ -12,16 +14,36 @@ Required Properties:
- #clock-cells: Must be 1
- clock-output-names: The names of the clocks. Supported clocks are "plla",
"z", "zs", "s", "s1", "p", "b", "out".
- #power-domain-cells: Must be 0
SoC devices that are part of the CPG/MSTP Clock Domain and can be power-managed
through an MSTP clock should refer to the CPG device node in their
"power-domains" property, as documented by the generic PM domain bindings in
Documentation/devicetree/bindings/power/power_domain.txt.
Example
-------
Examples
--------
- CPG device node:
cpg_clocks: cpg_clocks@ffc80000 {
compatible = "renesas,r8a7779-cpg-clocks";
reg = <0
0xffc80000
0 0x30>;
reg = <0
xffc8000
0 0x30>;
clocks = <&extal_clk>;
#clock-cells = <1>;
clock-output-names = "plla", "z", "zs", "s", "s1", "p",
"b", "out";
#power-domain-cells = <0>;
};
- CPG/MSTP Clock Domain member device node:
sata: sata@fc600000 {
compatible = "renesas,sata-r8a7779", "renesas,rcar-sata";
reg = <0xfc600000 0x2000>;
interrupts = <0 100 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mstp1_clks R8A7779_CLK_SATA>;
power-domains = <&cpg_clocks>;
};
Documentation/devicetree/bindings/clock/renesas,rcar-gen2-cpg-clocks.txt
View file @
3f3f0ea0
...
...
@@ -2,6 +2,8 @@
The CPG generates core clocks for the R-Car Gen2 SoCs. It includes three PLLs
and several fixed ratio dividers.
The CPG also provides a Clock Domain for SoC devices, in combination with the
CPG Module Stop (MSTP) Clocks.
Required Properties:
...
...
@@ -20,10 +22,18 @@ Required Properties:
- clock-output-names: The names of the clocks. Supported clocks are "main",
"pll0", "pll1", "pll3", "lb", "qspi", "sdh", "sd0", "sd1", "z", "rcan", and
"adsp"
- #power-domain-cells: Must be 0
SoC devices that are part of the CPG/MSTP Clock Domain and can be power-managed
through an MSTP clock should refer to the CPG device node in their
"power-domains" property, as documented by the generic PM domain bindings in
Documentation/devicetree/bindings/power/power_domain.txt.
Example
-------
Examples
--------
- CPG device node:
cpg_clocks: cpg_clocks@e6150000 {
compatible = "renesas,r8a7790-cpg-clocks",
...
...
@@ -34,4 +44,16 @@ Example
clock-output-names = "main", "pll0, "pll1", "pll3",
"lb", "qspi", "sdh", "sd0", "sd1", "z",
"rcan", "adsp";
#power-domain-cells = <0>;
};
- CPG/MSTP Clock Domain member device node:
thermal@e61f0000 {
compatible = "renesas,thermal-r8a7790", "renesas,rcar-thermal";
reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mstp5_clks R8A7790_CLK_THERMAL>;
power-domains = <&cpg_clocks>;
};
Documentation/devicetree/bindings/clock/renesas,rz-cpg-clocks.txt
View file @
3f3f0ea0
...
...
@@ -2,6 +2,8 @@
The CPG generates core clocks for the RZ SoCs. It includes the PLL, variable
CPU and GPU clocks, and several fixed ratio dividers.
The CPG also provides a Clock Domain for SoC devices, in combination with the
CPG Module Stop (MSTP) Clocks.
Required Properties:
...
...
@@ -14,10 +16,18 @@ Required Properties:
- #clock-cells: Must be 1
- clock-output-names: The names of the clocks. Supported clocks are "pll",
"i", and "g"
- #power-domain-cells: Must be 0
SoC devices that are part of the CPG/MSTP Clock Domain and can be power-managed
through an MSTP clock should refer to the CPG device node in their
"power-domains" property, as documented by the generic PM domain bindings in
Documentation/devicetree/bindings/power/power_domain.txt.
Example
-------
Examples
--------
- CPG device node:
cpg_clocks: cpg_clocks@fcfe0000 {
#clock-cells = <1>;
...
...
@@ -26,4 +36,19 @@ Example
reg = <0xfcfe0000 0x18>;
clocks = <&extal_clk>, <&usb_x1_clk>;
clock-output-names = "pll", "i", "g";
#power-domain-cells = <0>;
};
- CPG/MSTP Clock Domain member device node:
mtu2: timer@fcff0000 {
compatible = "renesas,mtu2-r7s72100", "renesas,mtu2";
reg = <0xfcff0000 0x400>;
interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "tgi0a";
clocks = <&mstp3_clks R7S72100_CLK_MTU2>;
clock-names = "fck";
power-domains = <&cpg_clocks>;
status = "disabled";
};
arch/arm/mach-shmobile/Kconfig
View file @
3f3f0ea0
...
...
@@ -4,6 +4,7 @@ config ARCH_SHMOBILE
config PM_RCAR
bool
select PM_GENERIC_DOMAINS if PM
config PM_RMOBILE
bool
...
...
@@ -50,6 +51,7 @@ config ARCH_EMEV2
config ARCH_R7S72100
bool "RZ/A1H (R7S72100)"
select PM_GENERIC_DOMAINS if PM
select SYS_SUPPORTS_SH_MTU2
config ARCH_R8A73A4
...
...
drivers/clk/shmobile/clk-mstp.c
View file @
3f3f0ea0
...
...
@@ -2,6 +2,7 @@
* R-Car MSTP clocks
*
* Copyright (C) 2013 Ideas On Board SPRL
* Copyright (C) 2015 Glider bvba
*
* Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
*
...
...
@@ -10,11 +11,16 @@
* the Free Software Foundation; version 2 of the License.
*/
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/clkdev.h>
#include <linux/clk/shmobile.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/pm_clock.h>
#include <linux/pm_domain.h>
#include <linux/spinlock.h>
/*
...
...
@@ -236,3 +242,84 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
of_clk_add_provider
(
np
,
of_clk_src_onecell_get
,
&
group
->
data
);
}
CLK_OF_DECLARE
(
cpg_mstp_clks
,
"renesas,cpg-mstp-clocks"
,
cpg_mstp_clocks_init
);
#ifdef CONFIG_PM_GENERIC_DOMAINS_OF
int
cpg_mstp_attach_dev
(
struct
generic_pm_domain
*
domain
,
struct
device
*
dev
)
{
struct
device_node
*
np
=
dev
->
of_node
;
struct
of_phandle_args
clkspec
;
struct
clk
*
clk
;
int
i
=
0
;
int
error
;
while
(
!
of_parse_phandle_with_args
(
np
,
"clocks"
,
"#clock-cells"
,
i
,
&
clkspec
))
{
if
(
of_device_is_compatible
(
clkspec
.
np
,
"renesas,cpg-mstp-clocks"
))
goto
found
;
of_node_put
(
clkspec
.
np
);
i
++
;
}
return
0
;
found:
clk
=
of_clk_get_from_provider
(
&
clkspec
);
of_node_put
(
clkspec
.
np
);
if
(
IS_ERR
(
clk
))
return
PTR_ERR
(
clk
);
error
=
pm_clk_create
(
dev
);
if
(
error
)
{
dev_err
(
dev
,
"pm_clk_create failed %d
\n
"
,
error
);
goto
fail_put
;
}
error
=
pm_clk_add_clk
(
dev
,
clk
);
if
(
error
)
{
dev_err
(
dev
,
"pm_clk_add_clk %pC failed %d
\n
"
,
clk
,
error
);
goto
fail_destroy
;
}
return
0
;
fail_destroy:
pm_clk_destroy
(
dev
);
fail_put:
clk_put
(
clk
);
return
error
;
}
void
cpg_mstp_detach_dev
(
struct
generic_pm_domain
*
domain
,
struct
device
*
dev
)
{
if
(
!
list_empty
(
&
dev
->
power
.
subsys_data
->
clock_list
))
pm_clk_destroy
(
dev
);
}
void
__init
cpg_mstp_add_clk_domain
(
struct
device_node
*
np
)
{
struct
generic_pm_domain
*
pd
;
u32
ncells
;
if
(
of_property_read_u32
(
np
,
"#power-domain-cells"
,
&
ncells
))
{
pr_warn
(
"%s lacks #power-domain-cells
\n
"
,
np
->
full_name
);
return
;
}
pd
=
kzalloc
(
sizeof
(
*
pd
),
GFP_KERNEL
);
if
(
!
pd
)
return
;
pd
->
name
=
np
->
name
;
pd
->
flags
=
GENPD_FLAG_PM_CLK
;
pm_genpd_init
(
pd
,
&
simple_qos_governor
,
false
);
pd
->
attach_dev
=
cpg_mstp_attach_dev
;
pd
->
detach_dev
=
cpg_mstp_detach_dev
;
of_genpd_add_provider_simple
(
np
,
pd
);
}
#endif
/* !CONFIG_PM_GENERIC_DOMAINS_OF */
drivers/clk/shmobile/clk-r8a7778.c
View file @
3f3f0ea0
...
...
@@ -124,6 +124,8 @@ static void __init r8a7778_cpg_clocks_init(struct device_node *np)
}
of_clk_add_provider
(
np
,
of_clk_src_onecell_get
,
&
cpg
->
data
);
cpg_mstp_add_clk_domain
(
np
);
}
CLK_OF_DECLARE
(
r8a7778_cpg_clks
,
"renesas,r8a7778-cpg-clocks"
,
...
...
drivers/clk/shmobile/clk-r8a7779.c
View file @
3f3f0ea0
...
...
@@ -168,6 +168,8 @@ static void __init r8a7779_cpg_clocks_init(struct device_node *np)
}
of_clk_add_provider
(
np
,
of_clk_src_onecell_get
,
&
cpg
->
data
);
cpg_mstp_add_clk_domain
(
np
);
}
CLK_OF_DECLARE
(
r8a7779_cpg_clks
,
"renesas,r8a7779-cpg-clocks"
,
r8a7779_cpg_clocks_init
);
...
...
drivers/clk/shmobile/clk-rcar-gen2.c
View file @
3f3f0ea0
...
...
@@ -415,6 +415,8 @@ static void __init rcar_gen2_cpg_clocks_init(struct device_node *np)
}
of_clk_add_provider
(
np
,
of_clk_src_onecell_get
,
&
cpg
->
data
);
cpg_mstp_add_clk_domain
(
np
);
}
CLK_OF_DECLARE
(
rcar_gen2_cpg_clks
,
"renesas,rcar-gen2-cpg-clocks"
,
rcar_gen2_cpg_clocks_init
);
...
...
drivers/clk/shmobile/clk-rz.c
View file @
3f3f0ea0
...
...
@@ -10,6 +10,7 @@
*/
#include <linux/clk-provider.h>
#include <linux/clk/shmobile.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/of.h>
...
...
@@ -99,5 +100,7 @@ static void __init rz_cpg_clocks_init(struct device_node *np)
}
of_clk_add_provider
(
np
,
of_clk_src_onecell_get
,
&
cpg
->
data
);
cpg_mstp_add_clk_domain
(
np
);
}
CLK_OF_DECLARE
(
rz_cpg_clks
,
"renesas,rz-cpg-clocks"
,
rz_cpg_clocks_init
);
include/linux/clk/shmobile.h
View file @
3f3f0ea0
...
...
@@ -16,8 +16,20 @@
#include <linux/types.h>
struct
device
;
struct
device_node
;
struct
generic_pm_domain
;
void
r8a7778_clocks_init
(
u32
mode
);
void
r8a7779_clocks_init
(
u32
mode
);
void
rcar_gen2_clocks_init
(
u32
mode
);
#ifdef CONFIG_PM_GENERIC_DOMAINS_OF
void
cpg_mstp_add_clk_domain
(
struct
device_node
*
np
);
int
cpg_mstp_attach_dev
(
struct
generic_pm_domain
*
domain
,
struct
device
*
dev
);
void
cpg_mstp_detach_dev
(
struct
generic_pm_domain
*
domain
,
struct
device
*
dev
);
#else
static
inline
void
cpg_mstp_add_clk_domain
(
struct
device_node
*
np
)
{}
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment