Deleted Added
full compact
digi_isa.c (272904) digi_isa.c (296137)
1/*-
2 * Copyright (c) 2001 Brian Somers <brian@Awfulhak.org>
3 * based on work by Slawa Olhovchenkov
4 * John Prince <johnp@knight-trosoft.com>
5 * Eric Hernes
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001 Brian Somers <brian@Awfulhak.org>
3 * based on work by Slawa Olhovchenkov
4 * John Prince <johnp@knight-trosoft.com>
5 * Eric Hernes
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/digi/digi_isa.c 272904 2014-10-10 19:12:04Z jhb $");
32__FBSDID("$FreeBSD: head/sys/dev/digi/digi_isa.c 296137 2016-02-27 03:38:01Z jhibbits $");
33
34/*-
35 * TODO:
36 * Figure out how to make the non-Xi boards use memory addresses other
37 * than 0xd0000 !!!
38 */
39
40#include <sys/param.h>

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

272 }
273 sc->vmem = (u_char *)sc->pmem;
274
275 DLOG(DIGIDB_INIT, (sc->dev, "isa? port 0x%03x mem 0x%lx\n",
276 sc->port, sc->pmem));
277
278 /* Temporarily map our io ports */
279 sc->res.iorid = 0;
33
34/*-
35 * TODO:
36 * Figure out how to make the non-Xi boards use memory addresses other
37 * than 0xd0000 !!!
38 */
39
40#include <sys/param.h>

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

272 }
273 sc->vmem = (u_char *)sc->pmem;
274
275 DLOG(DIGIDB_INIT, (sc->dev, "isa? port 0x%03x mem 0x%lx\n",
276 sc->port, sc->pmem));
277
278 /* Temporarily map our io ports */
279 sc->res.iorid = 0;
280 sc->res.io = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->res.iorid,
281 0ul, ~0ul, IO_SIZE, RF_ACTIVE);
280 sc->res.io = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT,
281 &sc->res.iorid, IO_SIZE, RF_ACTIVE);
282 if (sc->res.io == NULL)
283 return (ENXIO);
284
285 /* Check the type of card and get internal memory characteristics */
286 if (!digi_isa_check(sc)) {
287 bus_release_resource(dev, SYS_RES_IOPORT, sc->res.iorid,
288 sc->res.io);
289 return (ENXIO);
290 }
291
292 /* Temporarily map our memory */
293 sc->res.mrid = 0;
282 if (sc->res.io == NULL)
283 return (ENXIO);
284
285 /* Check the type of card and get internal memory characteristics */
286 if (!digi_isa_check(sc)) {
287 bus_release_resource(dev, SYS_RES_IOPORT, sc->res.iorid,
288 sc->res.io);
289 return (ENXIO);
290 }
291
292 /* Temporarily map our memory */
293 sc->res.mrid = 0;
294 sc->res.mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->res.mrid,
295 0ul, ~0ul, sc->win_size, 0);
294 sc->res.mem = bus_alloc_resource_anywhere(dev, SYS_RES_MEMORY,
295 &sc->res.mrid, sc->win_size, 0);
296 if (sc->res.mem == NULL) {
297 device_printf(dev, "0x%lx: Memory range is in use\n", sc->pmem);
298 bus_release_resource(dev, SYS_RES_IOPORT, sc->res.iorid,
299 sc->res.io);
300 return (ENXIO);
301 }
302
303 outb(sc->port, FEPCLR); /* drop RESET */

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

337
338 bus_get_resource(dev, SYS_RES_IOPORT, 0, &scport, &iosize);
339 bus_get_resource(dev, SYS_RES_MEMORY, 0, &sc->pmem, &msize);
340 sc->port = scport;
341 /* sc->altpin = !!(device_get_flags(dev) & DGBFLAG_ALTPIN); */
342
343 /* Allocate resources (verified in digi_isa_probe()) */
344 sc->res.iorid = 0;
296 if (sc->res.mem == NULL) {
297 device_printf(dev, "0x%lx: Memory range is in use\n", sc->pmem);
298 bus_release_resource(dev, SYS_RES_IOPORT, sc->res.iorid,
299 sc->res.io);
300 return (ENXIO);
301 }
302
303 outb(sc->port, FEPCLR); /* drop RESET */

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

337
338 bus_get_resource(dev, SYS_RES_IOPORT, 0, &scport, &iosize);
339 bus_get_resource(dev, SYS_RES_MEMORY, 0, &sc->pmem, &msize);
340 sc->port = scport;
341 /* sc->altpin = !!(device_get_flags(dev) & DGBFLAG_ALTPIN); */
342
343 /* Allocate resources (verified in digi_isa_probe()) */
344 sc->res.iorid = 0;
345 sc->res.io = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->res.iorid,
346 0ul, ~0ul, iosize, RF_ACTIVE);
345 sc->res.io = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT,
346 &sc->res.iorid, iosize, RF_ACTIVE);
347 if (sc->res.io == NULL)
348 return (ENXIO);
349
350 /* Check the type of card and get internal memory characteristics */
351 DLOG(DIGIDB_INIT, (sc->dev, "Checking card type\n"));
352 if (!digi_isa_check(sc))
353 goto failed;
354
355 callout_handle_init(&sc->callout);
356 callout_handle_init(&sc->inttest);
357
358 sc->res.mrid = 0;
347 if (sc->res.io == NULL)
348 return (ENXIO);
349
350 /* Check the type of card and get internal memory characteristics */
351 DLOG(DIGIDB_INIT, (sc->dev, "Checking card type\n"));
352 if (!digi_isa_check(sc))
353 goto failed;
354
355 callout_handle_init(&sc->callout);
356 callout_handle_init(&sc->inttest);
357
358 sc->res.mrid = 0;
359 sc->res.mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->res.mrid,
360 0ul, ~0ul, msize, RF_ACTIVE);
359 sc->res.mem = bus_alloc_resource_anywhere(dev, SYS_RES_MEMORY,
360 &sc->res.mrid, msize, RF_ACTIVE);
361 if (sc->res.mem == NULL) {
362 device_printf(dev, "0x%lx: Memory range is in use\n", sc->pmem);
363 sc->hidewin(sc);
364 goto failed;
365 }
366
367 /* map memory */
368 sc->vmem = pmap_mapdev(sc->pmem, msize);

--- 106 unchanged lines hidden ---
361 if (sc->res.mem == NULL) {
362 device_printf(dev, "0x%lx: Memory range is in use\n", sc->pmem);
363 sc->hidewin(sc);
364 goto failed;
365 }
366
367 /* map memory */
368 sc->vmem = pmap_mapdev(sc->pmem, msize);

--- 106 unchanged lines hidden ---