linking static to dynamic devices

Greg Watson gwatson at lanl.gov
Tue Aug 5 11:30:00 CEST 2003


I'm not on the plane yet... :-)

My suggestion was to add an 'optional' keyword to the cpu device. So 
you would declare something like:

cpu k8 "cpu0"
	...
end
cpu k8 "cpu1"
	optional
	...
end
cpu k8 "cpu2"
	optional
	...
end
cpu k8 "cpu3"
	optional
	...
end

The effect of the optional keyword is to call a special function 
"probe" which is added to the chip_control structure. probe() is 
called before any calls to enable() and the result (0=success, <0 
fail) is used to set a "present" flag in the chip structure. probe() 
should not do anything else except check for existence (any other 
configuration is done in enable()). Non-optional devices always have 
their present flag set to 1.

struct chip_control {
   void (*enable)(struct chip *, enum chip_pass);
   int (*probe)(struct chip *);
   char *path;     /* the default path. Can be overridden
                    * by commands in config
                    */
   // This is the print name for debugging
   char *name;
};

struct chip {
   struct chip_control *control; /* for this device */
   int present; /* device is present */
   char *path; /* can be 0, in which case the default is taken */
   char *configuration; /* can be 0. */
   int irq;
   struct chip *next, *children;
   /* there is one of these for each INSTANCE of a chip */
   void *chip_info; /* the dreaded "void *" */
};


Greg


At 7:54 AM -0600 5/8/03, ron minnich wrote:
>The next obvious step is to link static to dynamic devices.
>
>One issue is that we define CPUs statically, up to the maximum the
>mainboard can take. But they may not be there. How do we express this?
>Greg had some ideas, so he may jump in once he gets off the plane.
>
>I do think the new static architecture will allow for things like
>cpufixup() calls per-cpu, etc. but we'll see.
>
>ron
>
>_______________________________________________
>Linuxbios mailing list
>Linuxbios at clustermatic.org
>http://www.clustermatic.org/mailman/listinfo/linuxbios




More information about the coreboot mailing list