diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-am3517evm.c')
-rw-r--r-- | arch/arm/mach-omap2/board-am3517evm.c | 117 |
1 files changed, 2 insertions, 115 deletions
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 71138a1271d8..3645285a3e2b 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c | |||
@@ -39,124 +39,11 @@ | |||
39 | #include <video/omap-panel-generic-dpi.h> | 39 | #include <video/omap-panel-generic-dpi.h> |
40 | #include <video/omap-panel-dvi.h> | 40 | #include <video/omap-panel-dvi.h> |
41 | 41 | ||
42 | #include "am35xx-emac.h" | ||
42 | #include "mux.h" | 43 | #include "mux.h" |
43 | #include "control.h" | 44 | #include "control.h" |
44 | #include "hsmmc.h" | 45 | #include "hsmmc.h" |
45 | 46 | ||
46 | #define AM35XX_EVM_MDIO_FREQUENCY (1000000) | ||
47 | |||
48 | static struct mdio_platform_data am3517_evm_mdio_pdata = { | ||
49 | .bus_freq = AM35XX_EVM_MDIO_FREQUENCY, | ||
50 | }; | ||
51 | |||
52 | static struct resource am3517_mdio_resources[] = { | ||
53 | { | ||
54 | .start = AM35XX_IPSS_EMAC_BASE + AM35XX_EMAC_MDIO_OFFSET, | ||
55 | .end = AM35XX_IPSS_EMAC_BASE + AM35XX_EMAC_MDIO_OFFSET + | ||
56 | SZ_4K - 1, | ||
57 | .flags = IORESOURCE_MEM, | ||
58 | }, | ||
59 | }; | ||
60 | |||
61 | static struct platform_device am3517_mdio_device = { | ||
62 | .name = "davinci_mdio", | ||
63 | .id = 0, | ||
64 | .num_resources = ARRAY_SIZE(am3517_mdio_resources), | ||
65 | .resource = am3517_mdio_resources, | ||
66 | .dev.platform_data = &am3517_evm_mdio_pdata, | ||
67 | }; | ||
68 | |||
69 | static struct emac_platform_data am3517_evm_emac_pdata = { | ||
70 | .rmii_en = 1, | ||
71 | }; | ||
72 | |||
73 | static struct resource am3517_emac_resources[] = { | ||
74 | { | ||
75 | .start = AM35XX_IPSS_EMAC_BASE, | ||
76 | .end = AM35XX_IPSS_EMAC_BASE + 0x2FFFF, | ||
77 | .flags = IORESOURCE_MEM, | ||
78 | }, | ||
79 | { | ||
80 | .start = INT_35XX_EMAC_C0_RXTHRESH_IRQ, | ||
81 | .end = INT_35XX_EMAC_C0_RXTHRESH_IRQ, | ||
82 | .flags = IORESOURCE_IRQ, | ||
83 | }, | ||
84 | { | ||
85 | .start = INT_35XX_EMAC_C0_RX_PULSE_IRQ, | ||
86 | .end = INT_35XX_EMAC_C0_RX_PULSE_IRQ, | ||
87 | .flags = IORESOURCE_IRQ, | ||
88 | }, | ||
89 | { | ||
90 | .start = INT_35XX_EMAC_C0_TX_PULSE_IRQ, | ||
91 | .end = INT_35XX_EMAC_C0_TX_PULSE_IRQ, | ||
92 | .flags = IORESOURCE_IRQ, | ||
93 | }, | ||
94 | { | ||
95 | .start = INT_35XX_EMAC_C0_MISC_PULSE_IRQ, | ||
96 | .end = INT_35XX_EMAC_C0_MISC_PULSE_IRQ, | ||
97 | .flags = IORESOURCE_IRQ, | ||
98 | }, | ||
99 | }; | ||
100 | |||
101 | static struct platform_device am3517_emac_device = { | ||
102 | .name = "davinci_emac", | ||
103 | .id = -1, | ||
104 | .num_resources = ARRAY_SIZE(am3517_emac_resources), | ||
105 | .resource = am3517_emac_resources, | ||
106 | }; | ||
107 | |||
108 | static void am3517_enable_ethernet_int(void) | ||
109 | { | ||
110 | u32 regval; | ||
111 | |||
112 | regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); | ||
113 | regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR | | ||
114 | AM35XX_CPGMAC_C0_TX_PULSE_CLR | | ||
115 | AM35XX_CPGMAC_C0_MISC_PULSE_CLR | | ||
116 | AM35XX_CPGMAC_C0_RX_THRESH_CLR); | ||
117 | omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR); | ||
118 | regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); | ||
119 | } | ||
120 | |||
121 | static void am3517_disable_ethernet_int(void) | ||
122 | { | ||
123 | u32 regval; | ||
124 | |||
125 | regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); | ||
126 | regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR | | ||
127 | AM35XX_CPGMAC_C0_TX_PULSE_CLR); | ||
128 | omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR); | ||
129 | regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); | ||
130 | } | ||
131 | |||
132 | static void am3517_evm_ethernet_init(struct emac_platform_data *pdata) | ||
133 | { | ||
134 | unsigned int regval; | ||
135 | |||
136 | pdata->ctrl_reg_offset = AM35XX_EMAC_CNTRL_OFFSET; | ||
137 | pdata->ctrl_mod_reg_offset = AM35XX_EMAC_CNTRL_MOD_OFFSET; | ||
138 | pdata->ctrl_ram_offset = AM35XX_EMAC_CNTRL_RAM_OFFSET; | ||
139 | pdata->ctrl_ram_size = AM35XX_EMAC_CNTRL_RAM_SIZE; | ||
140 | pdata->version = EMAC_VERSION_2; | ||
141 | pdata->hw_ram_addr = AM35XX_EMAC_HW_RAM_ADDR; | ||
142 | pdata->interrupt_enable = am3517_enable_ethernet_int; | ||
143 | pdata->interrupt_disable = am3517_disable_ethernet_int; | ||
144 | am3517_emac_device.dev.platform_data = pdata; | ||
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); | ||
149 | |||
150 | regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); | ||
151 | regval = regval & (~(AM35XX_CPGMACSS_SW_RST)); | ||
152 | omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET); | ||
153 | regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); | ||
154 | |||
155 | return ; | ||
156 | } | ||
157 | |||
158 | |||
159 | |||
160 | #define LCD_PANEL_PWR 176 | 47 | #define LCD_PANEL_PWR 176 |
161 | #define LCD_PANEL_BKLIGHT_PWR 182 | 48 | #define LCD_PANEL_BKLIGHT_PWR 182 |
162 | #define LCD_PANEL_PWM 181 | 49 | #define LCD_PANEL_PWM 181 |
@@ -498,7 +385,7 @@ static void __init am3517_evm_init(void) | |||
498 | i2c_register_board_info(1, am3517evm_i2c1_boardinfo, | 385 | i2c_register_board_info(1, am3517evm_i2c1_boardinfo, |
499 | ARRAY_SIZE(am3517evm_i2c1_boardinfo)); | 386 | ARRAY_SIZE(am3517evm_i2c1_boardinfo)); |
500 | /*Ethernet*/ | 387 | /*Ethernet*/ |
501 | am3517_evm_ethernet_init(&am3517_evm_emac_pdata); | 388 | am35xx_emac_init(AM35XX_DEFAULT_MDIO_FREQUENCY, 1); |
502 | 389 | ||
503 | /* MUSB */ | 390 | /* MUSB */ |
504 | am3517_evm_musb_init(); | 391 | am3517_evm_musb_init(); |