Renesas R-Car Gen3 CPG support V3
Subsystems (5)
Magnus Damm
maintainerv3 cover Renesas R-Car Gen3 CPG support V3
Renesas R-Car Gen3 CPG support V3
[PATCH v3 01/04] clk: shmobile: Get rid of CONFIG_ARCH_SHMOBILE_MULTI [PATCH v3 02/04] clk: shmobile: Make MSTP clock-output-names optional [PATCH v3 03/04] clk: shmobile: Add Renesas R-Car Gen3 CPG support [PATCH v3 04/04] clk: shmobile: rcar-gen3: Add CPG/MSTP Clock Domain support
This series is the first attempt to take the CCF code from the single patch:
"[PATCH 1/9] clk: shmobile: add Renesas R-Car Gen3 CPG support" to a full series of various CCF related updates related to R-Car Gen3.
In this series patch 1 and 2 get rid of CONFIG_ARCH_SHMOBILE_MULTI kconfig bits and converts the MSTP CCF driver to not rely on clock-output-names. The latter may need a bit more work.
Patch 3 and 4 introduce an updated R-Car Gen3 CPG driver where I have reworked the code to not depend on clock-output-names instead of using strings simply rely on RCAR_GEN3_CLK_xxx. Those must match the ABI defined in SoC specific indicies such as the ones included in r8a7795-clock.h.
Patch 3 most likely needs to be reworked further to incorporate earlier feedback from CCF maintainers.
Comments are very welcome!
---
Written to be picked up independently from other R-Car Gen3 patches.
Documentation/devicetree/bindings/clock/renesas,rcar-gen3-cpg-clocks.txt | 31 + drivers/clk/Makefile | 2 drivers/clk/shmobile/Makefile | 23 drivers/clk/shmobile/clk-mstp.c | 15 drivers/clk/shmobile/clk-rcar-gen3.c | 254 ++++++++++ 5 files changed, 304 insertions(+), 21 deletions(-)
Magnus Damm
maintainerPATCH v3 1/4 clk: shmobile: Get rid of CONFIG_ARCH_SHMOBILE_MULTI
From: Magnus Damm <[email protected]>
Shmobile is all multiplatform these days, so get rid of the reference to CONFIG_ARCH_SHMOBILE_MULTI. Also instead of always enabling DIV6 and MSTP adjust the Makefile to enable DIV6 and MSTP depending on if they are included in the SoC or not.
---
Changes since V2:
- Fixed patch subject typo CONFIG_SHMOBILE_MULTI -> CONFIG_ARCH_SHMOBILE_MULTI
Changes since V1:
- dropped DIV6 from R-Car Gen1 variants - thanks Geert!
drivers/clk/Makefile | 2 +- drivers/clk/shmobile/Makefile | 22 ++++++++++------------ 2 files changed, 11 insertions(+), 13 deletions(-)
drivers/clk/Makefile +1 -1
@@ -66,7 +66,7 @@ obj-$(CONFIG_COMMON_CLK_PXA) += pxa/ obj-$(CONFIG_COMMON_CLK_QCOM) += qcom/ obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/ obj-$(CONFIG_COMMON_CLK_SAMSUNG) += samsung/ -obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += shmobile/ +obj-$(CONFIG_ARCH_SHMOBILE) += shmobile/ obj-$(CONFIG_ARCH_SIRF) += sirf/ obj-$(CONFIG_ARCH_SOCFPGA) += socfpga/ obj-$(CONFIG_PLAT_SPEAR) += spear/
drivers/clk/shmobile/Makefile +10 -12
@@ -1,13 +1,11 @@ obj-$(CONFIG_ARCH_EMEV2) += clk-emev2.o -obj-$(CONFIG_ARCH_R7S72100) += clk-rz.o -obj-$(CONFIG_ARCH_R8A73A4) += clk-r8a73a4.o -obj-$(CONFIG_ARCH_R8A7740) += clk-r8a7740.o -obj-$(CONFIG_ARCH_R8A7778) += clk-r8a7778.o -obj-$(CONFIG_ARCH_R8A7779) += clk-r8a7779.o -obj-$(CONFIG_ARCH_R8A7790) += clk-rcar-gen2.o -obj-$(CONFIG_ARCH_R8A7791) += clk-rcar-gen2.o -obj-$(CONFIG_ARCH_R8A7793) += clk-rcar-gen2.o -obj-$(CONFIG_ARCH_R8A7794) += clk-rcar-gen2.o -obj-$(CONFIG_ARCH_SH73A0) += clk-sh73a0.o -obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += clk-div6.o -obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += clk-mstp.o +obj-$(CONFIG_ARCH_R7S72100) += clk-rz.o clk-mstp.o +obj-$(CONFIG_ARCH_R8A73A4) += clk-r8a73a4.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_R8A7740) += clk-r8a7740.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_R8A7778) += clk-r8a7778.o clk-mstp.o +obj-$(CONFIG_ARCH_R8A7779) += clk-r8a7779.o clk-mstp.o +obj-$(CONFIG_ARCH_R8A7790) += clk-rcar-gen2.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_R8A7791) += clk-rcar-gen2.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_R8A7793) += clk-rcar-gen2.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_R8A7794) += clk-rcar-gen2.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_SH73A0) += clk-sh73a0.o clk-mstp.o clk-div6.o
Magnus Damm
maintainerPATCH v3 2/4 clk: shmobile: Make MSTP clock-output-names optional
In reply to Magnus DammFrom: Magnus Damm <[email protected]>
This patch updates the MSTP driver to make the "clock-output-names" DT property optional instead of mandatory. In case the DT property is omitted then the function clk_register_clkdev() is skipped.
The default for new SoCs is to not use "clock-output-names".
This version of the patch is kind of early, so please handle with care. So far the patch has only been tested with a single MSTP clock. =)
---
drivers/clk/shmobile/clk-mstp.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/clk/shmobile/clk-mstp.c +7 -8
@@ -198,15 +198,12 @@ static void __init cpg_mstp_clocks_init(for (i =0 ; i <MSTP_MAX_CLOCKS ; ++i) {const char *parent_name; -const char *name; +const char *name =NULL ;u32 clkidx;int ret; -/* Skip clocks with no name. */ ret =of_property_read_string_index (np,"clock-output-names" , i, &name); -if (ret <0 ||strlen (name) ==0 ) -continue ; parent_name =of_clk_get_parent_name (np, i); ret =of_property_read_u32_index (np, idxname, i, &clkidx);
@@ -214,12 +211,13 @@ static void __init cpg_mstp_clocks_init(break ;if (clkidx >=MSTP_MAX_CLOCKS ) { -pr_err ("%s: invalid clock %s %s index %u)\n" , - __func__, np->name, name, clkidx); +pr_err ("%s: invalid clock %s index %u)\n" , + __func__, np->name, clkidx);continue ; } - clks[clkidx] =cpg_mstp_clock_register (name, parent_name, + clks[clkidx] =cpg_mstp_clock_register (name ? name : np->name, + parent_name, clkidx, group);if (!IS_ERR (clks[clkidx])) { group->data.clk_num = max(group->data.clk_num,
@@ -232,7 +230,8 @@ static void __init cpg_mstp_clocks_init(* FIXME: Remove this when all devices that require a * clock will be instantiated from DT. */ -clk_register_clkdev (clks[clkidx], name,NULL ); +if (name)/* only if clock-output-names is provided */ +clk_register_clkdev (clks[clkidx], name,NULL ); }else {pr_err ("%s: failed to register %s %s clock (%ld)\n" , __func__, np->name, name,PTR_ERR (clks[clkidx]));
Magnus Damm
maintainerPATCH v3 3/4 clk: shmobile: Add Renesas R-Car Gen3 CPG support
In reply to Magnus DammFrom: Gaku Inami <[email protected]>
This patch adds very initial CPG support.
R-Car Gen3 write function should use CPG write protection method which is shared with MSTP driver. This patch has it but not used.
---
Documentation/devicetree/bindings/clock/renesas,rcar-gen3-cpg-clocks.txt | 31 + drivers/clk/shmobile/Makefile | 1 drivers/clk/shmobile/clk-rcar-gen3.c | 252 ++++++++++ 3 files changed, 284 insertions(+)
Documentation/devicetree/bindings/clock/renesas,rcar-gen3-cpg-clocks.txt new file +31 -0
@@ -0,0 +1,31 @@ +* Renesas R-Car Gen3 Clock Pulse Generator (CPG) + +The CPG generates core clocks for the R-Car Gen3 SoCs. It includes three PLLs +and several fixed ratio dividers. + +Required Properties: + + - compatible: Must be one of + - "renesas,r8a7795-cpg-clocks" for the r8a7795 CPG + - "renesas,rcar-gen3-cpg-clocks" for the generic R-Car Gen3 CPG + + - reg: Base address and length of the memory resource used by the CPG + + - clocks: References to the parent clocks: first to the EXTAL clock + - #clock-cells: Must be 1 + - clock-output-names: The names of the clocks. Supported clocks are + "main", "pll0", "pll1", "pll2", "pll3", "pll4" + + +Example +------- + + cpg_clocks: cpg_clocks@e6150000 { + compatible = "renesas,r8a7795-cpg-clocks", + "renesas,rcar-gen3-cpg-clocks"; + reg = <0 0xe6150000 0 0x1000>; + clocks = <&extal_clk>; + #clock-cells = <1>; + clock-output-names = "main", "pll0", "pll1","pll2", + "pll3", "pll4"; + };
drivers/clk/shmobile/Makefile +1 -0
@@ -8,4 +8,5 @@ obj-$(CONFIG_ARCH_R8A7790) += clk-rcar- obj-$(CONFIG_ARCH_R8A7791) += clk-rcar-gen2.o clk-mstp.o clk-div6.o obj-$(CONFIG_ARCH_R8A7793) += clk-rcar-gen2.o clk-mstp.o clk-div6.o obj-$(CONFIG_ARCH_R8A7794) += clk-rcar-gen2.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_R8A7795) += clk-rcar-gen3.o clk-mstp.o clk-div6.o obj-$(CONFIG_ARCH_SH73A0) += clk-sh73a0.o clk-mstp.o clk-div6.o
drivers/clk/shmobile/clk-rcar-gen3.c new file +252 -0
252 lines not on this page · raw message
Magnus Damm
maintainerPATCH v3 4/4 clk: shmobile: rcar-gen3: Add CPG/MSTP Clock Domain support
In reply to Magnus DammFrom: Magnus Damm <[email protected]>
Shmobile is all multiplatform these days, so get rid of the reference to CONFIG_ARCH_SHMOBILE_MULTI. Also instead of always enabling DIV6 and MSTP adjust the Makefile to enable DIV6 and MSTP depending on if they are included in the SoC or not.
---
Changes since V2:
- Fixed patch subject typo CONFIG_SHMOBILE_MULTI -> CONFIG_ARCH_SHMOBILE_MULTI
Changes since V1:
- dropped DIV6 from R-Car Gen1 variants - thanks Geert!
drivers/clk/Makefile | 2 +- drivers/clk/shmobile/Makefile | 22 ++++++++++------------ 2 files changed, 11 insertions(+), 13 deletions(-)
drivers/clk/Makefile +1 -1
@@ -66,7 +66,7 @@ obj-$(CONFIG_COMMON_CLK_PXA) += pxa/ obj-$(CONFIG_COMMON_CLK_QCOM) += qcom/ obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/ obj-$(CONFIG_COMMON_CLK_SAMSUNG) += samsung/ -obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += shmobile/ +obj-$(CONFIG_ARCH_SHMOBILE) += shmobile/ obj-$(CONFIG_ARCH_SIRF) += sirf/ obj-$(CONFIG_ARCH_SOCFPGA) += socfpga/ obj-$(CONFIG_PLAT_SPEAR) += spear/
drivers/clk/shmobile/Makefile +10 -12
@@ -1,13 +1,11 @@ obj-$(CONFIG_ARCH_EMEV2) += clk-emev2.o -obj-$(CONFIG_ARCH_R7S72100) += clk-rz.o -obj-$(CONFIG_ARCH_R8A73A4) += clk-r8a73a4.o -obj-$(CONFIG_ARCH_R8A7740) += clk-r8a7740.o -obj-$(CONFIG_ARCH_R8A7778) += clk-r8a7778.o -obj-$(CONFIG_ARCH_R8A7779) += clk-r8a7779.o -obj-$(CONFIG_ARCH_R8A7790) += clk-rcar-gen2.o -obj-$(CONFIG_ARCH_R8A7791) += clk-rcar-gen2.o -obj-$(CONFIG_ARCH_R8A7793) += clk-rcar-gen2.o -obj-$(CONFIG_ARCH_R8A7794) += clk-rcar-gen2.o -obj-$(CONFIG_ARCH_SH73A0) += clk-sh73a0.o -obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += clk-div6.o -obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += clk-mstp.o +obj-$(CONFIG_ARCH_R7S72100) += clk-rz.o clk-mstp.o +obj-$(CONFIG_ARCH_R8A73A4) += clk-r8a73a4.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_R8A7740) += clk-r8a7740.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_R8A7778) += clk-r8a7778.o clk-mstp.o +obj-$(CONFIG_ARCH_R8A7779) += clk-r8a7779.o clk-mstp.o +obj-$(CONFIG_ARCH_R8A7790) += clk-rcar-gen2.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_R8A7791) += clk-rcar-gen2.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_R8A7793) += clk-rcar-gen2.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_R8A7794) += clk-rcar-gen2.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_SH73A0) += clk-sh73a0.o clk-mstp.o clk-div6.o
Re: [PATCH v3 04/04] clk: shmobile: rcar-gen3: Add CPG/MSTP Clock Domain support
Quoted 7 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Shmobile is all multiplatform these days, so get rid of the reference to
CONFIG_ARCH_SHMOBILE_MULTI. Also instead of always enabling DIV6 and MSTP adjust theMakefileto enable DIV6 and MSTP depending on if they are included in the SoC or not.
Quoted 6 lines
Signed-off-by Magnus Damm <[email protected]>---
Changes since V2:
- Fixed patch subject typoCONFIG_SHMOBILE_MULTI->CONFIG_ARCH_SHMOBILE_MULTI
The subject doesn't seem to match the patch at all?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Magnus Damm
maintainerRe: [PATCH v3 04/04] clk: shmobile: rcar-gen3: Add CPG/MSTP Clock Domain support
Hi Geert,
Quoted 8 lines · Geert Uytterhoeven
Quoted 7 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Shmobile is all multiplatform these days, so get rid of the reference to
CONFIG_ARCH_SHMOBILE_MULTI. Also instead of always enabling DIV6 and MSTP adjust theMakefileto enable DIV6 and MSTP depending on if they are included in the SoC or not.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Magnus Damm <[email protected]>---
Changes since V2:
- Fixed patch subject typoCONFIG_SHMOBILE_MULTI->CONFIG_ARCH_SHMOBILE_MULTIThe subject doesn't seem to match the patch at all?
Yes, correct - I seem to have messed up something! Will fix.
Thanks,
/ magnus
Re: [PATCH v3 03/04] clk: shmobile: Add Renesas R-Car Gen3 CPG support
In reply to Magnus DammQuoted 10 lines · Magnus Damm
From: Gaku Inami <[email protected]>
This patch adds very initial CPG support.
R-Car Gen3 write function should use CPG write protection method which is shared with MSTP driver. This patch has it but not used.Signed-off-by Gaku Inami <[email protected]>Signed-off-by Kuninori Morimoto <[email protected]>Signed-off-by Magnus Damm <[email protected]>---
I think I already reviewed this, but it looks like none of the comments were addressed in this posting
http://lkml.kernel.org/r/[email protected]
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Quoted 15 lines · Magnus Damm
Renesas R-Car Gen3 CPG support V3
[PATCH v3 01/04] clk: shmobile: Get rid of
CONFIG_ARCH_SHMOBILE_MULTI[PATCH v3 02/04] clk: shmobile: Make MSTP clock-output-names optional [PATCH v3 03/04] clk: shmobile: Add Renesas R-Car Gen3 CPG support [PATCH v3 04/04] clk: shmobile: rcar-gen3: Add CPG/MSTP Clock Domain supportThis series is the first attempt to take the CCF code from the single patch:
"[PATCH 1/9] clk: shmobile: add Renesas R-Car Gen3 CPG support" to a full series of various CCF related updates related to R-Car Gen3.In this series patch 1 and 2 get rid of
CONFIG_ARCH_SHMOBILE_MULTIkconfig bits and converts the MSTP CCF driver to not rely on clock-output-names. The latter may need a bit more work.
Quoted 7 lines
Patch 3 and 4 introduce an updated R-Car Gen3 CPG driver where I have reworked the code to not depend on clock-output-names instead of using strings simply rely on
RCAR_GEN3_CLK_xxx. Those must match the ABI defined in SoC specific indicies such as the ones included inr8a7795-clock.h.Patch 3 most likely needs to be reworked further to incorporate earlier feedback from CCF maintainers.
Oh I should have read the cover letter first. Doh.
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v3 02/04] clk: shmobile: Make MSTP clock-output-names optional
In reply to Magnus DammHi Magnus,
Thank you for the patch.
drivers/clk/shmobile/clk-mstp.c
Quoted 19 lines · On Friday 28 August 2015 18:16:13 Magnus Damm wrote:
From: Magnus Damm <[email protected]>
This patch updates the MSTP driver to make the "clock-output-names" DT property optional instead of mandatory. In case the DT property is omitted then the function
clk_register_clkdev()is skipped.The default for new SoCs is to not use "clock-output-names".
This version of the patch is kind of early, so please handle with care. So far the patch has only been tested with a single MSTP clock. =)
Not-Yet-Signed-off-by Magnus Damm <[email protected]>---
drivers/clk/shmobile/clk-mstp.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)drivers/clk/shmobile/clk-mstp.c +0
-0
+0900
drivers/clk/shmobile/clk-mstp.c static void __init cpg_mstp_clocks_init( · line 206
Quoted 12 lines
drivers/clk/shmobile/clk-mstp.c +1
-2@@ -198,15 +198,12 @@ static void __init cpg_mstp_clocks_init(for (i =0 ; i <MSTP_MAX_CLOCKS ; ++i) {const char *parent_name; -const char *name; +const char *name =NULL ;u32 clkidx;int ret; -/* Skip clocks with no name. */ ret =of_property_read_string_index (np,"clock-output-names" , i, &name);
I think we can remove this completely.
Quoted 8 lines
drivers/clk/shmobile/clk-mstp.c +0
-2-if (ret <0 ||strlen (name) ==0 ) -continue ; parent_name =of_clk_get_parent_name (np, i); ret =of_property_read_u32_index (np, idxname, i, &clkidx);@@ -214,12 +211,13 @@ static void __init cpg_mstp_clocks_init(break ;
drivers/clk/shmobile/clk-mstp.c static void __init cpg_mstp_clocks_init( · line 219
Quoted 10 lines
drivers/clk/shmobile/clk-mstp.c +3
-3if (clkidx >=MSTP_MAX_CLOCKS ) { -pr_err ("%s: invalid clock %s %s index %u)\n" , - __func__, np->name, name, clkidx); +pr_err ("%s: invalid clock %s index %u)\n" , + __func__, np->name, clkidx);continue ; } - clks[clkidx] = cpg_mstp_clock_register(name, parent_name, + clks[clkidx] = cpg_mstp_clock_register(name ? name : np->name,
This would result in several clocks being registered with the same name. I would instead construct the name with sprintf(name, "%s.%u", np->name, clkidx).
drivers/clk/shmobile/clk-mstp.c static void __init cpg_mstp_clocks_init( · line 234
Quoted 11 lines
drivers/clk/shmobile/clk-mstp.c +3
-1+ parent_name, clkidx, group);if (!IS_ERR (clks[clkidx])) { group->data.clk_num = max(group->data.clk_num,@@ -232,7 +230,8 @@ static void __init cpg_mstp_clocks_init(* FIXME: Remove this when all devices that require a * clock will be instantiated from DT. */ -clk_register_clkdev (clks[clkidx], name,NULL ); +if (name)/* only if clock-output-names is provided */ +clk_register_clkdev (clks[clkidx], name,NULL );
Better than that, as all our devices are now instantiated from DT, we can remove the clk_register_clkdev() call completely as well as the FIXME comment.
drivers/clk/shmobile/clk-mstp.c static void __init cpg_mstp_clocks_init( · line 237
Quoted 3 lines
drivers/clk/shmobile/clk-mstp.c +0
-0}else {pr_err ("%s: failed to register %s %s clock (%ld)\n" , __func__, np->name, name,PTR_ERR (clks[clkidx]));
name can be NULL here, I'd use "%s.%u", np->name, clkidx.
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH v3 01/04] clk: shmobile: Get rid of CONFIG_ARCH_SHMOBILE_MULTI
In reply to Magnus DammHi Magnus,
Thank you for the patch.
Quoted 9 lines · On Friday 28 August 2015 18:16:02 Magnus Damm wrote:
From: Magnus Damm <[email protected]>
Shmobile is all multiplatform these days, so get rid of the reference to
CONFIG_ARCH_SHMOBILE_MULTI. Also instead of always enabling DIV6 and MSTP adjust theMakefileto enable DIV6 and MSTP depending on if they are included in the SoC or not.Signed-off-by Magnus Damm <[email protected]>
Assuming you have verified that adding the same object file several times to obj-y won't cause any issue,
Quoted 50 lines
---
Changes since V2:
- Fixed patch subject typoCONFIG_SHMOBILE_MULTI->CONFIG_ARCH_SHMOBILE_MULTIChanges since V1:
- dropped DIV6 from R-Car Gen1 variants - thanks Geert!drivers/clk/Makefile | 2 +- drivers/clk/shmobile/Makefile | 22 ++++++++++------------ 2 files changed, 11 insertions(+), 13 deletions(-)drivers/clk/Makefile +1
-1@@ -66,7 +66,7 @@ obj-$(CONFIG_COMMON_CLK_PXA) += pxa/ obj-$(CONFIG_COMMON_CLK_QCOM) += qcom/ obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/ obj-$(CONFIG_COMMON_CLK_SAMSUNG) += samsung/ -obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += shmobile/ +obj-$(CONFIG_ARCH_SHMOBILE) += shmobile/ obj-$(CONFIG_ARCH_SIRF) += sirf/ obj-$(CONFIG_ARCH_SOCFPGA) += socfpga/ obj-$(CONFIG_PLAT_SPEAR) += spear/drivers/clk/shmobile/Makefile +10
-12@@ -1,13 +1,11 @@ obj-$(CONFIG_ARCH_EMEV2) += clk-emev2.o -obj-$(CONFIG_ARCH_R7S72100) += clk-rz.o -obj-$(CONFIG_ARCH_R8A73A4) += clk-r8a73a4.o -obj-$(CONFIG_ARCH_R8A7740) += clk-r8a7740.o -obj-$(CONFIG_ARCH_R8A7778) += clk-r8a7778.o -obj-$(CONFIG_ARCH_R8A7779) += clk-r8a7779.o -obj-$(CONFIG_ARCH_R8A7790) += clk-rcar-gen2.o -obj-$(CONFIG_ARCH_R8A7791) += clk-rcar-gen2.o -obj-$(CONFIG_ARCH_R8A7793) += clk-rcar-gen2.o -obj-$(CONFIG_ARCH_R8A7794) += clk-rcar-gen2.o -obj-$(CONFIG_ARCH_SH73A0) += clk-sh73a0.o -obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += clk-div6.o -obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += clk-mstp.o +obj-$(CONFIG_ARCH_R7S72100) += clk-rz.o clk-mstp.o +obj-$(CONFIG_ARCH_R8A73A4) += clk-r8a73a4.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_R8A7740) += clk-r8a7740.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_R8A7778) += clk-r8a7778.o clk-mstp.o +obj-$(CONFIG_ARCH_R8A7779) += clk-r8a7779.o clk-mstp.o +obj-$(CONFIG_ARCH_R8A7790) += clk-rcar-gen2.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_R8A7791) += clk-rcar-gen2.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_R8A7793) += clk-rcar-gen2.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_R8A7794) += clk-rcar-gen2.o clk-mstp.o clk-div6.o +obj-$(CONFIG_ARCH_SH73A0) += clk-sh73a0.o clk-mstp.o clk-div6.o
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH v3 02/04] clk: shmobile: Make MSTP clock-output-names optional
In reply to Laurent PinchartQuoted 11 lines · Laurent Pinchart
Quoted 11 lines
drivers/clk/shmobile/clk-mstp.c +2
-2@@ -214,12 +211,13 @@ static void __init cpg_mstp_clocks_init(break ;if (clkidx >=MSTP_MAX_CLOCKS ) { -pr_err ("%s: invalid clock %s %s index %u)\n" , - __func__, np->name, name, clkidx); +pr_err ("%s: invalid clock %s index %u)\n" , + __func__, np->name, clkidx);continue ; }
Quoted 4 lines
drivers/clk/shmobile/clk-mstp.c static void __init cpg_mstp_clocks_init( · line 219
Quoted 2 lines
drivers/clk/shmobile/clk-mstp.c +1
-1- clks[clkidx] = cpg_mstp_clock_register(name, parent_name, + clks[clkidx] = cpg_mstp_clock_register(name ? name : np->name,This would result in several clocks being registered with the same name. I
Indeed.
Quoted 2 lines
would instead construct the name with
sprintf(name, "%s.%u", np->name, clkidx).
Not using clock-output-names makes the clock's names and /sys/kernel/debug/clk/clk_summary a bit harder to understand, though.
Quoted 6 lines
Quoted 6 lines
drivers/clk/shmobile/clk-mstp.c +1
-0+ parent_name, clkidx, group);if (!IS_ERR (clks[clkidx])) { group->data.clk_num = max(group->data.clk_num,@@ -232,7 +230,8 @@ static void __init cpg_mstp_clocks_init(* FIXME: Remove this when all devices that require a
Quoted 8 lines
drivers/clk/shmobile/clk-mstp.c static void __init cpg_mstp_clocks_init( · line 234
Quoted 5 lines
drivers/clk/shmobile/clk-mstp.c +2
-1* clock will be instantiated from DT. */ -clk_register_clkdev (clks[clkidx], name,NULL ); +if (name)/* only if clock-output-names is provided */ +clk_register_clkdev (clks[clkidx], name,NULL );Better than that, as all our devices are now instantiated from DT, we can remove the
clk_register_clkdev()call completely as well as the FIXME comment.
Unfortunately we cannot remove this yet, as board staging (e.g. Armadillo LCDC) depends on it (been there, done that).
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Magnus Damm
maintainerRe: [PATCH v3 01/04] clk: shmobile: Get rid of CONFIG_ARCH_SHMOBILE_MULTI
In reply to Laurent PinchartHi Laurent,
Quoted 12 lines · Laurent Pinchart
Hi Magnus,
Thank you for the patch.
Quoted 7 lines · On Friday 28 August 2015 18:16:02 Magnus Damm wrote:
From: Magnus Damm <[email protected]>
Shmobile is all multiplatform these days, so get rid of the reference to
CONFIG_ARCH_SHMOBILE_MULTI. Also instead of always enabling DIV6 and MSTP adjust theMakefileto enable DIV6 and MSTP depending on if they are included in the SoC or not.
Quoted 5 lines
Quoted 2 lines
Signed-off-by Magnus Damm <[email protected]>Assuming you have verified that adding the same object file several times to obj-y won't cause any issue,
Yeah. A good example of such (mis)use is in arch/arm/mach-shmobile/Kconfig. I've also built 32-bit shmobile_defconfig and 64-bit defconfig without issues.
Quoted 1 line
Acked-by Laurent Pinchart <[email protected]>
Thanks!
/ magnus
Re: [PATCH v3 03/04] clk: shmobile: Add Renesas R-Car Gen3 CPG support
In reply to Magnus DammQuoted 5 lines · Magnus Damm
From: Gaku Inami <[email protected]>
This patch adds very initial CPG support.
R-Car Gen3 write function should use CPG write protection method which is shared with MSTP driver. This patch has it but not used.
The last sentence is very confusing. I think it should be removed?
Quoted 3 lines
Signed-off-by Gaku Inami <[email protected]>Signed-off-by Kuninori Morimoto <[email protected]>Signed-off-by Magnus Damm <[email protected]>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Magnus Damm
maintainerRe: [PATCH v3 03/04] clk: shmobile: Add Renesas R-Car Gen3 CPG support
Hi Geert,
Quoted 8 lines · Geert Uytterhoeven
Quoted 5 lines · Magnus Damm
From: Gaku Inami <[email protected]>
This patch adds very initial CPG support.
R-Car Gen3 write function should use CPG write protection method which is shared with MSTP driver. This patch has it but not used.The last sentence is very confusing. I think it should be removed?
I agree it is confusing. I've reworked the commit log message in the latest version.
Thanks,
/ magnus