summaryrefslogtreecommitdiff
path: root/sys/arch/hppa/dev
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-12-18 23:52:46 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-12-18 23:52:46 +0000
commitfc877ee58f6d572a9d70bda817ee14104bfc83f6 (patch)
tree642c23942ed1feb3ae61f2fb1393da1adcf0592e /sys/arch/hppa/dev
parentd39e07d3103f88f7d4e66509e3a5d4db23f6afe8 (diff)
newer machines use phantom bus to attach lasi and other bus adapters.
oledr machines did not have a real device for the phantom bus port. change the device scanning technique to both include a full device path in the attach_args and do proper shifting in the pdc_scanbus() and add a device for the newer machines as well as use a newer device mapping (path to hpa) available on newer firmware versions, where old (hversion-dependant) is not available. tested on 712,715/33,c110, miod@ ok, weissmandude -- testing
Diffstat (limited to 'sys/arch/hppa/dev')
-rw-r--r--sys/arch/hppa/dev/asp.c9
-rw-r--r--sys/arch/hppa/dev/lasi.c47
-rw-r--r--sys/arch/hppa/dev/phantomas.c83
3 files changed, 133 insertions, 6 deletions
diff --git a/sys/arch/hppa/dev/asp.c b/sys/arch/hppa/dev/asp.c
index 66ee0028a67..40c5ac92f91 100644
--- a/sys/arch/hppa/dev/asp.c
+++ b/sys/arch/hppa/dev/asp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asp.c,v 1.8 2002/12/17 21:54:20 mickey Exp $ */
+/* $OpenBSD: asp.c,v 1.9 2002/12/18 23:52:45 mickey Exp $ */
/*
* Copyright (c) 1998-2002 Michael Shalayeff
@@ -201,6 +201,13 @@ aspattach(parent, self, aux)
sc->sc_ic.gsc_base = sc->sc_trs;
ga.ga_ca = *ca; /* clone from us */
+ ga.ga_dp.dp_bc[0] = ga.ga_dp.dp_bc[1];
+ ga.ga_dp.dp_bc[1] = ga.ga_dp.dp_bc[2];
+ ga.ga_dp.dp_bc[2] = ga.ga_dp.dp_bc[3];
+ ga.ga_dp.dp_bc[3] = ga.ga_dp.dp_bc[4];
+ ga.ga_dp.dp_bc[4] = ga.ga_dp.dp_bc[5];
+ ga.ga_dp.dp_bc[5] = ga.ga_dp.dp_mod;
+ ga.ga_dp.dp_mod = 0;
ga.ga_hpamask = ASP_IOMASK;
ga.ga_name = "gsc";
ga.ga_ic = &sc->sc_ic;
diff --git a/sys/arch/hppa/dev/lasi.c b/sys/arch/hppa/dev/lasi.c
index f0614519c95..dd7ebcc80c5 100644
--- a/sys/arch/hppa/dev/lasi.c
+++ b/sys/arch/hppa/dev/lasi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lasi.c,v 1.10 2002/12/17 21:54:20 mickey Exp $ */
+/* $OpenBSD: lasi.c,v 1.11 2002/12/18 23:52:45 mickey Exp $ */
/*
* Copyright (c) 1998-2002 Michael Shalayeff
@@ -69,6 +69,7 @@ struct lasi_trs {
struct lasi_softc {
struct device sc_dev;
struct gscbus_ic sc_ic;
+ int sc_phantomassed;
struct lasi_hwr volatile *sc_hw;
struct lasi_trs volatile *sc_trs;
@@ -77,10 +78,16 @@ struct lasi_softc {
int lasimatch(struct device *, void *, void *);
void lasiattach(struct device *, struct device *, void *);
+void lasi_mainbus_attach(struct device *, struct device *, void *);
+void lasi_phantomas_attach(struct device *, struct device *, void *);
void lasi_gsc_attach(struct device *);
-struct cfattach lasi_ca = {
- sizeof(struct lasi_softc), lasimatch, lasiattach
+struct cfattach lasi_mainbus_ca = {
+ sizeof(struct lasi_softc), lasimatch, lasi_mainbus_attach
+};
+
+struct cfattach lasi_phantomas_ca = {
+ sizeof(struct lasi_softc), lasimatch, lasi_phantomas_attach
};
struct cfdriver lasi_cd = {
@@ -106,13 +113,34 @@ lasimatch(parent, cfdata, aux)
}
void
+lasi_mainbus_attach(parent, self, aux)
+ struct device *parent;
+ struct device *self;
+ void *aux;
+{
+ lasiattach(parent, self, aux);
+}
+
+void
+lasi_phantomas_attach(parent, self, aux)
+ struct device *parent;
+ struct device *self;
+ void *aux;
+{
+ struct lasi_softc *sc = (struct lasi_softc *)self;
+
+ sc->sc_phantomassed = 1;
+ lasiattach(parent, self, aux);
+}
+
+void
lasiattach(parent, self, aux)
struct device *parent;
struct device *self;
void *aux;
{
- register struct confargs *ca = aux;
- register struct lasi_softc *sc = (struct lasi_softc *)self;
+ struct lasi_softc *sc = (struct lasi_softc *)self;
+ struct confargs *ca = aux;
bus_space_handle_t ioh;
int s, in;
@@ -146,6 +174,15 @@ lasiattach(parent, self, aux)
sc->sc_ic.gsc_base = sc->sc_trs;
sc->ga.ga_ca = *ca; /* clone from us */
+ if (!sc->sc_phantomassed) {
+ sc->ga.ga_dp.dp_bc[0] = sc->ga.ga_dp.dp_bc[1];
+ sc->ga.ga_dp.dp_bc[1] = sc->ga.ga_dp.dp_bc[2];
+ sc->ga.ga_dp.dp_bc[2] = sc->ga.ga_dp.dp_bc[3];
+ sc->ga.ga_dp.dp_bc[3] = sc->ga.ga_dp.dp_bc[4];
+ sc->ga.ga_dp.dp_bc[4] = sc->ga.ga_dp.dp_bc[5];
+ sc->ga.ga_dp.dp_bc[5] = sc->ga.ga_dp.dp_mod;
+ sc->ga.ga_dp.dp_mod = 0;
+ }
if (sc->sc_dev.dv_unit)
config_defer(self, lasi_gsc_attach);
else {
diff --git a/sys/arch/hppa/dev/phantomas.c b/sys/arch/hppa/dev/phantomas.c
new file mode 100644
index 00000000000..e5d6b171863
--- /dev/null
+++ b/sys/arch/hppa/dev/phantomas.c
@@ -0,0 +1,83 @@
+/* $OpenBSD: phantomas.c,v 1.1 2002/12/18 23:52:45 mickey Exp $ */
+
+/*
+ * Copyright (c) 2002 Michael Shalayeff
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Michael Shalayeff.
+ * 4. 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 OR HIS RELATIVES 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 MIND, 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.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+
+#include <machine/pdc.h>
+#include <machine/iomod.h>
+#include <machine/autoconf.h>
+
+#include <hppa/dev/cpudevs.h>
+
+struct cfdriver phantomas_cd = {
+ NULL, "phantomas", DV_DULL
+};
+
+struct phantomas_softc {
+ struct device sc_dev;
+
+};
+
+int phantomasmatch(struct device *, void *, void *);
+void phantomasattach(struct device *, struct device *, void *);
+
+struct cfattach phantomas_ca = {
+ sizeof(struct phantomas_softc), phantomasmatch, phantomasattach
+};
+
+int
+phantomasmatch(struct device *parent, void *cfdata, void *aux)
+{
+ struct confargs *ca = aux;
+
+ if (ca->ca_type.iodc_type != HPPA_TYPE_BCPORT ||
+ ca->ca_type.iodc_sv_model != HPPA_BCPORT_PHANTOM)
+ return (0);
+
+ return (1);
+}
+
+void
+phantomasattach(struct device *parent, struct device *self, void *aux)
+{
+ struct confargs *ca = aux, nca;
+
+ printf("\n");
+
+ nca = *ca;
+ nca.ca_name = "phantomas";
+ nca.ca_hpamask = HPPA_IOSPACE;
+ pdc_scanbus(self, &nca, MAXMODBUS);
+}