diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sgi/gio/gio.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/arch/sgi/gio/gio.c b/sys/arch/sgi/gio/gio.c index a4220d41e56..c412ac61153 100644 --- a/sys/arch/sgi/gio/gio.c +++ b/sys/arch/sgi/gio/gio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gio.c,v 1.11 2012/05/25 11:31:04 miod Exp $ */ +/* $OpenBSD: gio.c,v 1.12 2012/07/18 20:12:08 miod Exp $ */ /* $NetBSD: gio.c,v 1.32 2011/07/01 18:53:46 dyoung Exp $ */ /* @@ -370,19 +370,28 @@ gio_id(vaddr_t va, paddr_t pa, int maybe_gfx) } /* - * GIO32 devices will not answer to addresses not aligned on - * 32 bit boundaries. + * GIO32 devices with a 32-bit ID register will not answer to + * addresses not aligned on 32 bit boundaries. */ if (guarded_read_2(va | 2, &id16) != 0 || guarded_read_1(va | 3, &id8) != 0) { if (GIO_PRODUCT_32BIT_ID(id32)) return id32; - else + else /* not a frame buffer anyway */ return GIO_PRODUCT_PRODUCTID(id32); } /* + * Of course, GIO32 devices with a 8-bit ID register can use the + * other bytes in the first 32-bit word for other purposes. + */ + + if ((id32 & 0xffff) == id16 && (id32 & 0xff) == id8 && + !GIO_PRODUCT_32BIT_ID(id8)) + return /*GIO_PRODUCT_PRODUCTID*/(id8); + + /* * If there is a frame buffer device, then either we have hit a * device register (grtwo), or we did not fault because the slot * is pipelined (newport). |