aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index d547036aff3f..e1f8dda62799 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>
@@ -38,19 +39,37 @@
38 39
39#include "mux.h" 40#include "mux.h"
40 41
41#define AM35XX_EVM_PHY_MASK (0xF)
42#define AM35XX_EVM_MDIO_FREQUENCY (1000000) 42#define AM35XX_EVM_MDIO_FREQUENCY (1000000)
43 43
44static struct mdio_platform_data am3517_evm_mdio_pdata = {
45 .bus_freq = AM35XX_EVM_MDIO_FREQUENCY,
46};
47
48static struct resource am3517_mdio_resources[] = {
49 {
50 .start = AM35XX_IPSS_EMAC_BASE + AM35XX_EMAC_MDIO_OFFSET,
51 .end = AM35XX_IPSS_EMAC_BASE + AM35XX_EMAC_MDIO_OFFSET +
52 SZ_4K - 1,
53 .flags = IORESOURCE_MEM,
54 },
55};
56
57static struct platform_device am3517_mdio_device = {
58 .name = "davinci_mdio",
59 .id = 0,
60 .num_resources = ARRAY_SIZE(am3517_mdio_resources),
61 .resource = am3517_mdio_resources,
62 .dev.platform_data = &am3517_evm_mdio_pdata,
63};
64
44static struct emac_platform_data am3517_evm_emac_pdata = { 65static struct emac_platform_data am3517_evm_emac_pdata = {
45 .phy_mask = AM35XX_EVM_PHY_MASK,
46 .mdio_max_freq = AM35XX_EVM_MDIO_FREQUENCY,
47 .rmii_en = 1, 66 .rmii_en = 1,
48}; 67};
49 68
50static struct resource am3517_emac_resources[] = { 69static struct resource am3517_emac_resources[] = {
51 { 70 {
52 .start = AM35XX_IPSS_EMAC_BASE, 71 .start = AM35XX_IPSS_EMAC_BASE,
53 .end = AM35XX_IPSS_EMAC_BASE + 0x3FFFF, 72 .end = AM35XX_IPSS_EMAC_BASE + 0x2FFFF,
54 .flags = IORESOURCE_MEM, 73 .flags = IORESOURCE_MEM,
55 }, 74 },
56 { 75 {
@@ -113,7 +132,6 @@ void am3517_evm_ethernet_init(struct emac_platform_data *pdata)
113 pdata->ctrl_reg_offset = AM35XX_EMAC_CNTRL_OFFSET; 132 pdata->ctrl_reg_offset = AM35XX_EMAC_CNTRL_OFFSET;
114 pdata->ctrl_mod_reg_offset = AM35XX_EMAC_CNTRL_MOD_OFFSET; 133 pdata->ctrl_mod_reg_offset = AM35XX_EMAC_CNTRL_MOD_OFFSET;
115 pdata->ctrl_ram_offset = AM35XX_EMAC_CNTRL_RAM_OFFSET; 134 pdata->ctrl_ram_offset = AM35XX_EMAC_CNTRL_RAM_OFFSET;
116 pdata->mdio_reg_offset = AM35XX_EMAC_MDIO_OFFSET;
117 pdata->ctrl_ram_size = AM35XX_EMAC_CNTRL_RAM_SIZE; 135 pdata->ctrl_ram_size = AM35XX_EMAC_CNTRL_RAM_SIZE;
118 pdata->version = EMAC_VERSION_2; 136 pdata->version = EMAC_VERSION_2;
119 pdata->hw_ram_addr = AM35XX_EMAC_HW_RAM_ADDR; 137 pdata->hw_ram_addr = AM35XX_EMAC_HW_RAM_ADDR;
@@ -121,6 +139,9 @@ void am3517_evm_ethernet_init(struct emac_platform_data *pdata)
121 pdata->interrupt_disable = am3517_disable_ethernet_int; 139 pdata->interrupt_disable = am3517_disable_ethernet_int;
122 am3517_emac_device.dev.platform_data = pdata; 140 am3517_emac_device.dev.platform_data = pdata;
123 platform_device_register(&am3517_emac_device); 141 platform_device_register(&am3517_emac_device);
142 platform_device_register(&am3517_mdio_device);
143 clk_add_alias(NULL, dev_name(&am3517_mdio_device.dev),
144 NULL, &am3517_emac_device.dev);
124 145
125 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); 146 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
126 regval = regval & (~(AM35XX_CPGMACSS_SW_RST)); 147 regval = regval & (~(AM35XX_CPGMACSS_SW_RST));