Skip to contentSkip to conversation

ARM: mach-shmobile: clock-r8a7740: add FSI clock

PATCH New Rafael J. Wysocki 3 participants 7 messages Apr 25, 2012 – May 7, 2012

Subsystems (4)
lore
Share & tools
lore

Rafael J. Wysocki

author Applied
#0 lore raw
Quoted 1 line · Kuninori Morimoto

Applied to the r8a7740 branch of the renesas.git tree.

Thanks,
Rafael

Quoted 34 lines
---
 arch/arm/mach-shmobile/clock-r8a7740.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mach-shmobile/clock-r8a7740.c +3 -1
index 3b35b9a..4a659f2e 100644
@@ -257,7 +257,7 @@ enum {
 	MSTP222,
 	MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
 
-	MSTP329, MSTP323,
+	MSTP329, MSTP328, MSTP323,
 
 	MSTP_NR
 };
@@ -280,6 +280,7 @@ static struct clk mstp_clks[MSTP_NR] = {
 	[MSTP200] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB],	SMSTPCR2,  0, 0), /* SCIFA4 */
 
 	[MSTP329] = SH_CLK_MSTP32(&r_clk,		SMSTPCR3, 29, 0), /* CMT10 */
+	[MSTP328] = SH_CLK_MSTP32(&div4_clks[DIV4_HP],	SMSTPCR3, 28, 0), /* FSI */
 	[MSTP323] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB],	SMSTPCR3, 23, 0), /* IIC1 */
 };
 
@@ -334,6 +335,7 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("sh-sci.6",		&mstp_clks[MSTP230]),
 
 	CLKDEV_DEV_ID("sh_cmt.10",		&mstp_clks[MSTP329]),
+	CLKDEV_DEV_ID("sh_fsi2",		&mstp_clks[MSTP328]),
 	CLKDEV_DEV_ID("i2c-sh_mobile.1",	&mstp_clks[MSTP323]),
 };
 
#1 lore raw

PATCH 1/1 ARM: mach-shmobile: clock-r8a7740: use followparent_recalc on usb24s

If the clocks is always same value as the parent clock, we can use followparent_recalc() for .recalc

---
 arch/arm/mach-shmobile/clock-r8a7740.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
arch/arm/mach-shmobile/clock-r8a7740.c +1 -6
index 89a2f9d..81b54a6 100644
@@ -188,11 +188,6 @@ static struct clk *usb24s_parents[] = {
 	[1] = &extal2_clk
 };
 
-static unsigned long usb24s_recalc(struct clk *clk)
-{
-	return clk->parent->rate;
-};
-
 static int usb24s_enable(struct clk *clk)
 {
 	__raw_writel(__raw_readl(USBCKCR) & ~(1 << 8), USBCKCR);
@@ -234,7 +229,7 @@ static int usb24s_set_parent(struct clk *clk, struct clk *parent)
 }
 
 static struct sh_clk_ops usb24s_clk_ops = {
-	.recalc		= usb24s_recalc,
+	.recalc		= followparent_recalc,
 	.enable		= usb24s_enable,
 	.disable	= usb24s_disable,
 	.set_parent	= usb24s_set_parent,
Signature · 1 line
1.7.5.4
#3 lore raw

PATCH 1/1 ARM: mach-shmobile: clock-r8a7740: add sh-eth clock

In reply to Rafael J. Wysocki

armadillo800eva board is using sh-eth, but clock-r8a7740 didn't care it. This clock was enabled by boot-loader.
This patch fix it up.

---
 arch/arm/mach-shmobile/board-armadillo800eva.c |    1 +
 arch/arm/mach-shmobile/clock-r8a7740.c         |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)
arch/arm/mach-shmobile/board-armadillo800eva.c +1 -0
index 0cfaec5..e750ea6 100644
@@ -321,6 +321,7 @@ static struct resource sh_eth_resources[] = {
 
 static struct platform_device sh_eth_device = {
 	.name = "sh-eth",
+	.id = -1,
 	.dev = {
 		.platform_data = &sh_eth_platdata,
 	},
arch/arm/mach-shmobile/clock-r8a7740.c +3 -0
index 81b54a6..26eea5f 100644
@@ -352,6 +352,7 @@ enum {
 
 	MSTP329, MSTP328, MSTP323, MSTP320,
 	MSTP314, MSTP313, MSTP312,
+	MSTP309,
 
 	MSTP416, MSTP415, MSTP407, MSTP406,
 
@@ -382,6 +383,7 @@ static struct clk mstp_clks[MSTP_NR] = {
 	[MSTP314] = SH_CLK_MSTP32(&div4_clks[DIV4_HP],	SMSTPCR3, 14, 0), /* SDHI0 */
 	[MSTP313] = SH_CLK_MSTP32(&div4_clks[DIV4_HP],	SMSTPCR3, 13, 0), /* SDHI1 */
 	[MSTP312] = SH_CLK_MSTP32(&div4_clks[DIV4_HP],	SMSTPCR3, 12, 0), /* MMC */
+	[MSTP309] = SH_CLK_MSTP32(&div4_clks[DIV4_HP],	SMSTPCR3,  9, 0), /* GEther */
 
 	[MSTP416] = SH_CLK_MSTP32(&div4_clks[DIV4_HP],	SMSTPCR4, 16, 0), /* USBHOST */
 	[MSTP415] = SH_CLK_MSTP32(&div4_clks[DIV4_HP],	SMSTPCR4, 15, 0), /* SDHI2 */
@@ -447,6 +449,7 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("sh_mobile_sdhi.0",	&mstp_clks[MSTP314]),
 	CLKDEV_DEV_ID("sh_mobile_sdhi.1",	&mstp_clks[MSTP313]),
 	CLKDEV_DEV_ID("sh_mmcif",		&mstp_clks[MSTP312]),
+	CLKDEV_DEV_ID("sh-eth",			&mstp_clks[MSTP309]),
 
 	CLKDEV_DEV_ID("sh_mobile_sdhi.2",	&mstp_clks[MSTP415]),
 
Signature · 1 line
1.7.5.4
author Applied
#5 lore raw

Re: [PATCH] ARM: mach-shmobile: clock-r8a7740: use followparent_recalc on usb24s

In reply to Rafael J. Wysocki
Quoted 8 lines · Simon Horman
Quoted 5 lines · Kuninori Morimoto

If the clocks is always same value as the parent clock, we can use followparent_recalc() for .recalc

Applied to the r8a7740 branch of the renesas.git tree.

Thanks,
Rafael

author Applied
#6 lore raw

Re: [PATCH] ARM: mach-shmobile: clock-r8a7740: add sh-eth clock

In reply to Rafael J. Wysocki
Quoted 8 lines · Simon Horman
Quoted 5 lines · Kuninori Morimoto

armadillo800eva board is using sh-eth, but clock-r8a7740 didn't care it. This clock was enabled by boot-loader.
This patch fix it up.

Applied to the armadillo800eva branch of the renesas.git tree.

Thanks,
Rafael