/* Longword-access area. Translated to 2 16-bit access cycles by the * X-Surf 100 FPGA
*/ #define XS100_8390_DATA32_BASE 0x8000 #define XS100_8390_DATA32_SIZE 0x2000 /* Sub-Areas for fast data register access; addresses relative to area begin */ #define XS100_8390_DATA_READ32_BASE 0x0880 #define XS100_8390_DATA_WRITE32_BASE 0x0C80 #define XS100_8390_DATA_AREA_SIZE 0x80
/* force unsigned long back to 'void __iomem *' */ #define ax_convert_addr(_a) ((void __force __iomem *)(_a))
/* Block input and output, similar to the Crynwr packet driver. If * you are porting to a new ethercard, look at the packet driver * source for hints. The NEx000 doesn't share the on-board packet * memory -- you have to put the packet out through the "remote DMA" * dataport using ei_outb.
*/ staticvoid xs100_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset)
{ struct ei_device *ei_local = netdev_priv(dev); void __iomem *nic_base = ei_local->mem; char *buf = skb->data;
if (ei_local->dmaing) {
netdev_err(dev, "DMAing conflict in %s [DMAstat:%d][irqlock:%d]\n",
__func__,
ei_local->dmaing, ei_local->irqlock); return;
}
/* Round the count up for word writes. Do we need to do this? * What effect will an odd byte count have on the 8390? I * should check someday.
*/ if (ei_local->word16 && (count & 0x01))
count++;
/* This *shouldn't* happen. If it does, it's the last thing * you'll see
*/ if (ei_local->dmaing) {
netdev_err(dev, "DMAing conflict in %s [DMAstat:%d][irqlock:%d]\n",
__func__,
ei_local->dmaing, ei_local->irqlock); return;
}
ei_local->dmaing |= 0x01; /* We should already be in page 0, but to be safe... */
ei_outb(E8390_PAGE0 + E8390_START + E8390_NODMA, nic_base + NE_CMD);
ei_outb(ENISR_RDC, nic_base + EN0_ISR);
/* Now the normal output. */
ei_outb(count & 0xff, nic_base + EN0_RCNTLO);
ei_outb(count >> 8, nic_base + EN0_RCNTHI);
ei_outb(0x00, nic_base + EN0_RSARLO);
ei_outb(start_page, nic_base + EN0_RSARHI);
staticint xsurf100_probe(struct zorro_dev *zdev, conststruct zorro_device_id *ent)
{ struct platform_device *pdev; struct xsurf100_ax_plat_data ax88796_data; struct resource res[2] = {
DEFINE_RES_NAMED(IRQ_AMIGA_PORTS, 1, NULL,
IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE),
DEFINE_RES_MEM(zdev->resource.start + XS100_8390_BASE,
4 * 0x20)
}; int reg; /* This table is referenced in the device structure, so it must * outlive the scope of xsurf100_probe.
*/ static u32 reg_offsets[32]; int ret = 0;
/* X-Surf 100 control and 32 bit ring buffer data access areas. * These resources are not used by the ax88796 driver, so must * be requested here and passed via platform data.
*/
if (!request_mem_region(zdev->resource.start, 0x100, zdev->name)) {
dev_err(&zdev->dev, "cannot reserve X-Surf 100 control registers\n"); return -ENXIO;
}
if (!request_mem_region(zdev->resource.start +
XS100_8390_DATA32_BASE,
XS100_8390_DATA32_SIZE, "X-Surf 100 32-bit data access")) {
dev_err(&zdev->dev, "cannot reserve 32-bit area\n");
ret = -ENXIO; goto exit_req;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.