diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hppa/dev/sti_sgc.c | 30 | ||||
-rw-r--r-- | sys/dev/ic/sti.c | 13 | ||||
-rw-r--r-- | sys/dev/ic/stivar.h | 6 |
3 files changed, 17 insertions, 32 deletions
diff --git a/sys/arch/hppa/dev/sti_sgc.c b/sys/arch/hppa/dev/sti_sgc.c index 039ec96eca1..54ab7ee4ad7 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.18 2003/10/30 19:25:12 mickey Exp $ */ +/* $OpenBSD: sti_sgc.c,v 1.19 2003/12/16 06:07:13 mickey Exp $ */ /* * Copyright (c) 2000-2003 Michael Shalayeff @@ -55,7 +55,6 @@ #include <hppa/dev/cpudevs.h> -#define STI_MEMSIZE 0x2000000 #define STI_ROMSIZE 0x8000 #define STI_ID_FDDI 0x280b31af /* Medusa FDDI ROM id */ @@ -202,33 +201,15 @@ sti_sgc_attach(parent, self, aux) paddr_t rom; int rv; - rom = sti_sgc_getrom(sc->sc_dev.dv_cfdata->cf_unit, ca); - -#ifdef STIDEBUG - printf("sti: hpa=%x, rom=%x\n", ca->ca_hpa, rom); -#endif sc->memt = sc->iot = ca->ca_iot; + sc->base = ca->ca_hpa; - if ((rv = bus_space_map(ca->ca_iot, ca->ca_hpa, STI_MEMSIZE, 0, - &sc->ioh))) { -#ifdef STIDEBUG - printf(": cannot map io space (%d)\n", rv); -#endif - return; - } - - /* if it does not map, probably part of the lasi space */ - if (rom == ca->ca_hpa) - sc->romh = sc->ioh; - else if ((rv = bus_space_map(ca->ca_iot, rom, STI_ROMSIZE, 0, &sc->romh))) { + rom = sti_sgc_getrom(sc->sc_dev.dv_cfdata->cf_unit, ca); + if ((rv = bus_space_map(ca->ca_iot, rom, STI_ROMSIZE, 0, &sc->romh))) { if ((rom & HPPA_IOBEGIN) == HPPA_IOBEGIN) sc->romh = rom; else { -#ifdef STIDEBUG printf (": cannot map rom space (%d)\n", rv); -#endif - /* in this case i have no freaking idea */ - bus_space_unmap(ca->ca_iot, sc->ioh, STI_MEMSIZE); return; } } @@ -237,9 +218,6 @@ sti_sgc_attach(parent, self, aux) if (cpu_type == hpcxl2) eaio_l2(0x8 >> (((ca->ca_hpa >> 25) & 3) - 2)); -#ifdef STIDEBUG - printf("sti: ioh=%x, romh=%x\n", sc->ioh, sc->romh); -#endif 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; diff --git a/sys/dev/ic/sti.c b/sys/dev/ic/sti.c index 804813876a6..cbab532b910 100644 --- a/sys/dev/ic/sti.c +++ b/sys/dev/ic/sti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sti.c,v 1.34 2003/10/21 18:58:49 jmc Exp $ */ +/* $OpenBSD: sti.c,v 1.35 2003/12/16 06:07:13 mickey Exp $ */ /* * Copyright (c) 2000-2003 Michael Shalayeff @@ -277,7 +277,7 @@ sti_attach_common(sc) else *(u_int *)&r = bus_space_read_4(sc->memt, sc->romh, i), i += 4; - *p = (p == cc->regions? sc->romh : sc->ioh) + + *p = (p == cc->regions? sc->romh : sc->base) + (r.offset << PGSHIFT); #ifdef STIDEBUG printf("%x @ 0x%x%s%s%s%s\n", @@ -293,8 +293,13 @@ sti_attach_common(sc) #ifdef STIDEBUG printf("already mapped region\n"); #endif - } else if (p - cc->regions == 1) - sc->fbh = fbh; + } else { + if (p - cc->regions == 1) { + sc->fbaddr = *p; + sc->fblen = r.length << PGSHIFT; + } + *p = fbh; + } } } } diff --git a/sys/dev/ic/stivar.h b/sys/dev/ic/stivar.h index 85568c90df3..dff06edbc5a 100644 --- a/sys/dev/ic/stivar.h +++ b/sys/dev/ic/stivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stivar.h,v 1.14 2003/08/19 03:13:07 mickey Exp $ */ +/* $OpenBSD: stivar.h,v 1.15 2003/12/16 06:07:13 mickey Exp $ */ /* * Copyright (c) 2000-2003 Michael Shalayeff @@ -43,7 +43,9 @@ struct sti_softc { int sc_bpp; bus_space_tag_t iot, memt; - bus_space_handle_t ioh, romh, fbh; + bus_space_handle_t romh; + bus_addr_t base, fbaddr; + bus_size_t fblen; struct sti_dd sc_dd; /* in word format */ struct sti_font sc_curfont; |