Re: newbus ioport usage
From: M. Warner Losh (imp_at_bsdimp.com)
Date: 01/27/04
- Previous message: Nate Lawson: "Re: newbus ioport usage"
- In reply to: Nate Lawson: "Re: newbus ioport usage"
- Next in thread: Nate Lawson: "Re: newbus ioport usage"
- Reply: Nate Lawson: "Re: newbus ioport usage"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 27 Jan 2004 14:19:37 -0700 (MST) To: nate@root.org
In message: <20040127125547.G74774@root.org>
Nate Lawson <nate@root.org> writes:
: On Tue, 27 Jan 2004, M. Warner Losh wrote:
: > In message: <E4469364-5092-11D8-8DD8-000393C72BD6@freebsd.org>
: > Mike Smith <msmith@freebsd.org> writes:
: > : The whole reason for the sysresource device was to have something
: > : sitting on resources that the AML said had "something" behind them
: > : so that they didn't get handed out to devices on eg. PCI. If you're
: > : in the same sort of scope as the sysresource device, it's fair to
: > : say that you know more than eg. the PCI bus resource code does about
: > : whether you can use the resource in question.
: >
: > Yes. It is a form of resource enumeration that belongs to ACPI.
: > Therefore, ACPI should manage it and dole it out to its children which
: > are based on the AML. That's what it is there for. It is akin to the
: > PCI code assigning resources based on the BARs that a child has.
: > However, only akin, because the entire resource space is enumerated in
: > the bus, not the children, for ACPI. The sysresource stuff was a
: > means to an end, not the only way to that end. I'm starting to think
: > that the right way to go is to reserve EVERYTHING up front, and then
: > have all the acpi_foo devices allocate out of that reserveation.
: >
: > In this way it is similar to a BAR that has been assigned by the BIOS,
: > but isn't allocated by a child device on pci. In the code I'm working
: > on, those resources are reserved at the bus level and given to the
: > child if it asks for it later. Well, it is a little more complex than
: > that because the child device actually owns the resource, but the bus
: > is who assigns ownership. In ACPI, since the resource maps aren't
: > child specific, the ownership should resided in the bus layer. So
: > instead of belonging to acpi_sysresource0, it would belong to acpi0.
: > This may also help some downstream resource allocations, since they
: > would now be happening a little earlier in the game.
:
: Ok, let me propose a design and I'd appreciate your comments. The probe
: routine for acpi_sysresource will stay the same. The attach will allocate
: the resources to its parent device (acpi0).
:
: acpi0 will make this set of resources available to its children via a
: flag included with bus_alloc_resource, say ACPIDEV_REQUEST. If
: acpi_resource_alloc finds a range already has that flag set, it will
: refuse the request. Otherwise, it will release that range and then
: immediately allocate it to the child.
That seems overly convoluted. Why not just allocate it in acpi0? If
a driver requests something that acpi0 has allocated, it assigns it to
the child and takes it out of its resource manager. If not, then it
passes things up a level in the tree. No special flags needed,
although acpi does get a little more complicated. This will ensure
that the resources are owned by someone, and can easily be delegated.
These resource ranges are there to be used by acpi, and only acpi.
There's nothing magical about the acpi_sysresource device, and it can
be relegated to the scrap-heap of history if needed.
This is similar to how pci bridges should be working, but aren't,
right now. They have a range they decode, and they should own those
resources, but given them out to their children as they request them.
Warner
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
- Previous message: Nate Lawson: "Re: newbus ioport usage"
- In reply to: Nate Lawson: "Re: newbus ioport usage"
- Next in thread: Nate Lawson: "Re: newbus ioport usage"
- Reply: Nate Lawson: "Re: newbus ioport usage"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: Resources and ACPI
... You have to allocate the resource. ... but how do I get the resource list
from acpi to allocated them then? ... ACPI seems to have very little documentation and
nothing else seems to get resource lists (except fdc_acpi.c and uart_bus_acpi.c which don't seem
to be complete. ... (freebsd-hackers) - Re: newbus ioport usage
... whether you can use the resource in question. ... > PCI code assigning resources
based on the BARs that a child has. ... > the bus, not the children, for ACPI.
... > have all the acpi_foo devices allocate out of that reserveation. ... (freebsd-arch) - Re: newbus ioport usage
... Why not just allocate it in acpi0? ... > the child and takes it out
of its resource manager. ... > These resource ranges are there to be used by acpi,
... (freebsd-arch) - Re: newbus ioport usage
... :>: immediately allocate it to the child. ... Why not just allocate it in
acpi0? ... :> the child and takes it out of its resource manager. ...
:> These resource ranges are there to be used by acpi, ... (freebsd-arch) - Re: Resources and ACPI
... You have to allocate the resource. ... but how do I get the resource list
from acpi to allocated them then? ... situation that the driver needs to know about
and you code ... (freebsd-hackers)