Hi,
we currently have a config variable SYSTEM_TYPE in AMD based boards' romstage.c, which defines if the board is "server", "desktop" or "mobile". Among other things, the AMD code expects "server" to do ECC.
I broke that out to Kconfig, but extended the categories to the ACPI set (which the OS can use for tuning the power management profile accordingly). Now, it's declared in Kconfig with ACPI categories (which provides a couple more values, like "SOHO Server" and "Performance Server"), and based on these, the AMD value is chosen.
The Kconfig selection is also used to set the preferred PM profile in ACPI (on the modified boards only for now).
The upside of this approach is that we only set the board type once, and have it trickle down to whoever cares for it - so consistency is implicitely ensured through the build system. We also won't have to worry about this field should we ever get to the point that the fadt is handled by unified code instead of per-board code (and I hope we'll get there eventually).
The downside is that some things can't be modelled quite right (eg. one AMD board was marked "server" for the AMD code, but "workstation" for ACPI - I made that a "SOHO Server" instead in this patch).
If this patch is accepted, I'd build another patch that adapts those boards which provide an FADT (which contains the PM profile field) to this new config option. All others are of "unspecified" type by default if they're ever made ACPI aware.
Signed-off-by: Patrick Georgi patrick@georgi-clan.de
On Sat, Nov 06, 2010 at 07:43:32PM +0100, Patrick Georgi wrote:
Signed-off-by: Patrick Georgi patrick@georgi-clan.de
Yep, great idea + patch. If it survives abuild:
Acked-by: Uwe Hermann uwe@hermann-uwe.de
Index: src/cpu/amd/Kconfig
--- src/cpu/amd/Kconfig (Revision 6029) +++ src/cpu/amd/Kconfig (Arbeitskopie) @@ -20,3 +20,10 @@ source src/cpu/amd/model_lx/Kconfig
source src/cpu/amd/sc520/Kconfig
+config SYSTEM_TYPE_AMD
Maybe add a short comment here (similar to the commit msg) so that people who read the files know why this is done etc.
- int
- default 0 if SYSTEM_TYPE_UNSPECIFIED | SYSTEM_TYPE_ENTERPRISE_SERVER | SYSTEM_TYPE_SOHO_SERVER | SYSTEM_TYPE_PERFORMANCE_SERVER
- default 1 if SYSTEM_TYPE_DESKTOP | SYSTEM_TYPE_WORKSTATION
- default 2 if SYSTEM_TYPE_LAPTOP | SYSTEM_TYPE_APPLIANCE_PC
Index: src/mainboard/Kconfig
--- src/mainboard/Kconfig (Revision 6029) +++ src/mainboard/Kconfig (Arbeitskopie) @@ -247,6 +247,50 @@ default 0x200000 if COREBOOT_ROMSIZE_KB_2048 default 0x400000 if COREBOOT_ROMSIZE_KB_4096
+choice
- prompt "System Type"
- default SYSTEM_TYPE_UNSPECIFIED
- help
Chipset configuration and OS behaviour can be tuned for several
use cases.
+config SYSTEM_TYPE_UNSPECIFIED
- bool "Unspecified"
Maybe change bool "Unspecified" to just bool ?
The choice should not be user-visible, right? So no string needs to be supplied (the CONFIG_* name is self-describing already, too).
Ditto for the other SYSTEM_TYPE_* options.
Uwe.