Deleted Added
full compact
obio.c (182901) obio.c (202035)
1/* $NetBSD: obio.c,v 1.11 2003/07/15 00:25:05 lukem Exp $ */
2
3/*-
4 * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc.
5 * All rights reserved.
6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 *

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

36 */
37
38/*
39 * On-board device autoconfiguration support for Intel IQ80321
40 * evaluation boards.
41 */
42
43#include <sys/cdefs.h>
1/* $NetBSD: obio.c,v 1.11 2003/07/15 00:25:05 lukem Exp $ */
2
3/*-
4 * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc.
5 * All rights reserved.
6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 *

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

36 */
37
38/*
39 * On-board device autoconfiguration support for Intel IQ80321
40 * evaluation boards.
41 */
42
43#include <sys/cdefs.h>
44__FBSDID("$FreeBSD: head/sys/mips/malta/obio.c 182901 2008-09-10 03:49:08Z gonzo $");
44__FBSDID("$FreeBSD: head/sys/mips/malta/obio.c 202035 2010-01-10 20:06:14Z imp $");
45
46#include <sys/param.h>
47#include <sys/systm.h>
48#include <sys/bus.h>
49#include <sys/kernel.h>
50#include <sys/module.h>
51#include <sys/rman.h>
52#include <sys/malloc.h>

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

58
59int obio_probe(device_t);
60int obio_attach(device_t);
61
62/*
63 * A bit tricky and hackish. Since we need OBIO to rely
64 * on PCI we make it pseudo-pci device. But there should
65 * be only one such device, so we use this static flag
45
46#include <sys/param.h>
47#include <sys/systm.h>
48#include <sys/bus.h>
49#include <sys/kernel.h>
50#include <sys/module.h>
51#include <sys/rman.h>
52#include <sys/malloc.h>

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

58
59int obio_probe(device_t);
60int obio_attach(device_t);
61
62/*
63 * A bit tricky and hackish. Since we need OBIO to rely
64 * on PCI we make it pseudo-pci device. But there should
65 * be only one such device, so we use this static flag
66 * to prevent false positives on every realPCI device probe.
66 * to prevent false positives on every real PCI device probe.
67 */
68static int have_one = 0;
69
70int
71obio_probe(device_t dev)
72{
67 */
68static int have_one = 0;
69
70int
71obio_probe(device_t dev)
72{
73 if(!have_one)
74 {
73 if (!have_one) {
75 have_one = 1;
76 return 0;
77 }
74 have_one = 1;
75 return 0;
76 }
78 else
79 return (ENXIO);
77 return (ENXIO);
80}
81
82int
83obio_attach(device_t dev)
84{
85 struct obio_softc *sc = device_get_softc(dev);
86
78}
79
80int
81obio_attach(device_t dev)
82{
83 struct obio_softc *sc = device_get_softc(dev);
84
87 sc->oba_st = MIPS_BUS_SPACE_IO;
85 sc->oba_st = mips_bus_space_generic;
88 sc->oba_addr = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR);
89 sc->oba_size = MALTA_PCIMEM3_SIZE;
90 sc->oba_rman.rm_type = RMAN_ARRAY;
91 sc->oba_rman.rm_descr = "OBIO I/O";
92 if (rman_init(&sc->oba_rman) != 0 ||
93 rman_manage_region(&sc->oba_rman,
94 sc->oba_addr, sc->oba_addr + sc->oba_size) != 0)
95 panic("obio_attach: failed to set up I/O rman");

--- 90 unchanged lines hidden ---
86 sc->oba_addr = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR);
87 sc->oba_size = MALTA_PCIMEM3_SIZE;
88 sc->oba_rman.rm_type = RMAN_ARRAY;
89 sc->oba_rman.rm_descr = "OBIO I/O";
90 if (rman_init(&sc->oba_rman) != 0 ||
91 rman_manage_region(&sc->oba_rman,
92 sc->oba_addr, sc->oba_addr + sc->oba_size) != 0)
93 panic("obio_attach: failed to set up I/O rman");

--- 90 unchanged lines hidden ---