aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-12-06 13:53:04 -0500
committerTony Lindgren <tony@atomide.com>2013-12-08 17:15:46 -0500
commit719003144642687d6dea27f7541ef026b9f356ac (patch)
tree66bf6c4f9b9cde920421af431726e62b5c7a30da /arch
parentdad12d11380882616872a8243a9c3f706fcedd31 (diff)
ARM: OMAP2+: Use pdata quirks for emac on am3517
As the emac uses the system control module registers for reset and interrupts, we need to pass those in the platform data until we have a separate system control module driver. Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/pdata-quirks.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 47afff3b9c37..5aaf720211f4 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -8,6 +8,7 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <linux/clk.h> 10#include <linux/clk.h>
11#include <linux/davinci_emac.h>
11#include <linux/gpio.h> 12#include <linux/gpio.h>
12#include <linux/init.h> 13#include <linux/init.h>
13#include <linux/kernel.h> 14#include <linux/kernel.h>
@@ -16,6 +17,7 @@
16 17
17#include <linux/platform_data/pinctrl-single.h> 18#include <linux/platform_data/pinctrl-single.h>
18 19
20#include "am35xx.h"
19#include "common.h" 21#include "common.h"
20#include "common-board-devices.h" 22#include "common-board-devices.h"
21#include "dss-common.h" 23#include "dss-common.h"
@@ -104,6 +106,42 @@ static void __init omap3_zoom_legacy_init(void)
104{ 106{
105 legacy_init_wl12xx(WL12XX_REFCLOCK_26, 0, 162); 107 legacy_init_wl12xx(WL12XX_REFCLOCK_26, 0, 162);
106} 108}
109
110static void am35xx_enable_emac_int(void)
111{
112 u32 v;
113
114 v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
115 v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR |
116 AM35XX_CPGMAC_C0_MISC_PULSE_CLR | AM35XX_CPGMAC_C0_RX_THRESH_CLR);
117 omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
118 omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
119}
120
121static void am35xx_disable_emac_int(void)
122{
123 u32 v;
124
125 v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
126 v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR);
127 omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
128 omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
129}
130
131static struct emac_platform_data am35xx_emac_pdata = {
132 .interrupt_enable = am35xx_enable_emac_int,
133 .interrupt_disable = am35xx_disable_emac_int,
134};
135
136static void __init am3517_evm_legacy_init(void)
137{
138 u32 v;
139
140 v = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
141 v &= ~AM35XX_CPGMACSS_SW_RST;
142 omap_ctrl_writel(v, AM35XX_CONTROL_IP_SW_RESET);
143 omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */
144}
107#endif /* CONFIG_ARCH_OMAP3 */ 145#endif /* CONFIG_ARCH_OMAP3 */
108 146
109#ifdef CONFIG_ARCH_OMAP4 147#ifdef CONFIG_ARCH_OMAP4
@@ -172,6 +210,10 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
172#ifdef CONFIG_ARCH_OMAP3 210#ifdef CONFIG_ARCH_OMAP3
173 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata), 211 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata),
174 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata), 212 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata),
213 /* Only on am3517 */
214 OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
215 OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
216 &am35xx_emac_pdata),
175#endif 217#endif
176#ifdef CONFIG_ARCH_OMAP4 218#ifdef CONFIG_ARCH_OMAP4
177 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata), 219 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata),
@@ -192,6 +234,7 @@ static struct pdata_init pdata_quirks[] __initdata = {
192 { "isee,omap3-igep0020", omap3_igep0020_legacy_init, }, 234 { "isee,omap3-igep0020", omap3_igep0020_legacy_init, },
193 { "ti,omap3-evm-37xx", omap3_evm_legacy_init, }, 235 { "ti,omap3-evm-37xx", omap3_evm_legacy_init, },
194 { "ti,omap3-zoom3", omap3_zoom_legacy_init, }, 236 { "ti,omap3-zoom3", omap3_zoom_legacy_init, },
237 { "ti,am3517-evm", am3517_evm_legacy_init, },
195#endif 238#endif
196#ifdef CONFIG_ARCH_OMAP4 239#ifdef CONFIG_ARCH_OMAP4
197 { "ti,omap4-sdp", omap4_sdp_legacy_init, }, 240 { "ti,omap4-sdp", omap4_sdp_legacy_init, },