From: Vaibhav Hiremath <hvaibhav@ti.com>
To: <netdev@vger.kernel.org>
Cc: <paul@pwsan.com>, <linux-arm-kernel@lists.infradead.org>,
<linux-omap@vger.kernel.org>, Mugunthan V N <mugunthanvnm@ti.com>,
Vaibhav Hiremath <hvaibhav@ti.com>,
Richard Cochran <richardcochran@gmail.com>
Subject: [PATCH 3/4] ARM: OMAP3+: hwmod: Add AM33XX HWMOD data for davinci_mdio module
Date: Mon, 29 Oct 2012 13:51:20 +0530 [thread overview]
Message-ID: <1351498881-32482-5-git-send-email-hvaibhav@ti.com> (raw)
In-Reply-To: <1351498881-32482-1-git-send-email-hvaibhav@ti.com>
From: Mugunthan V N <mugunthanvnm@ti.com>
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 <mugunthanvnm@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Paul Walmsley <paul@pwsan.com>
---
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 = 0x48080000,
@@ -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
next prev parent reply other threads:[~2012-10-29 8:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-29 8:21 # (c) 2007, Joe Perches <joe@perches.com> Vaibhav Hiremath
2012-10-29 8:21 ` [PATCH-V2 0/4] ARM: AM33XX: net: Add DT support to CPGMAC and MDIO driver Vaibhav Hiremath
2012-10-29 8:33 ` Richard Cochran
2012-10-29 8:21 ` [PATCH 1/4] net: davinci_mdio: Fix typo mistake in calling runtime-pm api Vaibhav Hiremath
2012-10-30 21:33 ` Peter Korsgaard
2012-10-29 8:21 ` [PATCH 2/4] net: cpsw: Add parent<->child relation support between cpsw and mdio Vaibhav Hiremath
2012-10-30 21:34 ` Peter Korsgaard
2012-10-29 8:21 ` Vaibhav Hiremath [this message]
2012-10-30 21:35 ` [PATCH 3/4] ARM: OMAP3+: hwmod: Add AM33XX HWMOD data for davinci_mdio module Peter Korsgaard
2012-10-29 8:21 ` [PATCH 4/4] arm/dts: am33xx: Add CPSW and MDIO module nodes for AM33XX Vaibhav Hiremath
2012-10-30 21:35 ` Peter Korsgaard
2012-10-31 15:17 ` Benoit Cousson
2012-10-31 19:52 ` Hiremath, Vaibhav
2012-11-01 7:45 ` Richard Cochran
2012-11-01 9:28 ` Cousson, Benoit
2012-11-03 17:45 ` [PATCH RFC net-next 0/1] Simplify the CPSW DT Richard Cochran
2012-11-03 17:45 ` [PATCH RFC net-next 1/1] cpsw: simplify the setup of the register pointers Richard Cochran
2012-11-02 8:46 ` [PATCH 4/4] arm/dts: am33xx: Add CPSW and MDIO module nodes for AM33XX N, Mugunthan V
2012-11-02 8:56 ` Richard Cochran
2012-11-02 10:42 ` N, Mugunthan V
2012-11-02 15:19 ` Richard Cochran
2012-11-08 12:59 ` Mugunthan V N
2012-10-29 9:25 ` # (c) 2007, Joe Perches <joe@perches.com> Vaibhav Hiremath
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1351498881-32482-5-git-send-email-hvaibhav@ti.com \
--to=hvaibhav@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=mugunthanvnm@ti.com \
--cc=netdev@vger.kernel.org \
--cc=paul@pwsan.com \
--cc=richardcochran@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).