aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fs_enet/mac-fcc.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-06-12 09:32:13 -0400
committerKumar Gala <galak@kernel.crashing.org>2008-07-16 18:57:49 -0400
commitb219108cbacee5f2eaeca63cba013688eeba3bd4 (patch)
tree656039a1d7a4db0605562c5290056a21d98865be /drivers/net/fs_enet/mac-fcc.c
parent00262986ceeb5c3358b70491aa898906503a0fe7 (diff)
fs_enet: Remove !CONFIG_PPC_CPM_NEW_BINDING code
Now that arch/ppc is gone we always define CONFIG_PPC_CPM_NEW_BINDING so we can remove all the code associated with !CONFIG_PPC_CPM_NEW_BINDING. Also fixed some asm/of_platform.h to linux/of_platform.h (and of_device.h) Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'drivers/net/fs_enet/mac-fcc.c')
-rw-r--r--drivers/net/fs_enet/mac-fcc.c67
1 files changed, 1 insertions, 66 deletions
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c
index 8268b3535b30..0a97fc2d97ec 100644
--- a/drivers/net/fs_enet/mac-fcc.c
+++ b/drivers/net/fs_enet/mac-fcc.c
@@ -33,6 +33,7 @@
33#include <linux/fs.h> 33#include <linux/fs.h>
34#include <linux/platform_device.h> 34#include <linux/platform_device.h>
35#include <linux/phy.h> 35#include <linux/phy.h>
36#include <linux/of_device.h>
36 37
37#include <asm/immap_cpm2.h> 38#include <asm/immap_cpm2.h>
38#include <asm/mpc8260.h> 39#include <asm/mpc8260.h>
@@ -42,10 +43,6 @@
42#include <asm/irq.h> 43#include <asm/irq.h>
43#include <asm/uaccess.h> 44#include <asm/uaccess.h>
44 45
45#ifdef CONFIG_PPC_CPM_NEW_BINDING
46#include <asm/of_device.h>
47#endif
48
49#include "fs_enet.h" 46#include "fs_enet.h"
50 47
51/*************************************************/ 48/*************************************************/
@@ -87,7 +84,6 @@ static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 op)
87 84
88static int do_pd_setup(struct fs_enet_private *fep) 85static int do_pd_setup(struct fs_enet_private *fep)
89{ 86{
90#ifdef CONFIG_PPC_CPM_NEW_BINDING
91 struct of_device *ofdev = to_of_device(fep->dev); 87 struct of_device *ofdev = to_of_device(fep->dev);
92 struct fs_platform_info *fpi = fep->fpi; 88 struct fs_platform_info *fpi = fep->fpi;
93 int ret = -EINVAL; 89 int ret = -EINVAL;
@@ -125,44 +121,6 @@ out_fccp:
125 iounmap(fep->fcc.fccp); 121 iounmap(fep->fcc.fccp);
126out: 122out:
127 return ret; 123 return ret;
128#else
129 struct platform_device *pdev = to_platform_device(fep->dev);
130 struct resource *r;
131
132 /* Fill out IRQ field */
133 fep->interrupt = platform_get_irq(pdev, 0);
134 if (fep->interrupt < 0)
135 return -EINVAL;
136
137 /* Attach the memory for the FCC Parameter RAM */
138 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fcc_pram");
139 fep->fcc.ep = ioremap(r->start, r->end - r->start + 1);
140 if (fep->fcc.ep == NULL)
141 return -EINVAL;
142
143 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fcc_regs");
144 fep->fcc.fccp = ioremap(r->start, r->end - r->start + 1);
145 if (fep->fcc.fccp == NULL)
146 return -EINVAL;
147
148 if (fep->fpi->fcc_regs_c) {
149 fep->fcc.fcccp = (void __iomem *)fep->fpi->fcc_regs_c;
150 } else {
151 r = platform_get_resource_byname(pdev, IORESOURCE_MEM,
152 "fcc_regs_c");
153 fep->fcc.fcccp = ioremap(r->start,
154 r->end - r->start + 1);
155 }
156
157 if (fep->fcc.fcccp == NULL)
158 return -EINVAL;
159
160 fep->fcc.mem = (void __iomem *)fep->fpi->mem_offset;
161 if (fep->fcc.mem == NULL)
162 return -EINVAL;
163
164 return 0;
165#endif
166} 124}
167 125
168#define FCC_NAPI_RX_EVENT_MSK (FCC_ENET_RXF | FCC_ENET_RXB) 126#define FCC_NAPI_RX_EVENT_MSK (FCC_ENET_RXF | FCC_ENET_RXB)
@@ -173,17 +131,6 @@ out:
173static int setup_data(struct net_device *dev) 131static int setup_data(struct net_device *dev)
174{ 132{
175 struct fs_enet_private *fep = netdev_priv(dev); 133 struct fs_enet_private *fep = netdev_priv(dev);
176#ifndef CONFIG_PPC_CPM_NEW_BINDING
177 struct fs_platform_info *fpi = fep->fpi;
178
179 fpi->cp_command = (fpi->cp_page << 26) |
180 (fpi->cp_block << 21) |
181 (12 << 6);
182
183 fep->fcc.idx = fs_get_fcc_index(fpi->fs_no);
184 if ((unsigned int)fep->fcc.idx >= 3) /* max 3 FCCs */
185 return -EINVAL;
186#endif
187 134
188 if (do_pd_setup(fep) != 0) 135 if (do_pd_setup(fep) != 0)
189 return -EINVAL; 136 return -EINVAL;
@@ -304,9 +251,6 @@ static void restart(struct net_device *dev)
304 fcc_enet_t __iomem *ep = fep->fcc.ep; 251 fcc_enet_t __iomem *ep = fep->fcc.ep;
305 dma_addr_t rx_bd_base_phys, tx_bd_base_phys; 252 dma_addr_t rx_bd_base_phys, tx_bd_base_phys;
306 u16 paddrh, paddrm, paddrl; 253 u16 paddrh, paddrm, paddrl;
307#ifndef CONFIG_PPC_CPM_NEW_BINDING
308 u16 mem_addr;
309#endif
310 const unsigned char *mac; 254 const unsigned char *mac;
311 int i; 255 int i;
312 256
@@ -338,19 +282,10 @@ static void restart(struct net_device *dev)
338 * this area. 282 * this area.
339 */ 283 */
340 284
341#ifdef CONFIG_PPC_CPM_NEW_BINDING
342 W16(ep, fen_genfcc.fcc_riptr, fpi->dpram_offset); 285 W16(ep, fen_genfcc.fcc_riptr, fpi->dpram_offset);
343 W16(ep, fen_genfcc.fcc_tiptr, fpi->dpram_offset + 32); 286 W16(ep, fen_genfcc.fcc_tiptr, fpi->dpram_offset + 32);
344 287
345 W16(ep, fen_padptr, fpi->dpram_offset + 64); 288 W16(ep, fen_padptr, fpi->dpram_offset + 64);
346#else
347 mem_addr = (u32) fep->fcc.mem; /* de-fixup dpram offset */
348
349 W16(ep, fen_genfcc.fcc_riptr, (mem_addr & 0xffff));
350 W16(ep, fen_genfcc.fcc_tiptr, ((mem_addr + 32) & 0xffff));
351
352 W16(ep, fen_padptr, mem_addr + 64);
353#endif
354 289
355 /* fill with special symbol... */ 290 /* fill with special symbol... */
356 memset_io(fep->fcc.mem + fpi->dpram_offset + 64, 0x88, 32); 291 memset_io(fep->fcc.mem + fpi->dpram_offset + 64, 0x88, 32);