aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2007-10-01 15:20:58 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:54:04 -0400
commit31a5bb04d59931eb4657826213a439d37d12d4a9 (patch)
tree865af87dcb382e4cf035c9ccf5bf3ea094f2a712 /drivers
parent2b5b3a604a672be1d41728ed9e448ca3c9c23242 (diff)
fs_enet: sparse fixes
Mostly a bunch of __iomem annotations. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c18
-rw-r--r--drivers/net/fs_enet/fs_enet.h30
-rw-r--r--drivers/net/fs_enet/mac-fcc.c71
-rw-r--r--drivers/net/fs_enet/mac-fec.c34
-rw-r--r--drivers/net/fs_enet/mac-scc.c37
-rw-r--r--drivers/net/fs_enet/mii-fec.c8
6 files changed, 103 insertions, 95 deletions
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index fc4fda805d44..04c6faec88d2 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -60,7 +60,7 @@ MODULE_DESCRIPTION("Freescale Ethernet Driver");
60MODULE_LICENSE("GPL"); 60MODULE_LICENSE("GPL");
61MODULE_VERSION(DRV_MODULE_VERSION); 61MODULE_VERSION(DRV_MODULE_VERSION);
62 62
63int fs_enet_debug = -1; /* -1 == use FS_ENET_DEF_MSG_ENABLE as value */ 63static int fs_enet_debug = -1; /* -1 == use FS_ENET_DEF_MSG_ENABLE as value */
64module_param(fs_enet_debug, int, 0); 64module_param(fs_enet_debug, int, 0);
65MODULE_PARM_DESC(fs_enet_debug, 65MODULE_PARM_DESC(fs_enet_debug,
66 "Freescale bitmapped debugging message enable value"); 66 "Freescale bitmapped debugging message enable value");
@@ -90,7 +90,7 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget)
90 struct fs_enet_private *fep = container_of(napi, struct fs_enet_private, napi); 90 struct fs_enet_private *fep = container_of(napi, struct fs_enet_private, napi);
91 struct net_device *dev = to_net_dev(fep->dev); 91 struct net_device *dev = to_net_dev(fep->dev);
92 const struct fs_platform_info *fpi = fep->fpi; 92 const struct fs_platform_info *fpi = fep->fpi;
93 cbd_t *bdp; 93 cbd_t __iomem *bdp;
94 struct sk_buff *skb, *skbn, *skbt; 94 struct sk_buff *skb, *skbn, *skbt;
95 int received = 0; 95 int received = 0;
96 u16 pkt_len, sc; 96 u16 pkt_len, sc;
@@ -230,7 +230,7 @@ static int fs_enet_rx_non_napi(struct net_device *dev)
230{ 230{
231 struct fs_enet_private *fep = netdev_priv(dev); 231 struct fs_enet_private *fep = netdev_priv(dev);
232 const struct fs_platform_info *fpi = fep->fpi; 232 const struct fs_platform_info *fpi = fep->fpi;
233 cbd_t *bdp; 233 cbd_t __iomem *bdp;
234 struct sk_buff *skb, *skbn, *skbt; 234 struct sk_buff *skb, *skbn, *skbt;
235 int received = 0; 235 int received = 0;
236 u16 pkt_len, sc; 236 u16 pkt_len, sc;
@@ -355,7 +355,7 @@ static int fs_enet_rx_non_napi(struct net_device *dev)
355static void fs_enet_tx(struct net_device *dev) 355static void fs_enet_tx(struct net_device *dev)
356{ 356{
357 struct fs_enet_private *fep = netdev_priv(dev); 357 struct fs_enet_private *fep = netdev_priv(dev);
358 cbd_t *bdp; 358 cbd_t __iomem *bdp;
359 struct sk_buff *skb; 359 struct sk_buff *skb;
360 int dirtyidx, do_wake, do_restart; 360 int dirtyidx, do_wake, do_restart;
361 u16 sc; 361 u16 sc;
@@ -503,7 +503,7 @@ fs_enet_interrupt(int irq, void *dev_id)
503void fs_init_bds(struct net_device *dev) 503void fs_init_bds(struct net_device *dev)
504{ 504{
505 struct fs_enet_private *fep = netdev_priv(dev); 505 struct fs_enet_private *fep = netdev_priv(dev);
506 cbd_t *bdp; 506 cbd_t __iomem *bdp;
507 struct sk_buff *skb; 507 struct sk_buff *skb;
508 int i; 508 int i;
509 509
@@ -557,7 +557,7 @@ void fs_cleanup_bds(struct net_device *dev)
557{ 557{
558 struct fs_enet_private *fep = netdev_priv(dev); 558 struct fs_enet_private *fep = netdev_priv(dev);
559 struct sk_buff *skb; 559 struct sk_buff *skb;
560 cbd_t *bdp; 560 cbd_t __iomem *bdp;
561 int i; 561 int i;
562 562
563 /* 563 /*
@@ -598,7 +598,7 @@ void fs_cleanup_bds(struct net_device *dev)
598static int fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) 598static int fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
599{ 599{
600 struct fs_enet_private *fep = netdev_priv(dev); 600 struct fs_enet_private *fep = netdev_priv(dev);
601 cbd_t *bdp; 601 cbd_t __iomem *bdp;
602 int curidx; 602 int curidx;
603 u16 sc; 603 u16 sc;
604 unsigned long flags; 604 unsigned long flags;
@@ -1121,7 +1121,7 @@ static int fs_cleanup_instance(struct net_device *ndev)
1121 unregister_netdev(ndev); 1121 unregister_netdev(ndev);
1122 1122
1123 dma_free_coherent(fep->dev, (fpi->tx_ring + fpi->rx_ring) * sizeof(cbd_t), 1123 dma_free_coherent(fep->dev, (fpi->tx_ring + fpi->rx_ring) * sizeof(cbd_t),
1124 fep->ring_base, fep->ring_mem_addr); 1124 (void __force *)fep->ring_base, fep->ring_mem_addr);
1125 1125
1126 /* reset it */ 1126 /* reset it */
1127 (*fep->ops->cleanup_data)(ndev); 1127 (*fep->ops->cleanup_data)(ndev);
@@ -1141,7 +1141,7 @@ static int fs_cleanup_instance(struct net_device *ndev)
1141/**************************************************************************************/ 1141/**************************************************************************************/
1142 1142
1143/* handy pointer to the immap */ 1143/* handy pointer to the immap */
1144void *fs_enet_immap = NULL; 1144void __iomem *fs_enet_immap = NULL;
1145 1145
1146static int setup_immap(void) 1146static int setup_immap(void)
1147{ 1147{
diff --git a/drivers/net/fs_enet/fs_enet.h b/drivers/net/fs_enet/fs_enet.h
index 5a5c9d18df2e..baf6477165af 100644
--- a/drivers/net/fs_enet/fs_enet.h
+++ b/drivers/net/fs_enet/fs_enet.h
@@ -15,7 +15,7 @@
15#include <asm/commproc.h> 15#include <asm/commproc.h>
16 16
17struct fec_info { 17struct fec_info {
18 fec_t *fecp; 18 fec_t __iomem *fecp;
19 u32 mii_speed; 19 u32 mii_speed;
20}; 20};
21#endif 21#endif
@@ -81,14 +81,14 @@ struct fs_enet_private {
81 const struct fs_ops *ops; 81 const struct fs_ops *ops;
82 int rx_ring, tx_ring; 82 int rx_ring, tx_ring;
83 dma_addr_t ring_mem_addr; 83 dma_addr_t ring_mem_addr;
84 void *ring_base; 84 void __iomem *ring_base;
85 struct sk_buff **rx_skbuff; 85 struct sk_buff **rx_skbuff;
86 struct sk_buff **tx_skbuff; 86 struct sk_buff **tx_skbuff;
87 cbd_t *rx_bd_base; /* Address of Rx and Tx buffers. */ 87 cbd_t __iomem *rx_bd_base; /* Address of Rx and Tx buffers. */
88 cbd_t *tx_bd_base; 88 cbd_t __iomem *tx_bd_base;
89 cbd_t *dirty_tx; /* ring entries to be free()ed. */ 89 cbd_t __iomem *dirty_tx; /* ring entries to be free()ed. */
90 cbd_t *cur_rx; 90 cbd_t __iomem *cur_rx;
91 cbd_t *cur_tx; 91 cbd_t __iomem *cur_tx;
92 int tx_free; 92 int tx_free;
93 struct net_device_stats stats; 93 struct net_device_stats stats;
94 struct timer_list phy_timer_list; 94 struct timer_list phy_timer_list;
@@ -113,23 +113,23 @@ struct fs_enet_private {
113 union { 113 union {
114 struct { 114 struct {
115 int idx; /* FEC1 = 0, FEC2 = 1 */ 115 int idx; /* FEC1 = 0, FEC2 = 1 */
116 void *fecp; /* hw registers */ 116 void __iomem *fecp; /* hw registers */
117 u32 hthi, htlo; /* state for multicast */ 117 u32 hthi, htlo; /* state for multicast */
118 } fec; 118 } fec;
119 119
120 struct { 120 struct {
121 int idx; /* FCC1-3 = 0-2 */ 121 int idx; /* FCC1-3 = 0-2 */
122 void *fccp; /* hw registers */ 122 void __iomem *fccp; /* hw registers */
123 void *ep; /* parameter ram */ 123 void __iomem *ep; /* parameter ram */
124 void *fcccp; /* hw registers cont. */ 124 void __iomem *fcccp; /* hw registers cont. */
125 void *mem; /* FCC DPRAM */ 125 void __iomem *mem; /* FCC DPRAM */
126 u32 gaddrh, gaddrl; /* group address */ 126 u32 gaddrh, gaddrl; /* group address */
127 } fcc; 127 } fcc;
128 128
129 struct { 129 struct {
130 int idx; /* FEC1 = 0, FEC2 = 1 */ 130 int idx; /* FEC1 = 0, FEC2 = 1 */
131 void *sccp; /* hw registers */ 131 void __iomem *sccp; /* hw registers */
132 void *ep; /* parameter ram */ 132 void __iomem *ep; /* parameter ram */
133 u32 hthi, htlo; /* state for multicast */ 133 u32 hthi, htlo; /* state for multicast */
134 } scc; 134 } scc;
135 135
@@ -200,7 +200,7 @@ extern const struct fs_ops fs_scc_ops;
200/*******************************************************************/ 200/*******************************************************************/
201 201
202/* handy pointer to the immap */ 202/* handy pointer to the immap */
203extern void *fs_enet_immap; 203extern void __iomem *fs_enet_immap;
204 204
205/*******************************************************************/ 205/*******************************************************************/
206 206
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c
index 6094cbf542a2..da4efbca646e 100644
--- a/drivers/net/fs_enet/mac-fcc.c
+++ b/drivers/net/fs_enet/mac-fcc.c
@@ -81,8 +81,6 @@
81static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 op) 81static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 op)
82{ 82{
83 const struct fs_platform_info *fpi = fep->fpi; 83 const struct fs_platform_info *fpi = fep->fpi;
84 cpm2_map_t *immap = fs_enet_immap;
85 cpm_cpm2_t *cpmp = &immap->im_cpm;
86 int i; 84 int i;
87 85
88 W32(cpmp, cp_cpcr, fpi->cp_command | op | CPM_CR_FLG); 86 W32(cpmp, cp_cpcr, fpi->cp_command | op | CPM_CR_FLG);
@@ -118,8 +116,8 @@ static int do_pd_setup(struct fs_enet_private *fep)
118 if (!fep->fcc.fcccp) 116 if (!fep->fcc.fcccp)
119 goto out_ep; 117 goto out_ep;
120 118
121 fep->fcc.mem = (void *)cpm_dpalloc(128, 8); 119 fep->fcc.mem = (void __iomem *)cpm2_immr;
122 fpi->dpram_offset = (u32)cpm2_immr; 120 fpi->dpram_offset = cpm_dpalloc(128, 8);
123 if (IS_ERR_VALUE(fpi->dpram_offset)) { 121 if (IS_ERR_VALUE(fpi->dpram_offset)) {
124 ret = fpi->dpram_offset; 122 ret = fpi->dpram_offset;
125 goto out_fcccp; 123 goto out_fcccp;
@@ -146,29 +144,28 @@ out:
146 144
147 /* Attach the memory for the FCC Parameter RAM */ 145 /* Attach the memory for the FCC Parameter RAM */
148 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fcc_pram"); 146 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fcc_pram");
149 fep->fcc.ep = (void *)ioremap(r->start, r->end - r->start + 1); 147 fep->fcc.ep = ioremap(r->start, r->end - r->start + 1);
150 if (fep->fcc.ep == NULL) 148 if (fep->fcc.ep == NULL)
151 return -EINVAL; 149 return -EINVAL;
152 150
153 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fcc_regs"); 151 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fcc_regs");
154 fep->fcc.fccp = (void *)ioremap(r->start, r->end - r->start + 1); 152 fep->fcc.fccp = ioremap(r->start, r->end - r->start + 1);
155 if (fep->fcc.fccp == NULL) 153 if (fep->fcc.fccp == NULL)
156 return -EINVAL; 154 return -EINVAL;
157 155
158 if (fep->fpi->fcc_regs_c) { 156 if (fep->fpi->fcc_regs_c) {
159 157 fep->fcc.fcccp = (void __iomem *)fep->fpi->fcc_regs_c;
160 fep->fcc.fcccp = (void *)fep->fpi->fcc_regs_c;
161 } else { 158 } else {
162 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, 159 r = platform_get_resource_byname(pdev, IORESOURCE_MEM,
163 "fcc_regs_c"); 160 "fcc_regs_c");
164 fep->fcc.fcccp = (void *)ioremap(r->start, 161 fep->fcc.fcccp = ioremap(r->start,
165 r->end - r->start + 1); 162 r->end - r->start + 1);
166 } 163 }
167 164
168 if (fep->fcc.fcccp == NULL) 165 if (fep->fcc.fcccp == NULL)
169 return -EINVAL; 166 return -EINVAL;
170 167
171 fep->fcc.mem = (void *)fep->fpi->mem_offset; 168 fep->fcc.mem = (void __iomem *)fep->fpi->mem_offset;
172 if (fep->fcc.mem == NULL) 169 if (fep->fcc.mem == NULL)
173 return -EINVAL; 170 return -EINVAL;
174 171
@@ -212,7 +209,7 @@ static int allocate_bd(struct net_device *dev)
212 struct fs_enet_private *fep = netdev_priv(dev); 209 struct fs_enet_private *fep = netdev_priv(dev);
213 const struct fs_platform_info *fpi = fep->fpi; 210 const struct fs_platform_info *fpi = fep->fpi;
214 211
215 fep->ring_base = dma_alloc_coherent(fep->dev, 212 fep->ring_base = (void __iomem __force *)dma_alloc_coherent(fep->dev,
216 (fpi->tx_ring + fpi->rx_ring) * 213 (fpi->tx_ring + fpi->rx_ring) *
217 sizeof(cbd_t), &fep->ring_mem_addr, 214 sizeof(cbd_t), &fep->ring_mem_addr,
218 GFP_KERNEL); 215 GFP_KERNEL);
@@ -230,7 +227,7 @@ static void free_bd(struct net_device *dev)
230 if (fep->ring_base) 227 if (fep->ring_base)
231 dma_free_coherent(fep->dev, 228 dma_free_coherent(fep->dev,
232 (fpi->tx_ring + fpi->rx_ring) * sizeof(cbd_t), 229 (fpi->tx_ring + fpi->rx_ring) * sizeof(cbd_t),
233 fep->ring_base, fep->ring_mem_addr); 230 (void __force *)fep->ring_base, fep->ring_mem_addr);
234} 231}
235 232
236static void cleanup_data(struct net_device *dev) 233static void cleanup_data(struct net_device *dev)
@@ -241,7 +238,7 @@ static void cleanup_data(struct net_device *dev)
241static void set_promiscuous_mode(struct net_device *dev) 238static void set_promiscuous_mode(struct net_device *dev)
242{ 239{
243 struct fs_enet_private *fep = netdev_priv(dev); 240 struct fs_enet_private *fep = netdev_priv(dev);
244 fcc_t *fccp = fep->fcc.fccp; 241 fcc_t __iomem *fccp = fep->fcc.fccp;
245 242
246 S32(fccp, fcc_fpsmr, FCC_PSMR_PRO); 243 S32(fccp, fcc_fpsmr, FCC_PSMR_PRO);
247} 244}
@@ -249,7 +246,7 @@ static void set_promiscuous_mode(struct net_device *dev)
249static void set_multicast_start(struct net_device *dev) 246static void set_multicast_start(struct net_device *dev)
250{ 247{
251 struct fs_enet_private *fep = netdev_priv(dev); 248 struct fs_enet_private *fep = netdev_priv(dev);
252 fcc_enet_t *ep = fep->fcc.ep; 249 fcc_enet_t __iomem *ep = fep->fcc.ep;
253 250
254 W32(ep, fen_gaddrh, 0); 251 W32(ep, fen_gaddrh, 0);
255 W32(ep, fen_gaddrl, 0); 252 W32(ep, fen_gaddrl, 0);
@@ -258,7 +255,7 @@ static void set_multicast_start(struct net_device *dev)
258static void set_multicast_one(struct net_device *dev, const u8 *mac) 255static void set_multicast_one(struct net_device *dev, const u8 *mac)
259{ 256{
260 struct fs_enet_private *fep = netdev_priv(dev); 257 struct fs_enet_private *fep = netdev_priv(dev);
261 fcc_enet_t *ep = fep->fcc.ep; 258 fcc_enet_t __iomem *ep = fep->fcc.ep;
262 u16 taddrh, taddrm, taddrl; 259 u16 taddrh, taddrm, taddrl;
263 260
264 taddrh = ((u16)mac[5] << 8) | mac[4]; 261 taddrh = ((u16)mac[5] << 8) | mac[4];
@@ -274,8 +271,8 @@ static void set_multicast_one(struct net_device *dev, const u8 *mac)
274static void set_multicast_finish(struct net_device *dev) 271static void set_multicast_finish(struct net_device *dev)
275{ 272{
276 struct fs_enet_private *fep = netdev_priv(dev); 273 struct fs_enet_private *fep = netdev_priv(dev);
277 fcc_t *fccp = fep->fcc.fccp; 274 fcc_t __iomem *fccp = fep->fcc.fccp;
278 fcc_enet_t *ep = fep->fcc.ep; 275 fcc_enet_t __iomem *ep = fep->fcc.ep;
279 276
280 /* clear promiscuous always */ 277 /* clear promiscuous always */
281 C32(fccp, fcc_fpsmr, FCC_PSMR_PRO); 278 C32(fccp, fcc_fpsmr, FCC_PSMR_PRO);
@@ -310,12 +307,14 @@ static void restart(struct net_device *dev)
310{ 307{
311 struct fs_enet_private *fep = netdev_priv(dev); 308 struct fs_enet_private *fep = netdev_priv(dev);
312 const struct fs_platform_info *fpi = fep->fpi; 309 const struct fs_platform_info *fpi = fep->fpi;
313 fcc_t *fccp = fep->fcc.fccp; 310 fcc_t __iomem *fccp = fep->fcc.fccp;
314 fcc_c_t *fcccp = fep->fcc.fcccp; 311 fcc_c_t __iomem *fcccp = fep->fcc.fcccp;
315 fcc_enet_t *ep = fep->fcc.ep; 312 fcc_enet_t __iomem *ep = fep->fcc.ep;
316 dma_addr_t rx_bd_base_phys, tx_bd_base_phys; 313 dma_addr_t rx_bd_base_phys, tx_bd_base_phys;
317 u16 paddrh, paddrm, paddrl; 314 u16 paddrh, paddrm, paddrl;
315#ifndef CONFIG_PPC_CPM_NEW_BINDING
318 u16 mem_addr; 316 u16 mem_addr;
317#endif
319 const unsigned char *mac; 318 const unsigned char *mac;
320 int i; 319 int i;
321 320
@@ -347,14 +346,22 @@ static void restart(struct net_device *dev)
347 * this area. 346 * this area.
348 */ 347 */
349 348
349#ifdef CONFIG_PPC_CPM_NEW_BINDING
350 W16(ep, fen_genfcc.fcc_riptr, fpi->dpram_offset);
351 W16(ep, fen_genfcc.fcc_tiptr, fpi->dpram_offset + 32);
352
353 W16(ep, fen_padptr, fpi->dpram_offset + 64);
354#else
350 mem_addr = (u32) fep->fcc.mem; /* de-fixup dpram offset */ 355 mem_addr = (u32) fep->fcc.mem; /* de-fixup dpram offset */
351 356
352 W16(ep, fen_genfcc.fcc_riptr, (mem_addr & 0xffff)); 357 W16(ep, fen_genfcc.fcc_riptr, (mem_addr & 0xffff));
353 W16(ep, fen_genfcc.fcc_tiptr, ((mem_addr + 32) & 0xffff)); 358 W16(ep, fen_genfcc.fcc_tiptr, ((mem_addr + 32) & 0xffff));
359
354 W16(ep, fen_padptr, mem_addr + 64); 360 W16(ep, fen_padptr, mem_addr + 64);
361#endif
355 362
356 /* fill with special symbol... */ 363 /* fill with special symbol... */
357 memset(fep->fcc.mem + fpi->dpram_offset + 64, 0x88, 32); 364 memset_io(fep->fcc.mem + fpi->dpram_offset + 64, 0x88, 32);
358 365
359 W32(ep, fen_genfcc.fcc_rbptr, 0); 366 W32(ep, fen_genfcc.fcc_rbptr, 0);
360 W32(ep, fen_genfcc.fcc_tbptr, 0); 367 W32(ep, fen_genfcc.fcc_tbptr, 0);
@@ -470,7 +477,7 @@ static void restart(struct net_device *dev)
470static void stop(struct net_device *dev) 477static void stop(struct net_device *dev)
471{ 478{
472 struct fs_enet_private *fep = netdev_priv(dev); 479 struct fs_enet_private *fep = netdev_priv(dev);
473 fcc_t *fccp = fep->fcc.fccp; 480 fcc_t __iomem *fccp = fep->fcc.fccp;
474 481
475 /* stop ethernet */ 482 /* stop ethernet */
476 C32(fccp, fcc_gfmr, FCC_GFMR_ENR | FCC_GFMR_ENT); 483 C32(fccp, fcc_gfmr, FCC_GFMR_ENR | FCC_GFMR_ENT);
@@ -497,7 +504,7 @@ static void post_free_irq(struct net_device *dev, int irq)
497static void napi_clear_rx_event(struct net_device *dev) 504static void napi_clear_rx_event(struct net_device *dev)
498{ 505{
499 struct fs_enet_private *fep = netdev_priv(dev); 506 struct fs_enet_private *fep = netdev_priv(dev);
500 fcc_t *fccp = fep->fcc.fccp; 507 fcc_t __iomem *fccp = fep->fcc.fccp;
501 508
502 W16(fccp, fcc_fcce, FCC_NAPI_RX_EVENT_MSK); 509 W16(fccp, fcc_fcce, FCC_NAPI_RX_EVENT_MSK);
503} 510}
@@ -505,7 +512,7 @@ static void napi_clear_rx_event(struct net_device *dev)
505static void napi_enable_rx(struct net_device *dev) 512static void napi_enable_rx(struct net_device *dev)
506{ 513{
507 struct fs_enet_private *fep = netdev_priv(dev); 514 struct fs_enet_private *fep = netdev_priv(dev);
508 fcc_t *fccp = fep->fcc.fccp; 515 fcc_t __iomem *fccp = fep->fcc.fccp;
509 516
510 S16(fccp, fcc_fccm, FCC_NAPI_RX_EVENT_MSK); 517 S16(fccp, fcc_fccm, FCC_NAPI_RX_EVENT_MSK);
511} 518}
@@ -513,7 +520,7 @@ static void napi_enable_rx(struct net_device *dev)
513static void napi_disable_rx(struct net_device *dev) 520static void napi_disable_rx(struct net_device *dev)
514{ 521{
515 struct fs_enet_private *fep = netdev_priv(dev); 522 struct fs_enet_private *fep = netdev_priv(dev);
516 fcc_t *fccp = fep->fcc.fccp; 523 fcc_t __iomem *fccp = fep->fcc.fccp;
517 524
518 C16(fccp, fcc_fccm, FCC_NAPI_RX_EVENT_MSK); 525 C16(fccp, fcc_fccm, FCC_NAPI_RX_EVENT_MSK);
519} 526}
@@ -526,7 +533,7 @@ static void rx_bd_done(struct net_device *dev)
526static void tx_kickstart(struct net_device *dev) 533static void tx_kickstart(struct net_device *dev)
527{ 534{
528 struct fs_enet_private *fep = netdev_priv(dev); 535 struct fs_enet_private *fep = netdev_priv(dev);
529 fcc_t *fccp = fep->fcc.fccp; 536 fcc_t __iomem *fccp = fep->fcc.fccp;
530 537
531 S16(fccp, fcc_ftodr, 0x8000); 538 S16(fccp, fcc_ftodr, 0x8000);
532} 539}
@@ -534,7 +541,7 @@ static void tx_kickstart(struct net_device *dev)
534static u32 get_int_events(struct net_device *dev) 541static u32 get_int_events(struct net_device *dev)
535{ 542{
536 struct fs_enet_private *fep = netdev_priv(dev); 543 struct fs_enet_private *fep = netdev_priv(dev);
537 fcc_t *fccp = fep->fcc.fccp; 544 fcc_t __iomem *fccp = fep->fcc.fccp;
538 545
539 return (u32)R16(fccp, fcc_fcce); 546 return (u32)R16(fccp, fcc_fcce);
540} 547}
@@ -542,7 +549,7 @@ static u32 get_int_events(struct net_device *dev)
542static void clear_int_events(struct net_device *dev, u32 int_events) 549static void clear_int_events(struct net_device *dev, u32 int_events)
543{ 550{
544 struct fs_enet_private *fep = netdev_priv(dev); 551 struct fs_enet_private *fep = netdev_priv(dev);
545 fcc_t *fccp = fep->fcc.fccp; 552 fcc_t __iomem *fccp = fep->fcc.fccp;
546 553
547 W16(fccp, fcc_fcce, int_events & 0xffff); 554 W16(fccp, fcc_fcce, int_events & 0xffff);
548} 555}
@@ -553,7 +560,7 @@ static void ev_error(struct net_device *dev, u32 int_events)
553 ": %s FS_ENET ERROR(s) 0x%x\n", dev->name, int_events); 560 ": %s FS_ENET ERROR(s) 0x%x\n", dev->name, int_events);
554} 561}
555 562
556int get_regs(struct net_device *dev, void *p, int *sizep) 563static int get_regs(struct net_device *dev, void *p, int *sizep)
557{ 564{
558 struct fs_enet_private *fep = netdev_priv(dev); 565 struct fs_enet_private *fep = netdev_priv(dev);
559 566
@@ -570,7 +577,7 @@ int get_regs(struct net_device *dev, void *p, int *sizep)
570 return 0; 577 return 0;
571} 578}
572 579
573int get_regs_len(struct net_device *dev) 580static int get_regs_len(struct net_device *dev)
574{ 581{
575 return sizeof(fcc_t) + sizeof(fcc_enet_t) + 1; 582 return sizeof(fcc_t) + sizeof(fcc_enet_t) + 1;
576} 583}
@@ -583,10 +590,10 @@ int get_regs_len(struct net_device *dev)
583 * CPM37, we must disable and then re-enable the transmitter 590 * CPM37, we must disable and then re-enable the transmitter
584 * following a Late Collision, Underrun, or Retry Limit error. 591 * following a Late Collision, Underrun, or Retry Limit error.
585 */ 592 */
586void tx_restart(struct net_device *dev) 593static void tx_restart(struct net_device *dev)
587{ 594{
588 struct fs_enet_private *fep = netdev_priv(dev); 595 struct fs_enet_private *fep = netdev_priv(dev);
589 fcc_t *fccp = fep->fcc.fccp; 596 fcc_t __iomem *fccp = fep->fcc.fccp;
590 597
591 C32(fccp, fcc_gfmr, FCC_GFMR_ENT); 598 C32(fccp, fcc_gfmr, FCC_GFMR_ENT);
592 udelay(10); 599 udelay(10);
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c
index 924d6617cd30..c1fee48517e3 100644
--- a/drivers/net/fs_enet/mac-fec.c
+++ b/drivers/net/fs_enet/mac-fec.c
@@ -83,7 +83,7 @@
83 */ 83 */
84#define FEC_RESET_DELAY 50 84#define FEC_RESET_DELAY 50
85 85
86static int whack_reset(fec_t * fecp) 86static int whack_reset(fec_t __iomem *fecp)
87{ 87{
88 int i; 88 int i;
89 89
@@ -159,7 +159,7 @@ static int allocate_bd(struct net_device *dev)
159 struct fs_enet_private *fep = netdev_priv(dev); 159 struct fs_enet_private *fep = netdev_priv(dev);
160 const struct fs_platform_info *fpi = fep->fpi; 160 const struct fs_platform_info *fpi = fep->fpi;
161 161
162 fep->ring_base = dma_alloc_coherent(fep->dev, 162 fep->ring_base = (void __force __iomem *)dma_alloc_coherent(fep->dev,
163 (fpi->tx_ring + fpi->rx_ring) * 163 (fpi->tx_ring + fpi->rx_ring) *
164 sizeof(cbd_t), &fep->ring_mem_addr, 164 sizeof(cbd_t), &fep->ring_mem_addr,
165 GFP_KERNEL); 165 GFP_KERNEL);
@@ -177,7 +177,7 @@ static void free_bd(struct net_device *dev)
177 if(fep->ring_base) 177 if(fep->ring_base)
178 dma_free_coherent(fep->dev, (fpi->tx_ring + fpi->rx_ring) 178 dma_free_coherent(fep->dev, (fpi->tx_ring + fpi->rx_ring)
179 * sizeof(cbd_t), 179 * sizeof(cbd_t),
180 fep->ring_base, 180 (void __force *)fep->ring_base,
181 fep->ring_mem_addr); 181 fep->ring_mem_addr);
182} 182}
183 183
@@ -189,7 +189,7 @@ static void cleanup_data(struct net_device *dev)
189static void set_promiscuous_mode(struct net_device *dev) 189static void set_promiscuous_mode(struct net_device *dev)
190{ 190{
191 struct fs_enet_private *fep = netdev_priv(dev); 191 struct fs_enet_private *fep = netdev_priv(dev);
192 fec_t *fecp = fep->fec.fecp; 192 fec_t __iomem *fecp = fep->fec.fecp;
193 193
194 FS(fecp, r_cntrl, FEC_RCNTRL_PROM); 194 FS(fecp, r_cntrl, FEC_RCNTRL_PROM);
195} 195}
@@ -237,7 +237,7 @@ static void set_multicast_one(struct net_device *dev, const u8 *mac)
237static void set_multicast_finish(struct net_device *dev) 237static void set_multicast_finish(struct net_device *dev)
238{ 238{
239 struct fs_enet_private *fep = netdev_priv(dev); 239 struct fs_enet_private *fep = netdev_priv(dev);
240 fec_t *fecp = fep->fec.fecp; 240 fec_t __iomem *fecp = fep->fec.fecp;
241 241
242 /* if all multi or too many multicasts; just enable all */ 242 /* if all multi or too many multicasts; just enable all */
243 if ((dev->flags & IFF_ALLMULTI) != 0 || 243 if ((dev->flags & IFF_ALLMULTI) != 0 ||
@@ -271,7 +271,7 @@ static void restart(struct net_device *dev)
271 u32 cptr; 271 u32 cptr;
272#endif 272#endif
273 struct fs_enet_private *fep = netdev_priv(dev); 273 struct fs_enet_private *fep = netdev_priv(dev);
274 fec_t *fecp = fep->fec.fecp; 274 fec_t __iomem *fecp = fep->fec.fecp;
275 const struct fs_platform_info *fpi = fep->fpi; 275 const struct fs_platform_info *fpi = fep->fpi;
276 dma_addr_t rx_bd_base_phys, tx_bd_base_phys; 276 dma_addr_t rx_bd_base_phys, tx_bd_base_phys;
277 int r; 277 int r;
@@ -399,7 +399,7 @@ static void stop(struct net_device *dev)
399{ 399{
400 struct fs_enet_private *fep = netdev_priv(dev); 400 struct fs_enet_private *fep = netdev_priv(dev);
401 const struct fs_platform_info *fpi = fep->fpi; 401 const struct fs_platform_info *fpi = fep->fpi;
402 fec_t *fecp = fep->fec.fecp; 402 fec_t __iomem *fecp = fep->fec.fecp;
403 403
404 struct fec_info* feci= fep->phydev->bus->priv; 404 struct fec_info* feci= fep->phydev->bus->priv;
405 405
@@ -461,7 +461,7 @@ static void post_free_irq(struct net_device *dev, int irq)
461static void napi_clear_rx_event(struct net_device *dev) 461static void napi_clear_rx_event(struct net_device *dev)
462{ 462{
463 struct fs_enet_private *fep = netdev_priv(dev); 463 struct fs_enet_private *fep = netdev_priv(dev);
464 fec_t *fecp = fep->fec.fecp; 464 fec_t __iomem *fecp = fep->fec.fecp;
465 465
466 FW(fecp, ievent, FEC_NAPI_RX_EVENT_MSK); 466 FW(fecp, ievent, FEC_NAPI_RX_EVENT_MSK);
467} 467}
@@ -469,7 +469,7 @@ static void napi_clear_rx_event(struct net_device *dev)
469static void napi_enable_rx(struct net_device *dev) 469static void napi_enable_rx(struct net_device *dev)
470{ 470{
471 struct fs_enet_private *fep = netdev_priv(dev); 471 struct fs_enet_private *fep = netdev_priv(dev);
472 fec_t *fecp = fep->fec.fecp; 472 fec_t __iomem *fecp = fep->fec.fecp;
473 473
474 FS(fecp, imask, FEC_NAPI_RX_EVENT_MSK); 474 FS(fecp, imask, FEC_NAPI_RX_EVENT_MSK);
475} 475}
@@ -477,7 +477,7 @@ static void napi_enable_rx(struct net_device *dev)
477static void napi_disable_rx(struct net_device *dev) 477static void napi_disable_rx(struct net_device *dev)
478{ 478{
479 struct fs_enet_private *fep = netdev_priv(dev); 479 struct fs_enet_private *fep = netdev_priv(dev);
480 fec_t *fecp = fep->fec.fecp; 480 fec_t __iomem *fecp = fep->fec.fecp;
481 481
482 FC(fecp, imask, FEC_NAPI_RX_EVENT_MSK); 482 FC(fecp, imask, FEC_NAPI_RX_EVENT_MSK);
483} 483}
@@ -485,7 +485,7 @@ static void napi_disable_rx(struct net_device *dev)
485static void rx_bd_done(struct net_device *dev) 485static void rx_bd_done(struct net_device *dev)
486{ 486{
487 struct fs_enet_private *fep = netdev_priv(dev); 487 struct fs_enet_private *fep = netdev_priv(dev);
488 fec_t *fecp = fep->fec.fecp; 488 fec_t __iomem *fecp = fep->fec.fecp;
489 489
490 FW(fecp, r_des_active, 0x01000000); 490 FW(fecp, r_des_active, 0x01000000);
491} 491}
@@ -493,7 +493,7 @@ static void rx_bd_done(struct net_device *dev)
493static void tx_kickstart(struct net_device *dev) 493static void tx_kickstart(struct net_device *dev)
494{ 494{
495 struct fs_enet_private *fep = netdev_priv(dev); 495 struct fs_enet_private *fep = netdev_priv(dev);
496 fec_t *fecp = fep->fec.fecp; 496 fec_t __iomem *fecp = fep->fec.fecp;
497 497
498 FW(fecp, x_des_active, 0x01000000); 498 FW(fecp, x_des_active, 0x01000000);
499} 499}
@@ -501,7 +501,7 @@ static void tx_kickstart(struct net_device *dev)
501static u32 get_int_events(struct net_device *dev) 501static u32 get_int_events(struct net_device *dev)
502{ 502{
503 struct fs_enet_private *fep = netdev_priv(dev); 503 struct fs_enet_private *fep = netdev_priv(dev);
504 fec_t *fecp = fep->fec.fecp; 504 fec_t __iomem *fecp = fep->fec.fecp;
505 505
506 return FR(fecp, ievent) & FR(fecp, imask); 506 return FR(fecp, ievent) & FR(fecp, imask);
507} 507}
@@ -509,7 +509,7 @@ static u32 get_int_events(struct net_device *dev)
509static void clear_int_events(struct net_device *dev, u32 int_events) 509static void clear_int_events(struct net_device *dev, u32 int_events)
510{ 510{
511 struct fs_enet_private *fep = netdev_priv(dev); 511 struct fs_enet_private *fep = netdev_priv(dev);
512 fec_t *fecp = fep->fec.fecp; 512 fec_t __iomem *fecp = fep->fec.fecp;
513 513
514 FW(fecp, ievent, int_events); 514 FW(fecp, ievent, int_events);
515} 515}
@@ -520,7 +520,7 @@ static void ev_error(struct net_device *dev, u32 int_events)
520 ": %s FEC ERROR(s) 0x%x\n", dev->name, int_events); 520 ": %s FEC ERROR(s) 0x%x\n", dev->name, int_events);
521} 521}
522 522
523int get_regs(struct net_device *dev, void *p, int *sizep) 523static int get_regs(struct net_device *dev, void *p, int *sizep)
524{ 524{
525 struct fs_enet_private *fep = netdev_priv(dev); 525 struct fs_enet_private *fep = netdev_priv(dev);
526 526
@@ -532,12 +532,12 @@ int get_regs(struct net_device *dev, void *p, int *sizep)
532 return 0; 532 return 0;
533} 533}
534 534
535int get_regs_len(struct net_device *dev) 535static int get_regs_len(struct net_device *dev)
536{ 536{
537 return sizeof(fec_t); 537 return sizeof(fec_t);
538} 538}
539 539
540void tx_restart(struct net_device *dev) 540static void tx_restart(struct net_device *dev)
541{ 541{
542 /* nothing */ 542 /* nothing */
543} 543}
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c
index add9e32d4f47..03134f47a4eb 100644
--- a/drivers/net/fs_enet/mac-scc.c
+++ b/drivers/net/fs_enet/mac-scc.c
@@ -191,7 +191,8 @@ static int allocate_bd(struct net_device *dev)
191 if (IS_ERR_VALUE(fep->ring_mem_addr)) 191 if (IS_ERR_VALUE(fep->ring_mem_addr))
192 return -ENOMEM; 192 return -ENOMEM;
193 193
194 fep->ring_base = cpm_dpram_addr(fep->ring_mem_addr); 194 fep->ring_base = (void __iomem __force*)
195 cpm_dpram_addr(fep->ring_mem_addr);
195 196
196 return 0; 197 return 0;
197} 198}
@@ -212,7 +213,7 @@ static void cleanup_data(struct net_device *dev)
212static void set_promiscuous_mode(struct net_device *dev) 213static void set_promiscuous_mode(struct net_device *dev)
213{ 214{
214 struct fs_enet_private *fep = netdev_priv(dev); 215 struct fs_enet_private *fep = netdev_priv(dev);
215 scc_t *sccp = fep->scc.sccp; 216 scc_t __iomem *sccp = fep->scc.sccp;
216 217
217 S16(sccp, scc_psmr, SCC_PSMR_PRO); 218 S16(sccp, scc_psmr, SCC_PSMR_PRO);
218} 219}
@@ -220,7 +221,7 @@ static void set_promiscuous_mode(struct net_device *dev)
220static void set_multicast_start(struct net_device *dev) 221static void set_multicast_start(struct net_device *dev)
221{ 222{
222 struct fs_enet_private *fep = netdev_priv(dev); 223 struct fs_enet_private *fep = netdev_priv(dev);
223 scc_enet_t *ep = fep->scc.ep; 224 scc_enet_t __iomem *ep = fep->scc.ep;
224 225
225 W16(ep, sen_gaddr1, 0); 226 W16(ep, sen_gaddr1, 0);
226 W16(ep, sen_gaddr2, 0); 227 W16(ep, sen_gaddr2, 0);
@@ -231,7 +232,7 @@ static void set_multicast_start(struct net_device *dev)
231static void set_multicast_one(struct net_device *dev, const u8 * mac) 232static void set_multicast_one(struct net_device *dev, const u8 * mac)
232{ 233{
233 struct fs_enet_private *fep = netdev_priv(dev); 234 struct fs_enet_private *fep = netdev_priv(dev);
234 scc_enet_t *ep = fep->scc.ep; 235 scc_enet_t __iomem *ep = fep->scc.ep;
235 u16 taddrh, taddrm, taddrl; 236 u16 taddrh, taddrm, taddrl;
236 237
237 taddrh = ((u16) mac[5] << 8) | mac[4]; 238 taddrh = ((u16) mac[5] << 8) | mac[4];
@@ -247,8 +248,8 @@ static void set_multicast_one(struct net_device *dev, const u8 * mac)
247static void set_multicast_finish(struct net_device *dev) 248static void set_multicast_finish(struct net_device *dev)
248{ 249{
249 struct fs_enet_private *fep = netdev_priv(dev); 250 struct fs_enet_private *fep = netdev_priv(dev);
250 scc_t *sccp = fep->scc.sccp; 251 scc_t __iomem *sccp = fep->scc.sccp;
251 scc_enet_t *ep = fep->scc.ep; 252 scc_enet_t __iomem *ep = fep->scc.ep;
252 253
253 /* clear promiscuous always */ 254 /* clear promiscuous always */
254 C16(sccp, scc_psmr, SCC_PSMR_PRO); 255 C16(sccp, scc_psmr, SCC_PSMR_PRO);
@@ -285,8 +286,8 @@ static void set_multicast_list(struct net_device *dev)
285static void restart(struct net_device *dev) 286static void restart(struct net_device *dev)
286{ 287{
287 struct fs_enet_private *fep = netdev_priv(dev); 288 struct fs_enet_private *fep = netdev_priv(dev);
288 scc_t *sccp = fep->scc.sccp; 289 scc_t __iomem *sccp = fep->scc.sccp;
289 scc_enet_t *ep = fep->scc.ep; 290 scc_enet_t __iomem *ep = fep->scc.ep;
290 const struct fs_platform_info *fpi = fep->fpi; 291 const struct fs_platform_info *fpi = fep->fpi;
291 u16 paddrh, paddrm, paddrl; 292 u16 paddrh, paddrm, paddrl;
292 const unsigned char *mac; 293 const unsigned char *mac;
@@ -296,7 +297,7 @@ static void restart(struct net_device *dev)
296 297
297 /* clear everything (slow & steady does it) */ 298 /* clear everything (slow & steady does it) */
298 for (i = 0; i < sizeof(*ep); i++) 299 for (i = 0; i < sizeof(*ep); i++)
299 __fs_out8((char *)ep + i, 0); 300 __fs_out8((u8 __iomem *)ep + i, 0);
300 301
301 /* point to bds */ 302 /* point to bds */
302 W16(ep, sen_genscc.scc_rbase, fep->ring_mem_addr); 303 W16(ep, sen_genscc.scc_rbase, fep->ring_mem_addr);
@@ -397,7 +398,7 @@ static void restart(struct net_device *dev)
397static void stop(struct net_device *dev) 398static void stop(struct net_device *dev)
398{ 399{
399 struct fs_enet_private *fep = netdev_priv(dev); 400 struct fs_enet_private *fep = netdev_priv(dev);
400 scc_t *sccp = fep->scc.sccp; 401 scc_t __iomem *sccp = fep->scc.sccp;
401 int i; 402 int i;
402 403
403 for (i = 0; (R16(sccp, scc_sccm) == 0) && i < SCC_RESET_DELAY; i++) 404 for (i = 0; (R16(sccp, scc_sccm) == 0) && i < SCC_RESET_DELAY; i++)
@@ -441,7 +442,7 @@ static void post_free_irq(struct net_device *dev, int irq)
441static void napi_clear_rx_event(struct net_device *dev) 442static void napi_clear_rx_event(struct net_device *dev)
442{ 443{
443 struct fs_enet_private *fep = netdev_priv(dev); 444 struct fs_enet_private *fep = netdev_priv(dev);
444 scc_t *sccp = fep->scc.sccp; 445 scc_t __iomem *sccp = fep->scc.sccp;
445 446
446 W16(sccp, scc_scce, SCC_NAPI_RX_EVENT_MSK); 447 W16(sccp, scc_scce, SCC_NAPI_RX_EVENT_MSK);
447} 448}
@@ -449,7 +450,7 @@ static void napi_clear_rx_event(struct net_device *dev)
449static void napi_enable_rx(struct net_device *dev) 450static void napi_enable_rx(struct net_device *dev)
450{ 451{
451 struct fs_enet_private *fep = netdev_priv(dev); 452 struct fs_enet_private *fep = netdev_priv(dev);
452 scc_t *sccp = fep->scc.sccp; 453 scc_t __iomem *sccp = fep->scc.sccp;
453 454
454 S16(sccp, scc_sccm, SCC_NAPI_RX_EVENT_MSK); 455 S16(sccp, scc_sccm, SCC_NAPI_RX_EVENT_MSK);
455} 456}
@@ -457,7 +458,7 @@ static void napi_enable_rx(struct net_device *dev)
457static void napi_disable_rx(struct net_device *dev) 458static void napi_disable_rx(struct net_device *dev)
458{ 459{
459 struct fs_enet_private *fep = netdev_priv(dev); 460 struct fs_enet_private *fep = netdev_priv(dev);
460 scc_t *sccp = fep->scc.sccp; 461 scc_t __iomem *sccp = fep->scc.sccp;
461 462
462 C16(sccp, scc_sccm, SCC_NAPI_RX_EVENT_MSK); 463 C16(sccp, scc_sccm, SCC_NAPI_RX_EVENT_MSK);
463} 464}
@@ -475,7 +476,7 @@ static void tx_kickstart(struct net_device *dev)
475static u32 get_int_events(struct net_device *dev) 476static u32 get_int_events(struct net_device *dev)
476{ 477{
477 struct fs_enet_private *fep = netdev_priv(dev); 478 struct fs_enet_private *fep = netdev_priv(dev);
478 scc_t *sccp = fep->scc.sccp; 479 scc_t __iomem *sccp = fep->scc.sccp;
479 480
480 return (u32) R16(sccp, scc_scce); 481 return (u32) R16(sccp, scc_scce);
481} 482}
@@ -483,7 +484,7 @@ static u32 get_int_events(struct net_device *dev)
483static void clear_int_events(struct net_device *dev, u32 int_events) 484static void clear_int_events(struct net_device *dev, u32 int_events)
484{ 485{
485 struct fs_enet_private *fep = netdev_priv(dev); 486 struct fs_enet_private *fep = netdev_priv(dev);
486 scc_t *sccp = fep->scc.sccp; 487 scc_t __iomem *sccp = fep->scc.sccp;
487 488
488 W16(sccp, scc_scce, int_events & 0xffff); 489 W16(sccp, scc_scce, int_events & 0xffff);
489} 490}
@@ -498,20 +499,20 @@ static int get_regs(struct net_device *dev, void *p, int *sizep)
498{ 499{
499 struct fs_enet_private *fep = netdev_priv(dev); 500 struct fs_enet_private *fep = netdev_priv(dev);
500 501
501 if (*sizep < sizeof(scc_t) + sizeof(scc_enet_t)) 502 if (*sizep < sizeof(scc_t) + sizeof(scc_enet_t __iomem *))
502 return -EINVAL; 503 return -EINVAL;
503 504
504 memcpy_fromio(p, fep->scc.sccp, sizeof(scc_t)); 505 memcpy_fromio(p, fep->scc.sccp, sizeof(scc_t));
505 p = (char *)p + sizeof(scc_t); 506 p = (char *)p + sizeof(scc_t);
506 507
507 memcpy_fromio(p, fep->scc.ep, sizeof(scc_enet_t)); 508 memcpy_fromio(p, fep->scc.ep, sizeof(scc_enet_t __iomem *));
508 509
509 return 0; 510 return 0;
510} 511}
511 512
512static int get_regs_len(struct net_device *dev) 513static int get_regs_len(struct net_device *dev)
513{ 514{
514 return sizeof(scc_t) + sizeof(scc_enet_t); 515 return sizeof(scc_t) + sizeof(scc_enet_t __iomem *);
515} 516}
516 517
517static void tx_restart(struct net_device *dev) 518static void tx_restart(struct net_device *dev)
diff --git a/drivers/net/fs_enet/mii-fec.c b/drivers/net/fs_enet/mii-fec.c
index f91c38d0b57b..a89cf15090b8 100644
--- a/drivers/net/fs_enet/mii-fec.c
+++ b/drivers/net/fs_enet/mii-fec.c
@@ -70,7 +70,7 @@ static int match_has_phy (struct device *dev, void* data)
70static int fs_mii_fec_init(struct fec_info* fec, struct fs_mii_fec_platform_info *fmpi) 70static int fs_mii_fec_init(struct fec_info* fec, struct fs_mii_fec_platform_info *fmpi)
71{ 71{
72 struct resource *r; 72 struct resource *r;
73 fec_t *fecp; 73 fec_t __iomem *fecp;
74 char* name = "fsl-cpm-fec"; 74 char* name = "fsl-cpm-fec";
75 75
76 /* we need fec in order to be useful */ 76 /* we need fec in order to be useful */
@@ -85,7 +85,7 @@ static int fs_mii_fec_init(struct fec_info* fec, struct fs_mii_fec_platform_info
85 85
86 r = platform_get_resource_byname(fec_pdev, IORESOURCE_MEM, "regs"); 86 r = platform_get_resource_byname(fec_pdev, IORESOURCE_MEM, "regs");
87 87
88 fec->fecp = fecp = (fec_t*)ioremap(r->start,sizeof(fec_t)); 88 fec->fecp = fecp = ioremap(r->start,sizeof(fec_t));
89 fec->mii_speed = fmpi->mii_speed; 89 fec->mii_speed = fmpi->mii_speed;
90 90
91 setbits32(&fecp->fec_r_cntrl, FEC_RCNTRL_MII_MODE); /* MII enable */ 91 setbits32(&fecp->fec_r_cntrl, FEC_RCNTRL_MII_MODE); /* MII enable */
@@ -100,7 +100,7 @@ static int fs_mii_fec_init(struct fec_info* fec, struct fs_mii_fec_platform_info
100static int fs_enet_fec_mii_read(struct mii_bus *bus , int phy_id, int location) 100static int fs_enet_fec_mii_read(struct mii_bus *bus , int phy_id, int location)
101{ 101{
102 struct fec_info* fec = bus->priv; 102 struct fec_info* fec = bus->priv;
103 fec_t *fecp = fec->fecp; 103 fec_t __iomem *fecp = fec->fecp;
104 int i, ret = -1; 104 int i, ret = -1;
105 105
106 if ((in_be32(&fecp->fec_r_cntrl) & FEC_RCNTRL_MII_MODE) == 0) 106 if ((in_be32(&fecp->fec_r_cntrl) & FEC_RCNTRL_MII_MODE) == 0)
@@ -124,7 +124,7 @@ static int fs_enet_fec_mii_read(struct mii_bus *bus , int phy_id, int location)
124static int fs_enet_fec_mii_write(struct mii_bus *bus, int phy_id, int location, u16 val) 124static int fs_enet_fec_mii_write(struct mii_bus *bus, int phy_id, int location, u16 val)
125{ 125{
126 struct fec_info* fec = bus->priv; 126 struct fec_info* fec = bus->priv;
127 fec_t *fecp = fec->fecp; 127 fec_t __iomem *fecp = fec->fecp;
128 int i; 128 int i;
129 129
130 /* this must never happen */ 130 /* this must never happen */