aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ibm_newemac/mal.c
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@linux.vnet.ibm.com>2008-10-16 00:38:40 -0400
committerJosh Boyer <jwboyer@linux.vnet.ibm.com>2008-10-20 19:59:54 -0400
commit1ff0fcfcb1a6d0a4c4d065ed230be7beae087b83 (patch)
treef87ee18556af26da4b0923a7116371886e4ece70 /drivers/net/ibm_newemac/mal.c
parent878e7556bfe7b10178ea58862bf9708f35afe001 (diff)
ibm_newemac: Fix new MAL feature handling
Support for new features needed by the PPC 405EZ boards introduced some errors in the MAL and EMAC feature handling. This broke 'allmodconfig' builds as CONFIG_PPC_DCR_NATIVE is not set for those. This patch fixes these errors by wrapping the code in the appropriate #ifdefs. Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Diffstat (limited to 'drivers/net/ibm_newemac/mal.c')
-rw-r--r--drivers/net/ibm_newemac/mal.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/ibm_newemac/mal.c b/drivers/net/ibm_newemac/mal.c
index 1839d3f154a3..ecf9798987fa 100644
--- a/drivers/net/ibm_newemac/mal.c
+++ b/drivers/net/ibm_newemac/mal.c
@@ -280,9 +280,11 @@ static irqreturn_t mal_txeob(int irq, void *dev_instance)
280 mal_schedule_poll(mal); 280 mal_schedule_poll(mal);
281 set_mal_dcrn(mal, MAL_TXEOBISR, r); 281 set_mal_dcrn(mal, MAL_TXEOBISR, r);
282 282
283#ifdef CONFIG_PPC_DCR_NATIVE
283 if (mal_has_feature(mal, MAL_FTR_CLEAR_ICINTSTAT)) 284 if (mal_has_feature(mal, MAL_FTR_CLEAR_ICINTSTAT))
284 mtdcri(SDR0, DCRN_SDR_ICINTSTAT, 285 mtdcri(SDR0, DCRN_SDR_ICINTSTAT,
285 (mfdcri(SDR0, DCRN_SDR_ICINTSTAT) | ICINTSTAT_ICTX)); 286 (mfdcri(SDR0, DCRN_SDR_ICINTSTAT) | ICINTSTAT_ICTX));
287#endif
286 288
287 return IRQ_HANDLED; 289 return IRQ_HANDLED;
288} 290}
@@ -298,9 +300,11 @@ static irqreturn_t mal_rxeob(int irq, void *dev_instance)
298 mal_schedule_poll(mal); 300 mal_schedule_poll(mal);
299 set_mal_dcrn(mal, MAL_RXEOBISR, r); 301 set_mal_dcrn(mal, MAL_RXEOBISR, r);
300 302
303#ifdef CONFIG_PPC_DCR_NATIVE
301 if (mal_has_feature(mal, MAL_FTR_CLEAR_ICINTSTAT)) 304 if (mal_has_feature(mal, MAL_FTR_CLEAR_ICINTSTAT))
302 mtdcri(SDR0, DCRN_SDR_ICINTSTAT, 305 mtdcri(SDR0, DCRN_SDR_ICINTSTAT,
303 (mfdcri(SDR0, DCRN_SDR_ICINTSTAT) | ICINTSTAT_ICRX)); 306 (mfdcri(SDR0, DCRN_SDR_ICINTSTAT) | ICINTSTAT_ICRX));
307#endif
304 308
305 return IRQ_HANDLED; 309 return IRQ_HANDLED;
306} 310}
@@ -572,9 +576,18 @@ static int __devinit mal_probe(struct of_device *ofdev,
572 goto fail; 576 goto fail;
573 } 577 }
574 578
575 if (of_device_is_compatible(ofdev->node, "ibm,mcmal-405ez")) 579 if (of_device_is_compatible(ofdev->node, "ibm,mcmal-405ez")) {
580#if defined(CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT) && \
581 defined(CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR)
576 mal->features |= (MAL_FTR_CLEAR_ICINTSTAT | 582 mal->features |= (MAL_FTR_CLEAR_ICINTSTAT |
577 MAL_FTR_COMMON_ERR_INT); 583 MAL_FTR_COMMON_ERR_INT);
584#else
585 printk(KERN_ERR "%s: Support for 405EZ not enabled!\n",
586 ofdev->node->full_name);
587 err = -ENODEV;
588 goto fail;
589#endif
590 }
578 591
579 mal->txeob_irq = irq_of_parse_and_map(ofdev->node, 0); 592 mal->txeob_irq = irq_of_parse_and_map(ofdev->node, 0);
580 mal->rxeob_irq = irq_of_parse_and_map(ofdev->node, 1); 593 mal->rxeob_irq = irq_of_parse_and_map(ofdev->node, 1);