netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cyril Chemparathy <cyril@ti.com>
To: netdev@vger.kernel.org,
	davinci-linux-open-source@linux.davincidsp.com,
	linux-omap@vger.kernel.org
Cc: davem@davemloft.net, khilman@deeprootsystems.com,
	tony@atomide.com, Cyril Chemparathy <cyril@ti.com>
Subject: [PATCH v3 03/10] omap: add mdio platform devices
Date: Tue,  7 Sep 2010 16:25:35 -0400	[thread overview]
Message-ID: <1283891142-15522-4-git-send-email-cyril@ti.com> (raw)
In-Reply-To: <1283891142-15522-1-git-send-email-cyril@ti.com>

This patch adds mdio platform devices on SoCs that have the necessary
hardware.  Clock lookup entries (aliases) have also been added, so that the
MDIO and EMAC drivers can independently enable/disable a shared underlying
clock.  Further, the EMAC MMR region has been split down into separate MDIO
and EMAC regions.

Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Acked-by: David S. Miller <davem@davemloft.net>
---
 arch/arm/mach-omap2/board-am3517evm.c |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 4d0f585..5dd1b73 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -18,6 +18,7 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/clk.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
 #include <linux/i2c/pca953x.h>
@@ -41,6 +42,27 @@
 #define AM35XX_EVM_PHY_MASK		(0xF)
 #define AM35XX_EVM_MDIO_FREQUENCY	(1000000)
 
+static struct mdio_platform_data am3517_evm_mdio_pdata = {
+	.bus_freq	= AM35XX_EVM_MDIO_FREQUENCY,
+};
+
+static struct resource am3517_mdio_resources[] = {
+	{
+		.start  = AM35XX_IPSS_EMAC_BASE + AM35XX_EMAC_MDIO_OFFSET,
+		.end    = AM35XX_IPSS_EMAC_BASE + AM35XX_EMAC_MDIO_OFFSET +
+			  SZ_4K - 1,
+		.flags  = IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device am3517_mdio_device = {
+	.name		= "davinci_mdio",
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(am3517_mdio_resources),
+	.resource	= am3517_mdio_resources,
+	.dev.platform_data = &am3517_evm_mdio_pdata,
+};
+
 static struct emac_platform_data am3517_evm_emac_pdata = {
 	.phy_mask	= AM35XX_EVM_PHY_MASK,
 	.mdio_max_freq	= AM35XX_EVM_MDIO_FREQUENCY,
@@ -50,7 +72,7 @@ static struct emac_platform_data am3517_evm_emac_pdata = {
 static struct resource am3517_emac_resources[] = {
 	{
 		.start  = AM35XX_IPSS_EMAC_BASE,
-		.end    = AM35XX_IPSS_EMAC_BASE + 0x3FFFF,
+		.end    = AM35XX_IPSS_EMAC_BASE + 0x2FFFF,
 		.flags  = IORESOURCE_MEM,
 	},
 	{
@@ -121,6 +143,9 @@ void am3517_evm_ethernet_init(struct emac_platform_data *pdata)
 	pdata->interrupt_disable	= am3517_disable_ethernet_int;
 	am3517_emac_device.dev.platform_data	= pdata;
 	platform_device_register(&am3517_emac_device);
+	platform_device_register(&am3517_mdio_device);
+	clk_add_alias(NULL, dev_name(&am3517_mdio_device.dev),
+		      NULL, &am3517_emac_device.dev);
 
 	regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
 	regval = regval & (~(AM35XX_CPGMACSS_SW_RST));
-- 
1.7.0.4


  parent reply	other threads:[~2010-09-07 20:25 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-07 20:25 [PATCH v3 00/10] split out emac cpdma and mdio for reuse Cyril Chemparathy
2010-09-07 20:25 ` [PATCH v3 01/10] net: davinci_emac: separate out davinci mdio Cyril Chemparathy
2010-09-07 20:25 ` [PATCH v3 02/10] davinci: add mdio platform devices Cyril Chemparathy
2010-09-07 20:25 ` Cyril Chemparathy [this message]
2010-09-08  1:00   ` [PATCH v3 03/10] omap: " Tony Lindgren
2010-09-07 20:25 ` [PATCH v3 04/10] net: davinci_emac: switch to new mdio Cyril Chemparathy
2010-09-07 20:25 ` [PATCH v3 05/10] davinci: cleanup unused davinci mdio arch code Cyril Chemparathy
2010-09-07 20:25 ` [PATCH v3 06/10] omap: " Cyril Chemparathy
2010-09-08  1:00   ` Tony Lindgren
2010-09-07 20:25 ` [PATCH v3 07/10] net: davinci_emac: cleanup unused mdio emac code Cyril Chemparathy
2010-09-07 20:25 ` [PATCH v3 08/10] net: davinci_emac: separate out cpdma code Cyril Chemparathy
2010-09-07 20:25 ` [PATCH v3 09/10] net: davinci_emac: switch to new cpdma layer Cyril Chemparathy
2010-09-07 20:25 ` [PATCH v3 10/10] net: davinci_emac: cleanup unused cpdma code Cyril Chemparathy
2010-09-08  1:18 ` [PATCH v3 00/10] split out emac cpdma and mdio for reuse Kevin Hilman
2010-09-08  2:22   ` Michael Williamson
2010-09-08 21:59     ` Cyril Chemparathy
2010-09-09  0:47       ` Michael Williamson
2010-09-09 18:43         ` Michael Williamson
2010-09-09 19:51           ` Cyril Chemparathy
2010-09-09 21:24             ` Cyril Chemparathy
2010-09-09 21:45               ` Michael Williamson
2010-09-09 21:25             ` Michael Williamson
2010-09-10 15:23               ` Caglar Akyuz
2010-09-11  8:54                 ` Caglar Akyuz
2010-09-13 14:09                   ` Cyril Chemparathy
2010-09-13 15:46                     ` Cyril Chemparathy
2010-09-13 17:51                     ` Caglar Akyuz
2010-09-10 22:59               ` Cyril Chemparathy
2010-09-11 13:14                 ` Michael Williamson

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=1283891142-15522-4-git-send-email-cyril@ti.com \
    --to=cyril@ti.com \
    --cc=davem@davemloft.net \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tony@atomide.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).