From owner-freebsd-new-bus Thu Jul 20 8:11:53 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from finch-post-10.mail.demon.net (finch-post-10.mail.demon.net [194.217.242.38]) by hub.freebsd.org (Postfix) with ESMTP id 1E6E637BFB6 for ; Thu, 20 Jul 2000 08:11:37 -0700 (PDT) (envelope-from n_hibma@qubesoft.com) Received: from calcaphon.demon.co.uk ([193.237.19.5] helo=bluebottle.qubesoft.com) by finch-post-10.mail.demon.net with esmtp (Exim 2.12 #1) id 13FHz4-000HvW-0A; Thu, 20 Jul 2000 15:11:34 +0000 Received: from henny.webweaving.org (henny.qubesoft.com [192.168.1.5]) by bluebottle.qubesoft.com (8.9.3/8.9.1) with ESMTP id QAA47858; Thu, 20 Jul 2000 16:11:32 +0100 (BST) (envelope-from n_hibma@qubesoft.com) Received: from localhost (localhost [127.0.0.1]) by henny.webweaving.org (8.9.3/8.9.3) with ESMTP id PAA12862; Thu, 20 Jul 2000 15:37:04 +0100 (BST) (envelope-from n_hibma@qubesoft.com) Date: Thu, 20 Jul 2000 15:37:03 +0100 (BST) From: Nick Hibma X-Sender: n_hibma@localhost Reply-To: Nick Hibma To: Jeroen Ruigrok/Asmodai Cc: new-bus@FreeBSD.ORG Subject: Re: bus_config_intr() In-Reply-To: <20000710204018.F86887@daemon.ninth-circle.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG As suggested on IRC, bus_unconfig_intr is missing. Nick On Mon, 10 Jul 2000, Jeroen Ruigrok/Asmodai wrote: > Poul-Henning Kamp was friendly enough to make the following patch: > > http://phk.freebsd.dk/misc/bus_config_intr.patch > > Basically this removes some often duplicated code and wraps it in a > function of itself. I am not quite sure if the name shouldn't be > pcibus_config_intr(), but I welcome arguments, both for and against, > before I commit this to the tree since it makes sense. > > Thanks, > > -- > Jeroen Ruigrok vd Werven/Asmodai asmodai@[wxs.nl|bart.nl|freebsd.org] > Documentation nutter/C-rated Coder BSD: Technical excellence at its best > The BSD Programmer's Documentation Project > I think, therefore I am... > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-new-bus" in the body of the message > -- n_hibma@webweaving.org n_hibma@freebsd.org USB project http://www.etla.net/~n_hibma/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Sat Jul 22 8:51:14 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from mout2.silyn-tek.de (mout2.silyn-tek.de [194.25.165.70]) by hub.freebsd.org (Postfix) with ESMTP id E46DF37C24E for ; Sat, 22 Jul 2000 08:51:06 -0700 (PDT) (envelope-from alex@big.endian.de) Received: from [192.168.32.34] (helo=mx2.silyn-tek.de) by mout2.silyn-tek.de with esmtp (Exim 3.13 #1) id 13G1YP-0007YJ-00 for new-bus@freebsd.org; Sat, 22 Jul 2000 17:51:05 +0200 Received: from p3e9c1151.dip0.t-ipconnect.de ([62.156.17.81] helo=neutron.cichlids.com) by mx2.silyn-tek.de with esmtp (Exim 3.13 #1) id 13G1YL-0001KV-00 for new-bus@freebsd.org; Sat, 22 Jul 2000 17:51:02 +0200 Received: from cichlids.cichlids.com (cichlids.cichlids.com [192.168.0.10]) by neutron.cichlids.com (Postfix) with ESMTP id 34994AB91 for ; Sat, 22 Jul 2000 17:52:53 +0200 (CEST) Received: by cichlids.cichlids.com (Postfix, from userid 1001) id 1062414BAE; Sat, 22 Jul 2000 17:51:13 +0200 (CEST) Date: Sat, 22 Jul 2000 17:51:12 +0200 To: new-bus@freebsd.org Subject: newbus replacement for kvtop() Message-ID: <20000722175112.A16931@cichlids.cichlids.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i X-PGP-Fingerprint: 44 28 CA 4C 46 5B D3 A8 A8 E3 BA F3 4E 60 7D 7F X-PGP-at: finger alex@big.endian.de X-Verwirrung: Dieser Header dient der allgemeinen Verwirrung. From: alex@big.endian.de (Alexander Langer) Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello! Today I ported the dev/ed driver to bus_space_(read|write) instead of outb/inb/outw/inw. My PCI card already works. However, I'm having problems with kvtop(), which is used by the sub-driver for the SMC cards. This one uses soemthing like: 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); sc->mem_start is set to the virtual address of the memory: if_ed.c: sc->mem_start = (caddr_t) rman_get_virtual(sc->mem_res); However, I tried to find a replacement myself, but couldn't find anything that could replace the call to kvtop() here. 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? Thanks Alex -- cat: /home/alex/.sig: No such file or directory To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message 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 From owner-freebsd-new-bus Sat Jul 22 16:30:45 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 778FD37B569 for ; Sat, 22 Jul 2000 16:30:42 -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 RAA12473; Sat, 22 Jul 2000 17:30:40 -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 RAA14069; Sat, 22 Jul 2000 17:30:29 -0600 (MDT) Message-Id: <200007222330.RAA14069@harmony.village.org> Subject: Re: newbus replacement for kvtop() To: alex@big.endian.de (Alexander Langer), new-bus@FreeBSD.ORG In-reply-to: Your message of "Sat, 22 Jul 2000 17:26:09 MDT." <200007222326.RAA14043@harmony.village.org> References: <200007222326.RAA14043@harmony.village.org> <20000722175112.A16931@cichlids.cichlids.com> Date: Sat, 22 Jul 2000 17:30:29 -0600 From: Warner Losh Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I'd go even a step further and say that you should use the bus_space routines rather than calling bus_get_virtual() to access memory in the bus_space. This is a bigger change, I think, because we access them right now by dereferencing directly or indirectly with bcopy. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message