From 4b120723e435c3a790d9d9d5bf574cf2dc30f5d7 Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Wed, 15 Sep 2004 20:11:30 +0000 Subject: scan cpu bus manually for some machines do not support that in prom --- sys/arch/hppa/dev/dino.c | 4 ++-- sys/arch/hppa/dev/lasi.c | 38 +++++--------------------------------- sys/arch/hppa/dev/phantomas.c | 5 ++--- sys/arch/hppa/dev/sti_sgc.c | 9 ++------- sys/arch/hppa/dev/wax.c | 18 ++++++++++-------- sys/arch/hppa/gsc/gscbus.c | 4 ++-- sys/arch/hppa/hppa/autoconf.c | 12 +++++++++--- sys/arch/hppa/hppa/mainbus.c | 31 ++++++++++++++++++++++++++++--- sys/arch/hppa/include/autoconf.h | 4 ++-- 9 files changed, 62 insertions(+), 63 deletions(-) diff --git a/sys/arch/hppa/dev/dino.c b/sys/arch/hppa/dev/dino.c index a8380a5a376..17adf54468c 100644 --- a/sys/arch/hppa/dev/dino.c +++ b/sys/arch/hppa/dev/dino.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dino.c,v 1.12 2004/08/29 00:26:12 mickey Exp $ */ +/* $OpenBSD: dino.c,v 1.13 2004/09/15 20:11:28 mickey Exp $ */ /* * Copyright (c) 2003 Michael Shalayeff @@ -1595,7 +1595,7 @@ dinoattach(parent, self, aux) /* scan for ps2 kbd/ms, serial, and flying toasters */ ca->ca_hpamask = -1; - pdc_scanbus(self, ca, MAXMODBUS); + pdc_scanbus(self, ca, MAXMODBUS, 0); pba.pba_busname = "pci"; pba.pba_iot = &sc->sc_iot; diff --git a/sys/arch/hppa/dev/lasi.c b/sys/arch/hppa/dev/lasi.c index 54129fef191..9ed7240e541 100644 --- a/sys/arch/hppa/dev/lasi.c +++ b/sys/arch/hppa/dev/lasi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lasi.c,v 1.21 2004/09/15 01:10:06 mickey Exp $ */ +/* $OpenBSD: lasi.c,v 1.22 2004/09/15 20:11:28 mickey Exp $ */ /* * Copyright (c) 1998-2003 Michael Shalayeff @@ -65,7 +65,6 @@ 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; @@ -74,16 +73,9 @@ 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_mainbus_ca = { - sizeof(struct lasi_softc), lasimatch, lasi_mainbus_attach -}; - -struct cfattach lasi_phantomas_ca = { - sizeof(struct lasi_softc), lasimatch, lasi_phantomas_attach +struct cfattach lasi_ca = { + sizeof(struct lasi_softc), lasimatch, lasiattach }; struct cfdriver lasi_cd = { @@ -91,6 +83,7 @@ struct cfdriver lasi_cd = { }; void lasi_cold_hook(int on); +void lasi_gsc_attach(struct device *self); int lasimatch(parent, cfdata, aux) @@ -108,27 +101,6 @@ lasimatch(parent, cfdata, aux) return 1; } -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; @@ -222,7 +194,7 @@ lasiattach(parent, self, aux) #endif sc->ga.ga_ca = *ca; /* clone from us */ - if (!sc->sc_phantomassed) { + if (!strcmp(parent->dv_xname, "mainbus0")) { 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]; diff --git a/sys/arch/hppa/dev/phantomas.c b/sys/arch/hppa/dev/phantomas.c index f162b9e0627..532e564c90d 100644 --- a/sys/arch/hppa/dev/phantomas.c +++ b/sys/arch/hppa/dev/phantomas.c @@ -1,4 +1,4 @@ -/* $OpenBSD: phantomas.c,v 1.2 2004/04/07 18:24:19 mickey Exp $ */ +/* $OpenBSD: phantomas.c,v 1.3 2004/09/15 20:11:28 mickey Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -72,7 +72,6 @@ phantomasattach(struct device *parent, struct device *self, void *aux) printf("\n"); nca = *ca; - nca.ca_name = "phantomas"; nca.ca_hpamask = HPPA_IOSPACE; - pdc_scanbus(self, &nca, MAXMODBUS); + pdc_scanbus(self, &nca, MAXMODBUS, 0); } diff --git a/sys/arch/hppa/dev/sti_sgc.c b/sys/arch/hppa/dev/sti_sgc.c index 087ce77a2e9..99e955e6d29 100644 --- a/sys/arch/hppa/dev/sti_sgc.c +++ b/sys/arch/hppa/dev/sti_sgc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sti_sgc.c,v 1.23 2004/08/30 18:37:45 mickey Exp $ */ +/* $OpenBSD: sti_sgc.c,v 1.24 2004/09/15 20:11:28 mickey Exp $ */ /* * Copyright (c) 2000-2003 Michael Shalayeff @@ -68,11 +68,7 @@ extern struct cfdriver sti_cd; int sti_sgc_probe(struct device *, void *, void *); void sti_sgc_attach(struct device *, struct device *, void *); -struct cfattach sti_sgc_ca = { - sizeof(struct sti_softc), sti_sgc_probe, sti_sgc_attach -}; - -struct cfattach sti_phantom_ca = { +struct cfattach sti_gedoens_ca = { sizeof(struct sti_softc), sti_sgc_probe, sti_sgc_attach }; @@ -232,7 +228,6 @@ sti_sgc_attach(parent, self, aux) if (cpu_type == hpcxl2) eaio_l2(0x8 >> (((ca->ca_hpa >> 25) & 3) - 2)); - sc->sc_devtype = bus_space_read_1(sc->iot, sc->romh, 3); if (ca->ca_hpa == (hppa_hpa_t)PAGE0->mem_cons.pz_hpa) sc->sc_flags |= STI_CONSOLE; sti_attach_common(sc); diff --git a/sys/arch/hppa/dev/wax.c b/sys/arch/hppa/dev/wax.c index a465fbebfbb..24f24830bf7 100644 --- a/sys/arch/hppa/dev/wax.c +++ b/sys/arch/hppa/dev/wax.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wax.c,v 1.7 2004/04/07 18:24:19 mickey Exp $ */ +/* $OpenBSD: wax.c,v 1.8 2004/09/15 20:11:28 mickey Exp $ */ /* * Copyright (c) 1998-2003 Michael Shalayeff @@ -121,13 +121,15 @@ waxattach(parent, self, aux) sc->sc_ic.gsc_base = sc->sc_regs; 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; + if (!strcmp(parent->dv_xname, "mainbus0")) { + 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_name = "gsc"; ga.ga_hpamask = WAX_IOMASK; diff --git a/sys/arch/hppa/gsc/gscbus.c b/sys/arch/hppa/gsc/gscbus.c index 36801af6a77..3ee8f0a2cca 100644 --- a/sys/arch/hppa/gsc/gscbus.c +++ b/sys/arch/hppa/gsc/gscbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gscbus.c,v 1.25 2004/04/07 18:24:19 mickey Exp $ */ +/* $OpenBSD: gscbus.c,v 1.26 2004/09/15 20:11:29 mickey Exp $ */ /* * Copyright (c) 1998 Michael Shalayeff @@ -124,7 +124,7 @@ gscattach(parent, self, aux) sc->sc_dmatag._dmamem_mmap = gsc_dmamem_mmap; ga->ga_hpamask = HPPA_FLEX_MASK; - pdc_scanbus(self, &ga->ga_ca, MAXMODBUS); + pdc_scanbus(self, &ga->ga_ca, MAXMODBUS, 0); } int diff --git a/sys/arch/hppa/hppa/autoconf.c b/sys/arch/hppa/hppa/autoconf.c index d3d7180ef2f..a3e985144a9 100644 --- a/sys/arch/hppa/hppa/autoconf.c +++ b/sys/arch/hppa/hppa/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.40 2004/09/14 23:07:56 mickey Exp $ */ +/* $OpenBSD: autoconf.c,v 1.41 2004/09/15 20:11:29 mickey Exp $ */ /* * Copyright (c) 1998-2003 Michael Shalayeff @@ -631,10 +631,11 @@ struct pdc_sysmap_addrs pdc_addr PDC_ALIGNMENT; struct pdc_iodc_read pdc_iodc_read PDC_ALIGNMENT; void -pdc_scanbus(self, ca, maxmod) +pdc_scanbus(self, ca, maxmod, hpa) struct device *self; struct confargs *ca; int maxmod; + hppa_hpa_t hpa; { int i; @@ -653,8 +654,13 @@ pdc_scanbus(self, ca, maxmod) nca.ca_dp.dp_bc[5] = ca->ca_dp.dp_mod; nca.ca_dp.dp_mod = i; nca.ca_hpamask = ca->ca_hpamask; + nca.ca_naddrs = 0; + nca.ca_hpa = 0; - if ((error = pdc_call((iodcio_t)pdc, 0, PDC_MEMMAP, + if (hpa) { + nca.ca_hpa = hpa + IOMOD_HPASIZE * i; + nca.ca_dp.dp_mod = i; + } else if ((error = pdc_call((iodcio_t)pdc, 0, PDC_MEMMAP, PDC_MEMMAP_HPA, &pdc_memmap, &nca.ca_dp)) == 0) nca.ca_hpa = pdc_memmap.hpa; else if ((error = pdc_call((iodcio_t)pdc, 0, PDC_SYSMAP, diff --git a/sys/arch/hppa/hppa/mainbus.c b/sys/arch/hppa/hppa/mainbus.c index 42228f50e65..2a2f215bfff 100644 --- a/sys/arch/hppa/hppa/mainbus.c +++ b/sys/arch/hppa/hppa/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.56 2004/04/07 18:24:19 mickey Exp $ */ +/* $OpenBSD: mainbus.c,v 1.57 2004/09/15 20:11:29 mickey Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -44,6 +44,8 @@ #include #include +#include + struct mainbus_softc { struct device sc_dv; @@ -1042,7 +1044,6 @@ mbattach(parent, self, aux) #endif bzero (&nca, sizeof(nca)); - nca.ca_name = "mainbus"; nca.ca_hpa = 0; nca.ca_irq = -1; nca.ca_hpamask = HPPA_IOSPACE; @@ -1051,7 +1052,31 @@ mbattach(parent, self, aux) nca.ca_dp.dp_bc[0] = nca.ca_dp.dp_bc[1] = nca.ca_dp.dp_bc[2] = nca.ca_dp.dp_bc[3] = nca.ca_dp.dp_bc[4] = nca.ca_dp.dp_bc[5] = -1; nca.ca_dp.dp_mod = -1; - pdc_scanbus(self, &nca, MAXMODBUS); + switch (cpu_hvers) { +#if 0 + case HPPA_BOARD_HP809: + case HPPA_BOARD_HP819: + case HPPA_BOARD_HP839: + case HPPA_BOARD_HP859: + case HPPA_BOARD_HP770_J200: + case HPPA_BOARD_HP770_J210: + case HPPA_BOARD_HP770_J210XC: + case HPPA_BOARD_HP780_J282: + case HPPA_BOARD_HP782_J2240: +#endif + case HPPA_BOARD_HP785_C160: + case HPPA_BOARD_HP785_C180P: + case HPPA_BOARD_HP785_C180XP: + case HPPA_BOARD_HP785_C200: + case HPPA_BOARD_HP785_C230: + case HPPA_BOARD_HP785_C240: + case HPPA_BOARD_HP785_C360: + pdc_scanbus(self, &nca, MAXMODBUS, FP_ADDR); + break; + default: + pdc_scanbus(self, &nca, MAXMODBUS, 0); + break; + } } /* diff --git a/sys/arch/hppa/include/autoconf.h b/sys/arch/hppa/include/autoconf.h index 9a413b48c3f..9c5acb6c2de 100644 --- a/sys/arch/hppa/include/autoconf.h +++ b/sys/arch/hppa/include/autoconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.h,v 1.20 2004/04/07 18:24:19 mickey Exp $ */ +/* $OpenBSD: autoconf.h,v 1.21 2004/09/15 20:11:29 mickey Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -69,7 +69,7 @@ extern void (*cold_hook)(int); struct device; const char *hppa_mod_info(int, int); -void pdc_scanbus(struct device *, struct confargs *, int); +void pdc_scanbus(struct device *, struct confargs *, int, hppa_hpa_t hpa); int mbprint(void *, const char *); int mbsubmatch(struct device *, void *, void *); void *cpu_intr_map(void *v, int pri, int irq, int (*handler)(void *), -- cgit v1.2.3