xref: /freebsd/sys/isa/syscons_isa.c (revision f7f2df54bbae7a2203b56b6a2f248db3e2451110)
18a997770SDoug Rabson /*-
28a997770SDoug Rabson  * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
38a997770SDoug Rabson  * All rights reserved.
48a997770SDoug Rabson  *
58a997770SDoug Rabson  * Redistribution and use in source and binary forms, with or without
68a997770SDoug Rabson  * modification, are permitted provided that the following conditions
78a997770SDoug Rabson  * are met:
88a997770SDoug Rabson  * 1. Redistributions of source code must retain the above copyright
98a997770SDoug Rabson  *    notice, this list of conditions and the following disclaimer as
108a997770SDoug Rabson  *    the first lines of this file unmodified.
118a997770SDoug Rabson  * 2. Redistributions in binary form must reproduce the above copyright
128a997770SDoug Rabson  *    notice, this list of conditions and the following disclaimer in the
138a997770SDoug Rabson  *    documentation and/or other materials provided with the distribution.
148a997770SDoug Rabson  *
158a997770SDoug Rabson  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
168a997770SDoug Rabson  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
178a997770SDoug Rabson  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
188a997770SDoug Rabson  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
198a997770SDoug Rabson  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
208a997770SDoug Rabson  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
218a997770SDoug Rabson  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
228a997770SDoug Rabson  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
238a997770SDoug Rabson  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
248a997770SDoug Rabson  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
258a997770SDoug Rabson  *
26f7f2df54SDoug Rabson  * $Id: syscons_isa.c,v 1.3 1999/05/08 21:59:31 dfr Exp $
278a997770SDoug Rabson  */
288a997770SDoug Rabson 
298a997770SDoug Rabson #include "sc.h"
308a997770SDoug Rabson #include "opt_syscons.h"
318a997770SDoug Rabson 
328a997770SDoug Rabson #if NSC > 0
338a997770SDoug Rabson 
348a997770SDoug Rabson #include <sys/param.h>
358a997770SDoug Rabson #include <sys/systm.h>
368a997770SDoug Rabson #include <sys/kernel.h>
378a997770SDoug Rabson #include <sys/module.h>
388a997770SDoug Rabson #include <sys/bus.h>
398a997770SDoug Rabson 
408a997770SDoug Rabson #include <machine/console.h>
416182fdbdSPeter Wemm #ifdef __i386__
426182fdbdSPeter Wemm #include <machine/apm_bios.h>
436182fdbdSPeter Wemm #endif
448a997770SDoug Rabson 
458a997770SDoug Rabson #include <dev/syscons/syscons.h>
468a997770SDoug Rabson 
478a997770SDoug Rabson #include <isa/isareg.h>
488a997770SDoug Rabson #include <isa/isavar.h>
498a997770SDoug Rabson 
508a997770SDoug Rabson devclass_t	sc_devclass;
518a997770SDoug Rabson 
528a997770SDoug Rabson static int	scprobe(device_t dev);
538a997770SDoug Rabson static int	scattach(device_t dev);
548a997770SDoug Rabson 
558a997770SDoug Rabson static device_method_t sc_methods[] = {
568a997770SDoug Rabson 	DEVMETHOD(device_probe,         scprobe),
578a997770SDoug Rabson 	DEVMETHOD(device_attach,        scattach),
588a997770SDoug Rabson 	{ 0, 0 }
598a997770SDoug Rabson };
608a997770SDoug Rabson 
618a997770SDoug Rabson static driver_t sc_driver = {
628a997770SDoug Rabson 	"sc",
638a997770SDoug Rabson 	sc_methods,
648a997770SDoug Rabson 	1,                          /* XXX */
658a997770SDoug Rabson };
668a997770SDoug Rabson 
678a997770SDoug Rabson static int
688a997770SDoug Rabson scprobe(device_t dev)
698a997770SDoug Rabson {
70f7f2df54SDoug Rabson 	/* No pnp support */
71f7f2df54SDoug Rabson 	if (isa_get_vendorid(dev))
72f7f2df54SDoug Rabson 		return (ENXIO);
73f7f2df54SDoug Rabson 
748a997770SDoug Rabson 	device_set_desc(dev, "System console");
758a997770SDoug Rabson 	return sc_probe_unit(device_get_unit(dev), isa_get_flags(dev));
768a997770SDoug Rabson }
778a997770SDoug Rabson 
788a997770SDoug Rabson static int
798a997770SDoug Rabson scattach(device_t dev)
808a997770SDoug Rabson {
818a997770SDoug Rabson 	return sc_attach_unit(device_get_unit(dev), isa_get_flags(dev));
828a997770SDoug Rabson }
838a997770SDoug Rabson 
848a997770SDoug Rabson DRIVER_MODULE(sc, isa, sc_driver, sc_devclass, 0, 0);
858a997770SDoug Rabson 
868a997770SDoug Rabson #endif /* NSC > 0 */
87