From owner-freebsd-drivers@FreeBSD.ORG Sun Mar 13 22:00:51 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F4E01065672 for ; Sun, 13 Mar 2011 22:00:51 +0000 (UTC) (envelope-from brix@freebsd.org) Received: from solow.pil.dk (relay.pil.dk [195.41.47.164]) by mx1.freebsd.org (Postfix) with ESMTP id 2D0208FC1D for ; Sun, 13 Mar 2011 22:00:50 +0000 (UTC) Received: from druadan.brixandersen.dk (0x55534f5f.adsl.cybercity.dk [85.83.79.95]) by solow.pil.dk (Postfix) with ESMTPA id EEC9D1CC004; Sun, 13 Mar 2011 23:00:49 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-4--376100012" From: Henrik Brix Andersen In-Reply-To: Date: Sun, 13 Mar 2011 23:00:46 +0100 Content-Transfer-Encoding: 7bit Message-Id: References: <3550EA55-ADDE-40AC-9C22-1FAC441A0BC8@freebsd.org> <0A707516-C7D1-4441-B17B-1273B6C256B0@FreeBSD.org> To: Philip Schulz X-Pgp-Agent: GPGMail 1.3.2 X-Mailer: Apple Mail (2.1082) Cc: freebsd-drivers@freebsd.org Subject: Re: Allocating resources to isab children X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 22:00:51 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-4--376100012 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi, On Mar 13, 2011, at 20:45, Philip Schulz wrote: > I'm currently working on a driver for the exact same device, except > I'm going for the I2C engine. Naturally, I'm facing some similar > issues ;-) I am also writing a driver for the SMBus controller present in the = CS5536 chip... What a coincidence :) > I created a new isab driver that attaches specifically to the > relevant function in the CS5536 chip, mainly because I didn't want to > modify the existing generic PCI-ISA bridge driver. Interesting! However, I am not sure that is the best approach. The idea = of enabling direct children of the PCI-ISA bridge driver to allocate = BARs from the parent PCI bus would also benefit other drivers currently = present in FreeBSD, e.g. the sys/i386/i386/geode.c driver and ichwd(4) - = and it would imho make a for a cleaner, more generic solution. > On my system, the resource list obtained from the PCI bus does not > contain any interrupts. If I read the PCI bus code correctly, that's > because the "Interrupt Pin" and "Interrupt Line" fields in the > device's PCI config space are not set up. I didn't find any code that > sets up those fields which leads me to believe that the fields should > have been set up by the BIOS. As a result, my isab driver cannot > request any interrupts from the PCI bus driver. As far as I can tell, this can be set up by using pci_write_config(9)? = See intpm(4) for an example. > However, that's not a problem because my I2C device driver ("glxiic") > is a child of isa, not isab. So the tree is something like glxiix - > isa - isab - pci - ... - nexus - root. If the glxiic driver request an > interrupt resource, the request passes the isab driver at one point. > Because the interrupt resource is not in the list mentioned above, the > request is passed onto the parent, which is the PCI bus. The PCI bus > will only handle those requests that come from direct children, so the > request is again passed up. Eventually, the nexus device handles the > request and the interrupt is allocated. Hmm, but wouldn't that go against the design of the CS5536? The DIVIL = function block found in the CS5536 is not hooked up to the ISA bus. Regards, Brix --=20 Henrik Brix Andersen --Apple-Mail-4--376100012 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iEYEARECAAYFAk19Po8ACgkQv+Q4flTiePiaYQCeKW1gMkpzdaXlbmlg+j0JwB9O Kz4An1zbplF2yXEFsb3mYCkhkt+TC4zM =kCfT -----END PGP SIGNATURE----- --Apple-Mail-4--376100012--