Deleted Added
full compact
cy_isa.c (128800) cy_isa.c (128804)
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
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
31#include <sys/cdefs.h>
35#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/cy/cy_isa.c 128800 2004-05-01 18:09:16Z bde $");
36__FBSDID("$FreeBSD: head/sys/dev/cy/cy_isa.c 128804 2004-05-01 18:42:14Z bde $");
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/bus.h>
37#include <sys/kernel.h>
38
39#include <machine/bus.h>
40#include <sys/rman.h>
41#include <machine/resource.h>
42
43#include <isa/isavar.h>
44
45#include <dev/cy/cyreg.h>
46#include <dev/cy/cyvar.h>
47
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
48static int cy_isa_attach(device_t dev);
49static int cy_isa_probe(device_t dev);
52static int cy_isa_attach(device_t dev);
53static int cy_isa_probe(device_t dev);
50
51static device_method_t cy_isa_methods[] = {
52 /* Device interface. */
53 DEVMETHOD(device_probe, cy_isa_probe),
54 DEVMETHOD(device_attach, cy_isa_attach),
55
56 { 0, 0 }
57};

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

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

--- 48 unchanged lines hidden ---
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 ---