aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/8xx_io
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-04-29 22:38:01 -0400
committerPaul Mackerras <paulus@samba.org>2007-04-29 22:38:01 -0400
commit49e1900d4cc2e7bcecb681fe60f0990bec2dcce8 (patch)
tree253801ebf57e0a23856a2c7be129c2c178f62fdf /arch/ppc/8xx_io
parent34f6d749c0a328817d5e36274e53121c1db734dc (diff)
parentb9099ff63c75216d6ca10bce5a1abcd9293c27e6 (diff)
Merge branch 'linux-2.6' into for-2.6.22
Diffstat (limited to 'arch/ppc/8xx_io')
-rw-r--r--arch/ppc/8xx_io/commproc.c26
-rw-r--r--arch/ppc/8xx_io/enet.c1
-rw-r--r--arch/ppc/8xx_io/fec.c1
3 files changed, 26 insertions, 2 deletions
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
index 3b23bcb35b7a..7a8722beac12 100644
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -39,6 +39,21 @@
39#include <asm/tlbflush.h> 39#include <asm/tlbflush.h>
40#include <asm/rheap.h> 40#include <asm/rheap.h>
41 41
42#define immr_map(member) \
43({ \
44 u32 offset = offsetof(immap_t, member); \
45 void *addr = ioremap (IMAP_ADDR + offset, \
46 sizeof( ((immap_t*)0)->member)); \
47 addr; \
48})
49
50#define immr_map_size(member, size) \
51({ \
52 u32 offset = offsetof(immap_t, member); \
53 void *addr = ioremap (IMAP_ADDR + offset, size); \
54 addr; \
55})
56
42static void m8xx_cpm_dpinit(void); 57static void m8xx_cpm_dpinit(void);
43static uint host_buffer; /* One page of host buffer */ 58static uint host_buffer; /* One page of host buffer */
44static uint host_end; /* end + 1 */ 59static uint host_end; /* end + 1 */
@@ -364,11 +379,16 @@ static rh_block_t cpm_boot_dpmem_rh_block[16];
364static rh_info_t cpm_dpmem_info; 379static rh_info_t cpm_dpmem_info;
365 380
366#define CPM_DPMEM_ALIGNMENT 8 381#define CPM_DPMEM_ALIGNMENT 8
382static u8* dpram_vbase;
383static uint dpram_pbase;
367 384
368void m8xx_cpm_dpinit(void) 385void m8xx_cpm_dpinit(void)
369{ 386{
370 spin_lock_init(&cpm_dpmem_lock); 387 spin_lock_init(&cpm_dpmem_lock);
371 388
389 dpram_vbase = immr_map_size(im_cpm.cp_dpmem, CPM_DATAONLY_BASE + CPM_DATAONLY_SIZE);
390 dpram_pbase = (uint)&((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem;
391
372 /* Initialize the info header */ 392 /* Initialize the info header */
373 rh_init(&cpm_dpmem_info, CPM_DPMEM_ALIGNMENT, 393 rh_init(&cpm_dpmem_info, CPM_DPMEM_ALIGNMENT,
374 sizeof(cpm_boot_dpmem_rh_block) / 394 sizeof(cpm_boot_dpmem_rh_block) /
@@ -442,3 +462,9 @@ void *cpm_dpram_addr(uint offset)
442 return ((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem + offset; 462 return ((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem + offset;
443} 463}
444EXPORT_SYMBOL(cpm_dpram_addr); 464EXPORT_SYMBOL(cpm_dpram_addr);
465
466uint cpm_dpram_phys(u8* addr)
467{
468 return (dpram_pbase + (uint)(addr - dpram_vbase));
469}
470EXPORT_SYMBOL(cpm_dpram_phys);
diff --git a/arch/ppc/8xx_io/enet.c b/arch/ppc/8xx_io/enet.c
index b23c45bc151a..bfa3f52996d1 100644
--- a/arch/ppc/8xx_io/enet.c
+++ b/arch/ppc/8xx_io/enet.c
@@ -506,7 +506,6 @@ for (;;) {
506 cep->stats.rx_dropped++; 506 cep->stats.rx_dropped++;
507 } 507 }
508 else { 508 else {
509 skb->dev = dev;
510 skb_put(skb,pkt_len-4); /* Make room */ 509 skb_put(skb,pkt_len-4); /* Make room */
511 eth_copy_and_sum(skb, 510 eth_copy_and_sum(skb,
512 cep->rx_vaddr[bdp - cep->rx_bd_base], 511 cep->rx_vaddr[bdp - cep->rx_bd_base],
diff --git a/arch/ppc/8xx_io/fec.c b/arch/ppc/8xx_io/fec.c
index e6c28fb423b2..57a9a61e54b5 100644
--- a/arch/ppc/8xx_io/fec.c
+++ b/arch/ppc/8xx_io/fec.c
@@ -724,7 +724,6 @@ while (!(bdp->cbd_sc & BD_ENET_RX_EMPTY)) {
724 printk("%s: Memory squeeze, dropping packet.\n", dev->name); 724 printk("%s: Memory squeeze, dropping packet.\n", dev->name);
725 fep->stats.rx_dropped++; 725 fep->stats.rx_dropped++;
726 } else { 726 } else {
727 skb->dev = dev;
728 skb_put(skb,pkt_len-4); /* Make room */ 727 skb_put(skb,pkt_len-4); /* Make room */
729 eth_copy_and_sum(skb, data, pkt_len-4, 0); 728 eth_copy_and_sum(skb, data, pkt_len-4, 0);
730 skb->protocol=eth_type_trans(skb,dev); 729 skb->protocol=eth_type_trans(skb,dev);