diff options
Diffstat (limited to 'arch/ppc/8xx_io')
-rw-r--r-- | arch/ppc/8xx_io/Kconfig | 4 | ||||
-rw-r--r-- | arch/ppc/8xx_io/commproc.c | 20 | ||||
-rw-r--r-- | arch/ppc/8xx_io/fec.c | 43 |
3 files changed, 29 insertions, 38 deletions
diff --git a/arch/ppc/8xx_io/Kconfig b/arch/ppc/8xx_io/Kconfig index 9e2227ec3b34..57dacf978532 100644 --- a/arch/ppc/8xx_io/Kconfig +++ b/arch/ppc/8xx_io/Kconfig | |||
@@ -69,9 +69,9 @@ config FEC_QS6612 | |||
69 | 69 | ||
70 | config ENET_BIG_BUFFERS | 70 | config ENET_BIG_BUFFERS |
71 | bool "Use Big CPM Ethernet Buffers" | 71 | bool "Use Big CPM Ethernet Buffers" |
72 | depends on NET_ETHERNET | 72 | depends on SCC_ENET || FEC_ENET |
73 | help | 73 | help |
74 | Allocate large buffers for MPC8xx Etherenet. Increases throughput | 74 | Allocate large buffers for MPC8xx Ethernet. Increases throughput |
75 | and decreases the likelihood of dropped packets, but costs memory. | 75 | and decreases the likelihood of dropped packets, but costs memory. |
76 | 76 | ||
77 | config HTDMSOUND | 77 | config HTDMSOUND |
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c index 0cc2e7a9cb11..11726e2a4ec8 100644 --- a/arch/ppc/8xx_io/commproc.c +++ b/arch/ppc/8xx_io/commproc.c | |||
@@ -39,8 +39,6 @@ | |||
39 | #include <asm/tlbflush.h> | 39 | #include <asm/tlbflush.h> |
40 | #include <asm/rheap.h> | 40 | #include <asm/rheap.h> |
41 | 41 | ||
42 | extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep); | ||
43 | |||
44 | static void m8xx_cpm_dpinit(void); | 42 | static void m8xx_cpm_dpinit(void); |
45 | static uint host_buffer; /* One page of host buffer */ | 43 | static uint host_buffer; /* One page of host buffer */ |
46 | static uint host_end; /* end + 1 */ | 44 | static uint host_end; /* end + 1 */ |
@@ -108,14 +106,11 @@ struct hw_interrupt_type cpm_pic = { | |||
108 | .end = cpm_eoi, | 106 | .end = cpm_eoi, |
109 | }; | 107 | }; |
110 | 108 | ||
111 | extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr); | ||
112 | |||
113 | void | 109 | void |
114 | m8xx_cpm_reset(uint bootpage) | 110 | m8xx_cpm_reset(void) |
115 | { | 111 | { |
116 | volatile immap_t *imp; | 112 | volatile immap_t *imp; |
117 | volatile cpm8xx_t *commproc; | 113 | volatile cpm8xx_t *commproc; |
118 | pte_t *pte; | ||
119 | 114 | ||
120 | imp = (immap_t *)IMAP_ADDR; | 115 | imp = (immap_t *)IMAP_ADDR; |
121 | commproc = (cpm8xx_t *)&imp->im_cpm; | 116 | commproc = (cpm8xx_t *)&imp->im_cpm; |
@@ -143,17 +138,6 @@ m8xx_cpm_reset(uint bootpage) | |||
143 | /* Reclaim the DP memory for our use. */ | 138 | /* Reclaim the DP memory for our use. */ |
144 | m8xx_cpm_dpinit(); | 139 | m8xx_cpm_dpinit(); |
145 | 140 | ||
146 | /* get the PTE for the bootpage */ | ||
147 | if (!get_pteptr(&init_mm, bootpage, &pte)) | ||
148 | panic("get_pteptr failed\n"); | ||
149 | |||
150 | /* and make it uncachable */ | ||
151 | pte_val(*pte) |= _PAGE_NO_CACHE; | ||
152 | _tlbie(bootpage); | ||
153 | |||
154 | host_buffer = bootpage; | ||
155 | host_end = host_buffer + PAGE_SIZE; | ||
156 | |||
157 | /* Tell everyone where the comm processor resides. | 141 | /* Tell everyone where the comm processor resides. |
158 | */ | 142 | */ |
159 | cpmp = (cpm8xx_t *)commproc; | 143 | cpmp = (cpm8xx_t *)commproc; |
@@ -384,8 +368,6 @@ static rh_info_t cpm_dpmem_info; | |||
384 | 368 | ||
385 | void m8xx_cpm_dpinit(void) | 369 | void m8xx_cpm_dpinit(void) |
386 | { | 370 | { |
387 | cpm8xx_t *cp = &((immap_t *)IMAP_ADDR)->im_cpm; | ||
388 | |||
389 | spin_lock_init(&cpm_dpmem_lock); | 371 | spin_lock_init(&cpm_dpmem_lock); |
390 | 372 | ||
391 | /* Initialize the info header */ | 373 | /* Initialize the info header */ |
diff --git a/arch/ppc/8xx_io/fec.c b/arch/ppc/8xx_io/fec.c index 0730392dcc20..62f68d6181c6 100644 --- a/arch/ppc/8xx_io/fec.c +++ b/arch/ppc/8xx_io/fec.c | |||
@@ -173,7 +173,7 @@ struct fec_enet_private { | |||
173 | uint phy_status; | 173 | uint phy_status; |
174 | uint phy_speed; | 174 | uint phy_speed; |
175 | phy_info_t *phy; | 175 | phy_info_t *phy; |
176 | struct tq_struct phy_task; | 176 | struct work_struct phy_task; |
177 | 177 | ||
178 | uint sequence_done; | 178 | uint sequence_done; |
179 | 179 | ||
@@ -199,7 +199,8 @@ static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev); | |||
199 | #ifdef CONFIG_USE_MDIO | 199 | #ifdef CONFIG_USE_MDIO |
200 | static void fec_enet_mii(struct net_device *dev); | 200 | static void fec_enet_mii(struct net_device *dev); |
201 | #endif /* CONFIG_USE_MDIO */ | 201 | #endif /* CONFIG_USE_MDIO */ |
202 | static void fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs); | 202 | static irqreturn_t fec_enet_interrupt(int irq, void * dev_id, |
203 | struct pt_regs * regs); | ||
203 | #ifdef CONFIG_FEC_PACKETHOOK | 204 | #ifdef CONFIG_FEC_PACKETHOOK |
204 | static void fec_enet_tx(struct net_device *dev, __u32 regval); | 205 | static void fec_enet_tx(struct net_device *dev, __u32 regval); |
205 | static void fec_enet_rx(struct net_device *dev, __u32 regval); | 206 | static void fec_enet_rx(struct net_device *dev, __u32 regval); |
@@ -471,7 +472,7 @@ fec_timeout(struct net_device *dev) | |||
471 | /* The interrupt handler. | 472 | /* The interrupt handler. |
472 | * This is called from the MPC core interrupt. | 473 | * This is called from the MPC core interrupt. |
473 | */ | 474 | */ |
474 | static void | 475 | static irqreturn_t |
475 | fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs) | 476 | fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs) |
476 | { | 477 | { |
477 | struct net_device *dev = dev_id; | 478 | struct net_device *dev = dev_id; |
@@ -525,6 +526,7 @@ printk("%s[%d] %s: unexpected FEC_ENET_MII event\n", __FILE__,__LINE__,__FUNCTIO | |||
525 | } | 526 | } |
526 | 527 | ||
527 | } | 528 | } |
529 | return IRQ_RETVAL(IRQ_HANDLED); | ||
528 | } | 530 | } |
529 | 531 | ||
530 | 532 | ||
@@ -1263,8 +1265,9 @@ static void mii_display_status(struct net_device *dev) | |||
1263 | printk(".\n"); | 1265 | printk(".\n"); |
1264 | } | 1266 | } |
1265 | 1267 | ||
1266 | static void mii_display_config(struct net_device *dev) | 1268 | static void mii_display_config(void *priv) |
1267 | { | 1269 | { |
1270 | struct net_device *dev = (struct net_device *)priv; | ||
1268 | struct fec_enet_private *fep = dev->priv; | 1271 | struct fec_enet_private *fep = dev->priv; |
1269 | volatile uint *s = &(fep->phy_status); | 1272 | volatile uint *s = &(fep->phy_status); |
1270 | 1273 | ||
@@ -1294,8 +1297,9 @@ static void mii_display_config(struct net_device *dev) | |||
1294 | fep->sequence_done = 1; | 1297 | fep->sequence_done = 1; |
1295 | } | 1298 | } |
1296 | 1299 | ||
1297 | static void mii_relink(struct net_device *dev) | 1300 | static void mii_relink(void *priv) |
1298 | { | 1301 | { |
1302 | struct net_device *dev = (struct net_device *)priv; | ||
1299 | struct fec_enet_private *fep = dev->priv; | 1303 | struct fec_enet_private *fep = dev->priv; |
1300 | int duplex; | 1304 | int duplex; |
1301 | 1305 | ||
@@ -1323,18 +1327,16 @@ static void mii_queue_relink(uint mii_reg, struct net_device *dev) | |||
1323 | { | 1327 | { |
1324 | struct fec_enet_private *fep = dev->priv; | 1328 | struct fec_enet_private *fep = dev->priv; |
1325 | 1329 | ||
1326 | fep->phy_task.routine = (void *)mii_relink; | 1330 | INIT_WORK(&fep->phy_task, mii_relink, (void *)dev); |
1327 | fep->phy_task.data = dev; | 1331 | schedule_work(&fep->phy_task); |
1328 | schedule_task(&fep->phy_task); | ||
1329 | } | 1332 | } |
1330 | 1333 | ||
1331 | static void mii_queue_config(uint mii_reg, struct net_device *dev) | 1334 | static void mii_queue_config(uint mii_reg, struct net_device *dev) |
1332 | { | 1335 | { |
1333 | struct fec_enet_private *fep = dev->priv; | 1336 | struct fec_enet_private *fep = dev->priv; |
1334 | 1337 | ||
1335 | fep->phy_task.routine = (void *)mii_display_config; | 1338 | INIT_WORK(&fep->phy_task, mii_display_config, (void *)dev); |
1336 | fep->phy_task.data = dev; | 1339 | schedule_work(&fep->phy_task); |
1337 | schedule_task(&fep->phy_task); | ||
1338 | } | 1340 | } |
1339 | 1341 | ||
1340 | 1342 | ||
@@ -1403,11 +1405,11 @@ mii_discover_phy(uint mii_reg, struct net_device *dev) | |||
1403 | 1405 | ||
1404 | /* This interrupt occurs when the PHY detects a link change. | 1406 | /* This interrupt occurs when the PHY detects a link change. |
1405 | */ | 1407 | */ |
1406 | static void | 1408 | static |
1407 | #ifdef CONFIG_RPXCLASSIC | 1409 | #ifdef CONFIG_RPXCLASSIC |
1408 | mii_link_interrupt(void *dev_id) | 1410 | void mii_link_interrupt(void *dev_id) |
1409 | #else | 1411 | #else |
1410 | mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) | 1412 | irqreturn_t mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) |
1411 | #endif | 1413 | #endif |
1412 | { | 1414 | { |
1413 | #ifdef CONFIG_USE_MDIO | 1415 | #ifdef CONFIG_USE_MDIO |
@@ -1440,6 +1442,9 @@ mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) | |||
1440 | printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__,__LINE__,__FUNCTION__); | 1442 | printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__,__LINE__,__FUNCTION__); |
1441 | #endif /* CONFIG_USE_MDIO */ | 1443 | #endif /* CONFIG_USE_MDIO */ |
1442 | 1444 | ||
1445 | #ifndef CONFIG_RPXCLASSIC | ||
1446 | return IRQ_RETVAL(IRQ_HANDLED); | ||
1447 | #endif /* CONFIG_RPXCLASSIC */ | ||
1443 | } | 1448 | } |
1444 | 1449 | ||
1445 | static int | 1450 | static int |
@@ -1575,7 +1580,7 @@ static int __init fec_enet_init(void) | |||
1575 | struct fec_enet_private *fep; | 1580 | struct fec_enet_private *fep; |
1576 | int i, j, k, err; | 1581 | int i, j, k, err; |
1577 | unsigned char *eap, *iap, *ba; | 1582 | unsigned char *eap, *iap, *ba; |
1578 | unsigned long mem_addr; | 1583 | dma_addr_t mem_addr; |
1579 | volatile cbd_t *bdp; | 1584 | volatile cbd_t *bdp; |
1580 | cbd_t *cbd_base; | 1585 | cbd_t *cbd_base; |
1581 | volatile immap_t *immap; | 1586 | volatile immap_t *immap; |
@@ -1640,7 +1645,8 @@ static int __init fec_enet_init(void) | |||
1640 | printk("FEC initialization failed.\n"); | 1645 | printk("FEC initialization failed.\n"); |
1641 | return 1; | 1646 | return 1; |
1642 | } | 1647 | } |
1643 | cbd_base = (cbd_t *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr); | 1648 | cbd_base = (cbd_t *)dma_alloc_coherent(dev->class_dev.dev, PAGE_SIZE, |
1649 | &mem_addr, GFP_KERNEL); | ||
1644 | 1650 | ||
1645 | /* Set receive and transmit descriptor base. | 1651 | /* Set receive and transmit descriptor base. |
1646 | */ | 1652 | */ |
@@ -1657,7 +1663,10 @@ static int __init fec_enet_init(void) | |||
1657 | 1663 | ||
1658 | /* Allocate a page. | 1664 | /* Allocate a page. |
1659 | */ | 1665 | */ |
1660 | ba = (unsigned char *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr); | 1666 | ba = (unsigned char *)dma_alloc_coherent(dev->class_dev.dev, |
1667 | PAGE_SIZE, | ||
1668 | &mem_addr, | ||
1669 | GFP_KERNEL); | ||
1661 | /* BUG: no check for failure */ | 1670 | /* BUG: no check for failure */ |
1662 | 1671 | ||
1663 | /* Initialize the BD for every fragment in the page. | 1672 | /* Initialize the BD for every fragment in the page. |