geode: Update OLPC power management

Albert Cahalan acahalan at gmail.com
Sat Mar 10 20:31:01 EST 2007


Jordan Crouse writes:

> I guess I should provide a bit of context for this code.  When the 5535
> (the predecessor to the 5536) first came out, the BIOS folks decided
> to combine some of the "random" legacy devices as bars under what
> we call the ISA_BRIDGE device, and it has been that way until this day.
>
> This has been very frustrating, since it doesn't mesh very well with
> the Linux PCI model.  To get around that - most of the drivers have
> either read the resource base directly from the 5536 MSRs (such as the
> cs5535_gpio driver), and others like the SMBUS driver have probed for the
> PCI devices, but not actually used them.  The SMBUS driver is particularly
> confusing because the same block was accessible through ISA ports in
> earlier generations of the Geode, so we have to do way more probing
> then one would expect.
>
> This driver was an effort to provide some place to manage the PCI device,
> particularly for power management purposes.  In the end, its like we are
> designing our own API for our own bus, but we're really hijacking
> existing infrastructure, which seemed easier to me then creating a new
> device type from scratch just for the Geode.

When faced with this, I'd just provide config space accessor functions
that make things look normal. See arch/i386/pci for where you set that.
Call something that does:

        raw_pci_ops = pci_geode_access;

You'll have one of these:

static struct pci_raw_ops pci_geode_access = {
        .read =         pci_geode_read,
        .write =        pci_geode_write
};

Those functions can of course call the normal functions if it helps any.



More information about the Devel mailing list