aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@uclinux.org>2009-07-06 22:13:23 -0400
committerGreg Ungerer <gerg@uclinux.org>2009-09-15 19:43:54 -0400
commit49802967cb7ec4f36a64e192108babe1c3b67e8e (patch)
tree4e869066f37e6215f7dd6c66c76395f7b1332c92
parent9075216d2c8761c91dc268125f6580af3ffc58b5 (diff)
m68knommu: remove ColdFire direct interrupt register access
Now that the ColdFire 5272 has full interrupt controller functionality we can remove all the interrupt masking and acking code from the FEC ethernet driver. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
-rw-r--r--arch/m68knommu/platform/5272/config.c65
-rw-r--r--drivers/net/fec.c18
2 files changed, 11 insertions, 72 deletions
diff --git a/arch/m68knommu/platform/5272/config.c b/arch/m68knommu/platform/5272/config.c
index b16add9aa4e5..59278c0887d0 100644
--- a/arch/m68knommu/platform/5272/config.c
+++ b/arch/m68knommu/platform/5272/config.c
@@ -31,11 +31,11 @@ unsigned char ledbank = 0xff;
31static struct mcf_platform_uart m5272_uart_platform[] = { 31static struct mcf_platform_uart m5272_uart_platform[] = {
32 { 32 {
33 .mapbase = MCF_MBAR + MCFUART_BASE1, 33 .mapbase = MCF_MBAR + MCFUART_BASE1,
34 .irq = 73, 34 .irq = MCF_IRQ_UART1,
35 }, 35 },
36 { 36 {
37 .mapbase = MCF_MBAR + MCFUART_BASE2, 37 .mapbase = MCF_MBAR + MCFUART_BASE2,
38 .irq = 74, 38 .irq = MCF_IRQ_UART2,
39 }, 39 },
40 { }, 40 { },
41}; 41};
@@ -53,18 +53,18 @@ static struct resource m5272_fec_resources[] = {
53 .flags = IORESOURCE_MEM, 53 .flags = IORESOURCE_MEM,
54 }, 54 },
55 { 55 {
56 .start = 86, 56 .start = MCF_IRQ_ERX,
57 .end = 86, 57 .end = MCF_IRQ_ERX,
58 .flags = IORESOURCE_IRQ, 58 .flags = IORESOURCE_IRQ,
59 }, 59 },
60 { 60 {
61 .start = 87, 61 .start = MCF_IRQ_ETX,
62 .end = 87, 62 .end = MCF_IRQ_ETX,
63 .flags = IORESOURCE_IRQ, 63 .flags = IORESOURCE_IRQ,
64 }, 64 },
65 { 65 {
66 .start = 88, 66 .start = MCF_IRQ_ENTC,
67 .end = 88, 67 .end = MCF_IRQ_ENTC,
68 .flags = IORESOURCE_IRQ, 68 .flags = IORESOURCE_IRQ,
69 }, 69 },
70}; 70};
@@ -88,9 +88,6 @@ static void __init m5272_uart_init_line(int line, int irq)
88 u32 v; 88 u32 v;
89 89
90 if ((line >= 0) && (line < 2)) { 90 if ((line >= 0) && (line < 2)) {
91 v = (line) ? 0x0e000000 : 0xe0000000;
92 writel(v, MCF_MBAR + MCFSIM_ICR2);
93
94 /* Enable the output lines for the serial ports */ 91 /* Enable the output lines for the serial ports */
95 v = readl(MCF_MBAR + MCFSIM_PBCNT); 92 v = readl(MCF_MBAR + MCFSIM_PBCNT);
96 v = (v & ~0x000000ff) | 0x00000055; 93 v = (v & ~0x000000ff) | 0x00000055;
@@ -113,48 +110,6 @@ static void __init m5272_uarts_init(void)
113 110
114/***************************************************************************/ 111/***************************************************************************/
115 112
116static void __init m5272_fec_init(void)
117{
118 u32 imr;
119
120 /* Unmask FEC interrupts at ColdFire interrupt controller */
121 imr = readl(MCF_MBAR + MCFSIM_ICR3);
122 imr = (imr & ~0x00000fff) | 0x00000ddd;
123 writel(imr, MCF_MBAR + MCFSIM_ICR3);
124
125 imr = readl(MCF_MBAR + MCFSIM_ICR1);
126 imr = (imr & ~0x0f000000) | 0x0d000000;
127 writel(imr, MCF_MBAR + MCFSIM_ICR1);
128}
129
130/***************************************************************************/
131
132void mcf_disableall(void)
133{
134 volatile unsigned long *icrp;
135
136 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
137 icrp[0] = 0x88888888;
138 icrp[1] = 0x88888888;
139 icrp[2] = 0x88888888;
140 icrp[3] = 0x88888888;
141}
142
143/***************************************************************************/
144
145static void __init m5272_timers_init(void)
146{
147 /* Timer1 @ level6 is always used as system timer */
148 writel((0x8 | 0x6) << ((4 - 1) * 4), MCF_MBAR + MCFSIM_ICR1);
149
150#ifdef CONFIG_HIGHPROFILE
151 /* Timer2 @ level7 is to be used as a high speed profile timer */
152 writel((0x8 | 0x7) << ((4 - 2) * 4), MCF_MBAR + MCFSIM_ICR1);
153#endif
154}
155
156/***************************************************************************/
157
158static void m5272_cpu_reset(void) 113static void m5272_cpu_reset(void)
159{ 114{
160 local_irq_disable(); 115 local_irq_disable();
@@ -178,8 +133,6 @@ void __init config_BSP(char *commandp, int size)
178 *pivrp = 0x40; 133 *pivrp = 0x40;
179#endif 134#endif
180 135
181 mcf_disableall();
182
183#if defined(CONFIG_NETtel) || defined(CONFIG_SCALES) 136#if defined(CONFIG_NETtel) || defined(CONFIG_SCALES)
184 /* Copy command line from FLASH to local buffer... */ 137 /* Copy command line from FLASH to local buffer... */
185 memcpy(commandp, (char *) 0xf0004000, size); 138 memcpy(commandp, (char *) 0xf0004000, size);
@@ -191,7 +144,6 @@ void __init config_BSP(char *commandp, int size)
191#endif 144#endif
192 145
193 mach_reset = m5272_cpu_reset; 146 mach_reset = m5272_cpu_reset;
194 m5272_timers_init();
195} 147}
196 148
197/***************************************************************************/ 149/***************************************************************************/
@@ -199,7 +151,6 @@ void __init config_BSP(char *commandp, int size)
199static int __init init_BSP(void) 151static int __init init_BSP(void)
200{ 152{
201 m5272_uarts_init(); 153 m5272_uarts_init();
202 m5272_fec_init();
203 platform_add_devices(m5272_devices, ARRAY_SIZE(m5272_devices)); 154 platform_add_devices(m5272_devices, ARRAY_SIZE(m5272_devices));
204 return 0; 155 return 0;
205} 156}
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index c9fd82d3a80d..a32230bbe195 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1142,19 +1142,9 @@ static void __inline__ fec_request_mii_intr(struct net_device *dev)
1142 printk("FEC: Could not allocate fec(MII) IRQ(66)!\n"); 1142 printk("FEC: Could not allocate fec(MII) IRQ(66)!\n");
1143} 1143}
1144 1144
1145static void __inline__ fec_disable_phy_intr(void) 1145static void __inline__ fec_disable_phy_intr(struct net_device *dev)
1146{ 1146{
1147 volatile unsigned long *icrp; 1147 free_irq(66, dev);
1148 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
1149 *icrp = 0x08000000;
1150}
1151
1152static void __inline__ fec_phy_ack_intr(void)
1153{
1154 volatile unsigned long *icrp;
1155 /* Acknowledge the interrupt */
1156 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
1157 *icrp = 0x0d000000;
1158} 1148}
1159#endif 1149#endif
1160 1150
@@ -1386,7 +1376,7 @@ mii_discover_phy(uint mii_reg, struct net_device *dev)
1386 writel(0, fep->hwp + FEC_MII_SPEED); 1376 writel(0, fep->hwp + FEC_MII_SPEED);
1387 fep->phy_speed = 0; 1377 fep->phy_speed = 0;
1388#ifdef HAVE_mii_link_interrupt 1378#ifdef HAVE_mii_link_interrupt
1389 fec_disable_phy_intr(); 1379 fec_disable_phy_intr(dev);
1390#endif 1380#endif
1391 } 1381 }
1392} 1382}
@@ -1399,8 +1389,6 @@ mii_link_interrupt(int irq, void * dev_id)
1399 struct net_device *dev = dev_id; 1389 struct net_device *dev = dev_id;
1400 struct fec_enet_private *fep = netdev_priv(dev); 1390 struct fec_enet_private *fep = netdev_priv(dev);
1401 1391
1402 fec_phy_ack_intr();
1403
1404 mii_do_cmd(dev, fep->phy->ack_int); 1392 mii_do_cmd(dev, fep->phy->ack_int);
1405 mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */ 1393 mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */
1406 1394