From owner-freebsd-current Wed Feb 14 17:40:15 2001 Delivered-To: freebsd-current@freebsd.org Received: from netau1.alcanet.com.au (ntp.alcanet.com.au [203.62.196.27]) by hub.freebsd.org (Postfix) with ESMTP id 80E8C37B401 for ; Wed, 14 Feb 2001 17:40:09 -0800 (PST) Received: from mfg1.cim.alcatel.com.au (mfg1.cim.alcatel.com.au [139.188.23.1]) by netau1.alcanet.com.au (8.9.3 (PHNE_22672)/8.9.3) with ESMTP id MAA25500 for ; Thu, 15 Feb 2001 12:40:06 +1100 (EDT) Received: from gsmx07.alcatel.com.au by cim.alcatel.com.au (PMDF V5.2-32 #37641) with ESMTP id <01K051747A6OI8TAOR@cim.alcatel.com.au> for freebsd-current@freebsd.org; Thu, 15 Feb 2001 12:39:53 +1100 Received: (from jeremyp@localhost) by gsmx07.alcatel.com.au (8.11.1/8.11.1) id f1F1e1c71520 for freebsd-current@freebsd.org; Thu, 15 Feb 2001 12:40:02 +1100 (EST envelope-from jeremyp) Content-return: prohibited Date: Thu, 15 Feb 2001 12:40:01 +1100 From: Peter Jeremy Subject: Accessing a PCI device by `physical' address To: freebsd-current@freebsd.org Mail-followup-to: freebsd-current@freebsd.org Message-id: <20010215124001.A71053@gsmx07.alcatel.com.au> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I'm trying to port an Alpha video driver (TGA) from -stable to -current and have run into a problem converting some calls to pci_cfgread() and pci_cfgwrite(). The Alpha firmware reports the location of the console video card as a physical hose, bus type, bus, slot value. In -stable, the card can be accessed by calling pci_cfg{read,write}() with this information. In -current, pci_cfg{read,write}() have been replaced by pci_{read,write}_config(), but the latter function needs a device_t structure that defines both the device and it's parent. Unfortunately, I don't have the relevant device_t available. In any case, based on my reading of the code, I need to access the PCI config registers before the video card has been probed/attached via the normal bus/device scan. Luckily, there's only one point at which I need this `physical' access. The call backtrace is: pci_cfg{read,write}() tga_configure() vid_configure() scvidprobe() sccnattach() <>_cons_init() alpha_init() ... Does anyone have any useful suggestions?[1] Is there an `approved' mechanism to bypass the bus abstraction layers? Is is practical to hand-craft a device_t that will satisfy pci_{read,write}_config()? [1] I don't count "throw out the TGA" as a useful suggestion. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message