From owner-freebsd-drivers@FreeBSD.ORG Sun Mar 13 16:13:05 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 C1110106566B for ; Sun, 13 Mar 2011 16:13:05 +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 804608FC12 for ; Sun, 13 Mar 2011 16:13:05 +0000 (UTC) Received: from druadan.brixandersen.dk (0x55534f5f.adsl.cybercity.dk [85.83.79.95]) by solow.pil.dk (Postfix) with ESMTPA id A70651CC00B for ; Sun, 13 Mar 2011 17:13:03 +0100 (CET) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-10--396967715" Mime-Version: 1.0 (Apple Message framework v1082) From: Henrik Brix Andersen In-Reply-To: <0A707516-C7D1-4441-B17B-1273B6C256B0@FreeBSD.org> Date: Sun, 13 Mar 2011 17:12:59 +0100 Content-Transfer-Encoding: 7bit Message-Id: References: <3550EA55-ADDE-40AC-9C22-1FAC441A0BC8@freebsd.org> <0A707516-C7D1-4441-B17B-1273B6C256B0@FreeBSD.org> To: freebsd-drivers@freebsd.org X-Pgp-Agent: GPGMail 1.3.2 X-Mailer: Apple Mail (2.1082) 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 16:13:05 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-10--396967715 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Mar 12, 2011, at 20:47, Henrik Brix Andersen wrote: > On Mar 12, 2011, at 19:49, Henrik Brix Andersen wrote: >> I am writing a driver for the GPIO part of the AMD CS5536 south = bridge (isab0), but have encountered a problem with resource allocation. >> The GPIO address (0x6100-0x61FF) is available through PCI BAR 1 as = seen in the output from pciconf(8): >>=20 >> isab0@pci0:0:15:0: class=3D0x060100 card=3D0x20901022 = chip=3D0x20901022 rev=3D0x03 hdr=3D0x00 >> vendor =3D 'Advanced Micro Devices (AMD)' >> device =3D 'CS5536 [Geode companion] ISA' >> class =3D bridge >> subclass =3D PCI-ISA >> bar [10] =3D type I/O Port, range 32, base 0x6000, size 8, = enabled >> bar [14] =3D type I/O Port, range 32, base 0x6100, size 256, = enabled >> bar [18] =3D type I/O Port, range 32, base 0x6200, size 64, = enabled >> bar [20] =3D type I/O Port, range 32, base 0x9d00, size 128, = enabled >> bar [24] =3D type I/O Port, range 32, base 0x9c00, size 64, = enabled >>=20 >> However, when I try to allocate the I/O port resource in the = minimalistic example below, I always get 0x1100-0x1100, not = 0x6100-0x61FF? >>=20 >> I have modelled the code after recommendation from John Baldwin in = http://lists.freebsd.org/pipermail/freebsd-acpi/2007-August/003964.html = but I must be doing something wrong... >=20 > Ahh, I just re-read Johns recommendation and realized that isab does = not support proxying resource allocations (yet). I will try adding that = functionality and report back. I have a patch ready for allowing the PCI-ISA bridge to proxy = SYS_RES_MEMORY and SYS_RES_IOPORT resource allocations from direct = children to the parent PCI bus. The patch is available from here: = http://people.freebsd.org/~brix/src-patches/isa_pci.c.diff Comments are more than welcome. I am still trying to figure out how to = allow children to allocate and setup interrupts through isab; any = pointers to what needs to be done in that regard are also very welcome = since I'm not having much luck with it so far... Regards, Brix --=20 Henrik Brix Andersen --Apple-Mail-10--396967715 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) iEUEARECAAYFAk187QsACgkQv+Q4flTiePit6QCfUEqNuN7j7WaBUy/sto7F+m1e jqgAmOD1fyvOaSNZrOFaFY3qAzz5nd4= =Bfi8 -----END PGP SIGNATURE----- --Apple-Mail-10--396967715--