Clock divisor/parent settings changes
Subsystems (4)
Patches (3x) to ensure we see:
sh_mobile_sdhi ee100000.sd: mmc0 base at 0xee100000 clock rate 97 MHz
sh_mobile_sdhi ee140000.sd: mmc1 base at 0xee140000 clock rate 48 MHzAttached:
[PATCH 1/3] clk: rcar-h2: fix sd0/sd1 divisor table [PATCH 2/3] ARM: shmobile: r8a7790: specify multiple parents for [PATCH 3/3] clk: shmobile: handle multiple parent clocks for cpg
PATCH 1/3 clk: rcar-h2: fix sd0/sd1 divisor table
The clk_div_table for cpg_sd01_div_table[] concurs with the manual but not with values found in the device itself (which are also the same as the ones in arch/arm/mach-shmobile/clock-r8a7790.c).
Update the clk-rcar-gen2.c driver to have the same table as the one used by the mach-shmobile driver which work once further issues are fixed in the clk-rcar-gen2.c driver.
Part of the fix for the following error where the driver reports the output as 1MHz but is really 97.5MHz:
sh_mobile_sdhi ee100000.sd: mmc0 base at 0xee100000 clock rate 1 MHz
--- drivers/clk/shmobile/clk-rcar-gen2.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/shmobile/clk-rcar-gen2.c +2 -0
@@ -170,6 +170,8 @@ static const struct clk_div_table cpg_sdh_div_table[] = { };static const struct clk_div_table cpg_sd01_div_table[] = { + {0 ,2 }, {1 ,3 }, {2 ,4 }, {3 ,6 }, + {4 ,8 }, {5 ,12 }, {6 ,16 }, {7 ,18 }, {8 ,24 }, {10 ,36 }, {11 ,48 }, {12 ,10 }, {0 ,0 }, };
Signature · 1 line
1.7.10.4
PATCH 1/3 clk: rcar-h2: fix sd0/sd1 divisor table
Hi William,
Thank you for the patch.
Quoted 24 lines · On Tuesday 04 February 2014 18:17:36 William Towle wrote:
The
clk_div_tablefor cpg_sd01_div_table[] concurs with the manual but not with values found in the device itself (which are also the same as the ones inarch/arm/mach-shmobile/clock-r8a7790.c).Update the
clk-rcar-gen2.cdriver to have the same table as the one used by the mach-shmobile driver which work once further issues are fixed in theclk-rcar-gen2.cdriver.Part of the fix for the following error where the driver reports the output as 1MHz but is really 97.5MHz:
sh_mobile_sdhi ee100000.sd: mmc0 base at 0xee100000 clock rate 1 MHz[ben.dooks at codethink.co.uk: updated patch description]Signed-off-by William Towle <[email protected]>Reviewed-by Ben Dooks <[email protected]>--- drivers/clk/shmobile/clk-rcar-gen2.c | 2 ++ 1 file changed, 2 insertions(+)(quoted diff) +0
-0
b/drivers/clk/shmobile/clk-rcar-gen2.cindex a59ec21..df4a1e6 100644
drivers/clk/shmobile/clk-rcar-gen2.c static const struct clk_div_table cpg_sdh_div_table[] = · line 176
Quoted 7 lines
drivers/clk/shmobile/clk-rcar-gen2.c +2
-0@@ -170,6 +170,8 @@ static const struct clk_div_table cpg_sdh_div_table[] = { };static const struct clk_div_table cpg_sd01_div_table[] = { + {0 ,2 }, {1 ,3 }, {2 ,4 }, {3 ,6 }, + {4 ,8 }, {5 ,12 }, {6 ,16 }, {7 ,18 }, {8 ,24 }, {10 ,36 }, {11 ,48 }, {12 ,10 }, {0 ,0 },
With this applied the only difference between the sdh and sd0/1 dividers tables would be the { 12, 10 } entry, available for sd0/1 only. Given that the hardware does not match the documentation, could you check whether that entry is supported by sdh as well ? If so we could merge the two tables. Otherwise this patch looks good, could you please just reformat the table to avoid the mostly empty line in the middle ?
Quoted 1 line
drivers/clk/shmobile/clk-rcar-gen2.c +0
-0};
Signature · 3 lines
Regards, Laurent Pinchart
PATCH 1/3 clk: rcar-h2: fix sd0/sd1 divisor table
Quoted 31 lines · Laurent Pinchart
Hi William,
Thank you for the patch.
Quoted 26 lines · On Tuesday 04 February 2014 18:17:36 William Towle wrote:
The
clk_div_tablefor cpg_sd01_div_table[] concurs with the manual but not with values found in the device itself (which are also the same as the ones inarch/arm/mach-shmobile/clock-r8a7790.c).Update the
clk-rcar-gen2.cdriver to have the same table as the one used by the mach-shmobile driver which work once further issues are fixed in theclk-rcar-gen2.cdriver.Part of the fix for the following error where the driver reports the output as 1MHz but is really 97.5MHz:
sh_mobile_sdhi ee100000.sd: mmc0 base at 0xee100000 clock rate 1 MHz[ben.dooks at codethink.co.uk: updated patch description]Signed-off-by William Towle <[email protected]>Reviewed-by Ben Dooks <[email protected]>--- drivers/clk/shmobile/clk-rcar-gen2.c | 2 ++ 1 file changed, 2 insertions(+)(quoted diff) +0
-0
b/drivers/clk/shmobile/clk-rcar-gen2.cindex a59ec21..df4a1e6 100644drivers/clk/shmobile/clk-rcar-gen2.c +0
-0@@ -170,6 +170,8 @@ static const struct clk_div_table cpg_sdh_div_table[] = { };
Quoted 12 lines
drivers/clk/shmobile/clk-rcar-gen2.c static const struct clk_div_table cpg_sdh_div_table[] = { · line 176
Quoted 5 lines
drivers/clk/shmobile/clk-rcar-gen2.c +2
-0static const struct clk_div_table cpg_sd01_div_table[] = { + {0 ,2 }, {1 ,3 }, {2 ,4 }, {3 ,6 }, + {4 ,8 }, {5 ,12 }, {6 ,16 }, {7 ,18 }, {8 ,24 }, {10 ,36 }, {11 ,48 }, {12 ,10 }, {0 ,0 },With this applied the only difference between the sdh and sd0/1 dividers tables would be the { 12, 10 } entry, available for sd0/1 only. Given that the hardware does not match the documentation, could you check whether that entry is supported by sdh as well ? If so we could merge the two tables. Otherwise this patch looks good, could you please just reformat the table to avoid the mostly empty line in the middle ?
I would like feedback from Renesas on this issue if possible. I can have a quick try at setting the clock value to 10 in u-boot and scope it out and see what happens.
Magnus or Morimoto-san, is there a chance this could be reviewed by someone in Renesas who has knowledge of the hardware block?
[PS, added Kuninori Morimoto to this[
Signature · 2 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius
PATCH 1/3 clk: rcar-h2: fix sd0/sd1 divisor table
Quoted 51 lines · Ben Dooks
Quoted 33 lines · Laurent Pinchart
Hi William,
Thank you for the patch.
Quoted 28 lines · On Tuesday 04 February 2014 18:17:36 William Towle wrote:
The
clk_div_tablefor cpg_sd01_div_table[] concurs with the manual but not with values found in the device itself (which are also the same as the ones inarch/arm/mach-shmobile/clock-r8a7790.c).Update the
clk-rcar-gen2.cdriver to have the same table as the one used by the mach-shmobile driver which work once further issues are fixed in theclk-rcar-gen2.cdriver.Part of the fix for the following error where the driver reports the output as 1MHz but is really 97.5MHz:
sh_mobile_sdhi ee100000.sd: mmc0 base at 0xee100000 clock rate 1MHz
[ben.dooks at codethink.co.uk: updated patch description]Signed-off-by William Towle <[email protected]>Reviewed-by Ben Dooks <[email protected]>--- drivers/clk/shmobile/clk-rcar-gen2.c | 2 ++ 1 file changed, 2 insertions(+)(quoted diff) +0
-0
b/drivers/clk/shmobile/clk-rcar-gen2.cindex a59ec21..df4a1e6 100644drivers/clk/shmobile/clk-rcar-gen2.c +0
-0@@ -170,6 +170,8 @@ static const struct clk_div_tablecpg_sdh_div_table[] =
{ };Quoted 16 lines
drivers/clk/shmobile/clk-rcar-gen2.c static const struct clk_div_table cpg_sdh_div_table[] = { · line 176
Quoted 5 lines
static const struct clk_div_table cpg_sd01_div_table[] = {drivers/clk/shmobile/clk-rcar-gen2.c +2
-0+ { 0, 2 }, { 1, 3 }, { 2, 4 }, { 3, 6 }, + { 4, 8 }, { 5, 12 }, { 6, 16 }, { 7, 18 }, { 8, 24 }, { 10, 36 }, { 11, 48 }, { 12, 10 }, { 0, 0 },With this applied the only difference between the sdh and sd0/1 dividers tables would be the { 12, 10 } entry, available for sd0/1 only. Given that the
hardware does not match the documentation, could you check whether that entry
is supported by sdh as well ? If so we could merge the two tables. Otherwise
this patch looks good, could you please just reformat the table to avoid the
mostly empty line in the middle ?
Quoted 8 lines
I would like feedback from Renesas on this issue if possible. I can have a quick try at setting the clock value to 10 in u-boot and scope it out and see what happens.
Magnus or Morimoto-san, is there a chance this could be reviewed by someone in Renesas who has knowledge of the hardware block?
[PS, added Kuninori Morimoto to this[
I got William to do a quick test with the following u-boot command
mw.l 0xE6150074 0xCCC
sdhi0 showed 156MHz output, and it seemed to work. So there is a distinct possibility that the sdh clock also supports setting 12 for a /10
Signature · 2 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius
PATCH 1/3 clk: rcar-h2: fix sd0/sd1 divisor table
Hi Ben,
Quoted 55 lines · On Wednesday 05 February 2014 12:41:10 Ben Dooks wrote:
Quoted 54 lines · Ben Dooks
Quoted 36 lines · Laurent Pinchart
Quoted 35 lines · On Tuesday 04 February 2014 18:17:36 William Towle wrote:
The
clk_div_tablefor cpg_sd01_div_table[] concurs with the manual but not with values found in the device itself (which are also the same as the ones inarch/arm/mach-shmobile/clock-r8a7790.c).Update the
clk-rcar-gen2.cdriver to have the same table as the one used by the mach-shmobile driver which work once further issues are fixed in theclk-rcar-gen2.cdriver.Part of the fix for the following error where the driver reports the
output as 1MHz but is really 97.5MHz:
sh_mobile_sdhi ee100000.sd: mmc0 base at 0xee100000 clock rate 1MHz
[ben.dooks at codethink.co.uk: updated patch description]Signed-off-by William Towle <[email protected]>Reviewed-by Ben Dooks <[email protected]>---
drivers/clk/shmobile/clk-rcar-gen2.c | 2 ++ 1 file changed, 2 insertions(+)(quoted diff) +0
-0
b/drivers/clk/shmobile/clk-rcar-gen2.cindex a59ec21..df4a1e6 100644drivers/clk/shmobile/clk-rcar-gen2.c +0
-0@@ -170,6 +170,8 @@ static const struct clk_div_tablecpg_sdh_div_table[] =
{ };static const struct clk_div_table cpg_sd01_div_table[] = {drivers/clk/shmobile/clk-rcar-gen2.c +2
-0+ { 0, 2 }, { 1, 3 }, { 2, 4 }, { 3, 6 }, + { 4, 8 },Quoted 9 lines
Quoted 2 lines
{ 5, 12 }, { 6, 16 }, { 7, 18 }, { 8, 24 }, { 10, 36 }, { 11, 48 }, { 12, 10 }, { 0, 0 },With this applied the only difference between the sdh and sd0/1 dividers tables would be the { 12, 10 } entry, available for sd0/1 only. Given that the hardware does not match the documentation, could you check whether that entry is supported by sdh as well ? If so we could merge the two tables. Otherwise this patch looks good, could you please just reformat the table to avoid the mostly empty line in the middle ?
I would like feedback from Renesas on this issue if possible. I can have a quick try at setting the clock value to 10 in u-boot and scope it out and see what happens.
Magnus or Morimoto-san, is there a chance this could be reviewed by someone in Renesas who has knowledge of the hardware block?
Quoted 8 lines
Quoted 1 line
[PS, added Kuninori Morimoto to this[
I got William to do a quick test with the following u-boot command
mw.l 0xE6150074 0xCCCsdhi0 showed 156MHz output, and it seemed to work. So there is a distinct possibility that the sdh clock also supports setting 12 for a /10
Thank you for trying it out. I'd like feedback from Renesas as well, assuming we don't get a "don't do that or it will cause the universe to collapse - woops, too late" nack, let's respin this patch and merge the two tables instead.
Signature · 3 lines
Regards, Laurent Pinchart
PATCH 1/3 clk: rcar-h2: fix sd0/sd1 divisor table
Hi all
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
The
clk_div_tablefor cpg_sd01_div_table[] concurs with the manual but not with values found in the device itself (which are also the same as the ones inarch/arm/mach-shmobile/clock-r8a7790.c).Update the
clk-rcar-gen2.cdriver to have the same table as the one used by the mach-shmobile driver which work once further issues are fixed in theclk-rcar-gen2.cdriver.Part of the fix for the following error where the driver reports the
output as 1MHz but is really 97.5MHz:
sh_mobile_sdhi ee100000.sd: mmc0 base at 0xee100000 clock rate 1MHz
[ben.dooks at codethink.co.uk: updated patch description]Signed-off-by William Towle <[email protected]>Reviewed-by Ben Dooks <[email protected]>
(snip)
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
static const struct clk_div_table cpg_sd01_div_table[] = {drivers/clk/shmobile/clk-rcar-gen2.c +2
-0+ { 0, 2 }, { 1, 3 }, { 2, 4 }, { 3, 6 }, + { 4, 8 }, { 5, 12 }, { 6, 16 }, { 7, 18 }, { 8, 24 }, { 10, 36 }, { 11, 48 }, { 12, 10 }, { 0, 0 },
(snip)
Quoted 12 lines
Quoted 12 lines
Quoted 8 lines
I would like feedback from Renesas on this issue if possible. I can have a quick try at setting the clock value to 10 in u-boot and scope it out and see what happens.
Magnus or Morimoto-san, is there a chance this could be reviewed by someone in Renesas who has knowledge of the hardware block?
[PS, added Kuninori Morimoto to this[
I got William to do a quick test with the following u-boot command
mw.l 0xE6150074 0xCCC
Quoted 8 lines
Quoted 3 lines
sdhi0 showed 156MHz output, and it seemed to work. So there is a distinct possibility that the sdh clock also supports setting 12 for a /10
Thank you for trying it out. I'd like feedback from Renesas as well, assuming we don't get a "don't do that or it will cause the universe to collapse - woops, too late" nack, let's respin this patch and merge the two tables instead.
I ask it to Renesas HW team.
Please wait
Best regards
---
Kuninori Morimoto
PATCH 1/3 clk: rcar-h2: fix sd0/sd1 divisor table
Hi William, Ben, Laurent
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/clk/shmobile/clk-rcar-gen2.c static const struct clk_div_table cpg_sdh_div_table[] = { · line 176
Quoted 6 lines
static const struct clk_div_table cpg_sd01_div_table[] = {drivers/clk/shmobile/clk-rcar-gen2.c +2
-0+ { 0, 2 }, { 1, 3 }, { 2, 4 }, { 3, 6 }, + { 4, 8 }, { 5, 12 }, { 6, 16 }, { 7, 18 }, { 8, 24 }, { 10, 36 }, { 11, 48 }, { 12, 10 }, { 0, 0 },
According to HW team, datasheet is correct.
Some HW has above un-documented implementation indeed, but these are not supported.
But, 0x0100 (x1/8) on SD0FC/SD1FC is now supported and documented in latest datasheet.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
sdhi0 showed 156MHz output, and it seemed to work. So there is a distinct possibility that the sdh clock also supports setting 12 for a /10
According to HW there,
SDHFC will be stopped if you set 0xC.
Best regards
---
Kuninori Morimoto
PATCH 1/3 clk: rcar-h2: fix sd0/sd1 divisor table
Quoted 6 lines · Kuninori Morimoto
Hi William, Ben, Laurent
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
static const struct clk_div_table cpg_sd01_div_table[] = {(quoted diff) +2
-0+ { 0, 2 }, { 1, 3 }, { 2, 4 }, { 3, 6 }, + { 4, 8 },
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
{ 5, 12 }, { 6, 16 }, { 7, 18 }, { 8, 24 }, { 10, 36 }, { 11, 48 }, { 12, 10 }, { 0, 0 },According to HW team, datasheet is correct.
Some HW has above un-documented implementation indeed, but these are not supported.
But,0x0100(x1/8) on SD0FC/SD1FC is now supported and documented in latest datasheet.
Thanks, we do not have a copy of that so cannot comment.
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
sdhi0 showed 156MHz output, and it seemed to work. So there is a distinct possibility that the sdh clock also supports setting 12 for a /10
According to HW there,
SDHFC will be stopped if you set0xC.
We'll look at re-working this patch and getting it re-sent.
Signature · 2 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius
PATCH 2/3 ARM: shmobile: r8a7790: specify multiple parents for cpg_clks
In reply to William TowleThe current drivers/clk/shmobile/clk-rcar-gen2.c uses the extal_clk reference for the parent of all the clocks that it registers. However the lb, qspi, sdh, sd0 and sd1 clocks are all parented to either pll1 or pll1_div2 which means that the clock rates are incorrect.
This is part of the fix that corrects the SDHI0 clock rate error where it reports 1MHz instead of 97.5:
sh_mobile_sdhi ee100000.sd: mmc0 base at 0xee100000 clock rate 1 MHz
Notes:
- May require cross-merge with clk-rcar-gen2.c fix
- Also not clear which clock "z" is to fix it.
--- arch/arm/boot/dts/r8a7790.dtsi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
arch/arm/boot/dts/r8a7790.dtsi +7 -1
@@ -446,7 +446,13 @@ compatible = "renesas,r8a7790-cpg-clocks", "renesas,rcar-gen2-cpg-clocks"; reg = <0 0xe6150000 0 0x1000>; - clocks = <&extal_clk>; + clocks = <&extal_clk>, <&extal_clk>, <&extal_clk>, <&extal_clk>, + <&cpg_clocks R8A7790_CLK_PLL1>, + <&pll1_div2_clk>, + <&cpg_clocks R8A7790_CLK_PLL1>, + <&cpg_clocks R8A7790_CLK_PLL1>, + <&cpg_clocks R8A7790_CLK_PLL1> + /* not known for "z" ...,<> */; #clock-cells = <1>; clock-output-names = "main", "pll0", "pll1", "pll3", "lb", "qspi", "sdh", "sd0", "sd1",
Signature · 1 line
1.7.10.4
PATCH 2/3 ARM: shmobile: r8a7790: specify multiple parents for cpg_clks
Quoted 6 lines · William Towle
The current
drivers/clk/shmobile/clk-rcar-gen2.cuses theextal_clkreference for the parent of all the clocks that it registers. However the lb, qspi, sdh, sd0 and sd1 clocks are all parented to either pll1 orpll1_div2which means that the clock rates are incorrect.
Quoted 7 lines
This is part of the fix that corrects the SDHI0 clock rate error where it reports 1MHz instead of 97.5:
sh_mobile_sdhi ee100000.sd: mmc0 base at 0xee100000 clock rate 1 MHzNotes:
- May require cross-merge withclk-rcar-gen2.cfix
- Also not clear which clock "z" is to fix it.
Laurent, if you could give us an idea of how to fix this then it would be helpful to get this patch fully fixed.
Quoted 13 lines
[ben.dooks at codethink.co.uk: updated patch description]Signed-off-by William Towle <[email protected]>Reviewed-by Ben Dooks <[email protected]>--- arch/arm/boot/dts/r8a7790.dtsi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)arch/arm/boot/dts/r8a7790.dtsi +0
-0
arch/arm/boot/dts/r8a7790.dtsi line 454
Quoted 10 lines
arch/arm/boot/dts/r8a7790.dtsi +6
-1@@ -446,7 +446,13 @@ compatible = "renesas,r8a7790-cpg-clocks", "renesas,rcar-gen2-cpg-clocks"; reg = <0 0xe6150000 0 0x1000>; - clocks = <&extal_clk>; + clocks = <&extal_clk>, <&extal_clk>, <&extal_clk>, <&extal_clk>, + <&cpg_clocks R8A7790_CLK_PLL1>, + <&pll1_div2_clk>, + <&cpg_clocks R8A7790_CLK_PLL1>, + <&cpg_clocks R8A7790_CLK_PLL1>, + <&cpg_clocks R8A7790_CLK_PLL1>
Should we add a pll1_clk node, or leave this as is?
Quoted 5 lines
arch/arm/boot/dts/r8a7790.dtsi +1
-0+ /* not known for "z" ...,<> */; #clock-cells = <1>; clock-output-names = "main", "pll0", "pll1", "pll3", "lb", "qspi", "sdh", "sd0", "sd1",
Signature · 2 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius
PATCH 2/3 ARM: shmobile: r8a7790: specify multiple parents for cpg_clks
Hi Ben,
Quoted 12 lines · On Wednesday 05 February 2014 09:15:31 Ben Dooks wrote:
Quoted 11 lines · William Towle
The current
drivers/clk/shmobile/clk-rcar-gen2.cuses theextal_clkreference for the parent of all the clocks that it registers. However the lb, qspi, sdh, sd0 and sd1 clocks are all parented to either pll1 orpll1_div2which means that the clock rates are incorrect.This is part of the fix that corrects the SDHI0 clock
rate error where it reports 1MHz instead of 97.5:
sh_mobile_sdhi ee100000.sd: mmc0 base at 0xee100000 clock rate 1 MHz
Quoted 6 lines
Quoted 3 lines
Notes:
- May require cross-merge withclk-rcar-gen2.cfix
- Also not clear which clock "z" is to fix it.Laurent, if you could give us an idea of how to fix this then it would be helpful to get this patch fully fixed.
I've already sent a patch that fixes this issue.
"clk: shmobile: rcar-gen2: Fix clock parent all non-PLL clocks"
(http://www.spinics.net/lists/linux-sh/msg27275.html)
I've just pinged Mike to ask him to pick it up for v3.14.
Quoted 14 lines
Quoted 14 lines
[ben.dooks at codethink.co.uk: updated patch description]Signed-off-by William Towle <[email protected]>Reviewed-by Ben Dooks <[email protected]>---
arch/arm/boot/dts/r8a7790.dtsi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/arch/arm/boot/dts/r8a7790.dtsiindex ff55c6e..242e6e2 100644arch/arm/boot/dts/r8a7790.dtsi +0
-0@@ -446,7 +446,13 @@
Quoted 8 lines
arch/arm/boot/dts/r8a7790.dtsi
Quoted 8 lines
arch/arm/boot/dts/r8a7790.dtsi +1
-1compatible = "renesas,r8a7790-cpg-clocks", "renesas,rcar-gen2-cpg-clocks"; reg = <0 0xe6150000 0 0x1000>; - clocks = <&extal_clk>; + clocks = <&extal_clk>, <&extal_clk>, <&extal_clk>,
<&extal_clk>,
Quoted 14 lines
arch/arm/boot/dts/r8a7790.dtsi line 454
Quoted 5 lines
arch/arm/boot/dts/r8a7790.dtsi +5
-0+ <&cpg_clocks R8A7790_CLK_PLL1>, + <&pll1_div2_clk>, + <&cpg_clocks R8A7790_CLK_PLL1>, + <&cpg_clocks R8A7790_CLK_PLL1>, + <&cpg_clocks R8A7790_CLK_PLL1>Should we add a
pll1_clknode, or leave this as is?Quoted 6 lines
arch/arm/boot/dts/r8a7790.dtsi +1
-0+ /* not known for "z" ...,<> */; #clock-cells = <1>; clock-output-names = "main", "pll0", "pll1", "pll3", "lb", "qspi", "sdh", "sd0", "sd1",
Signature · 3 lines
Regards, Laurent Pinchart
PATCH 2/3 ARM: shmobile: r8a7790: specify multiple parents for cpg_clks
Quoted 22 lines · Laurent Pinchart
Hi Ben,
Quoted 12 lines · On Wednesday 05 February 2014 09:15:31 Ben Dooks wrote:
Quoted 11 lines · William Towle
The current
drivers/clk/shmobile/clk-rcar-gen2.cuses theextal_clkreference for the parent of all the clocks that it registers. However the lb, qspi, sdh, sd0 and sd1 clocks are all parented to either pll1 orpll1_div2which means that the clock rates are incorrect.This is part of the fix that corrects the SDHI0 clock
rate error where it reports 1MHz instead of 97.5:
sh_mobile_sdhi ee100000.sd: mmc0 base at 0xee100000 clock rate 1 MHzQuoted 6 lines
Quoted 3 lines
Notes:
- May require cross-merge withclk-rcar-gen2.cfix
- Also not clear which clock "z" is to fix it.Laurent, if you could give us an idea of how to fix this then it would be helpful to get this patch fully fixed.
Quoted 7 lines
I've already sent a patch that fixes this issue.
"clk: shmobile: rcar-gen2: Fix clock parent all non-PLL clocks"
(http://www.spinics.net/lists/linux-sh/msg27275.html)
I've just pinged Mike to ask him to pick it up for v3.14.
I just saw and commented on it. I think the DT is the nicer way of actually doing this, especially if the driver may get re-used in future.
There's also an issue with SDHI0/1 divider table which has been posted too.
Signature · 2 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius
PATCH 2/3 ARM: shmobile: r8a7790: specify multiple parents for cpg_clks
Hi Ben,
Quoted 26 lines · On Wednesday 05 February 2014 10:36:56 Ben Dooks wrote:
Quoted 25 lines · Laurent Pinchart
Quoted 13 lines · On Wednesday 05 February 2014 09:15:31 Ben Dooks wrote:
Quoted 12 lines · William Towle
The current
drivers/clk/shmobile/clk-rcar-gen2.cuses theextal_clkreference for the parent of all the clocks that it registers. However the lb, qspi, sdh, sd0 and sd1 clocks are all parented to either pll1 orpll1_div2which means that the clock rates are incorrect.This is part of the fix that corrects the SDHI0 clock
rate error where it reports 1MHz instead of 97.5:
sh_mobile_sdhi ee100000.sd: mmc0 base at 0xee100000 clock rate 1 MHzQuoted 6 lines
Quoted 3 lines
Notes:
- May require cross-merge withclk-rcar-gen2.cfix
- Also not clear which clock "z" is to fix it.Laurent, if you could give us an idea of how to fix this then it would be helpful to get this patch fully fixed.
I've already sent a patch that fixes this issue.
"clk: shmobile: rcar-gen2: Fix clock parent all non-PLL clocks"
Quoted 7 lines
Quoted 3 lines
(http://www.spinics.net/lists/linux-sh/msg27275.html)
I've just pinged Mike to ask him to pick it up for v3.14.
I just saw and commented on it. I think the DT is the nicer way of actually doing this, especially if the driver may get re-used in future.
I've replied to that in the other mail thread, we can continue the discussion there.
Quoted 1 line
There's also an issue with SDHI0/1 divider table which has been posted too.
I've replied to that patch as well.
Signature · 3 lines
Regards, Laurent Pinchart
PATCH 3/3 clk: shmobile: handle multiple parent clocks for cpg clocks
In reply to William TowleThe current action on registering the cpg_clocks is to have them all registered with a single parent clock. This is not the correct action, as some of the clocks such as the SDHI and QSPI are actually parented to PLL1 or PLL1/2.
This also requires a change to the device-tree files to make sure that appropriate parent clocks are assigned.
--- drivers/clk/shmobile/clk-rcar-gen2.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/clk/shmobile/clk-rcar-gen2.c +8 -3
@@ -185,7 +185,7 @@ static u32 cpg_mode __initdata;static struct clk *__init rcar_gen2_cpg_register_clock (struct device_node *np,struct rcar_gen2_cpg *cpg,const struct cpg_pll_config *config, -const char *name) +const char *name,int index) {const struct clk_div_table *table =NULL ;const char *parent_name ="main" ;
@@ -193,8 +193,13 @@ rcar_gen2_cpg_register_clock(struct device_node *np, struct rcar_gen2_cpg *cpg,unsigned int mult =1 ;unsigned int div =1 ; + parent_name =of_clk_get_parent_name (np, index); +if (!parent_name) { +pr_err ("no parent set for clocks array\n" ); +return ERR_PTR (-ENOENT ); + } +if (!strcmp (name,"main" )) { - parent_name =of_clk_get_parent_name (np,0 ); div = config->extal_div; }else if (!strcmp (name,"pll0" )) {/* PLL0 is a configurable multiplier clock. Register it as a
@@ -279,7 +284,7 @@ static void __init rcar_gen2_cpg_clocks_init(struct device_node *np)of_property_read_string_index (np,"clock-output-names" , i, &name); - clk =rcar_gen2_cpg_register_clock (np, cpg, config, name); + clk =rcar_gen2_cpg_register_clock (np, cpg, config, name, i);if (IS_ERR (clk))pr_err ("%s: failed to register %s %s clock (%ld)\n" , __func__, np->name, name,PTR_ERR (clk));
Signature · 1 line
1.7.10.4