diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1998-03-16 10:41:43 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1998-03-16 10:41:43 +0000 |
commit | afc1bb105a944135a2d6490dd7818a72673b2329 (patch) | |
tree | f07fd213238e624d8448456c72240231b9863255 /sys/dev/isa | |
parent | 4fb767e71a40aac18bd0f84f33764a1b33863487 (diff) |
slightly improved SMC autodetection
Diffstat (limited to 'sys/dev/isa')
-rw-r--r-- | sys/dev/isa/if_ed.c | 22 | ||||
-rw-r--r-- | sys/dev/isa/if_edreg.h | 11 |
2 files changed, 23 insertions, 10 deletions
diff --git a/sys/dev/isa/if_ed.c b/sys/dev/isa/if_ed.c index ba4d9dc7cf9..266125d72e4 100644 --- a/sys/dev/isa/if_ed.c +++ b/sys/dev/isa/if_ed.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ed.c,v 1.34 1998/02/15 01:49:58 deraadt Exp $ */ +/* $OpenBSD: if_ed.c,v 1.35 1998/03/16 10:41:39 downsj Exp $ */ /* $NetBSD: if_ed.c,v 1.105 1996/10/21 22:40:45 thorpej Exp $ */ /* @@ -625,7 +625,7 @@ ed_find_WD80x3(sc, cf, ia) bus_space_handle_t delaybah = ia->ia_delaybah; bus_space_handle_t memh; u_int memsize; - u_char iptr, isa16bit, sum; + u_char iptr, isa16bit, sum, wd790rev; int i, rv, memfail, mapped_mem = 0; int asicbase, nicbase; @@ -735,8 +735,19 @@ ed_find_WD80x3(sc, cf, ia) break; case ED_TYPE_SMC8216C: case ED_TYPE_SMC8216T: - sc->type_str = (sc->type == ED_TYPE_SMC8216C) ? - "SMC8216/SMC8216C" : "SMC8216T"; + wd790rev = bus_space_read_1(iot, ioh, asicbase + ED_WD790_REV); + if (wd790rev < ED_WD795) + sc->type_str = (sc->type == ED_TYPE_SMC8216C) ? + "SMC8216/SMC8216C" : "SMC8216T"; + else { + sc->type_str = "SMC8416C/SMC8416BT"; + if (bus_space_read_1(iot, ioh, + asicbase + ED_WD795_PIO)) { + printf ("%s: detected SMC8416 in PIO mode, unsupported hardware configuration.\n", sc->sc_dev.dv_xname); + goto out; + } + } + bus_space_write_1(iot, ioh, asicbase + ED_WD790_HWR, bus_space_read_1(iot, ioh, asicbase + ED_WD790_HWR) | ED_WD790_HWR_SWH); @@ -752,9 +763,6 @@ ed_find_WD80x3(sc, cf, ia) memsize = 16384; break; case ED_WD790_RAR_SZ8: - /* 8216 has 16K shared mem -- 8416 has 8K */ - sc->type_str = (sc->type == ED_TYPE_SMC8216C) ? - "SMC8416C/SMC8416BT" : "SMC8416T"; memsize = 8192; break; } diff --git a/sys/dev/isa/if_edreg.h b/sys/dev/isa/if_edreg.h index 044143188dd..50493068a3a 100644 --- a/sys/dev/isa/if_edreg.h +++ b/sys/dev/isa/if_edreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_edreg.h,v 1.3 1996/03/08 16:43:00 niklas Exp $ */ +/* $OpenBSD: if_edreg.h,v 1.4 1998/03/16 10:41:42 downsj Exp $ */ /* $NetBSD: if_edreg.h,v 1.15 1996/01/10 16:49:22 chuck Exp $ */ /* @@ -158,8 +158,13 @@ */ #define ED_WD790_REV 7 -#define ED_WD790 0x20 -#define ED_WD795 0x40 +#define ED_WD790 0x20 /* and 0x21... */ +#define ED_WD795 0x40 /* and 0x41... */ + +/* + * PIO mode register for the 83C795 + */ +#define ED_WD795_PIO 8 /* * 79X RAM Address Register (RAR) |