Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Mar 2011 10:28:57 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-drivers@freebsd.org
Subject:   Re: Allocating resources to isab children
Message-ID:  <201103141028.57324.jhb@freebsd.org>
In-Reply-To: <A5AEBC94-8E50-49E0-A72E-9B9E8A73E7F6@FreeBSD.org>
References:  <3550EA55-ADDE-40AC-9C22-1FAC441A0BC8@freebsd.org> <0A707516-C7D1-4441-B17B-1273B6C256B0@FreeBSD.org> <A5AEBC94-8E50-49E0-A72E-9B9E8A73E7F6@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday, March 13, 2011 12:12:59 pm Henrik Brix Andersen wrote:
> 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):
> >> 
> >> isab0@pci0:0:15:0:	class=0x060100 card=0x20901022 chip=0x20901022 
rev=0x03 hdr=0x00
> >>   vendor     = 'Advanced Micro Devices (AMD)'
> >>   device     = 'CS5536 [Geode companion] ISA'
> >>   class      = bridge
> >>   subclass   = PCI-ISA
> >>   bar   [10] = type I/O Port, range 32, base 0x6000, size  8, enabled
> >>   bar   [14] = type I/O Port, range 32, base 0x6100, size 256, enabled
> >>   bar   [18] = type I/O Port, range 32, base 0x6200, size 64, enabled
> >>   bar   [20] = type I/O Port, range 32, base 0x9d00, size 128, enabled
> >>   bar   [24] = type I/O Port, range 32, base 0x9c00, size 64, enabled
> >> 
> >> However, when I try to allocate the I/O port resource in the minimalistic 
example below, I always get 0x1100-0x1100, not 0x6100-0x61FF?
> >> 
> >> 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...
> > 
> > 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

Yes, I think this looks good.

> 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...

Well, it depends on where the interrupts come from.  Is your device's 
interrupt actually tied to the INTx line or an MSI or MSI-X message on the ISA 
bridge?  If so it will need to allocate the resource from the isab device.  If 
your device is just using an ISA IRQ then you will probably need to use hints 
or some other method for figuring out which ISA IRQ your device is using.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103141028.57324.jhb>