Lines Matching +full:smc +full:- +full:reboot
1 // SPDX-License-Identifier: GPL-1.0+
4 Written 1993-94 by Donald Becker.
21 for non-standard memory sizes.
46 /* A zero-terminated list of I/O addresses to be probed. */
71 #define WD_CMDREG5 5 /* Offset to 16-bit-only ASIC register 5. */
90 int base_addr = dev->base_addr; in do_wd_probe()
91 int irq = dev->irq; in do_wd_probe()
92 int mem_start = dev->mem_start; in do_wd_probe()
93 int mem_end = dev->mem_end; in do_wd_probe()
96 r = request_region(base_addr, WD_IO_EXTENT, "wd-probe"); in do_wd_probe()
98 return -EBUSY; in do_wd_probe()
103 r->name = dev->name; in do_wd_probe()
107 return -ENXIO; in do_wd_probe()
111 r = request_region(ioaddr, WD_IO_EXTENT, "wd-probe"); in do_wd_probe()
115 r->name = dev->name; in do_wd_probe()
119 dev->irq = irq; in do_wd_probe()
120 dev->mem_start = mem_start; in do_wd_probe()
121 dev->mem_end = mem_end; in do_wd_probe()
124 return -ENODEV; in do_wd_probe()
134 return ERR_PTR(-ENOMEM); in wd_probe()
136 sprintf(dev->name, "eth%d", unit); in wd_probe()
180 return -ENODEV; in wd_probe1()
182 /* Check for semi-valid mem_start/end values if supplied. */ in wd_probe1()
183 if ((dev->mem_start % 0x2000) || (dev->mem_end % 0x2000)) { in wd_probe1()
185 "wd.c: user supplied mem_start or mem_end not on 8kB boundary - ignored.\n"); in wd_probe1()
186 dev->mem_start = 0; in wd_probe1()
187 dev->mem_end = 0; in wd_probe1()
197 netdev_info(dev, "WD80x3 at %#3x, %pM", ioaddr, dev->dev_addr); in wd_probe1()
208 case 0x03: word16 = 0; model_name = "PDI8023-8"; break; in wd_probe1()
210 case 0x0a: word16 = 1; model_name = "PDI8023-16"; break; in wd_probe1()
214 dev->mem_start = ((reg5 & 0x1c) + 0xc0) << 12; in wd_probe1()
215 dev->irq = (reg5 & 0xe0) == 0xe0 ? 10 : (reg5 >> 5) + 1; in wd_probe1()
217 /* This method of checking for a 16-bit board is borrowed from the in wd_probe1()
221 /* Check for the old 8 bit board - it has register 0/8 aliasing. in wd_probe1()
222 Do NOT check i>=6 here -- it hangs the old 8003 boards! */ in wd_probe1()
228 model_name = "WD8003-old"; in wd_probe1()
236 /* Magic to set ASIC to word-wide mode. */ in wd_probe1()
256 /* Allow a compile-time override. */ in wd_probe1()
257 dev->mem_start = WD_SHMEM; in wd_probe1()
259 if (dev->mem_start == 0) { in wd_probe1()
264 dev->mem_start = 0xd0000; in wd_probe1()
265 pr_cont(" assigning address %#lx", dev->mem_start); in wd_probe1()
268 /* Some boards don't have the register 5 -- it returns 0xff. */ in wd_probe1()
271 dev->mem_start = ((reg0&0x3f) << 13) + (high_addr_bits << 19); in wd_probe1()
276 /* The 8390 isn't at the base address -- the ASIC regs are there! */ in wd_probe1()
277 dev->base_addr = ioaddr+WD_NIC_OFFSET; in wd_probe1()
279 if (dev->irq < 2) { in wd_probe1()
287 /* We have an old-style ethercard that doesn't report its IRQ in wd_probe1()
299 dev->irq = probe_irq_off(irq_mask); in wd_probe1()
304 pr_cont(" autoirq is %d", dev->irq); in wd_probe1()
305 if (dev->irq < 2) in wd_probe1()
306 dev->irq = word16 ? 10 : 5; in wd_probe1()
308 dev->irq = irqmap[((reg4 >> 5) & 0x03) + (reg1 & 0x04)]; in wd_probe1()
309 } else if (dev->irq == 2) /* Fixup bogosity: IRQ2 is really IRQ9 */ in wd_probe1()
310 dev->irq = 9; in wd_probe1()
314 i = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev); in wd_probe1()
316 pr_cont(" unable to get IRQ %d.\n", dev->irq); in wd_probe1()
329 if (dev->mem_end != 0) { in wd_probe1()
330 ei_status.stop_page = (dev->mem_end - dev->mem_start)/256; in wd_probe1()
331 ei_status.priv = dev->mem_end - dev->mem_start; in wd_probe1()
334 dev->mem_end = dev->mem_start + (ei_status.stop_page - WD_START_PG)*256; in wd_probe1()
335 ei_status.priv = (ei_status.stop_page - WD_START_PG)*256; in wd_probe1()
338 ei_status.mem = ioremap(dev->mem_start, ei_status.priv); in wd_probe1()
340 free_irq(dev->irq, dev); in wd_probe1()
341 return -ENOMEM; in wd_probe1()
344 pr_cont(" %s, IRQ %d, shared memory at %#lx-%#lx.\n", in wd_probe1()
345 model_name, dev->irq, dev->mem_start, dev->mem_end-1); in wd_probe1()
352 dev->netdev_ops = &wd_netdev_ops; in wd_probe1()
354 ei_local->msg_enable = wd_msg_enable; in wd_probe1()
357 /* Enable interrupt generation on softconfig cards -- M.U */ in wd_probe1()
358 /* .. but possibly potentially unsafe - Donald */ in wd_probe1()
365 free_irq(dev->irq, dev); in wd_probe1()
374 int ioaddr = dev->base_addr - WD_NIC_OFFSET; /* WD_CMDREG */ in wd_open()
378 ei_status.reg0 = ((dev->mem_start>>13) & 0x3f) | WD_MEMENB; in wd_open()
379 ei_status.reg5 = ((dev->mem_start>>19) & 0x1f) | NIC16; in wd_open()
391 int wd_cmd_port = dev->base_addr - WD_NIC_OFFSET; /* WD_CMDREG */ in wd_reset_8390()
400 outb((((dev->mem_start>>13) & 0x3f)|WD_MEMENB), wd_cmd_port); in wd_reset_8390()
402 outb(NIC16 | ((dev->mem_start>>19) & 0x1f), wd_cmd_port+WD_CMDREG5); in wd_reset_8390()
415 int wd_cmdreg = dev->base_addr - WD_NIC_OFFSET; /* WD_CMDREG */ in wd_get_8390_hdr()
416 void __iomem *hdr_start = ei_status.mem + ((ring_page - WD_START_PG)<<8); in wd_get_8390_hdr()
427 hdr->count = le16_to_cpu(hdr->count); in wd_get_8390_hdr()
436 switch between 8- and 16-bit modes. */
441 int wd_cmdreg = dev->base_addr - WD_NIC_OFFSET; /* WD_CMDREG */ in wd_block_input()
442 unsigned long offset = ring_offset - (WD_START_PG<<8); in wd_block_input()
447 int semi_count = ei_status.priv - offset; in wd_block_input()
448 memcpy_fromio(skb->data, xfer_start, semi_count); in wd_block_input()
449 count -= semi_count; in wd_block_input()
450 memcpy_fromio(skb->data + semi_count, ei_status.mem + TX_PAGES * 256, count); in wd_block_input()
452 /* Packet is in one chunk -- we can copy + cksum. */ in wd_block_input()
453 memcpy_fromio(skb->data, xfer_start, count); in wd_block_input()
456 /* Turn off 16 bit access so that reboot works. ISA brain-damage */ in wd_block_input()
465 int wd_cmdreg = dev->base_addr - WD_NIC_OFFSET; /* WD_CMDREG */ in wd_block_output()
466 void __iomem *shmem = ei_status.mem + ((start_page - WD_START_PG)<<8); in wd_block_output()
470 /* Turn on and off 16 bit access so that reboot works. */ in wd_block_output()
482 int wd_cmdreg = dev->base_addr - WD_NIC_OFFSET; /* WD_CMDREG */ in wd_close()
488 /* Change from 16-bit to 8-bit shared memory so reboot works. */ in wd_close()
517 MODULE_DESCRIPTION("ISA Western Digital wd8003/wd8013 ; SMC Elite, Elite16 ethernet driver");
536 dev->irq = irq[this_dev]; in wd_init_module()
537 dev->base_addr = io[this_dev]; in wd_init_module()
538 dev->mem_start = mem[this_dev]; in wd_init_module()
539 dev->mem_end = mem_end[this_dev]; in wd_init_module()
550 return -ENXIO; in wd_init_module()
556 free_irq(dev->irq, dev); in cleanup_card()
557 release_region(dev->base_addr - WD_NIC_OFFSET, WD_IO_EXTENT); in cleanup_card()