Skip to contentSkip to conversation

ARM: OMAP3: clock: cleanup AM35xx clock flags

PATCH New Kevin Hilman 2 participants 8 messages Apr 30, 2012 – May 2, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover ARM: OMAP3: clock: cleanup AM35xx clock flags

Remove all AM35xx specifics from the clock tree and tree and treat all AM35xx devices the same.

Kevin Hilman (2):
ARM: OMAP3: clock data: replace 3503/3517 flag with AM35x flag for
UART4
ARM: OMAP3: clock data: treat all AM35x devices the same

Paul Walmsley (1):
ARM: OMAP: clock: convert AM3517/3505 detection/flags to AM35xx

 arch/arm/mach-omap2/clock3xxx_data.c          |   36 +++++++++----------------
 arch/arm/plat-omap/include/plat/clkdev_omap.h |    4 +--
 2 files changed, 13 insertions(+), 27 deletions(-)
Signature · 1 line
1.7.9.2
#1 lore raw

PATCH 1/3 ARM: OMAP3: clock data: replace 3503/3517 flag with AM35x flag for UART4

The AM35x UART4 is common to all AM35x devices, so use CK_AM35XX instead of (CK_3505 | CK_3517), which is equivalent.

---
 arch/arm/mach-omap2/clock3xxx_data.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/clock3xxx_data.c +8 -8
index f4a626f..ce0cbd8 100644
@@ -2489,13 +2489,13 @@ static struct clk uart4_fck = {
 };
 
 static struct clk uart4_fck_am35xx = {
-	.name           = "uart4_fck",
-	.ops            = &clkops_omap2_dflt_wait,
-	.parent         = &per_48m_fck,
-	.enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
-	.enable_bit     = OMAP3430_EN_UART4_SHIFT,
-	.clkdm_name     = "core_l4_clkdm",
-	.recalc         = &followparent_recalc,
+	.name		= "uart4_fck",
+	.ops		= &clkops_omap2_dflt_wait,
+	.parent		= &per_48m_fck,
+	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+	.enable_bit	= OMAP3430_EN_UART4_SHIFT,
+	.clkdm_name	= "core_l4_clkdm",
+	.recalc		= &followparent_recalc,
 };
 
 static struct clk gpt2_fck = {
@@ -3419,7 +3419,7 @@ static struct omap_clk omap3xxx_clks[] = {
 	CLK(NULL,	"per_48m_fck",	&per_48m_fck,	CK_3XXX),
 	CLK(NULL,	"uart3_fck",	&uart3_fck,	CK_3XXX),
 	CLK(NULL,	"uart4_fck",	&uart4_fck,	CK_36XX),
-	CLK(NULL,	"uart4_fck",	&uart4_fck_am35xx, CK_3505 | CK_3517),
+	CLK(NULL,	"uart4_fck",	&uart4_fck_am35xx, CK_AM35XX),
 	CLK(NULL,	"gpt2_fck",	&gpt2_fck,	CK_3XXX),
 	CLK(NULL,	"gpt3_fck",	&gpt3_fck,	CK_3XXX),
 	CLK(NULL,	"gpt4_fck",	&gpt4_fck,	CK_3XXX),
Signature · 1 line
1.7.9.2
#2 lore raw

PATCH 2/3 ARM: OMAP3: clock data: treat all AM35x devices the same

In reply to Kevin Hilman

The init for 3505/3517 specific clocks depends on the ordering of cpu_is checks, is error prone and confusing (there are 2 separate checks for cpu_is_omap3505()).

Remove the 3505-specific checking since CK_3505 flag is not used, and treat all AM35x clocks the same.

This means that the SGX clock (the only AM35x clkdev not currently flagged for 3505) will now be registered on 3505, but that is harmless. That can be cleaned up when the clkdev nodes are removed in favor of them being registered by hwmod.

---
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
arch/arm/mach-omap2/clock3xxx_data.c +1 -13
index ce0cbd8..5e64b33 100644
@@ -3513,21 +3513,9 @@ int __init omap3xxx_clk_init(void)
 	struct omap_clk *c;
 	u32 cpu_clkflg = 0;
 
-	/*
-	 * 3505 must be tested before 3517, since 3517 returns true
-	 * for both AM3517 chips and AM3517 family chips, which
-	 * includes 3505.  Unfortunately there's no obvious family
-	 * test for 3517/3505 :-(
-	 */
-	if (cpu_is_omap3505()) {
-		cpu_mask = RATE_IN_34XX;
-		cpu_clkflg = CK_3505;
-	} else if (cpu_is_omap3517()) {
+	if (cpu_is_omap3517()) {
 		cpu_mask = RATE_IN_34XX;
 		cpu_clkflg = CK_3517;
-	} else if (cpu_is_omap3505()) {
-		cpu_mask = RATE_IN_34XX;
-		cpu_clkflg = CK_3505;
 	} else if (cpu_is_omap3630()) {
 		cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
 		cpu_clkflg = CK_36XX;
Signature · 1 line
1.7.9.2
#3 lore raw

PATCH 3/3 ARM: OMAP: clock: convert AM3517/3505 detection/flags to AM35xx

In reply to Kevin Hilman

From: Paul Walmsley <[email protected]>

To improve the clarity of the code, replace the CK_3517 flag used in the clock data with CK_AM35XX. The CK_3505 flag can also be removed, since it is now unused.

---
 arch/arm/mach-omap2/clock3xxx_data.c          |    6 +++---
 arch/arm/plat-omap/include/plat/clkdev_omap.h |    4 +---
 2 files changed, 4 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/clock3xxx_data.c +3 -3
index 5e64b33..9f48f84 100644
@@ -3294,8 +3294,8 @@ static struct omap_clk omap3xxx_clks[] = {
 	CLK(NULL,	"gfx_l3_ick",	&gfx_l3_ick,	CK_3430ES1),
 	CLK(NULL,	"gfx_cg1_ck",	&gfx_cg1_ck,	CK_3430ES1),
 	CLK(NULL,	"gfx_cg2_ck",	&gfx_cg2_ck,	CK_3430ES1),
-	CLK(NULL,	"sgx_fck",	&sgx_fck,	CK_3430ES2PLUS | CK_3517 | CK_36XX),
-	CLK(NULL,	"sgx_ick",	&sgx_ick,	CK_3430ES2PLUS | CK_3517 | CK_36XX),
+	CLK(NULL,	"sgx_fck",	&sgx_fck,	CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
+	CLK(NULL,	"sgx_ick",	&sgx_ick,	CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
 	CLK(NULL,	"d2d_26m_fck",	&d2d_26m_fck,	CK_3430ES1),
 	CLK(NULL,	"modem_fck",	&modem_fck,	CK_34XX | CK_36XX),
 	CLK(NULL,	"sad2d_ick",	&sad2d_ick,	CK_34XX | CK_36XX),
@@ -3515,7 +3515,7 @@ int __init omap3xxx_clk_init(void)
 
 	if (cpu_is_omap3517()) {
 		cpu_mask = RATE_IN_34XX;
-		cpu_clkflg = CK_3517;
+		cpu_clkflg = CK_AM35XX;
 	} else if (cpu_is_omap3630()) {
 		cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
 		cpu_clkflg = CK_36XX;
arch/arm/plat-omap/include/plat/clkdev_omap.h +1 -3
index b299b8d..d0ed8c4 100644
@@ -34,8 +34,7 @@ struct omap_clk {
 #define CK_243X		(1 << 5)	/* 243x, 253x */
 #define CK_3430ES1	(1 << 6)	/* 34xxES1 only */
 #define CK_3430ES2PLUS	(1 << 7)	/* 34xxES2, ES3, non-Sitara 35xx only */
-#define CK_3505		(1 << 8)
-#define CK_3517		(1 << 9)
+#define CK_AM35XX	(1 << 9)	/* Sitara AM35xx */
 #define CK_36XX		(1 << 10)	/* 36xx/37xx-specific clocks */
 #define CK_443X		(1 << 11)
 #define CK_TI816X	(1 << 12)
@@ -44,7 +43,6 @@ struct omap_clk {
 
 
 #define CK_34XX		(CK_3430ES1 | CK_3430ES2PLUS)
-#define CK_AM35XX	(CK_3505 | CK_3517)	/* all Sitara AM35xx */
 #define CK_3XXX		(CK_34XX | CK_AM35XX | CK_36XX)
 
 
Signature · 1 line
1.7.9.2
maintainer
#4 lore raw

PATCH 3/3 ARM: OMAP: clock: convert AM3517/3505 detection/flags to AM35xx

Quoted 1 line · Kevin Hilman

From: Paul Walmsley <[email protected]>

Looks good to me but I think you created this patch, right? :-)

- Paul

#5 lore raw

PATCH 3/3 ARM: OMAP: clock: convert AM3517/3505 detection/flags to AM35xx

Quoted 5 lines · Paul Walmsley
Quoted 1 line · Kevin Hilman

From: Paul Walmsley <[email protected]>

Looks good to me but I think you created this patch, right? :-)

er, yeah.

Seems the combined version I pulled from your temporary branch had your authorship (maybe because of the combine?) and I didn't notice.

Anyways, feel free free to fix up.

Thanks,

Kevin

maintainer
#6 lore raw

PATCH 3/3 ARM: OMAP: clock: convert AM3517/3505 detection/flags to AM35xx

Quoted 6 lines · Kevin Hilman

er, yeah.

Seems the combined version I pulled from your temporary branch had your authorship (maybe because of the combine?) and I didn't notice.

Anyways, feel free free to fix up.

Weird, sorry about that. Will fix here...

- Paul

maintainer
#7 lore raw

cover ARM: OMAP3: clock: cleanup AM35xx clock flags

In reply to Kevin Hilman
Quoted 2 lines · Kevin Hilman

Remove all AM35xx specifics from the clock tree and tree and treat all AM35xx devices the same.

Thanks, queued for 3.5, and authorship fixed on the third patch as we discussed.

- Paul