static initialization
Greg Watson
gwatson at lanl.gov
Mon Jul 28 17:46:00 CEST 2003
Stefan,
I've added the ability to name parts. This means that you can do the following:
cpu k8 "cpu0"
register "south" = "&sb0"
register "east" = "&cpu1"
end
cpu k8 "cpu1"
register "south" = ...
register "east" = ...
end
southbridge <device>/<vendor> "sb0"
end
In the k8 directory you will need to add 'config chip.h' to
Config.lb, then create a chip.h that contains something like:
#ifndef _CPU_K8
#define _CPU_K8
extern struct chip_control cpu_k8_control;
struct cpu_k8_config {
struct chip *south;
struct chip *east;
<any other stuff>
};
#endif /* _CPU_K8 */
Then add an object that contains the code that deals with
'cpu_k8_control' (see superio/NSC/pc97307/superio.c for an example).
Hopefully this will allow you to deal with the hyperchannel setup stuff.
Things that still need to be done/other changes:
1. The above scheme assumes that all cpu's actually exist, which may
not be the case. Only the first cpu can be relied on to exist. So we
need to think about the best way to indicate that subsequent cpu's
are optional. One way might be to add the keyword 'optional' to the
definition. e.g.
cpu k8 "cpu1"
optional
register "south" = ...
register "east" = ...
end
We could add an extra pass to the chip_configure() routine called
CHIP_PASS_PROBE that is called for all devices that are marked
optional. It would then be up to the individual device to check for
its existence. This could set a flag that means the enable() entry
point is called on subsequent passes for the device.
One problem with this approach is that you've already set the 'south'
field to point at cpu1. If cpu1 doesn't exist then the probe code
would need to set this field to 0.
Let me know what you think.
2. Ron is testing replacing:
cpu p5 end
cpu p6 end
cpu k7 end
cpu k8 end
with just 'cpu k8 end', then using the 'dir' command in the k8
Config.lb file to include support for k7, p6, p5. This will hopefully
prevent spurious devices from being included in the static tree.
3. You now must declare:
extern struct chip_control part_vendor_device_control;
in the part specific chip.h file.
Cheers,
Greg
More information about the coreboot
mailing list