Re: [PATCH 3/4] ARM: OMAP3+: hwmod: Add AM33XX HWMOD data for davinci_mdio module

2012-10-30 Thread Peter Korsgaard
> "Vaibhav" == Vaibhav Hiremath  writes:

 Vaibhav> From: Mugunthan V N 
 Vaibhav> This patch adds hwmod entry for davinci MDIO module,
 Vaibhav> creating parent<->child relationship between CPSW and MDIO module.

 Vaibhav> This Parent-child relation is required in order to use common 
resources
 Vaibhav> like, clock, but still maintaining the logical separation between 
them.

 Vaibhav> CPGMAC SubSystem consist of various sub-modules, like, mdio, cpdma,
 Vaibhav> cpsw, etc... These sub-modules are also used in some of Davinci
 Vaibhav> family of devices, so separate and independent platform devices &
 Vaibhav> drivers for CPSW and MDIO is implemented.
 Vaibhav> In case of AM33XX, the resources are shared and common register
 Vaibhav> bit-field is provided to control module/clock enable/disable,
 Vaibhav> makes it difficult to handle common resources from both drivers.

 Vaibhav> So the solution is, create parent<->child relationship between
 Vaibhav> CPGMAC & MDIO modules.

 Vaibhav> Signed-off-by: Mugunthan V N 
 Vaibhav> Signed-off-by: Vaibhav Hiremath 
 Vaibhav> Cc: Richard Cochran 
 Vaibhav> Cc: Paul Walmsley 

Acked-by: Peter Korsgaard 

-- 
Bye, Peter Korsgaard
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] ARM: OMAP3+: hwmod: Add AM33XX HWMOD data for davinci_mdio module

2012-10-29 Thread Vaibhav Hiremath
From: Mugunthan V N 

This patch adds hwmod entry for davinci MDIO module,
creating parent<->child relationship between CPSW and MDIO module.

This Parent-child relation is required in order to use common resources
like, clock, but still maintaining the logical separation between them.

CPGMAC SubSystem consist of various sub-modules, like, mdio, cpdma,
cpsw, etc... These sub-modules are also used in some of Davinci
family of devices, so separate and independent platform devices &
drivers for CPSW and MDIO is implemented.
In case of AM33XX, the resources are shared and common register
bit-field is provided to control module/clock enable/disable,
makes it difficult to handle common resources from both drivers.

So the solution is, create parent<->child relationship between
CPGMAC & MDIO modules.

Signed-off-by: Mugunthan V N 
Signed-off-by: Vaibhav Hiremath 
Cc: Richard Cochran 
Cc: Paul Walmsley 
---
 arch/arm/mach-omap2/omap_hwmod_33xx_data.c |   32 
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
index ad8d43b..3c235d8 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
@@ -674,6 +674,7 @@ static struct omap_hwmod am33xx_cpgmac0_hwmod = {
.name   = "cpgmac0",
.class  = &am33xx_cpgmac0_hwmod_class,
.clkdm_name = "cpsw_125mhz_clkdm",
+   .flags  = (HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY),
.mpu_irqs   = am33xx_cpgmac0_irqs,
.main_clk   = "cpsw_125mhz_gclk",
.prcm   = {
@@ -685,6 +686,20 @@ static struct omap_hwmod am33xx_cpgmac0_hwmod = {
 };

 /*
+ * mdio class
+ */
+static struct omap_hwmod_class am33xx_mdio_hwmod_class = {
+   .name   = "davinci_mdio",
+};
+
+static struct omap_hwmod am33xx_mdio_hwmod = {
+   .name   = "davinci_mdio",
+   .class  = &am33xx_mdio_hwmod_class,
+   .clkdm_name = "cpsw_125mhz_clkdm",
+   .main_clk   = "cpsw_125mhz_gclk",
+};
+
+/*
  * dcan class
  */
 static struct omap_hwmod_class am33xx_dcan_hwmod_class = {
@@ -2501,6 +2516,22 @@ static struct omap_hwmod_ocp_if am33xx_l4_hs__cpgmac0 = {
.user   = OCP_USER_MPU,
 };

+struct omap_hwmod_addr_space am33xx_mdio_addr_space[] = {
+   {
+   .pa_start   = 0x4A101000,
+   .pa_end = 0x4A101000 + SZ_256 - 1,
+   .flags  = ADDR_MAP_ON_INIT,
+   },
+   { }
+};
+
+struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio = {
+   .master = &am33xx_cpgmac0_hwmod,
+   .slave  = &am33xx_mdio_hwmod,
+   .addr   = am33xx_mdio_addr_space,
+   .user   = OCP_USER_MPU,
+};
+
 static struct omap_hwmod_addr_space am33xx_elm_addr_space[] = {
{
.pa_start   = 0x4808,
@@ -3371,6 +3402,7 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] 
__initdata = {
&am33xx_l3_main__tptc2,
&am33xx_l3_s__usbss,
&am33xx_l4_hs__cpgmac0,
+   &am33xx_cpgmac0__mdio,
NULL,
 };

--
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html