aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-am3517evm.c
diff options
context:
space:
mode:
authorCyril Chemparathy <cyril@ti.com>2010-09-15 10:11:23 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2010-09-24 10:40:30 -0400
commit433cdb0ac4c4660e98412e441589a7a712010325 (patch)
tree1bb74941f1a4699c4c27d8ad27c6e59ca6f98f96 /arch/arm/mach-omap2/board-am3517evm.c
parentd22960c8bbb8f685c2d8c4051e1f335ab13dca24 (diff)
omap: add mdio platform devices
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> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-am3517evm.c')
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c27
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 4d0f58592864..5dd1b7376444 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -18,6 +18,7 @@
18 18
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/clk.h>
21#include <linux/platform_device.h> 22#include <linux/platform_device.h>
22#include <linux/gpio.h> 23#include <linux/gpio.h>
23#include <linux/i2c/pca953x.h> 24#include <linux/i2c/pca953x.h>
@@ -41,6 +42,27 @@
41#define AM35XX_EVM_PHY_MASK (0xF) 42#define AM35XX_EVM_PHY_MASK (0xF)
42#define AM35XX_EVM_MDIO_FREQUENCY (1000000) 43#define AM35XX_EVM_MDIO_FREQUENCY (1000000)
43 44
45static struct mdio_platform_data am3517_evm_mdio_pdata = {
46 .bus_freq = AM35XX_EVM_MDIO_FREQUENCY,
47};
48
49static struct resource am3517_mdio_resources[] = {
50 {
51 .start = AM35XX_IPSS_EMAC_BASE + AM35XX_EMAC_MDIO_OFFSET,
52 .end = AM35XX_IPSS_EMAC_BASE + AM35XX_EMAC_MDIO_OFFSET +
53 SZ_4K - 1,
54 .flags = IORESOURCE_MEM,
55 },
56};
57
58static struct platform_device am3517_mdio_device = {
59 .name = "davinci_mdio",
60 .id = 0,
61 .num_resources = ARRAY_SIZE(am3517_mdio_resources),
62 .resource = am3517_mdio_resources,
63 .dev.platform_data = &am3517_evm_mdio_pdata,
64};
65
44static struct emac_platform_data am3517_evm_emac_pdata = { 66static struct emac_platform_data am3517_evm_emac_pdata = {
45 .phy_mask = AM35XX_EVM_PHY_MASK, 67 .phy_mask = AM35XX_EVM_PHY_MASK,
46 .mdio_max_freq = AM35XX_EVM_MDIO_FREQUENCY, 68 .mdio_max_freq = AM35XX_EVM_MDIO_FREQUENCY,
@@ -50,7 +72,7 @@ static struct emac_platform_data am3517_evm_emac_pdata = {
50static struct resource am3517_emac_resources[] = { 72static struct resource am3517_emac_resources[] = {
51 { 73 {
52 .start = AM35XX_IPSS_EMAC_BASE, 74 .start = AM35XX_IPSS_EMAC_BASE,
53 .end = AM35XX_IPSS_EMAC_BASE + 0x3FFFF, 75 .end = AM35XX_IPSS_EMAC_BASE + 0x2FFFF,
54 .flags = IORESOURCE_MEM, 76 .flags = IORESOURCE_MEM,
55 }, 77 },
56 { 78 {
@@ -121,6 +143,9 @@ void am3517_evm_ethernet_init(struct emac_platform_data *pdata)
121 pdata->interrupt_disable = am3517_disable_ethernet_int; 143 pdata->interrupt_disable = am3517_disable_ethernet_int;
122 am3517_emac_device.dev.platform_data = pdata; 144 am3517_emac_device.dev.platform_data = pdata;
123 platform_device_register(&am3517_emac_device); 145 platform_device_register(&am3517_emac_device);
146 platform_device_register(&am3517_mdio_device);
147 clk_add_alias(NULL, dev_name(&am3517_mdio_device.dev),
148 NULL, &am3517_emac_device.dev);
124 149
125 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); 150 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
126 regval = regval & (~(AM35XX_CPGMACSS_SW_RST)); 151 regval = regval & (~(AM35XX_CPGMACSS_SW_RST));