diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2006-05-20 01:58:28 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2006-05-20 01:58:28 +0000 |
commit | 703a2bef6671e7cff98fd7ebb90841b8634b2aa1 (patch) | |
tree | 5c03b8b3dcbe3038af3cdacb1e186fa59166b62e /sys/arch/hppa | |
parent | e1c004296b5d7861b4663c49c231dc23078a314f (diff) |
do not even match on unsupported hw (instead of return from attach); from 710
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r-- | sys/arch/hppa/gsc/harmony.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sys/arch/hppa/gsc/harmony.c b/sys/arch/hppa/gsc/harmony.c index 2f32b08798c..2fb05dbc834 100644 --- a/sys/arch/hppa/gsc/harmony.c +++ b/sys/arch/hppa/gsc/harmony.c @@ -1,4 +1,4 @@ -/* $OpenBSD: harmony.c,v 1.24 2005/04/16 21:54:32 mickey Exp $ */ +/* $OpenBSD: harmony.c,v 1.25 2006/05/20 01:58:27 mickey Exp $ */ /* * Copyright (c) 2003 Jason L. Wright (jason@thought.net) @@ -133,13 +133,23 @@ harmony_match(parent, match, aux) void *match, *aux; { struct gsc_attach_args *ga = aux; + bus_space_handle_t bh; + u_int32_t cntl; if (ga->ga_type.iodc_type == HPPA_TYPE_FIO) { if (ga->ga_type.iodc_sv_model == HPPA_FIO_A1 || ga->ga_type.iodc_sv_model == HPPA_FIO_A2NB || ga->ga_type.iodc_sv_model == HPPA_FIO_A1NB || - ga->ga_type.iodc_sv_model == HPPA_FIO_A2) - return (1); + ga->ga_type.iodc_sv_model == HPPA_FIO_A2) { + if (bus_space_map(ga->ga_iot, ga->ga_hpa, + HARMONY_NREGS, 0, &bh) != 0) + return (0); + cntl = bus_space_read_4(ga->ga_iot, bh, HARMONY_ID) & + ID_REV_MASK; + bus_space_unmap(ga->ga_iot, bh, HARMONY_NREGS); + if (cntl == ID_REV_TS || cntl == ID_REV_NOTS) + return (1); + } } return (0); } @@ -165,17 +175,7 @@ harmony_attach(parent, self, aux) } cntl = READ_REG(sc, HARMONY_ID); - switch ((cntl & ID_REV_MASK)) { - case ID_REV_TS: - sc->sc_teleshare = 1; - case ID_REV_NOTS: - break; - default: - printf(": unknown id == 0x%02x\n", - (cntl & ID_REV_MASK) >> ID_REV_SHIFT); - bus_space_unmap(sc->sc_bt, sc->sc_bh, HARMONY_NREGS); - return; - } + sc->sc_teleshare = (cntl & ID_REV_MASK) == ID_REV_TS; if (bus_dmamem_alloc(sc->sc_dmat, sizeof(struct harmony_empty), PAGE_SIZE, 0, &sc->sc_empty_seg, 1, &sc->sc_empty_rseg, |