[coreboot] patch: resource map proposal.

ron minnich rminnich at gmail.com
Mon Aug 4 22:20:48 CEST 2008


let's take it in two pieces.

Everyone ok with the resource map patch? It's pretty simple.

second piece.

On Mon, Aug 4, 2008 at 11:44 AM, Stefan Reinauer <stepan at coresystems.de> wrote:

> I don't understand the patch. Why does having a single function for
> "resource maps" require pci_read_configXY to be renamed? And how does that
> reduce the mess?

The resource map and the configXY are totally unrelated.

romcc-based code used to have:
nbcap = pci_read_config32(ctrl->f3, NORTHBRIDGE_CAP);

This worked in v2 due to abuse of cpp and a few other bits. I was
never comfortable with it -- more magic than I like. in romcc and CAR
code, a device_t was a u32; in other code, it was a struct device *.
icky.

In v3 pci_read_config32 takes a struct device *. We don't have them in
stage 1. So to make this work, I do this:

nbcap = pci_cf8_conf1.read32(NULL, 0, ctrl->f3, NORTHBRIDGE_CAP);

Which will work fine.

I'm not that concerned with syntactic sugar to cover this up, such as
the define at front. I'm actually *more* comfortable with this, since
it makes it
very clear what's going on. Nobody will come along later and get confused.


> I never saw a conf2 system since 1994, so putting this in the name is an
> anachronism. No conf2 system could ever work anyways without signigicantly
> changing the code.

I did not pick the name, it's the name of the struct with the function
pointers.

I've got an ack from peter and I'd like to commit. Yes these are two
patches but --key point -- they'll work and we can keep going.

Thanks

ron




More information about the coreboot mailing list