Deleted Added
sdiff udiff text old ( 128800 ) new ( 128804 )
full compact
1/*-
2 * cyclades cyclom-y serial driver
3 * Andrew Herbert <andrew@werple.apana.org.au>, 17 August 1993
4 *
5 * Copyright (c) 1993 Andrew Herbert.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/*
32 * Cyclades Y ISA serial interface driver
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/dev/cy/cy_isa.c 128804 2004-05-01 18:42:14Z bde $");
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/bus.h>
41#include <sys/kernel.h>
42
43#include <machine/bus.h>
44#include <sys/rman.h>
45#include <machine/resource.h>
46
47#include <isa/isavar.h>
48
49#include <dev/cy/cyreg.h>
50#include <dev/cy/cyvar.h>
51
52static int cy_isa_attach(device_t dev);
53static int cy_isa_probe(device_t dev);
54
55static device_method_t cy_isa_methods[] = {
56 /* Device interface. */
57 DEVMETHOD(device_probe, cy_isa_probe),
58 DEVMETHOD(device_attach, cy_isa_attach),
59
60 { 0, 0 }
61};

--- 22 unchanged lines hidden (view full) ---

84 if (mem_res == NULL) {
85 device_printf(dev, "ioport resource allocation failed\n");
86 return (ENXIO);
87 }
88 iobase = rman_get_virtual(mem_res);
89
90 /* Cyclom-16Y hardware reset (Cyclom-8Ys don't care) */
91 cy_inb(iobase, CY16_RESET, 0); /* XXX? */
92 DELAY(500); /* wait for the board to get its act together */
93
94 /* this is needed to get the board out of reset */
95 cy_outb(iobase, CY_CLEAR_INTR, 0, 0);
96 DELAY(500);
97
98 bus_release_resource(dev, SYS_RES_MEMORY, mem_rid, mem_res);
99 return (cy_units(iobase, 0) == 0 ? ENXIO : 0);
100}

--- 48 unchanged lines hidden ---