diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2005-05-22 01:38:10 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2005-05-22 01:38:10 +0000 |
commit | 54b769663376f683bf53219c264af1a274591a5e (patch) | |
tree | e49704d86dceb6682cda8649de98a34402452369 /sys | |
parent | bda15a35d3608003a90619359e20438f587b7041 (diff) |
devices scan for the early new hppa64 machines.
match on product id as well as names in correspondent drivers.
chain pluto later in case it shows up too early...
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hppa64/dev/cpu.c | 10 | ||||
-rw-r--r-- | sys/arch/hppa64/dev/elroy.c | 14 | ||||
-rw-r--r-- | sys/arch/hppa64/dev/mem.c | 12 | ||||
-rw-r--r-- | sys/arch/hppa64/dev/pluto.c | 35 | ||||
-rw-r--r-- | sys/arch/hppa64/hppa64/autoconf.c | 56 | ||||
-rw-r--r-- | sys/arch/hppa64/hppa64/mainbus.c | 5 | ||||
-rw-r--r-- | sys/arch/hppa64/include/autoconf.h | 5 |
7 files changed, 102 insertions, 35 deletions
diff --git a/sys/arch/hppa64/dev/cpu.c b/sys/arch/hppa64/dev/cpu.c index a4ce15560e2..f57c4b619b4 100644 --- a/sys/arch/hppa64/dev/cpu.c +++ b/sys/arch/hppa64/dev/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.1 2005/04/01 10:40:47 mickey Exp $ */ +/* $OpenBSD: cpu.c,v 1.2 2005/05/22 01:38:09 mickey Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -56,10 +56,12 @@ cpumatch(parent, cfdata, aux) struct confargs *ca = aux; /* struct cfdata *cf = cfdata; */ - if (strcmp(ca->ca_name, "cpu")) - return 0; + if ((ca->ca_name && !strcmp(ca->ca_name, "cpu")) || + (ca->ca_type.iodc_type == HPPA_TYPE_NPROC && + ca->ca_type.iodc_sv_model == HPPA_NPROC_HPPA)) + return 1; - return 1; + return 0; } int diff --git a/sys/arch/hppa64/dev/elroy.c b/sys/arch/hppa64/dev/elroy.c index 9f7d3f6b6b4..36538cdfd00 100644 --- a/sys/arch/hppa64/dev/elroy.c +++ b/sys/arch/hppa64/dev/elroy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elroy.c,v 1.1 2005/04/01 10:40:47 mickey Exp $ */ +/* $OpenBSD: elroy.c,v 1.2 2005/05/22 01:38:09 mickey Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -29,6 +29,8 @@ #include <machine/iomod.h> #include <machine/autoconf.h> +#include <arch/hppa/dev/cpudevs.h> + #if NCARDBUS > 0 #include <dev/cardbus/rbus.h> #endif @@ -68,10 +70,13 @@ elroymatch(parent, cfdata, aux) struct confargs *ca = aux; /* struct cfdata *cf = cfdata; */ - if (strcmp(ca->ca_name, "lba")) - return (0); + if ((ca->ca_name && !strcmp(ca->ca_name, "lba")) || + (ca->ca_type.iodc_type == HPPA_TYPE_BRIDGE && + ca->ca_type.iodc_sv_model == HPPA_BRIDGE_DINO && + ca->ca_type.iodc_model == 0x78)) + return (1); - return (1); + return (0); } void @@ -1141,6 +1146,7 @@ elroyattach(parent, self, aux) printf(": %s TR%d.%d%s", p, sc->sc_ver >> 4, sc->sc_ver & 0xf, q); apic_attach(sc); + printf("\n"); /* TODO reserve elroy's pci space ? */ diff --git a/sys/arch/hppa64/dev/mem.c b/sys/arch/hppa64/dev/mem.c index 4b6fcc17fe0..484a94c6ab5 100644 --- a/sys/arch/hppa64/dev/mem.c +++ b/sys/arch/hppa64/dev/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.1 2005/04/01 10:40:47 mickey Exp $ */ +/* $OpenBSD: mem.c,v 1.2 2005/05/22 01:38:09 mickey Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -82,6 +82,8 @@ #include <machine/autoconf.h> #include <machine/pmap.h> +#include <arch/hppa/dev/cpudevs.h> + struct mem_softc { struct device sc_dev; }; @@ -107,10 +109,12 @@ memmatch(parent, cfdata, aux) { struct confargs *ca = aux; - if (strcmp(ca->ca_name, "memory")) - return 0; + if ((ca->ca_name && !strcmp(ca->ca_name, "memory")) || + (ca->ca_type.iodc_type == HPPA_TYPE_MEMORY && + ca->ca_type.iodc_sv_model == HPPA_MEMORY_PDEP)) + return 1; - return 1; + return 0; } void diff --git a/sys/arch/hppa64/dev/pluto.c b/sys/arch/hppa64/dev/pluto.c index f69dcc0d7a7..e813dc71795 100644 --- a/sys/arch/hppa64/dev/pluto.c +++ b/sys/arch/hppa64/dev/pluto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pluto.c,v 1.1 2005/04/01 10:40:47 mickey Exp $ */ +/* $OpenBSD: pluto.c,v 1.2 2005/05/22 01:38:09 mickey Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -28,6 +28,8 @@ #include <machine/autoconf.h> #include <machine/bus.h> +#include <arch/hppa/dev/cpudevs.h> + struct pluto_regs { u_int32_t version; /* 0x000: version */ u_int32_t pad00; @@ -58,7 +60,8 @@ struct pluto_regs { struct pluto_softc { struct device sc_dv; - struct pluto_regs volatile *sc_regs; + volatile struct pluto_regs *sc_regs; + struct confargs sc_ca; }; int plutomatch(struct device *, void *, void *); @@ -68,6 +71,8 @@ struct cfattach plut_ca = { sizeof(struct pluto_softc), plutomatch, plutoattach }; +void pluto_scan(struct device *self); + struct cfdriver plut_cd = { NULL, "plut", DV_DULL }; @@ -81,10 +86,16 @@ plutomatch(parent, cfdata, aux) struct confargs *ca = aux; /* struct cfdata *cf = cfdata; */ - if (strcmp(ca->ca_name, "sba")) - return 0; + if ((ca->ca_name && !strcmp(ca->ca_name, "sba")) || + (ca->ca_type.iodc_type == HPPA_TYPE_IOA && + ca->ca_type.iodc_sv_model == HPPA_IOA_PLUTO) || + (ca->ca_type.iodc_type == HPPA_TYPE_IOA && + ca->ca_type.iodc_sv_model == HPPA_IOA_UTURN && + ca->ca_type.iodc_model == 0x58 && + ca->ca_type.iodc_revision >= 0x20)) + return 1; - return 1; + return 0; } void @@ -93,7 +104,7 @@ plutoattach(parent, self, aux) struct device *self; void *aux; { - struct confargs *ca = aux, nca; + struct confargs *ca = aux; struct pluto_softc *sc = (struct pluto_softc *)self; struct pluto_regs volatile *r; bus_space_handle_t ioh; @@ -140,6 +151,14 @@ plutoattach(parent, self, aux) printf(": %s\n", buf); - nca = *ca; /* clone from us */ - pdc_patscan(self, &nca, 0); + sc->sc_ca = *ca; /* clone from us */ + config_defer(self, &pluto_scan); +} + +void +pluto_scan(struct device *self) +{ + struct pluto_softc *sc = (struct pluto_softc *)self; + + pdc_scan(self, &sc->sc_ca); } diff --git a/sys/arch/hppa64/hppa64/autoconf.c b/sys/arch/hppa64/hppa64/autoconf.c index 3605b9ec49b..e6d35b146bc 100644 --- a/sys/arch/hppa64/hppa64/autoconf.c +++ b/sys/arch/hppa64/hppa64/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.1 2005/04/01 10:40:47 mickey Exp $ */ +/* $OpenBSD: autoconf.c,v 1.2 2005/05/22 01:38:09 mickey Exp $ */ /* * Copyright (c) 1998-2005 Michael Shalayeff @@ -629,6 +629,7 @@ getstr(cp, size) } } +struct pdc_sysmap_find pdc_find PDC_ALIGNMENT; struct pdc_iodc_read pdc_iodc_read PDC_ALIGNMENT; struct pdc_pat_cell_id pdc_pat_cell_id PDC_ALIGNMENT; struct pdc_pat_cell_module pdc_pat_cell_module PDC_ALIGNMENT; @@ -644,21 +645,54 @@ const char *pat_names[] = { }; void -pdc_patscan(struct device *self, struct confargs *ca, int mod) +pdc_scan(struct device *self, struct confargs *ca) { + struct device_path path; + struct confargs nca; u_long rv[16]; - int i, err; + int i, err, mod = ca->ca_mod; if (pdc_call((iodcio_t)pdc, 0, PDC_PAT_CELL, PDC_PAT_CELL_GETID, - &pdc_pat_cell_id, 0)) { - printf("pat_fetch: cannot fetch cell number\n"); - return; - } + &pdc_pat_cell_id, 0)) + for (i = 0; !(err = pdc_call((iodcio_t)pdc, 0, PDC_SYSMAP, + PDC_SYSMAP_FIND, &pdc_find, &path, i)); i++) { + if (autoconf_verbose) + printf(">> hpa %x/%x dp %d/%d/%d/%d/%d/%d.%d\n", + pdc_find.hpa, pdc_find.size, + path.dp_bc[0], path.dp_bc[1], path.dp_bc[2], + path.dp_bc[3], path.dp_bc[4], path.dp_bc[5], + path.dp_mod); + + if (path.dp_bc[5] == mod) { + nca = *ca; + nca.ca_name = NULL; + nca.ca_hpa = 0xffffffff00000000ULL | + (hppa_hpa_t)pdc_find.hpa; + nca.ca_hpasz = pdc_find.size; + nca.ca_mod = path.dp_mod; + + err = pdc_call((iodcio_t)pdc, 0, PDC_IODC, + PDC_IODC_READ, &pdc_iodc_read, nca.ca_hpa, + IODC_DATA, &nca.ca_type, sizeof(nca.ca_type)); + if (err < 0 || pdc_iodc_read.size < 8) { + if (autoconf_verbose) + printf(">> iodc_data error %d\n", err); + bzero(&nca.ca_type, sizeof(nca.ca_type)); + } + + if (autoconf_verbose) { + u_int *p = (u_int *)&nca.ca_type; + printf(">> iodc_data 0x%08x 0x%08x\n", + p[0], p[1]); + } + + config_found(self, &nca, mbprint); + } + } - i = 0; - for (i = 0; !pdc_call((iodcio_t)pdc, 0, PDC_PAT_CELL, + for (i = 0; !(err = pdc_call((iodcio_t)pdc, 0, PDC_PAT_CELL, PDC_PAT_CELL_MODULE, rv, pdc_pat_cell_id.loc, i, - PDC_PAT_PAVIEW, &pdc_pat_cell_module, 0); i++) { + PDC_PAT_PAVIEW, &pdc_pat_cell_module, 0)); i++) { if (autoconf_verbose) printf(">> chpa %lx info %lx loc %lx " "dp %d/%d/%d/%d/%d/%d.%d\n", @@ -673,7 +707,6 @@ pdc_patscan(struct device *self, struct confargs *ca, int mod) pdc_pat_cell_module.dp.dp_mod); if (pdc_pat_cell_module.dp.dp_bc[5] == mod) { - struct confargs nca; int t; t = PDC_PAT_CELL_MODTYPE(pdc_pat_cell_module.info); @@ -686,6 +719,7 @@ pdc_patscan(struct device *self, struct confargs *ca, int mod) ~(u_long)PAGE_MASK; nca.ca_hpasz = PDC_PAT_CELL_MODSIZE(pdc_pat_cell_module.info); + nca.ca_mod = pdc_pat_cell_module.dp.dp_mod; err = pdc_call((iodcio_t)pdc, 0, PDC_IODC, PDC_IODC_READ, &pdc_iodc_read, nca.ca_hpa, diff --git a/sys/arch/hppa64/hppa64/mainbus.c b/sys/arch/hppa64/hppa64/mainbus.c index 871d032d846..b1276b56140 100644 --- a/sys/arch/hppa64/hppa64/mainbus.c +++ b/sys/arch/hppa64/hppa64/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.1 2005/04/01 10:40:47 mickey Exp $ */ +/* $OpenBSD: mainbus.c,v 1.2 2005/05/22 01:38:09 mickey Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -627,7 +627,8 @@ mbattach(parent, self, aux) bzero (&nca, sizeof(nca)); nca.ca_iot = &hppa_bustag; nca.ca_dmatag = &hppa_dmatag; - pdc_patscan(self, &nca, -1); + nca.ca_mod = -1; + pdc_scan(self, &nca); } /* diff --git a/sys/arch/hppa64/include/autoconf.h b/sys/arch/hppa64/include/autoconf.h index 2d40eb5e236..14495bd005b 100644 --- a/sys/arch/hppa64/include/autoconf.h +++ b/sys/arch/hppa64/include/autoconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.h,v 1.1 2005/04/01 10:40:48 mickey Exp $ */ +/* $OpenBSD: autoconf.h,v 1.2 2005/05/22 01:38:09 mickey Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -27,6 +27,7 @@ struct confargs { bus_dma_tag_t ca_dmatag; /* DMA tag */ hppa_hpa_t ca_hpa; /* module HPA */ u_int ca_hpasz; /* module HPA size (if avail) */ + int ca_mod; /* this module */ }; /* this is used for hppa_knownmodules table @@ -47,7 +48,7 @@ extern void (*cold_hook)(int); struct device; const char *hppa_mod_info(int, int); -void pdc_patscan(struct device *, struct confargs *, int); +void pdc_scan(struct device *, struct confargs *); int mbprint(void *, const char *); void dumpconf(void); |