Here's what I want for options.
I want all options defined (that means the name of the option) in src/config/Options.lb
For those options that can have reasonable project-wide defaults, i.e defaults that make sense across all mainboards and architectures, I want those defined options to have a reasonable default value set in Options.lb. Note that there are very few options that can have a default value set project-wide. CONFIG_COMPRESS is an option that can have a default project-wide value. ROM_SIZE is not an option that can have a default project-wide value. Let's call these global values.
For those options that make sense for a single motherboard, and are required to have a fixed value for that motherboard, I want that option set in mainboard/<vendor>/<part>/Config.lb. CONFIG_SMBASE is such an option: it's a fixed attribute of the motherboard, and you don't want to let people set it to some bogus value. ROM_SIZE may or may not be such an option; on motherboards with pluggable ROMs different people use different size ROMs; on motherboards with soldered-on ROMs, the size is fixed. Therefore, some motherboard Config.lb files will set ROM_SIZE as a default, and others will set it as a fixed value via the option command.
For those options that make sense for a single motherboard, and have a reasonable default value for that motherboard, I want that option set to a default value in mainboard/<vendor>/<part>/Config.lb. This default value can be over-ridden in the target mainboard file. ROM_SIZE is an example of such an option: there are usually reasonable default values but many motherboards allow this to be set as users change rom parts.
The current tool supports this hierarchy. First, global (to the project) option definitions and default values are read in. Then, in the file targets/<vendor>/<part>/Config.lb, user settings are parsed. Finally, mainboard settings are read in. Conflicts in option settings will result in a fatal error. If the motherboard has set a default, but the user has already over-ridden that default value (as in ROM_SIZE), then the default is ignored. As explained earlier, however, the order of default and option is not that important; what's important is that variables can not be set-after-use.
Comments?
ron