Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] sgiseeq: Configure PIO and DMA timing requests.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

drivers/net/sgiseeq.c | 28 ++++++++++++++--------------
include/asm-mips/sgi/hpc3.h | 40 ++++++++++++++++++++--------------------
2 files changed, 34 insertions(+), 34 deletions(-)
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>

authored by

Ralf Baechle and committed by
Jeff Garzik
302a5c4b 2891439e

+32 -32
+14 -14
drivers/net/sgiseeq.c
··· 32 32 33 33 #include "sgiseeq.h" 34 34 35 - static char *version = "sgiseeq.c: David S. Miller (dm@engr.sgi.com)\n"; 36 - 37 35 static char *sgiseeqstr = "SGI Seeq8003"; 38 36 39 37 /* ··· 111 113 112 114 static inline void hpc3_eth_reset(struct hpc3_ethregs *hregs) 113 115 { 114 - hregs->rx_reset = HPC3_ERXRST_CRESET | HPC3_ERXRST_CLRIRQ; 116 + hregs->reset = HPC3_ERST_CRESET | HPC3_ERST_CLRIRQ; 115 117 udelay(20); 116 - hregs->rx_reset = 0; 118 + hregs->reset = 0; 117 119 } 118 120 119 121 static inline void reset_hpc3_and_seeq(struct hpc3_ethregs *hregs, ··· 250 252 251 253 #define TSTAT_INIT_SEEQ (SEEQ_TCMD_IPT|SEEQ_TCMD_I16|SEEQ_TCMD_IC|SEEQ_TCMD_IUF) 252 254 #define TSTAT_INIT_EDLC ((TSTAT_INIT_SEEQ) | SEEQ_TCMD_RB2) 253 - #define RDMACFG_INIT (HPC3_ERXDCFG_FRXDC | HPC3_ERXDCFG_FEOP | HPC3_ERXDCFG_FIRQ) 254 255 255 256 static int init_seeq(struct net_device *dev, struct sgiseeq_private *sp, 256 257 struct sgiseeq_regs *sregs) ··· 270 273 } else { 271 274 sregs->tstat = TSTAT_INIT_SEEQ; 272 275 } 273 - 274 - hregs->rx_dconfig |= RDMACFG_INIT; 275 276 276 277 hregs->rx_ndptr = CPHYSADDR(sp->rx_desc); 277 278 hregs->tx_ndptr = CPHYSADDR(sp->tx_desc); ··· 441 446 spin_lock(&sp->tx_lock); 442 447 443 448 /* Ack the IRQ and set software state. */ 444 - hregs->rx_reset = HPC3_ERXRST_CLRIRQ; 449 + hregs->reset = HPC3_ERST_CLRIRQ; 445 450 446 451 /* Always check for received packets. */ 447 452 sgiseeq_rx(dev, sp, hregs, sregs); ··· 641 646 642 647 #define ALIGNED(x) ((((unsigned long)(x)) + 0xf) & ~(0xf)) 643 648 644 - static int sgiseeq_init(struct hpc3_regs* regs, int irq) 649 + static int sgiseeq_init(struct hpc3_regs* hpcregs, int irq) 645 650 { 646 651 struct sgiseeq_init_block *sr; 647 652 struct sgiseeq_private *sp; ··· 677 682 gpriv = sp; 678 683 gdev = dev; 679 684 #endif 680 - sp->sregs = (struct sgiseeq_regs *) &hpc3c0->eth_ext[0]; 681 - sp->hregs = &hpc3c0->ethregs; 685 + sp->sregs = (struct sgiseeq_regs *) &hpcregs->eth_ext[0]; 686 + sp->hregs = &hpcregs->ethregs; 682 687 sp->name = sgiseeqstr; 683 688 sp->mode = SEEQ_RCMD_RBCAST; 684 689 ··· 694 699 /* A couple calculations now, saves many cycles later. */ 695 700 setup_rx_ring(sp->rx_desc, SEEQ_RX_BUFFERS); 696 701 setup_tx_ring(sp->tx_desc, SEEQ_TX_BUFFERS); 702 + 703 + /* Setup PIO and DMA transfer timing */ 704 + sp->hregs->pconfig = 0x161; 705 + sp->hregs->dconfig = HPC3_EDCFG_FIRQ | HPC3_EDCFG_FEOP | 706 + HPC3_EDCFG_FRXDC | HPC3_EDCFG_PTO | 0x026; 697 707 698 708 /* Reset the chip. */ 699 709 hpc3_eth_reset(sp->hregs); ··· 726 726 goto err_out_free_page; 727 727 } 728 728 729 - printk(KERN_INFO "%s: SGI Seeq8003 ", dev->name); 729 + printk(KERN_INFO "%s: %s ", dev->name, sgiseeqstr); 730 730 for (i = 0; i < 6; i++) 731 731 printk("%2.2x%c", dev->dev_addr[i], i == 5 ? '\n' : ':'); 732 732 ··· 746 746 747 747 static int __init sgiseeq_probe(void) 748 748 { 749 - printk(version); 750 - 751 749 /* On board adapter on 1st HPC is always present */ 752 750 return sgiseeq_init(hpc3c0, SGI_ENET_IRQ); 753 751 } ··· 767 769 module_init(sgiseeq_probe); 768 770 module_exit(sgiseeq_exit); 769 771 772 + MODULE_DESCRIPTION("SGI Seeq 8003 driver"); 773 + MODULE_AUTHOR("Linux/MIPS Mailing List <linux-mips@linux-mips.org>"); 770 774 MODULE_LICENSE("GPL");
+18 -18
include/asm-mips/sgi/hpc3.h
··· 128 128 volatile u32 rx_gfptr; /* current GIO fifo ptr */ 129 129 volatile u32 rx_dfptr; /* current device fifo ptr */ 130 130 u32 _unused1; /* padding */ 131 - volatile u32 rx_reset; /* reset register */ 132 - #define HPC3_ERXRST_CRESET 0x1 /* Reset dma channel and external controller */ 133 - #define HPC3_ERXRST_CLRIRQ 0x2 /* Clear channel interrupt */ 134 - #define HPC3_ERXRST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */ 131 + volatile u32 reset; /* reset register */ 132 + #define HPC3_ERST_CRESET 0x1 /* Reset dma channel and external controller */ 133 + #define HPC3_ERST_CLRIRQ 0x2 /* Clear channel interrupt */ 134 + #define HPC3_ERST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */ 135 135 136 - volatile u32 rx_dconfig; /* DMA configuration register */ 137 - #define HPC3_ERXDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */ 138 - #define HPC3_ERXDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */ 139 - #define HPC3_ERXDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */ 140 - #define HPC3_ERXDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */ 141 - #define HPC3_ERXDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */ 142 - #define HPC3_ERXDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */ 143 - #define HPC3_ERXDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */ 144 - #define HPC3_ERXDCFG_PTO 0x30000 /* Programmed timeout value for above two */ 136 + volatile u32 dconfig; /* DMA configuration register */ 137 + #define HPC3_EDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */ 138 + #define HPC3_EDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */ 139 + #define HPC3_EDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */ 140 + #define HPC3_EDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */ 141 + #define HPC3_EDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */ 142 + #define HPC3_EDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */ 143 + #define HPC3_EDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */ 144 + #define HPC3_EDCFG_PTO 0x30000 /* Programmed timeout value for above two */ 145 145 146 - volatile u32 rx_pconfig; /* PIO configuration register */ 147 - #define HPC3_ERXPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */ 148 - #define HPC3_ERXPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */ 149 - #define HPC3_ERXPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */ 150 - #define HPC3_ERXPCFG_TST 0x1000 /* Diagnistic ram test feature bit */ 146 + volatile u32 pconfig; /* PIO configuration register */ 147 + #define HPC3_EPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */ 148 + #define HPC3_EPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */ 149 + #define HPC3_EPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */ 150 + #define HPC3_EPCFG_TST 0x1000 /* Diagnistic ram test feature bit */ 151 151 152 152 u32 _unused2[0x1000/4 - 8]; /* padding */ 153 153