From owner-freebsd-new-bus Sat Jul 22 16:26:25 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 2EE3E37B5CA for ; Sat, 22 Jul 2000 16:26:22 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id RAA12461; Sat, 22 Jul 2000 17:26:20 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id RAA14043; Sat, 22 Jul 2000 17:26:09 -0600 (MDT) Message-Id: <200007222326.RAA14043@harmony.village.org> To: alex@big.endian.de (Alexander Langer) Subject: Re: newbus replacement for kvtop() Cc: new-bus@FreeBSD.ORG In-reply-to: Your message of "Sat, 22 Jul 2000 17:51:12 +0200." <20000722175112.A16931@cichlids.cichlids.com> References: <20000722175112.A16931@cichlids.cichlids.com> Date: Sat, 22 Jul 2000 17:26:09 -0600 From: Warner Losh Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <20000722175112.A16931@cichlids.cichlids.com> Alexander Langer writes: : if (isa16bit) { : if (sc->is790) { : sc->wd_laar_proto = ed_readb(sc, : sc->asic_addr + ED_WD_LAAR); : } else { : sc->wd_laar_proto = ED_WD_LAAR_L16EN | : ((kvtop(sc->mem_start) >> 19) & ED_WD_LAAR_ADDRHI); : } : /* : * Enable 16bit access : */ : ed_writeb(sc, sc->asic_addr + ED_WD_LAAR, sc->wd_laar_proto | : ED_WD_LAAR_M16EN); I think that you can replace the kvtop with a rman_get_start(). The address that needs to be passed in this case is the BUS OFFSET where the memory on the card lives. : On the other hand, I could imagine that rman_get_start w/o the usage : of kvtop() could be enough here. : : Could anyone point me to the right direction please? I think that the rman_get_start is the right thing to do. That will return you an offset into the bus space of the device for this resource, which is what you want. The device will then do things into this address space (also on the bus) so how it is mapped to the host processor is irrelevant. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message