Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jul 2004 17:10:42 +0900
From:      Pyun YongHyeon <yongari@kt-is.co.kr>
To:        freebsd-sparc64@freebsd.org
Subject:   SBus/EBus auxio driver
Message-ID:  <20040712081042.GB656@kt-is.co.kr>

next in thread | raw e-mail | index | archive | help

--1UWUbFP1cBYEclgG
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello,

This is an auxio driver for SBus/EBus based sparc64 systems.
The driver controls front panel LED. By setting an OID
"machdep.auxio_led_blink" with sysctl(8), the LED is made to
blink based on system load average.

The driver is based on NetBSD's driver and modified to allow
changes of blinking setup dynamically. The driver was tested
on SBus Ultra2(SMP). It was not tested on EBus based sparc64
systems.(I don't have the H/W.)

If you have EBus based sparc64 system, please let me know success
or failure of the driver. Even though I don't have that hardware,
I'll do my best to fix it.

Driver URL:
http://www.kr.freebsd.org/~yongari/auxio.diff

Installation:
1. Get a diff file and patch your system.
   #fetch http://www.kr.freebsd.org/~yongari/auxio.diff
   #cd /usr/src
   #patch -p0 < /path/to/auxio.diff

2. Add 'device auxio' to your kernel configuration file if you
   prefer to use statically linked driver.

3. Build a new kernel/kernel modules and install.

4. Reboot or load kernel module with kldload(8).

Test:
#sysctl machdep.auxio_led_blink=1
LED blink rate is:
 full cycle every second if completely idle (loadav = 0)
 full cycle every 2 seconds if loadav = 1
 full cycle every 3 seconds if loadav = 2
 etc.

Thanks.

Regards,
Pyun YongHyeon
-- 
Pyun YongHyeon <http://www.kr.freebsd.org/~yongari>;

--1UWUbFP1cBYEclgG
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="auxio.diff"

--- sys/conf/files.orig	Wed Jun 30 23:52:49 2004
+++ sys/conf/files	Wed Jul  7 11:55:19 2004
@@ -362,6 +362,8 @@
 dev/ath/if_ath.c	optional ath
 dev/ath/if_ath_pci.c	optional ath pci
 dev/ath/if_ath_pci.c	optional ath card
+dev/auxio/auxio.c	optional auxio sbus
+dev/auxio/auxio.c	optional auxio ebus
 dev/awi/am79c930.c	optional awi
 dev/awi/awi.c		optional awi
 dev/awi/if_awi_pccard.c	optional awi card
--- /dev/null	Mon Jul 12 16:55:00 2004
+++ sys/dev/auxio/auxio.c	Mon Jul 12 16:58:12 2004
@@ -0,0 +1,469 @@
+/*-
+ * Copyright (c) 2004 Pyun YongHyeon <yongari@kt-is.co.kr>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+/*	$NetBSD: auxio.c,v 1.11 2003/07/15 03:36:04 lukem Exp $	*/
+
+/*
+ * Copyright (c) 2000, 2001 Matthew R. Green
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * AUXIO registers support on the sbus & ebus2, used for the floppy driver
+ * and to control the system LED, for the BLINK option.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/callout.h>
+#include <sys/endian.h>
+#include <sys/kernel.h>
+#include <sys/lock.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/resource.h>
+#include <sys/sysctl.h>
+
+#include <machine/bus.h>
+#include <dev/ofw/openfirm.h>
+#include <machine/ofw_machdep.h>
+#include <machine/resource.h>
+#include <sys/rman.h>
+#include <sparc64/sbus/sbusvar.h>
+#include <sparc64/ebus/ebusvar.h>
+
+#include <dev/auxio/auxioreg.h>
+
+/*
+ * on sun4u, auxio exists with one register (LED) on the sbus, and 5
+ * registers on the ebus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI
+ * OSCILLATOR, and TEMP SENSE.
+ */
+
+struct auxio_softc {
+	struct device		*sc_dev;
+
+	int			sc_rid_temp;
+	struct resource		*sc_res_temp;
+	bus_space_handle_t	sc_regh_temp;
+	bus_space_tag_t		sc_regt_temp;
+	int			sc_rid_scsi;
+	struct resource		*sc_res_scsi;
+	bus_space_handle_t	sc_regh_scsi;
+	bus_space_tag_t		sc_regt_scsi;
+	int			sc_rid_freq;
+	struct resource		*sc_res_freq;
+	bus_space_handle_t	sc_regh_freq;
+	bus_space_tag_t		sc_regt_freq;
+	int			sc_rid_pci;
+	struct resource		*sc_res_pci;
+	bus_space_handle_t	sc_regh_pci;
+	bus_space_tag_t		sc_regt_pci;
+	int			sc_rid_led;
+	struct resource		*sc_res_led;
+	bus_space_handle_t	sc_regh_led;
+	bus_space_tag_t		sc_regt_led;
+	u_int32_t		sc_led_stat;
+
+	int			sc_flags;
+#define	AUXIO_LEDONLY		0x1
+#define	AUXIO_EBUS		0x2
+#define	AUXIO_SBUS		0x4
+
+	struct callout		sc_ch;
+	struct mtx		sc_lock;
+};
+
+#define	AUXIO_ROM_NAME		"auxio"
+
+static void	auxio_attach_common(struct auxio_softc *);
+static int	auxio_sbus_probe(device_t);
+static int	auxio_sbus_attach(device_t);
+static int	auxio_sbus_detach(device_t);
+static void	auxio_sbus_free_resource(struct auxio_softc *);
+static int	auxio_ebus_probe(device_t);
+static int	auxio_ebus_attach(device_t);
+static int	auxio_ebus_detach(device_t);
+static void	auxio_ebus_free_resource(struct auxio_softc *);
+static void	auxio_blink(void *);
+static int	sysctl_auxio_led_blink(SYSCTL_HANDLER_ARGS);
+static __inline u_int32_t auxio_led_read(struct auxio_softc *);
+static __inline void auxio_led_write(struct auxio_softc *, u_int32_t);
+
+/* SBus */
+static device_method_t auxio_sbus_methods[] = {
+	DEVMETHOD(device_probe,		auxio_sbus_probe),
+	DEVMETHOD(device_attach,	auxio_sbus_attach),
+	DEVMETHOD(device_detach,	auxio_sbus_detach),
+	{0, 0}
+};
+
+static driver_t auxio_sbus_driver = {
+	"auxio",
+	auxio_sbus_methods,
+	sizeof(struct auxio_softc)
+};
+
+static devclass_t	auxio_devclass;
+DRIVER_MODULE(auxio, sbus, auxio_sbus_driver, auxio_devclass, 0, 0);
+
+/* EBus */
+static device_method_t auxio_ebus_methods[] = {
+	DEVMETHOD(device_probe,		auxio_ebus_probe),
+	DEVMETHOD(device_attach,	auxio_ebus_attach),
+	DEVMETHOD(device_detach,	auxio_ebus_detach),
+	{0, 0}
+};
+
+static driver_t auxio_ebus_driver = {
+	"auxio",
+	auxio_ebus_methods,
+	sizeof(struct auxio_softc)
+};
+
+/* not elegant solution :-( */
+static struct auxio_softc *auxio_sc;
+
+DRIVER_MODULE(auxio, ebus, auxio_ebus_driver, auxio_devclass, 0, 0);
+
+#define AUXIO_LOCK_INIT(sc)	\
+	mtx_init(&sc->sc_lock, "auxio mtx", NULL, MTX_DEF)
+#define AUXIO_LOCK(sc)		mtx_lock(&sc->sc_lock)
+#define AUXIO_UNLOCK(sc)	mtx_unlock(&sc->sc_lock)
+#define AUXIO_LOCK_DESTROY(sc)	mtx_destroy(&sc->sc_lock)
+
+/* 0 : no blink(default), 1 : blink depending on system loads */
+static int auxio_led_blink;
+SYSCTL_PROC(_machdep, OID_AUTO, auxio_led_blink, CTLTYPE_INT | CTLFLAG_RW,
+    &auxio_led_blink, 0, &sysctl_auxio_led_blink, "I",
+    "auxio led blink control");
+
+
+static __inline void
+auxio_led_write(struct auxio_softc *sc, u_int32_t v)
+{
+	if (sc->sc_flags & AUXIO_EBUS)
+		bus_space_write_4(sc->sc_regt_led, sc->sc_regh_led, 0,
+		    htole32(v));
+	else
+		bus_space_write_1(sc->sc_regt_led, sc->sc_regh_led, 0, v);
+}
+
+static __inline u_int32_t
+auxio_led_read(struct auxio_softc *sc)
+{
+	u_int32_t led;
+
+	if (sc->sc_flags & AUXIO_EBUS)
+		led = le32toh(bus_space_read_4(sc->sc_regt_led,
+		    sc->sc_regh_led, 0));
+	else
+		led = bus_space_read_1(sc->sc_regt_led, sc->sc_regh_led, 0);
+
+	return (led);
+}
+
+/*
+ * handler for machdep.auxio_led_blink
+ */
+static int
+sysctl_auxio_led_blink(SYSCTL_HANDLER_ARGS)
+{
+	int blink, error;
+
+	blink = auxio_led_blink;
+	error = sysctl_handle_int(oidp, &blink, 0, req);
+	if (error)
+		return (error);
+	/* force to boolean */
+	blink = blink ? 1 : 0;
+	if (blink == auxio_led_blink)
+		return (error);
+	auxio_led_blink = blink;
+	if (blink)
+		auxio_blink(auxio_sc);
+	else {
+		callout_stop(&auxio_sc->sc_ch);
+		AUXIO_LOCK(auxio_sc);
+		auxio_led_write(auxio_sc, auxio_sc->sc_led_stat);
+		AUXIO_UNLOCK(auxio_sc);
+	}
+
+	return (error);
+}
+
+static void
+auxio_blink(void *arg)
+{
+	struct auxio_softc *sc;
+	u_int32_t led;
+	int nticks;
+
+	sc = (struct auxio_softc *)arg;
+	AUXIO_LOCK(sc);
+	led = auxio_led_read(sc);
+	led ^= AUXIO_LED_LED;
+	auxio_led_write(sc, led);
+	AUXIO_UNLOCK(sc);
+
+	/*
+	 * Blink rate is:
+	 *	full cycle every second if completely idle (loadav = 0)
+	 *	full cycle every 2 seconds if loadav = 1
+	 *	full cycle every 3 seconds if loadav = 2
+	 * etc.
+	 */
+	nticks = (((averunnable.ldavg[0] + FSCALE) * hz) >> (FSHIFT + 1));
+	callout_reset(&sc->sc_ch, nticks, auxio_blink, sc);
+}
+
+static void
+auxio_attach_common(struct auxio_softc *sc)
+{
+	auxio_sc = sc; /* for sysctl reference */
+	callout_init(&sc->sc_ch, CALLOUT_MPSAFE);
+	AUXIO_LOCK(sc);
+	sc->sc_led_stat = auxio_led_read(sc);
+	AUXIO_UNLOCK(sc);
+	if (auxio_led_blink)
+		auxio_blink(sc);
+}
+
+static int
+auxio_ebus_probe(device_t dev)
+{
+	char *name;
+
+	name = ebus_get_name(dev);
+	if (strcmp(AUXIO_ROM_NAME, name) == 0) {
+		device_set_desc(dev, "Sun Auxiliary I/O");
+		return (0);
+	}
+
+	return (ENXIO);
+}
+
+static int
+auxio_ebus_attach(device_t dev)
+{
+	struct auxio_softc *sc;
+
+	sc = device_get_softc(dev);
+	bzero(sc, sizeof(*sc));
+	sc->sc_dev = dev;
+
+	AUXIO_LOCK_INIT(sc);
+	/* XXX Check for # of available I/O ports? */
+	sc->sc_rid_temp = 0;
+	if ((sc->sc_res_temp = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
+	    &sc->sc_rid_temp, RF_ACTIVE)) == NULL) {
+		device_printf(dev, "cannot map temp. port\n");
+		goto attach_fail;
+	}
+	sc->sc_regt_temp = rman_get_bustag(sc->sc_res_temp);
+	sc->sc_regh_temp = rman_get_bushandle(sc->sc_res_temp);
+
+	sc->sc_rid_scsi = 1;
+	if ((sc->sc_res_scsi = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
+	    &sc->sc_rid_scsi, RF_ACTIVE)) == NULL) {
+		device_printf(dev, "cannot map scsi port\n");
+		goto attach_fail;
+	}
+	sc->sc_regt_scsi = rman_get_bustag(sc->sc_res_scsi);
+	sc->sc_regh_scsi = rman_get_bushandle(sc->sc_res_scsi);
+
+	sc->sc_rid_freq = 2;
+	if ((sc->sc_res_freq = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
+	    &sc->sc_rid_freq, RF_ACTIVE)) == NULL) {
+		device_printf(dev, "cannot map freq. port\n");
+		goto attach_fail;
+	}
+	sc->sc_regt_freq = rman_get_bustag(sc->sc_res_freq);
+	sc->sc_regh_freq = rman_get_bushandle(sc->sc_res_freq);
+
+	sc->sc_rid_pci = 3;
+	if ((sc->sc_res_pci = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
+	    &sc->sc_rid_pci, RF_ACTIVE)) == NULL) {
+		device_printf(dev, "cannot map pci port\n");
+		goto attach_fail;
+	}
+	sc->sc_regt_pci = rman_get_bustag(sc->sc_res_pci);
+	sc->sc_regh_pci = rman_get_bushandle(sc->sc_res_pci);
+
+	sc->sc_rid_led = 4;
+	if ((sc->sc_res_led = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
+	    &sc->sc_rid_led, RF_ACTIVE)) == NULL) {
+		device_printf(dev, "cannot map led port\n");
+		goto attach_fail;
+	}
+	sc->sc_regt_led = rman_get_bustag(sc->sc_res_led);
+	sc->sc_regh_led = rman_get_bushandle(sc->sc_res_led);
+
+	/* ebus auxio has 5 I/O ports */
+	sc->sc_flags = AUXIO_EBUS;
+	auxio_attach_common(sc);
+
+	return (0);
+
+attach_fail:
+	auxio_ebus_free_resource(sc);
+
+	return (ENXIO);
+}
+
+static int
+auxio_ebus_detach(device_t dev)
+{
+	struct auxio_softc *sc;
+
+	sc = device_get_softc(dev);
+	callout_stop(&sc->sc_ch);
+	AUXIO_LOCK(sc);
+	auxio_led_write(sc, sc->sc_led_stat);
+	AUXIO_UNLOCK(sc);
+	auxio_ebus_free_resource(sc);
+
+	return (0);
+}
+
+static void
+auxio_ebus_free_resource(struct auxio_softc *sc)
+{
+	if (sc->sc_res_led)
+		bus_release_resource(sc->sc_dev, SYS_RES_IOPORT,
+		    sc->sc_rid_led, sc->sc_res_led);
+	if (sc->sc_res_pci)
+		bus_release_resource(sc->sc_dev, SYS_RES_IOPORT,
+		    sc->sc_rid_pci, sc->sc_res_pci);
+	if (sc->sc_res_freq)
+		bus_release_resource(sc->sc_dev, SYS_RES_IOPORT,
+		    sc->sc_rid_freq, sc->sc_res_freq);
+	if (sc->sc_res_scsi)
+		bus_release_resource(sc->sc_dev, SYS_RES_IOPORT,
+		    sc->sc_rid_scsi, sc->sc_res_scsi);
+	if (sc->sc_res_temp)
+		bus_release_resource(sc->sc_dev, SYS_RES_IOPORT,
+		    sc->sc_rid_temp, sc->sc_res_temp);
+	AUXIO_LOCK_DESTROY(sc);
+}
+
+static int
+auxio_sbus_probe(device_t dev)
+{
+	char *name;
+
+	name = sbus_get_name(dev);
+	if (strcmp(AUXIO_ROM_NAME, name) == 0) {
+		device_set_desc(dev, "Sun Auxiliary I/O");
+		return (0);
+	}
+
+	return (ENXIO);
+}
+
+
+static int
+auxio_sbus_attach(device_t dev)
+{
+	struct auxio_softc *sc;
+
+	sc = device_get_softc(dev);
+	bzero(sc, sizeof(*sc));
+	sc->sc_dev = dev;
+
+	AUXIO_LOCK_INIT(sc);
+	sc->sc_rid_led = 0;
+	if ((sc->sc_res_led = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+	    &sc->sc_rid_led, RF_ACTIVE)) == NULL) {
+		device_printf(dev, "cannot map led register\n");
+		goto attach_fail;
+	}
+	sc->sc_regt_led = rman_get_bustag(sc->sc_res_led);
+	sc->sc_regh_led = rman_get_bushandle(sc->sc_res_led);
+
+	/* sbus auxio only has one set of registers */
+	sc->sc_flags = AUXIO_LEDONLY | AUXIO_SBUS;
+	auxio_attach_common(sc);
+
+	return (0);
+
+attach_fail:
+	auxio_sbus_free_resource(sc);
+
+	return (ENXIO);
+}
+
+static void
+auxio_sbus_free_resource(struct auxio_softc *sc)
+{
+	if (sc->sc_res_led)
+		bus_release_resource(sc->sc_dev, SYS_RES_MEMORY,
+		    sc->sc_rid_led, sc->sc_res_led);
+	AUXIO_LOCK_DESTROY(sc);
+}
+
+static int
+auxio_sbus_detach(device_t dev)
+{
+	struct auxio_softc *sc;
+
+	sc = device_get_softc(dev);
+	callout_stop(&sc->sc_ch);
+	AUXIO_LOCK(sc);
+	auxio_led_write(sc, sc->sc_led_stat);
+	AUXIO_UNLOCK(sc);
+	auxio_sbus_free_resource(sc);
+
+	return (0);
+}
--- /dev/null	Wed Jul  7 12:44:00 2004
+++ sys/dev/auxio/auxioreg.h	Wed Jul  7 12:02:27 2004
@@ -0,0 +1,72 @@
+/*	$NetBSD: auxioreg.h,v 1.4 2001/10/22 07:31:41 mrg Exp $	*/
+
+/*
+ * Copyright (c) 2000 Matthew R. Green
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * The AUXIO registers; their offset in the Ebus2 address space, plus the
+ * bits for each register.  Note that the fdthree (FD), SUNW,CS4231 (AUDIO)
+ * and power (POWER) devices on the Ebus2 have their AUXIO regsiters mapped
+ * into their own "reg" properties, not the "auxio" device's "reg" properties.
+ */
+#define	AUXIO_FD			0x00720000
+#define	AUXIO_FD_DENSENSE_INPUT		0x0
+#define	AUXIO_FD_DENSENSE_OUTPUT	0x1
+
+#define	AUXIO_AUDIO			0x00722000
+#define	AUXIO_AUDIO_POWERDOWN		0x0
+
+#define	AUXIO_POWER			0x00724000
+#define	AUXIO_POWER_SYSTEM_OFF		0x0
+#define	AUXIO_POWER_COURTESY_OFF	0x1
+
+#define	AUXIO_LED			0x00726000
+#define	AUXIO_LED_LED			1
+
+#define	AUXIO_PCI			0x00728000
+#define	AUXIO_PCI_SLOT0			0x0	/* two bits each */
+#define	AUXIO_PCI_SLOT1			0x2
+#define	AUXIO_PCI_SLOT2			0x4
+#define	AUXIO_PCI_SLOT3			0x6
+#define	AUXIO_PCI_MODE			0x8
+
+#define	AUXIO_FREQ			0x0072a000
+#define	AUXIO_FREQ_FREQ0		0x0
+#define	AUXIO_FREQ_FREQ1		0x1
+#define	AUXIO_FREQ_FREQ2		0x2
+
+#define	AUXIO_SCSI			0x0072c000
+#define	AUXIO_SCSI_INT_OSC_EN		0x0
+#define	AUXIO_SCSI_EXT_OSC_EN		0x1
+
+#define	AUXIO_TEMP			0x0072f000
+#define	AUXIO_TEMP_SELECT		0x0
+#define	AUXIO_TEMP_CLOCK		0x1
+#define	AUXIO_TEMP_ENABLE		0x2
+#define	AUXIO_TEMP_DATAOUT		0x3
+#define	AUXIO_TEMP_DATAINT		0x4
--- sys/modules/Makefile.orig	Fri Jul  2 16:05:24 2004
+++ sys/modules/Makefile	Wed Jul  7 12:06:03 2004
@@ -27,6 +27,7 @@
 	ath \
 	${_ath_hal} \
 	aue \
+	${_auxio} \
 	${_awi} \
 	axe \
 	bfe \
@@ -418,6 +419,7 @@
 .endif
 
 .if ${MACHINE_ARCH} == "sparc64"
+_auxio=		auxio
 _gem=		gem
 _hme=		hme
 _sound=		sound
--- /dev/null	Mon Jul 12 14:11:00 2004
+++ sys/modules/auxio/Makefile	Wed Jul  7 12:07:10 2004
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../dev/auxio
+
+KMOD=	auxio
+
+SRCS=	auxio.c
+SRCS+=  device_if.h bus_if.h
+
+.include <bsd.kmod.mk>

--1UWUbFP1cBYEclgG--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040712081042.GB656>